Skip to main content

Canonical Terminology

Every term has exactly one meaning. Use these definitions.

Core Values

TermTypeDefinitionComputed How
secretbytes32Random value known only to committer. Proves ownership of commitment.crypto.getRandomValues() → 32 bytes
nullifierSecretbytes32Random value used to derive nullifier. Separate from secret for privacy.crypto.getRandomValues() → 32 bytes
blindingbytes32Random value that blinds the dataHash in the commitment.crypto.getRandomValues() → 32 bytes
dataHashbytes32Hash of application-specific data. Ties commitment to its purpose.Poseidon(app_field_1, app_field_2) or keccak256(data) % FIELD_SIZE
commitmentbytes32The on-chain identifier. Hides all inputs. Cannot be reversed.See formula below
leafIndexuint256Position in Merkle tree. Assigned at commit time.Returned from commit() / emitted in event
nullifierbytes32Unique spend tag. Derived from nullifierSecret + leafIndex.See formula below
rootbytes32Merkle root at a point in time. Must be in last 100 roots.Computed by relayer, stored on-chain
proofProof structGroth16 ZK proof. Proves knowledge of secrets without revealing them.Generated off-chain

Field Size Constraint

All values passed to Poseidon or used in proofs must be valid BN254 field elements:

FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617
Field Size Rule

If a value ≥ FIELD_SIZE, the commitment or proof is invalid.

Collision Safety: Commitment collisions are cryptographically infeasible assuming Poseidon preimage resistance and correct field handling. You do not need to check for collisions.

Commitment Formula (Exact)

commitment = Poseidon(
Poseidon(secret, nullifierSecret),
Poseidon(dataHash, blinding)
)

This is a 2-level tree of Poseidon T3 (2-input) hashes. The order matters. Swapping inputs produces a different commitment.

Nullifier Formula (Exact)

intermediate = Poseidon(nullifierSecret, commitment)
nullifier = Poseidon(intermediate, leafIndex)
Important

The nullifier depends on leafIndex, which is only known after commit. You cannot precompute the nullifier before committing.

Core Protocol Operations

TermMeaning
CommitAdd a commitment to the Merkle tree (core protocol)
RevealProve knowledge of secrets with ZK proof and mark nullifier as spent (core protocol)

Token Privacy Operations (Application Layer)

TermMeaning
VanishBurn GHOST tokens and create a commitment (uses Commit internally)
SummonProve ownership and mint GHOST tokens to recipient (uses Reveal internally)
info

Vanish/Summon are built on top of Commit/Reveal. The core protocol is data-agnostic—it can be used for tokens, access control, voting, or any private data.

Next Steps