OpenZeppelin / OpenZeppelin/compact-contracts

Add Confidential Note Fungible Token PrivateSupply extension

Open
#728 0 comments 0 reactions 1 assignee View on GitHub

@0xisk is already working on this.

Since Sep 7, 2026.

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

Description

🧐 Motivation

"What is the total supply?" has to be answerable without a public counter — a disclosed total leaks every mint and burn as a public delta, which is exactly the leak the note model exists to close.

📝 Details

contracts/src/token/extensions/ConfidentialNoteFungibleTokenPrivateSupply.compact

  • _encSupply holds outstanding supply as an exponential-ElGamal ciphertext under _supplyKey; _addMinted / _addBurned update it HOMOMORPHICALLY in the same transaction as the token op, so nobody decrypts to account.
  • attestSupply publishes a proof-backed public total when a deployment wants one, without making the running total public.
  • Supply-key self-rotation re-encrypts _encSupply under the new key in-proof.
  • Uses crypto/ElGamal; imports no token module.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.