Keys and signatures
Every message in DIM is signed, and each kind of key can do exactly one job. Owners and agents sign on-chain funding. A per-channel session key signs holds and vouchers. Sellers sign listings, capacity reports and receipts. Probe operators sign measurements, and the discovery index signs its answers. You decide which index and probe keys to trust by pinning them; everything else is checked against those pins or against keys inside signed listings.
Who signs what
| Key | Belongs to | Signs | Cannot |
|---|---|---|---|
| Owner key | Vault owner | init_vault, deposit, withdraw_free, root Mandates, owner-signed channel opens, closing |
— |
| Agent key | An agent named in a Mandate | Channel opens and child Mandates within its Mandate; revoking its descendants; closing | Withdraw from the vault or exceed its Mandate |
| Session key | One channel | Holds and vouchers for that channel only | Touch any other channel or the vault |
Listing key (seller_id) |
Seller | The listing and capacity reports | Pay or receive money by itself |
Receipt key (key_epoch) |
Seller | Receipts | Be used unless listed in the current signed listing |
| Settler key | Seller | Starting to close its channels; it identifies the seller's settlement side of a channel | — |
| Probe operator key | Independent operator | Probe observations | Change rankings unless you pinned it |
| Indexer attestation key | Discovery index | Every discovery response | Vouch for sellers' claims |
The roles are kept apart on purpose: the prober runbook forbids reusing an operator key as any seller, indexer, buyer or session key, and the index refuses configurations where seller, operator and attestation keys overlap.
Two signature formats
- Binary messages (holds, vouchers, receipts) start with a 16-byte type tag such as
IM/VOUCHER/1, then the 64-byte domaingenesis_hash ‖ program_id, then fixed-width fields. They are signed with Ed25519 over the exact bytes. Wrong length or trailing bytes are rejected. - JSON documents (listings, capacity, observations, index answers) are canonicalized with RFC 8785, then signed over
SHA256("IM/JSON/1\0" ‖ canonical bytes). They travel as{"doc": …, "sig": base64, "key": base58}. JSON numbers must be integers from 0 to 2^53−1; floats and negatives are rejected.
The domain makes a hold or voucher for one deployment worthless on any other, and the tags keep one kind of message from being passed off as another.
What you pin
| Pin | Why | In the SDK |
|---|---|---|
| Indexer attestation key | Only answers signed by it are accepted. Published informationally at /.well-known/im-indexer.json, but get it through a trusted channel. |
indexer: { url, key }, or keys: [old, new] to overlap a rotation |
| Probe operator keys | Only their observations affect planning. | operators: [...] |
| Seller listing key, for direct use | When you skip the index and talk to one seller. | discovery.direct({ url, key }) |
| Program domain | Holds and vouchers are signed for it. | domain: backend.domain |
Index answers also carry the exact query and an issued_at time. The SDK rejects an answer for a different query or more than 300 seconds away from local time, so an old or swapped answer cannot be replayed at you.