Skip to content
Open app

The policy proof

The Groth16 proof every Plaza spend carries, what it shows, and what the program checks before calling SPP.

A Custom Ring decides which spends of its notes SPP will settle. Plaza decides with one zero-knowledge proof per spend: the note being spent carries a label that is a leaf under the chosen set's root, and the outputs carry the same label. The proof is Groth16 on BN254, made in the holder's browser and verified on chain with alt_bn128 syscalls (groth16-solana).

What the circuit proves

The Membership circuit, at depth 32, shows all of this without revealing the label, the note or the path:

  • The label is non-zero, and hashing it up the given path of 32 siblings gives root.
  • The spent note's commitment, rebuilt from its fields and the label, is the note the holder's nullifier secret opens, and nullifier is Poseidon(commitment, blinding, nullifierSecret). This is the same nullifier SPP checks.
  • Each output that is present is a note commitment carrying the same label. An absent output is 0.
  • exitLabel is 0 for a spend; it is the label itself only on the ragequit path.
  • authorization is Poseidon(nullifierSecret, intent), which ties the holder's secret to this spend's payout.

The full signal list is on Circuits.

Public signals

The proof has seven public signals, in this order:

#SignalChecked against
0authorizationPart of the verified statement
1rootA root in the ASP's window
2nullifierThe nullifier in the SPP transaction
3outputs[0]The first output commitment in the SPP transaction
4outputs[1]The second output commitment, or 0
5exitLabelMust be 0 in transact
6intentThe payout this spend makes

The intent

The intent binds the proof to where the money goes, so nobody who sees a proof in flight, the relayer included, can redirect it:

intent
intent = SHA-256("plaza/spend/v1" ‖ asp ‖ destination ‖ fee_recipient ‖ mint ‖ amount ‖ fee_bps), first byte set to 0

amount is a little-endian u64 and fee_bps a little-endian u16. For SOL, mint is the system program address. For a private transfer, amount is 0. Zeroing the first byte keeps the hash below the BN254 field order.

What transact checks

In order, before any money moves:

  1. The SPP transaction is a one-input, two-output transfer in the shape Plaza expects, or the program refuses with InvalidWire.
  2. If the spend pays out and the destination is a registered venue, the venue accepts this ASP (VenueRefused).
  3. root is in the ASP's window (RootOutsideWindow).
  4. nullifier and both outputs match the SPP transaction, exitLabel is 0, and intent matches the accounts and the configured fee (InvalidBinding).
  5. The Groth16 proof verifies against Plaza's verifying key (InvalidProof).
  6. Plaza calls SPP's transact with its ring authority as signer. SPP verifies its own proof and records the nullifier.
  7. For a withdrawal, Plaza's payout account received exactly amount (InvalidSettlement), and Plaza pays it out to the destination and the fee recipient.

The ragequit path

ragequit verifies the same circuit with three differences: root must be the deposit tree's current root, or one of the roots its last 32 deposits replaced, instead of a set's, exitLabel must be the label the program rebuilds from the deposit's facts and the destination, and the spend has no outputs and pays no fee. See Ragequit.

Proof encoding

The proof travels as the PolicyProof argument of transact: a (64 bytes), b (128 bytes), c (64 bytes) and signals, seven 32-byte big-endian field elements. Through the API, the same bytes go base64-encoded as policyProofBase64 on POST /relay.