---
title: "Checks Mc… (0x09)"
description: "Two-key secp256k1 specification for Mc… checks and RedeemCheck (0x09): Lock encoding as big.Int, 16-byte nonce cap, gasPrice/gasCoin invariants, and off-chain balance rules."
track: "developers"
lang: "en"
protocol: "Minter v3.3.0"
consensus: "Tendermint v0.34.19 + IAVL v0.17.3"
canonical_url: "https://docs.minter.network/developers/gasless-checks"
raw_markdown_url: "https://docs.minter.network/developers/gasless-checks.md"
---

# Checks Mc… (0x09)

> Two-key secp256k1 specification for Mc… checks and RedeemCheck (0x09): Lock encoding as big.Int, 16-byte nonce cap, gasPrice/gasCoin invariants, and off-chain balance rules.

An `Mc...` check is an off-chain voucher protected by two `secp256k1` signatures (`issuerKey` and `passKey`) and redeemed on-chain via `RedeemCheck (0x09)`. The `$0.03` fee in `check.gasCoin` is deducted from the check issuer, allowing a recipient address with `0 pip` balance to claim funds without prior gas funding.

> **[warn] Check issuance does not reserve issuer funds**
> Issuing a check happens offline and does not lock coins on the issuer's account. Both the check principal `value` and the `$0.03` fee are deducted from the issuer only when `RedeemCheck (0x09)` is committed in a block. If the issuer's balance is below the required principal or fee in `check.gasCoin` at redemption time, the node rejects the transaction. Before `dueBlock`, an unredeemed check can only be invalidated by moving the funds out of the issuer's address.

## Two-key scheme and `Lock` encoding

Building an `Mc...` check takes five local steps:
1. Derive the 32-byte scalar `passKey = SHA256(UTF8(passphrase))`.
2. Choose a `nonce` of `1` to `16` bytes. If `len(nonce) > 16`, the node rejects redemption with `TooLongNonce`.
3. Hash the 6-field check body (`dueBlock` is encoded as `uint64`):
   ```text
   bodyHash = Keccak256(RLP([nonce, chainId, dueBlock, coinId, value, gasCoin]))
   ```
4. Sign `bodyHash` with `passKey` (`RFC 6979`, `lowS`) to produce the 65-byte Go-layout recoverable signature `lockBytes65 = r_be32 || s_be32 || recoveryByte` (`recoveryByte` in `{0, 1}`). In the reference Go node (`check.go`), `Lock` has type `*big.Int`, so RLP encodes `trimLeadingZeros(lockBytes65)` with any leading `0x00` bytes removed. Encoding all 65 bytes verbatim when `r[0] == 0x00` (roughly 1 in 256 checks) alters `checkHash` and breaks issuer address recovery.
5. Hash the 7-element list and sign `checkHash` with `issuerKey` (`v = recovery + 27`, stripping leading `0x00` bytes from `r` and `s`):
   ```text
   lockTrimmed = trimLeadingZeros(lockBytes65)
   checkHash = Keccak256(RLP([nonce, chainId, dueBlock, coinId, value, gasCoin, lockTrimmed]))
   rawCheck = "Mc" + hexLower(RLP([nonce, chainId, dueBlock, coinId, value, gasCoin, lockTrimmed, v, r, s]))
   ```

To redeem (`RedeemCheck 0x09`), the recipient (`recipientAddress20B`) computes `addrHash = Keccak256(RLP([recipientAddress20B]))` and signs `addrHash` with `passKey` to form the 65-byte `proofBytes65 = r_be32 || s_be32 || recoveryByte`. The node recovers `ecrecover(bodyHash, lock)` and `ecrecover(addrHash, proof)`: matching public keys prove knowledge of `passphrase` bound to `tx.sender`. A mempool observer cannot redirect the check to another address because changing `tx.sender` changes `addrHash`, though anyone who obtains `passphrase` off-chain can submit their own `RedeemCheck` first.

Consensus envelope rules for `RedeemCheck (0x09)`:
1. `tx.gasPrice === 1`: any multiplier greater than `1` fails with `TooHighGasPrice` (preventing a redeemer from draining the issuer's balance through inflated gas).
2. `tx.gasCoin === check.gasCoin`: any mismatch between the outer transaction `gasCoin` and `check.gasCoin` fails with `WrongGasCoin`.

## Issuing and redeeming in `@minter-network/tx-core`

`buildRedeemCheckTx` decodes `rawCheck`, validates `nonce` byte length, and sets `gasPrice: 1` and `gasCoin: check.gasCoin`.

#### TypeScript (@minter-network/tx-core)

```typescript
import {
  MinterGateClient,
  buildRedeemCheckTx,
  createCheckProof,
  decodeCheck,
  issueCheck,
  parsePip,
  signTx,
} from "@minter-network/tx-core";
import type { MinterWallet } from "@minter-network/tx-core";

// Supply these inputs from your application.
declare const issuerWallet: MinterWallet;
declare const recipientWallet: MinterWallet;

const gate = new MinterGateClient(
  process.env.MINTER_GATE_URL ?? "https://gate.minter.network/v2",
);

const status = await gate.getStatus();
const dueBlock = BigInt(status.latest_block_height) + 200_000n;

// 1. Issue an off-chain check for 50 USDTE (UTF-8 nonce <= 16 bytes)
const { rawCheck } = issueCheck(
  {
    nonce: "onboarding-001",
    chainId: 1,
    dueBlock,
    coinId: 1993,
    valuePip: parsePip("50"),
    gasCoin: 1993,
    passphrase: "correct-horse-battery-staple",
  },
  issuerWallet.privateKey,
);

// 2. Decode metadata locally and build recipient-bound proof (0 BIP on recipient)
const decoded = decodeCheck(rawCheck);
const { proofBytes } = createCheckProof(
  recipientWallet.address,
  "correct-horse-battery-staple",
);

const recipientNonce = await gate.getNextNonce(recipientWallet.address);
const redeemUnsigned = buildRedeemCheckTx({
  nonce: recipientNonce,
  chainId: 1,
  rawCheck,
  proof: proofBytes,
});

const signed = signTx(redeemUnsigned, recipientWallet.privateKey);
const mempool = await gate.sendTransaction(signed.signedRawTxHex);
if (mempool.code !== "0") {
  throw new Error(`CheckTx rejected (${mempool.code}): ${mempool.log}`);
}

const committed = await gate.waitForTransaction(signed.txHash);
console.log("Redeemed at height:", committed.height, "amount pip:", decoded.valuePip);
```

#### cURL

```bash
GATE_URL="${MINTER_GATE_URL:-https://gate.minter.network/v2}"

# Broadcast signed RedeemCheck (0x09) with gasPrice=1 and gasCoin=check.gasCoin (1993 RLP-encoded as 0x8207c9)
curl -sS -X POST "${GATE_URL}/send_transaction" \
  -H "Content-Type: application/json" \
  -d '{"tx": "0xf901440101018207c909b8f1f8efb8aaf8a88b63686b2d757466382d3032018402aea5408207c989056bc75e2d631000008207c9b841b0760871eb0b1f1dfdafd98a32fbca5f5177ee3490c574dcd993e8e158a69b495ab10610294441e9fb0fe1f96bd1e985a80d8cb3c4a34a197dc217b354cc479a001ba022783bc7a87e3ee24b2542083e73a4a52b878a69aab6f5a8d3dd1c636702c7cca079ed464b2107c9bd4fbef7c07a8faab39588a64c9382288d36c7e58ddd787bceb84167318e7c5b62f19f1825e78edb7665470808064ffd2da9dc72d15b6ec8c357ef4a0ef873740ad068835436965e25aed64711e41f611d0f5d4d90bec393fe48b400808001b845f8431ca03581b1619f6c988b28c72dff59c95cd4763776e4fe452fd7ade75d7939eb233ba06efa5509f92c64a311b6a98b7a8c4d6cdcc0355fc1aead0178826717a91ee7d6"}'

curl -sS "${GATE_URL}/transaction/Mt9e3c45a94283bdb7fb66f34c49340f40b7aa1434ae9d296f7cf87208aab5b3ec"
```

## Passing checks in web links

When building a web claim link, place `Mc...` and the passphrase in the URL `#fragment` rather than `?query` parameters (`https://app.example/claim#redeem=Mc...&p=...`). Query strings travel in HTTP requests, server access logs, and `Referer` headers. Although the `#fragment` is not sent over the network, it remains readable to scripts running on the page (analytics tags, browser extensions) and persists in browser history, so read `window.location.hash` into memory on mount and clear the address bar via `history.replaceState(null, "", window.location.pathname)`.
