Documentation
accounts-and-notes

Accounts & Notes

A short primer on the Miden concepts Darwin is built out of, in the terms the rest of these docs use.

Accounts

An account on Miden has an id, a vault of assets, storage, and code (a set of procedures). Three properties matter here.

KindWho holds the stateWho can execute it
PublicThe chain stores it in fullWhoever can satisfy its auth
PrivateYou store it; the chain keeps a commitmentYou
NetworkPublic, and the network operates itThe network, when a note targets it

A Darwin user wallet is a normal account with a signature auth scheme. The BLUEDW vault is a network account. The relay's operator account is a public account. A faucet is just an account whose code can mint and burn one asset.

Notes

A note is the unit of value transfer. It carries:

  • Assets: what it moves;
  • A script: code that runs when it is consumed, identified by its MAST root;
  • Inputs / storage: the data the script reads;
  • A serial number: the randomness that makes the note unique;
  • Metadata: sender, tag, and whether it is public or private.

From those, two values are derived that the whole flow depends on:

  • The recipient digest, which binds script, inputs and serial;
  • The note id, which binds the recipient digest to the note's assets. Change the amount by one base unit and the id changes completely.

A note is consumed once. Consuming it publishes a nullifier, which prevents a second consumption without revealing which note it was.

Public and private notes

A public note stores its details on-chain. Anyone can see its assets and reconstruct it; the recipient's wallet can discover it by syncing.

A private note publishes only its id and metadata. The assets, the script and the inputs stay off-chain. A wallet cannot discover one by syncing: someone has to hand over the details, or the recipient has to be able to rebuild them.

Darwin uses both, deliberately:

NoteTypeWhy
Your trade note to the relayPrivateIt carries your USDCx or BLUEDW. Only you and the relay know its content
In-kind deposit / redeem notePublicIt targets the vault, a network account, which has to be able to read it. Sent by the relay's account, not yours
DEX orders (PSWAP)PublicA market maker has to see an order to fill it. Placed by the relay's account
Your shares, your USDCx backPrivateIt is your position. Nobody should be able to read it

P2ID

Pay-to-id is the standard note script: "whoever holds account X may consume this". The notes you send to the relay, and the notes you receive back, are P2ID notes. The relay transmits the details of a note it sends you as a note file; the app checks the file against your account before your wallet consumes it.

Tags

Every note carries a tag, a 32-bit value the network indexes. A P2ID's tag is derived from the target account, so the chain can answer "which note ids were created for this account" without revealing what those notes contain. It also means a tag says roughly which account a note is for. See Public Surface.

Why a position is a note

Put together: your Darwin position is a private P2ID note, minted by a network account, addressed to an account only you can sign for, whose id is on-chain and whose contents are not. There is no row anywhere that says you hold it. Consuming it folds its assets into your account's own vault.