OpenZeppelin / OpenZeppelin/compact-contracts

Add multi-input spend (note consolidation) to the note token core

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

Nobody has claimed this yet.

effort: 4-L enhancement feat:token
Dominant language
TypeScript
Stars
55
Forks
29
Avg merge
5d 7h
Merged PRs (30d)
25

Description

🧐 Motivation

The biggest practical hole in the family. Every spend consumes exactly one input note, so nothing larger than the holder's biggest note is payable and balances fragment forever with no way to consolidate.

📝 Details

  • Needs a _join / two-input _consumeNote in the core — it requires the commitment tree and the nullifier set, so it is not expressible as an extension.
  • Two nullifiers per spend, two membership proofs; value conservation extends to the multi-input sum.
  • Watch the cost: _consumeNote is already k=14 / ~12.2k rows and the Regulated transfer is k=18 / ~136k rows.
  • Transaction-shape leakage changes: input count becomes a visible fact unless outputs/inputs are padded to a fixed shape.

Planned, not in #679 (confidential-note-token.md §0).

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 with confidential-note-token.md §0 and compare the planned work with issue #679. Then locate the core _consumeNote implementation and its commitment-tree and nullifier-set handling. Done means the core supports multi-input spends while covering the stated proof, value-conservation, cost, and transaction-shape considerations.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.