Skip to content
Open app

Association sets

A set is a list of approved deposit labels, published on chain as a Merkle root. A spend proves its label is under one of the set's recent roots.

An association set is a subset of Plaza's deposits that one ASP approves. The idea comes from Privacy Pools (Buterin, Illum, Nadler, Schär, Soleimani, 2024): a spend proves membership in a published set of deposits, so an honest holder separates their money from deposits they don't want to stand beside, without saying which deposit is theirs.

Roots

An ASP publishes its set as the root of a Poseidon Merkle tree of depth 32 whose leaves are the approved labels. Each publish replaces the set: the new root covers every label the ASP approves at that moment.

The tree is built the same way in the SDK, the API and the circuit:

  • Leaves are the labels in the order the ASP lists them. Each is non-zero and appears once.
  • A node is Poseidon(left, right). A missing right child is the empty subtree of that height: 0 at the leaves, Poseidon(z, z) one level up from z.
  • Up to 4,294,967,296 labels fit under one root.

The SDK's AssociationTree builds the root and a label's path from a leaf list; see SDK.

The root window

The program keeps each ASP's most recent roots in its Asp account. The window's length is window in the program Config, between 1 and 32; Plaza is initialized with 32. Publishing a root when the window is full drops the oldest one.

A spend proves against any root in the window, not only the newest. A holder whose proof was made a moment before the ASP published again still lands. A root that has left the window is refused with RootOutsideWindow. The API marks each root active while it is in the window.

Dropping a label

An ASP drops a label by publishing a root without it. The label is still under the older roots in the window, so a spend can keep proving it there until 32 newer roots push those out. clear_roots closes that gap: it empties the ASP's window and emits RootsCleared, and the label stops proving in the set at once. The ASP sends clear_roots, then publish_root with the new root, which is then the only root in its window. The Open Set worker sends both in one transaction whenever a label leaves its set.

A proof made against a cleared root is refused with RootOutsideWindow and is made again against the new one. See Run an association set for the steps.

Leaves are public

Anyone can fetch every label under a root with GET /sets/{asp}/roots/{root}/leaves. The holder's browser downloads the whole list and builds its membership path locally, so the API never learns which label the holder is proving.

Choosing a set

A holder picks the set for each spend. Any set that has approved the note's label works for a private transfer. For a withdrawal to a registered venue, the set has to be one that venue accepts, and the app offers those first. A note no set approves can still leave through ragequit.

The Open Set

Plaza runs one set itself, the Open Set. Its policy: Approves deposits after a screening delay. Its manifest is served at GET /manifests/open-set. Any wallet can run another set beside it; see Run an association set.