ExchainDocs
DocsAPI

Get startedQuickstart

Quickstart

Register a guarded wallet and co-sign your first payment.

Register one guarded wallet and co-sign one payment from your backend.

A guarded wallet holds the agent's funds and spends only with two signatures: the agent's, and that of Exchain's attested quorum. The quorum signs only payments that fit the wallet's mandate.

Sign-up creates a preprod node, for Cardano preprod and the EVM testnets. Add a mainnet node from the console once you are signed in.

Get a Node Token

Sign up at cosign.exchain.network/console/signup with your organisation, email and node id. Sign-in is a link sent by email, with no password, and it arrives once the account is approved.

The console shows your Node Token once. The same token works for every chain and endpoint.

Keep it on your backend. The API sends no CORS headers, so browsers cannot call it directly.

Create the wallet

The owner mints a Masumi smart wallet with the owner key, the agent key, every Exchain quorum key hash shown in the console, threshold 3, an on-chain limit and period, and a minimum balance, then funds it. Exchain is not involved in this step.

Read the mint parameters and the threshold warning before you mint.

Register it

Register the wallet you minted.

Register
curl https://cosign.exchain.network/v1/wallets \
  -H "Authorization: Bearer $EXCHAIN_NODE_TOKEN" \
  -H "Content-Type: application/json" \
  -d @wallet.json
wallet.json
{
  "walletAddress": "addr_test1w…",
  "stateToken": "<56 hex policy id>.<asset name hex>",
  "ownerKeyHash": "<56 hex>",
  "agentKeyHashes": ["<56 hex>"],
  "quorumKeyHashes": ["<quorum key hash 1>", "<quorum key hash 2>", "<quorum key hash 3>"],
  "quorumThreshold": 3,
  "escrowAddresses": ["addr_test1w… (Masumi V2 escrow)"],
  "network": "preprod",
  "orgId": "org_acme",
  "nodeId": "node_1",
  "governedAsset": { "id": "lovelace", "decimals": 6 },
  "constitution": {
    "params": {
      "perTxCap": "50000000",
      "daily": "1000000000",
      "perSeller": "200000000",
      "perAgent": "500000000",
      "envelope": "50000000000",
      "burstPerMinute": 10
    }
  }
}

50000000 = 50 tADA (6 decimals). The answer is 201 with walletId.

Co-sign a payment

Build the agent spend by the transaction rules, then send it before you submit. Idempotency-Key must equal batchId.

Co-sign
curl https://cosign.exchain.network/v1/cosign \
  -H "Authorization: Bearer $EXCHAIN_NODE_TOKEN" \
  -H "Idempotency-Key: 7f0c3d2e-9a4b-4c1d-8e2f-000000000001" \
  -H "Content-Type: application/json" \
  -d @cosign.json
cosign.json
{
  "batchId": "7f0c3d2e-9a4b-4c1d-8e2f-000000000001",
  "walletUtxoRef": "<64 hex tx hash>#0",
  "txBodyHex": "a40081825820…",
  "intents": [{
    "purchaseId": "pur_1",
    "outputIndex": 0,
    "counterparty": "sellerVkeyHash:<56 hex>",
    "amount": "19000000",
    "asset": "lovelace",
    "jobHash": "blake2b_256:<64 hex>",
    "agentIdentifier": "<seller agent's registry asset id>"
  }],
  "context": { "nodeId": "node_1", "orgId": "org_acme", "submittedAt": "2026-11-05T10:00:00Z" }
}

On 200, merge witnessSetHex with the agent's witness and submit. The transaction id does not change.

A 409 means Exchain refused: Refusals and retries.

Check it

Read back
curl https://cosign.exchain.network/v1/wallets/wal_01J9XK3M4N5P6Q7R8S9T0V1W2Z/allowance \
  -H "Authorization: Bearer $EXCHAIN_NODE_TOKEN"

curl https://cosign.exchain.network/v1/decisions/dec_01J9XK3M4N5P6Q7R8S9T0V1W2X \
  -H "Authorization: Bearer $EXCHAIN_NODE_TOKEN"
  • The allowance shows what is left in each mandate window.
  • The decision carries its Merkle proof after the next hourly root.
  • Search the decision id on journal.exchain.network.

On this page