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

Public and private, in plain terms

Every account on LEZ is one or the other, chosen when it is created.

A public account

Its contents (balance, every program’s state on it, nonce) are on chain in the clear, readable by anyone. Reading one is a query:

wallet account get --scope all --account-id Public/<id>

Transactions touching it are executed by the sequencer. Every user transaction pays a fee, charged per transaction rather than per account (Fees lists the few exceptions).

A private account

The chain does not hold its plaintext contents. It holds a commitment, which is a hash, and an encrypted note that only the owner’s keys can open.

So your wallet does not read the account directly: it scans the chain for notes it can decrypt and builds a local picture:

wallet account sync-private
wallet account get --scope all --account-id Private/<id>

Run them the other way round and the wallet prints its last record, which may be stale, or Account is Uninitialized for an account it holds keys for but has no state for yet (Reading the chain).

Transactions touching a private account are executed on your own machine and proved there. The sequencer verifies the proof without learning the private information used in it.

What a private transaction still shows

What a private transaction reveals takes each published field in turn. In short:

HiddenPublished
the contents of a private accountthat a transaction happened, and when
the ids of private accounts, unless the transaction names one (The boundary)every effect on a public account, in full: amounts, recipients, everything
which private accounts a transaction touchedthe number of private actions (accounts, collected messages, an outside fee payer), padded by the reference wallet (Private actions)
what private handlers received and repliedwhich programs ran, by default (Program claims)
messages between private actors delivered inside the transactionthe validity windows the handlers set (Validity windows)
events from private handlers, which are droppedeach stored message, sealed so only its recipient can open it, or in the clear if the sender chose (Sealed async messages)
how much private work the proof coveredthe fee, as a reserve or a public signer’s declaration, priced from the transaction’s size, a flat verification charge and its public work, not its private work
a public refund account, if the transaction names one

A private account’s id appears only if the transaction puts it there: a private sender that shows its real id instead of a blinded address, a message published in the clear and addressed to the real id, or a recovery binding registered for it. Otherwise the records a private account leaves (a nullifier, a commitment, an encrypted note) carry no id and do not link to the account or to each other.

The largest leak in practice is a public effect: if a private transaction pays a public address, the amount and the recipient are public.

The reference wallet shows each private sender under a fresh blinded address for every message and grant, so they do not look related. Two exceptions: grants for an actor the client gave a blinded address use that address, and the fee payer’s native balance keeps one address per transaction, the one its refund is bound to.

Outside the transaction itself: timing, how a transaction correlates with others, who submitted it at the network level, and any pseudonym reused twice.

What follows from the model

These follow from the model, except the limit on native credits per proof below, which is the reference wallet’s.

Nobody can make a private actor act: advancing a private account needs a proof only its key holders can produce. A program cannot reach into a private account on a schedule, on a trigger, or on anyone else’s transaction.

A message to a stranger’s private actor must be stored rather than delivered, since the sender cannot run the recipient’s handler. It waits on chain until the owner collects it with their own transaction and proof; if they never do, nothing goes back to the sender (A stored message is never returned).

One transaction can collect several stored messages. With the reference wallet, a proof clears up to five native credits (stored transfers of the native token), and each other message costs a proof of its own (Collecting costs a proof).

Events from private handlers are dropped, so if anything off chain must learn a fact, a public actor has to announce it.

The mistake to avoid

“Is this program private?” has no answer. The same program can serve both kinds of account, so privacy is decided per transaction, by which accounts it touches, and by the client that builds it.

A design can hold all its state privately and still leak everything through its shape. The common failure is deriving an address deterministically from a value that some specific party already knows, then treating the address as private. The issuer of a credential knows which accounts it issued to. The organizer of a vote knows the option keys they published. In both cases a deterministic derivation turns “private” into “recognizable by exactly the party the design was hiding from”.