Skip to content

BAP-674: Privacy-Preserving Token Transfer Protocol#674

Open
niconiconi wants to merge 1 commit intobnb-chain:masterfrom
niconiconi:bap-674
Open

BAP-674: Privacy-Preserving Token Transfer Protocol#674
niconiconi wants to merge 1 commit intobnb-chain:masterfrom
niconiconi:bap-674

Conversation

@niconiconi
Copy link
Copy Markdown

Summary

BAP-674 specifies a standard interface for privacy-preserving token transfers on BNB Chain, enabling deposit, transfer, and withdraw of BEP-20 tokens (and native BNB) with on-chain confidentiality using a UTXO-based model and zk-SNARK (Groth16) proofs.

Key Features

  • Shielded UTXO model: Deposit, transfer, freeze, and withdraw operations with Poseidon2 commitments and nullifiers over BN254
  • Amortized Merkle tree: Buffer array (size 32) with frontier-based batch insertion into a depth-32 tree, dual-root verification (merkleRoot + arrayHash)
  • Nullifier derivation: Supports both default (direct secret key) and freezer-aware (DH-derived nullifier key) paths
  • Compliance layer: Per-pool viewer (ElGamal encryption on BabyJubjub) and freezer (bidirectional freeze/unfreeze toggle) keys
  • Relayer model: Per-operation binding input construction preventing parameter tampering, with self-relay support
  • Complete event specification: 21 events covering core operations, encrypted data, pool lifecycle, fee claims, and Merkle tree state
  • Poseidon2 reference: Full round constants, MDS matrices, and test vectors (Appendix A)

Discussion

https://forum.bnbchain.org/

Add BAP-674 specifying a standard interface for privacy-preserving token
transfers on BNB Chain using a UTXO model with zk-SNARK (Groth16) proofs.

Key features:
- Shielded deposit/transfer/freeze/withdraw operations
- Poseidon2 commitments and nullifiers over BN254
- Amortized Merkle tree with buffer array and frontier-based insertion
- ElGamal viewer encryption and freezer key compliance
- Relayer model with per-operation binding input construction
- Complete event specification (21 events)
- Poseidon2 round constants and test vectors (Appendix A)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant