Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How to read the catalog

Each entry opens with a Shows line naming the patterns it demonstrates, by number as in “(pattern 7)”, defined in The pattern language. The sections follow; not every entry has all of them:

  • Goal. What the program does for its users.
  • Actors. Which actors exist, where each lives (see Where state lives), and who authorizes it.
  • Messages. The message types, with who may send each.
  • Handler. Illustrative Rust. It follows the real API and has not been built or tested. Helper names such as decode and Ship::from_bytes stand for ordinary serialization code.
  • What to notice. The points the example exists to make.
  • Public and private. What changes, and what an observer sees, for each mix of participants.
  • Going further. What a real version would add, and what does not work.

Reading the diagrams

Most entries include a diagram of an example execution:

  • One column per participant: a wallet, an actor, the sequencer, the mailbox. An actor named in blue is private, one in amber is public.
  • One row per message, in order, grouped into phases.
  • The line says what kind of message it is: solid amber for a signed public transaction, dashed blue for a private one (a proof), solid black for a call inside a transaction, dashed black for an AsyncMessage delivered in the same transaction, dotted amber or blue for a message stored in the mailbox in the clear or sealed, and red for a step that is refused. A box on one column is a step one party takes alone, on its own machine or to its own state.
  • In the rendered guide, click a row or step through with the arrow keys to see what happens and what an observer of the chain learns at that step. Observer’s view greys out every step that never reaches the chain.

The entries

Most entries are the smallest program that shows their idea. A real token has freezing, metadata and allowances; the one here has three messages.

EntryThe one idea
Private donationspaying someone who is offline and unknown
Payment requestswhy collecting a message is not consent, and what is
Multisigone program in every public/private combination
A minimal tokeneach actor changes only itself
Automated market makera pool deployed on the legacy testnet, and how it fits the actor model
Payment streamsa public actor that anyone can move forward
Payment channelsmany off-chain payments, two transactions
Private votinga public tally that trusts hidden voters
Credentialsproving a fact about yourself under a pseudonym
Rate-limiting nullifiersa public registry that members can join anonymously
Escrow and sealed bidsa public actor between two private parties
Deep Space Radioall of it, as a game
Battleshipa player who cannot lie about what they hide
Idea catalogmany shorter designs, and what does not fit

What works with the reference wallet today

The protocol supports every design in the catalog except those the Idea catalog lists as not fitting the model. The reference wallet (lez/wallet) lacks four things some of them need, and those need a client built on the wallet library:

  • A stable blinded address. The wallet presents a private sender at a fresh blinded address for each message (WalletPresenter, lez/wallet/src/account_manager.rs; the fee payer keeps one alias per transaction). A design that recognises a private party by the address it registered (a multisig seat, an escrow party, an auction paddle, a Battleship board, a radio call sign) works with the wallet only for public parties.
  • Registering an address. No CLI command publishes a recovery binding for an address on its own, and the CLI pays a private account only at an id it holds or by the recipient’s keys, never at a bare blinded address.
  • Private calls. wallet program call sends only public transactions. The CLI runs a deployed program privately only to collect a stored message (wallet pending receive); auth-transfer send runs only the native token privately.
  • Group PDAs of a deployed program. wallet account new private-gms --pda, and the library’s create_shared_pda_account behind it, take the program’s account id to be its image id’s bytes (AccountId::from_builtin_program), where only test programs sit, so for a deployed program the derived account does not match the chain. A client derives the id itself with AccountId::for_private_pda and the program’s account id (Shared private accounts).

A caution

Privacy claims here assume the protocol as it is, including interim choices of the reference wallet: it pads every private transaction up to seven private actions, and claims only native credits alongside a send. Re-check them against What you cannot do privately when those change.