OpenZeppelin / OpenZeppelin/compact-contracts
Add Set Membership Nullifier module
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 29
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 25
Description
🧐 Motivation
Several Midnight patterns (anonymous airdrops, anonymous voting, sealed-bid auctions, anonymous credentials) share one primitive: prove membership in a set, once per context, without revealing which member. Each consumer currently re-derives the commitment/nullifier scheme and its subtle correctness rules. A shared, audited module collapses each consumer to ~10 lines.
📝 Details
Module over HistoricMerkleTree (set + root history) and Set<Bytes<32>> (spent nullifiers). API: _register(commitment), proveAndConsume(secret, path, context), deriveCommitment, deriveNullifier, isUsed. Three namespacing layers: module tag, deployment domain, call-time context. Registration is permissionless — consumers gate it with Ownable/AccessControl.
Roadmap: Libraries → Set Membership Nullifier (Priority MNF: high).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing HistoricMerkleTree and current consumer implementations that re-derive membership commitments and nullifiers. Compare their behavior with the proposed API—_register, proveAndConsume, deriveCommitment, deriveNullifier, and isUsed—and verify that module, deployment-domain, and call-time-context namespacing and spent-nullifier tracking are covered.
Written by the indexing model from the issue text.
Assessment
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100