Concepts

How Once works

From a credential to a claim, and what each party sees on the way.

A person enrolls once and then claims once in each scope. Enrolling turns a credential into a secret s that only the person's device holds, with help from OPRF nodes that never see who is asking. Claiming proves, from s, that the claimant is in the person tree and has not claimed in this scope before.

Credentialissuer signs a VCSecret s2 of 3 OPRF nodesEnrollleaf in person treeClaimn per scope, relayed
Credentialissuer signs a VCSecret s2 of 3 OPRF nodesEnrollleaf in person treeClaimn per scope, relayed
One enrollment, then one claim in each scope.

Unlock

The person's wallet signs one message:

text
once unlock v1
Sign to derive your private keys. This signature stays on this device.

From that signature the device derives, with HKDF-SHA256 salted by the wallet address, three things: the place secret k, the holder key (a BabyJubJub key the credential is issued to), and the payout keys that receive a drop's payouts in Rings. Ed25519 signatures are deterministic, so the same wallet derives the same keys on any device. The signature and everything derived from it stay in the device's memory and are wiped when the wallet locks or switches.

Get a credential

An issuer checks the person and signs a W3C Verifiable Credential to their holder key. The credential's fields become a 16-leaf Poseidon Merkle tree, and the issuer signs its root with BabyJubJub EdDSA. The device keeps the credential and computes from it the private identifier HashID, a Poseidon hash of six identity fields and the original valid-from time, which never leaves the device. Credentials and issuers has the fields and the encoding.

Get the person secret

The device maps HashID to a point P on BabyJubJub and blinds it with a random scalar r, sending B = r·P. With the authorize circuit it proves that B came from the HashID of a credential signed by the issuer key it names and issued to this holder key, exposing only B, the two keys and the valid-until time, then signs the request with the holder key.

Each OPRF node checks the proof, the signature, that the issuer is registered and that the credential hasn't expired, multiplies B by its key share and answers with a DLEQ proof that it used its registered share. 2 of 3 nodes must answer. The device checks both proofs, combines the two answers into sk·B, where sk is the OPRF key no node holds whole, removes r to get Q = sk·P, and hashes Q into the person secret s. The same person gets the same s from any wallet and any device. The threshold OPRF explains the construction.

Enroll

From s the device computes the person nullifier N and the leaf Poseidon(s, k, expiry), where expiry is the credential's valid-until time. The enroll circuit proves that N and the leaf come from a credential signed by the given issuer and from a correct OPRF transcript under the registered key. The wallet sends enroll, and the program checks the issuer, the OPRF key version, the expiry and the proof, creates the person account keyed by N, and appends the leaf to the person tree. A second enrollment from the same person derives the same N and is refused.

Claim

An app opens a scope: a drop or a poll. To claim in it, the device computes the scope nullifier n = Poseidon(s, scope_id), builds the Merkle path to its own leaf from the full leaf list, and proves with the claim circuit that its leaf is in a root the program still keeps, that its credential expires after the scope closes, and which recipient or option the claim is for.

The API relays the claim, paying the fee and the rent. The program checks the proof, records a claim receipt at the address derived from the scope and n, and then pays the drop's share into a new Rings note that only the claimant's device can open, or adds the vote to the poll's tally. Another claim with the same n in that scope finds the receipt and is refused.

Close

After the scope's window ends, anyone can close it. A drop's unclaimed funds and a poll's unspent relay budget go back to the creator. Once it is closed, close_claims returns each claim receipt's rent to the relayer that paid it.

What each party sees

PartySeesDoes not see
IssuerThe identity fields it checked, the holder public key, the validity intervals, N, any wallet, any claim
Each OPRF nodeThe blinded point B, the holder public key, the issuer key, the credential's valid-until time, the request timeHashID, s, N, any wallet
The chain, at enrollmentThe enrolling wallet, N, the leaf and its index, the issuer key, the credential's expiry, the timeHashID, s
The chain, at a claimThe scope, n, the root proved against, the binding, a poll's option, the relayer, the timeWhich leaf or which wallet the claim came from
The APIEvery claim request it relays, and every leaf when it serves the full listWhich leaf a device builds its path to
The app that opened the scopeIts ledger of scope nullifiers with times, and a poll's tallyWho claimed

What each party is trusted for is on Trust model.