---
title: "Multisig (0x0C)"
description: "Weighted multisig accounts in Minter v3.3.0: CreateMultisig (0x0C), EditMultisig (0x12), SignatureMulti (0x02) assembly, and an isolated Cooler policy signer."
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/multisig"
raw_markdown_url: "https://docs.minter.network/developers/multisig.md"
---

# Multisig (0x0C)

> Weighted multisig accounts in Minter v3.3.0: CreateMultisig (0x0C), EditMultisig (0x12), SignatureMulti (0x02) assembly, and an isolated Cooler policy signer.

`CreateMultisig (0x0C)` creates a protocol `Mx...` account configured with `1` to `32` unique participant `addresses[]`, per-signer `weights[]` (each `<= 1023`), and a `threshold` (`threshold <= sum(weights)`). `ExecutorV3` executes any of the 37 active transaction types from that address under `signatureType = 0x02` once the weights of unique valid signers reach `threshold`.

## Creation (`0x0C`), rotation (`0x12`) and `SignatureMulti`

| Opcode | Operation | Fee (`USDTE`) | Inner RLP `data` schema | Protocol constraints |
| :---: | :--- | :---: | :--- | :--- |
| `0x0C` | `CREATE_MULTISIG` | `$0.10` | `[threshold: u32, weights: u32[], addresses: bytes20[]]` | `1..32` unique `Mx...` addresses; weight `<= 1023`; `threshold <= sum(weights)` |
| `0x12` | `EDIT_MULTISIG` | `$0.10` | `[threshold: u32, weights: u32[], addresses: bytes20[]]` | Sent from the multisig address itself (`signatureType = 0x02`) |

The created multisig address is derived deterministically from the creator's address and creation transaction `nonce`: `deriveMultisigAddress(creatorMx, nonce)` (`Keccak256(RLP([creator20B, nonce]))[12..32]`).

Rules for assembling `SignatureMulti` (`signatureType = 0x02`):
1. Set `nonce` to `transaction_count + 1n` of the multisig account itself (a newly created multisig starts at `transaction_count = 0`, so its first outgoing transaction uses `nonce: 1n`).
2. Each co-signer signs `signingHash = Keccak256(RLP([nonce, chainId, gasPrice, gasCoin, type, dataBytes, payload, serviceData, 0x02]))`.
3. Encode outer field `#9` (`signatureData`) as `RLP([multisigAddress20B, [[v1, r1, s1], [v2, r2, s2], ...]])`.
4. The Minter protocol does not require lexicographical signature sorting: the node recovers each signer via `ecrecover`, rejects duplicate signers, matches each recovered address against `addresses[]`, and verifies `sum(weights) >= threshold`. Ordering `signatures[]` to match `addresses[]` is an application convention so independent co-signers produce byte-identical `signedRawTxHex` and the same `Mt...` hash.
5. Off-chain `.msig` JSON draft files are an external application convention rather than a built-in `@minter-network/tx-core` format (`decodeRawTx` decodes complete 10-field signed transactions; to inspect an unsigned draft, pass structured `UnsignedTx` fields and decode inner `data` via `decodeTxData`).

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

```typescript
import {
  MinterGateClient,
  assembleMultisigTx,
  buildCreateMultisigTx,
  buildSendTx,
  deriveMultisigAddress,
  parsePip,
  signTx,
  signTxForMultisig,
} from "@minter-network/tx-core";
import type { MinterWallet } from "@minter-network/tx-core";

// Supply these inputs from your application.
declare const owner1: MinterWallet;
declare const owner2: MinterWallet;
declare const owner3: MinterWallet;

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

// 1. Create a 2-of-3 multisig (weights [400, 400, 600], threshold 800)
const creatorNonce = await gate.getNextNonce(owner1.address);
const createUnsigned = buildCreateMultisigTx(
  {
    threshold: 800,
    weights: [400, 400, 600],
    addresses: [owner1.address, owner2.address, owner3.address],
  },
  { nonce: creatorNonce, chainId: 1, gasCoin: 1993 },
);

const createSigned = signTx(createUnsigned, owner1.privateKey);
await gate.sendTransaction(createSigned.signedRawTxHex);
await gate.waitForTransaction(createSigned.txHash);

const multisigMx = deriveMultisigAddress(owner1.address, creatorNonce);

// 2. First payout from the multisig account (transaction_count = 0 -> nonce = 1n)
const unsignedPayout = buildSendTx(
  {
    coinId: 1993,
    to: "Mx3a7b9104e82d19c64f01b5a8e9c72104d3e811f0",
    valuePip: parsePip("1000"),
  },
  {
    nonce: 1n,
    chainId: 1,
    gasPrice: 1,
    gasCoin: 1993,
    payload: "treasury:payout-Q4",
    signatureType: 2,
  },
);

const sig1 = signTxForMultisig(unsignedPayout, owner1.privateKey);
const sig2 = signTxForMultisig(unsignedPayout, owner2.privateKey);

const { signedRawTxHex, txHash } = assembleMultisigTx(
  unsignedPayout,
  multisigMx,
  [sig1, sig2],
);
await gate.sendTransaction(signedRawTxHex);
await gate.waitForTransaction(txHash);
```

#### cURL

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

# Query multisig weights, threshold, addresses[], and transaction_count
curl -sS "${GATE_URL}/address/Mx8c3e6ba8824854141383c7d8054e671b8773efc1"
```

## `Hot / Cooler / Cold` custody and policy signer

If the only signing key resides on an internet-facing server, a compromised process can drain the treasury. Assigning weights `[400, 400, 600]` with `threshold = 800` splits authority across three keys:
1. `Hot` (weight `400`) runs inside the application worker or AI agent, builds `UnsignedTx`, and produces `sigHot`, which alone cannot reach `800`.
2. `Cooler` (weight `400`) runs on an isolated host with no inbound ports, pulls signing requests from a queue, verifies `sigHot` via `ecrecover`, validates `chainId`, `signatureType`, `gasCoin`, opcode, recipient allowlist, and per-`coinId` caps, and appends `sigCooler` (`400 + 400 = 800`).
3. `Cold` (weight `600`) stays offline and pairs with `Cooler` (`1000 >= 800`) to rotate a compromised `Hot` key via `EditMultisig (0x12)`, or pairs with `Hot` (`1000 >= 800`) during `Cooler` hardware maintenance.

| Signer combination | Weight sum | Node decision (`threshold = 800`) | Operational role |
| :--- | :---: | :--- | :--- |
| `Hot` only | `400` | Rejected (`< 800`) | Compromised web worker or agent cannot move funds |
| `Hot` + `Cooler` | `800` | Executed (`>= 800`) | Automated payouts within policy limits |
| `Cold` + `Cooler` | `1000` | Executed (`>= 800`) | Rotate `Hot` key via `EditMultisig (0x12)` |
| `Cold` + `Hot` | `1000` | Executed (`>= 800`) | Recovery signing if `Cooler` host is offline |

```typescript
import {
  SIGNATURE_TYPE,
  TX_TYPE,
  assembleMultisigTx,
  computeSigningHash,
  decodeTxData,
  parsePip,
  recoverAddressFromVrs,
  signTxForMultisig,
  type EcdsaSignatureVrs,
  type MxAddress,
  type SendTxData,
  type UnsignedTx,
} from "@minter-network/tx-core";

const ALLOWED_GAS_COINS = new Set<number>([0, 1993]);
const ALLOWED_RECIPIENTS = new Set<string>([
  "mx3a7b9104e82d19c64f01b5a8e9c72104d3e811f0",
]);

// Separate per-coinId caps in pip
const MAX_PER_TX_BY_COIN = new Map<number, bigint>([
  [1993, parsePip("250")],     // max 250 USDTE per transaction
  [0, parsePip("50000")],      // max 50,000 BIP per transaction
]);

export function coolerCoSignIfCompliant(params: {
  unsignedTx: UnsignedTx;
  multisigMx: MxAddress;
  expectedHotMx: MxAddress;
  sigHot: EcdsaSignatureVrs;
  coolerPrivateKey: Uint8Array;
}) {
  const { unsignedTx, multisigMx, expectedHotMx, sigHot, coolerPrivateKey } = params;

  if (unsignedTx.chainId !== 1) {
    throw new Error(`Unexpected chainId: ${unsignedTx.chainId}`);
  }
  if (unsignedTx.signatureType !== SIGNATURE_TYPE.MULTISIG) {
    throw new Error(`Expected signatureType 2, got ${unsignedTx.signatureType}`);
  }
  if (ALLOWED_GAS_COINS.has(unsignedTx.gasCoin) === false) {
    throw new Error(`Disallowed gasCoin: ${unsignedTx.gasCoin}`);
  }
  if (unsignedTx.gasPrice !== 1) {
    throw new Error(`Disallowed gasPrice: ${unsignedTx.gasPrice}`);
  }
  if (unsignedTx.payload.length + unsignedTx.serviceData.length > 256) {
    throw new Error("Payload/serviceData exceeds Cooler policy (256 bytes)");
  }

  const signingHash = computeSigningHash(unsignedTx);
  const recoveredHot = recoverAddressFromVrs(signingHash, sigHot);
  if (recoveredHot.toLowerCase() !== expectedHotMx.toLowerCase()) {
    throw new Error(`sigHot signer mismatch: ${recoveredHot}`);
  }

  // Reject EditMultisig (0x12), Unbond (0x08), and all opcodes except Send (0x01)
  if (unsignedTx.type !== TX_TYPE.SEND) {
    throw new Error(`Opcode not permitted by policy: 0x${unsignedTx.type.toString(16)}`);
  }

  const send = decodeTxData(TX_TYPE.SEND, unsignedTx.data) as SendTxData;
  if (ALLOWED_RECIPIENTS.has(send.to.toLowerCase()) === false) {
    throw new Error(`Recipient not in allowlist: ${send.to}`);
  }

  const maxPip = MAX_PER_TX_BY_COIN.get(send.coinId);
  if (maxPip === undefined) {
    throw new Error(`Asset coinId ${send.coinId} is not permitted`);
  }
  if (send.valuePip > maxPip) {
    throw new Error(`Amount ${send.valuePip} pip exceeds cap ${maxPip} pip for coinId ${send.coinId}`);
  }

  const sigCooler = signTxForMultisig(unsignedTx, coolerPrivateKey);
  return assembleMultisigTx(unsignedTx, multisigMx, [sigHot, sigCooler]);
}
```
