Concepts

Rings payouts

How a drop holds its funds in Solana Privacy Rings and pays each claimant a private note.

A drop pays each claimant through Solana Privacy Rings, a shielded pool on Solana. Value in it sits in notes whose asset and amount are encrypted, and each spend is one Solana transaction that verifies a Groth16 proof in the Solana Privacy Program (SPP). Once's program owns the drop's funds and every claimant's payout as notes, through two of its own PDAs, and spends them by calling into SPP.

Rings accountAddress
Solana Privacy Programring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW
User registryregy3WAeRXMYuMYxr5iK3Bf9Arr3PcxGxyzAddbiqDQ
State tree777pvSGe5LaBd9nCczvE2FXEauiwtfGJ5XRpjKyniGor

The addresses are the same on mainnet and on the localnet, where Once runs against a copy of SPP and its tree.

Two owners

PDASeedsOwns
Pool authority["pool"]Each drop's pool note
Holders authority["holders"]Every claimant's payout notes, each under the claimant's own key

A note's owner is a hash of the owning PDA and a nullifier key. The pool authority owns pool notes with a fixed zero key, so only the program, signing as that PDA, can spend them. A payout note is owned by the holders authority together with a payout key derived on the claimant's device, so spending it needs both the program's signature and that key.

Funding a drop

create_scope for a drop moves amount_per_person × cap from the creator into SPP as one deposit, owned by the pool authority, and pays the protocol fee to the fee recipient in the same instruction. The scope keeps the pool note's hash, blinding and nullifier, and how much is left in it.

Paying a claim

The relayer builds an SPP transaction that spends the pool note into two outputs and one public payment:

  • The claimant's note: amount_per_person minus the relay fee, owned by the holders authority under a key the claimant's device chose for this payout.
  • The rest of the pool, as a new pool note, or an empty output when this claim takes the last share.
  • The relay fee, paid publicly to the relayer.

Once checks every part of it: that the input is the scope's current pool note, that the change matches the pool's balance, that the relay fee goes to the relayer, and that the claimant's output is the note the claim proof's binding names. Then it signs as the pool authority and calls SPP. The scope account is written by each claim, so claims in one scope are applied one at a time; a claim that loses a race is rebuilt against the new pool note, and its Once proof stays valid because the binding doesn't depend on the pool note.

A fresh key for every payout

The claimant's device derives its payout keys, which Rings calls holders, from the wallet's unlock signature under the app label once, and takes a new one, the next index of the kind claim, for each payout. No two payouts share a key or a viewing key, so the notes can't be grouped by owner.

Every payout note carries the same view tag, the holders authority's, so the device reads all of Once's payout traffic and decrypts only the outputs addressed to its own keys. It looks ahead past the highest index it has seen, so payouts are found on any device the wallet unlocks. What it opens and hasn't spent is the person's private balance, readable only where the wallet's unlock signature is.

Withdrawing

withdraw sends from the private balance to a public address. The device proves an SPP transaction spending its notes, and the API relays it through Once's withdraw instruction, which signs as the holders authority; SPP checks the claimant's payout key for each note. The transaction pays the destination the amount minus the relay fee, and pays the relay fee to the relayer. Withdraw a private balance walks through it.

Transactions

Claims and withdrawals are v1 transactions, the format Rings runs on, with a 4,096-byte limit. The relayer signs and pays for both, so the claimant's wallet signs nothing and appears in no account list.