Reference

Accounts

Every account the program owns: its address, discriminator and fields.

Each account is an Anchor account: an 8-byte discriminator, then its fields in Borsh, except the person tree, which is zero-copy. A program reading one of them checks the owner is Once and the first 8 bytes match the discriminator.

Config

The program’s settings. One account, created by initialize.

Address: PDA ["config"]. Discriminator 9b0caae01efacc82.

NameTypeDescription
adminPubkeyThe wallet that can change fees, issuers and the OPRF registry.
fee_recipientPubkeyThe wallet that receives the protocol fee on drops.
fee_bpsu16The protocol fee in basis points: 100.
sol_relay_feeu64The relay fee per claim for SOL scopes and polls, in lamports.
usdc_relay_feeu64The relay fee per claim for USDC scopes, in base units.
usdc_mintPubkeyThe USDC mint drops accept.
spp_programPubkeyThe Solana Privacy Program.
registry_programPubkeyThe Rings user registry program.
state_treePubkeyThe Rings state tree notes are appended to.
next_scope_idu64The ID the next scope gets.
pool_authorityPubkeyThe pool authority PDA, ["pool"].
holders_authorityPubkeyThe holders authority PDA, ["holders"].
pool_bumpu8The pool authority’s bump.
holders_bumpu8The holders authority’s bump.

Issuer

One registered issuer key.

Address: PDA ["issuer", key_x, key_y]. Discriminator d81353e66c35500e.

NameTypeDescription
keyCurvePointThe issuer’s BabyJubJub public key.
activeboolWhether credentials from this key can enroll.

OprfKeys

The OPRF registry. One account.

Address: PDA ["oprf"]. Discriminator f406911854f3b4b7.

NameTypeDescription
shares[CurvePoint; 3]The public points of the three key shares, in node order.
combinedCurvePointThe combined OPRF public key K.
digest[u8; 32]Poseidon of the eight coordinates of the shares and K, in that order. The enrollment proof commits to it.
versionu64Raised by each set_oprf. An enrollment names the version it used.

Person

One enrollment, keyed by the person nullifier.

Address: PDA ["person", n]. Discriminator 10f22c18790b00b7.

NameTypeDescription
walletPubkeyThe wallet that enrolled. Only it can revoke.
leaf[u8; 32]The leaf in the person tree.
indexu32The leaf’s index in the person tree.
enrolled_ati64When it enrolled, Unix seconds.
activeboolFalse after a revoke.
revoked_ati64When it was last revoked, Unix seconds; zero if never. Enrolling again opens 24 hours later.

PersonTree

The person tree. One zero-copy account of 3,368 bytes after its discriminator.

Address: PDA ["tree"]. Discriminator 795bebf8fe087420.

NameTypeDescription
frontier[[u8; 32]; 20]The last left node at each of the 20 levels, enough to append the next leaf.
zeros[[u8; 32]; 21]The hash of an empty subtree at each height, 0 to 20.
roots[[u8; 32]; 64]A ring of the last 64 roots.
next_indexu32The index the next leaf takes.
cursoru8The position of the current root in roots.
history_lenu8How many entries of roots are filled, up to 64.
padding[u8; 2]Unused.

Scope

One drop or poll.

Address: PDA ["scope", id as u64 little-endian]. Discriminator a539efd81ea0db5c.

NameTypeDescription
idu64The scope ID, from the config’s counter.
creatorPubkeyThe wallet that opened and funded it, and receives what is left at closing.
kindScopeKindDrop or poll.
titleStringThe title, up to 64 bytes.
assetAssetSOL or USDC. Always SOL for a poll.
amount_per_personu64What each claim takes from a drop, in base units, relay fee included. Zero for a poll.
capu64The most claims the scope accepts.
opens_ati64When claims open, Unix seconds.
closes_ati64When claims close, Unix seconds. A claim’s credential must expire after it.
optionsVec<String>A poll’s options, 2 to 8 of up to 32 bytes.
tally[u64; 8]Votes per option.
countu64Claims so far.
closedboolSet by close_scope.
relay_feeu64The relay fee per claim, copied from the config at creation.
relay_budgetu64What is left of a poll’s relay budget, in lamports.
pool_hash[u8; 32]The current pool note’s commitment.
pool_nullifier[u8; 32]The current pool note’s nullifier.
pool_blinding[u8; 32]The current pool note’s blinding.
remainingu64What is left in the pool, in base units.

ClaimReceipt

One claim. Its address, ["claim", scope, n], is what refuses a second claim with the same scope nullifier.

Address: PDA ["claim", scope, n]. Discriminator dfe90be57ca5cf1c.

NameTypeDescription
scopePubkeyThe scope claimed in.
n[u8; 32]The scope nullifier.
payerPubkeyThe relayer that paid the rent, which close_claims returns to it.
claimed_ati64When the claim landed, Unix seconds.
optionOption<u8>The option voted for in a poll; empty for a drop.

Owned through Rings

Two PDAs hold no data and sign for notes in the Solana Privacy Program: the pool authority at ["pool"], which owns each drop's pool note, and the holders authority at ["holders"], which owns each payout note together with the claimant's key. Rings payouts explains both.