anza-xyz / anza-xyz/cryptography
[tracker] private transaction milestone 1: single-institution demo
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 7
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 6
Mô tả
**Goal:**
Design and implement a privacy-preserving transaction protocol
- institutions issue fully-controlled assets (audit/freeze/monitor)
- user identity and amounts are hidden from the public but visible to the issuer
- cross-institution settlement deferred to Milestone 2.
**Scope of milestone 1:**
Single-institution demo for benchmarking and comparison:
- a generic Groth16 verifier program on Solana,
- Gnark circuits for private transactions with issuer tracing/auditability (Zcash-style pool with viewing capability).
**Out of scope (Milestone 2):**
- Cross-institution transfer (on-chain bidirectional bridge vs. off-chain settlement layer)
- wrap/unwrap settlement of a common underlying asset (e.g., wUSDC-A ↔ wUSDC-B).
---
## Epic 1 — Protocol & Circuit Design Spec
- [ ] **1 Protocol Spec (v0)**
- Note/commitment format (asset id, amount, owner pk, randomness, memo)
- Nullifier derivation scheme
- Merkle tree spec: depth, hash function (Poseidon parameters), root history window
- Address / key hierarchy: spending key, viewing key (issuer audit key), proof authorizing key
- Tracing design: issuer-decryptable ciphertext attached to every note (Zcash IVK)
- encrypt-to-issuer with in-circuit correctness proof
- Freeze mechanism: program-level nullifier blocking
## Epic 2 — Generic Groth16 Verifier Program (Solana)
> Reusable by other ZKP protocols: verification key is an input (account data), not baked into the binary.
- [ ] **Program skeleton & instruction layout**
- Instructions: `init_vk` (store VK in a PDA), `update_vk` (authority-gated), `verify` (proof + public inputs)
- VK serialization format (arkworks/gnark compatibility)
- [ ] **Groth16 verification via alt_bn128 syscalls**
- Pairing check with `alt_bn128_pairing`, MSM of public inputs with `alt_bn128_group_op`
- Compute-unit profiling;
## Epic 3 — Gnark Circuits (Single Institution)
- [ ] **Poseidon + Merkle gadget in Gnark**
- [ ] **Transfer circuit (spend/output, Zcash-style)**
- Inputs: note commitments, Merkle membership, nullifier correctness, ownership (sig or key-derivation), value balance, amount range checks
- Asset-id consistency across inputs/outputs
- [ ] **Tracing/audit constraints**
- In-circuit proof that the note plaintext (owner, amount) is correctly encrypted to the issuer's audit key
- [ ] **Mint & burn circuits**
- Issuer-authorized mint (public amount → shielded note), burn (shielded → public)
## Epic 4 — Shielded Pool Program & Glue
> Minimal on-chain state machine so the demo is end-to-end, using the Epic 2 verifier via CPI.
- [ ] **Pool program: state & instructions**
- Merkle root management (incremental tree or root-update-with-proof), nullifier set (PDA map), root history
- `transact` instruction: CPI verify → check/insert nullifiers → append commitments → emit encrypted memos as events
- Issuer admin instructions: freeze/unfreeze, pause, VK rotation
- [ ] **Client SDK / CLI**
- Note scanning & decryption, witness building, proof generation (Gnark prover), tx assembly
- Issuer audit CLI: decrypt-all with audit key, trace a note's history
## Demo E2E
- [ ] A proof generated by the Gnark transfer circuit verifies on-chain via the generic verifier (devnet)
- [ ] Issuer can decrypt any note and freeze an account; frozen account's spends fail
- [ ] Public observers cannot learn sender, receiver, or amount from on-chain data
- [ ] Benchmark and comparison against other known solutions
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start with Epic 1's Protocol Spec, then map the init_vk, update_vk, and verify instructions and the Gnark circuit entries in Epics 2–3. Confirm the milestone boundaries and single-institution assumptions before estimating implementation. Done means the listed demo criteria pass: on-chain verification on devnet, issuer decryption and freezing, public privacy, and benchmark comparison.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- go, rust
- Lĩnh vực
- blockchain, cryptography, security
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 20/100