OpenZeppelin / OpenZeppelin/compact-contracts

Add Set Membership Nullifier module

Open
#542 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1-medium effort: 3-M feat:crypto
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.