OpenZeppelin / OpenZeppelin/compact-contracts

Add RegulatedConfidentialNoteFungibleToken preset

Open
#733 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 pieces are only useful together, and getting the wiring wrong silently breaks the compliance properties. A regulated deployment needs one reviewed composition it can deploy as-is.

📝 Details

contracts/src/token/presets/RegulatedConfidentialNoteFungibleToken.compact

  • Wires core + Issuer + Authority + Audit + Delivery + supply, binding every role key in initialize.
  • The whole design hangs off one chokepoint, emitOutput(ownerPk, encPk, value, slot): audit first (which produces the nonce), deliver second, commit third. Every output note the preset ever creates — mint output, transfer output, transfer change, burn change, seizure recovery — flows through it, which is what makes the compliance properties structural.
  • Escrow-free seize (k=17, ~75k rows): owner-spend and seizure race on the same shared nullifier, so the authority never holds spend keys and no escrow account exists.
  • Re-exports the ledger fields wallets, auditors, and indexers must read (a prefix-only import would keep them out of the generated ledger() reader).
  • Costs: transfer k=18 / ~136k rows, burn k=17 / ~83k rows, mint k=17 / ~69k rows, attestSupply k=13 / ~4.7k rows.

Landed in #679 (draft).

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

Read contracts/src/token/presets/RegulatedConfidentialNoteFungibleToken.compact and the draft work in #679 first. Trace emitOutput and initialize, then verify that the listed token operations use the reviewed composition and that the required ledger fields are re-exported.

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
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.