Protocol Specification · Version 1
Cryptographic & On-Chain Specification
Exact wire formats, Multi-Base Binary Triptych verification equations, Structure-of-Arrays byte offsets, and measured sBPFv3 Compute Units implemented in github.com/audren-xyz/audren and deployed at AUDRBK6kVkQoEGm3EB7swd34SUPqrHZeNEkB5vZWVSv3.
1. Instruction Set (11 Instructions)
| Tag | Instruction | Behavior & Invariants |
|---|---|---|
0x00 | InitPool | Create PoolState (192 B), EpochPage #0 (6,240 B < 10 KiB CPI cap), sol_vault, and page_rent_vault. |
0x01 | OpenPage | Permissionless rollover sealing current EpochPage and opening page_id + 1 funded by PageRentVault via live Rent::get(). |
0x02 | Deposit | Shield Native SOL, Classic SPL, or safe Token-2022 directly to any Audren stealth address (zero spend key or ZK proof required). |
0x03 | Transfer | Private multi-asset 1-in → 2-out transfer: Triptych (m=5/6/7), CrossBase2 (256 B, unlinkable asset tags), Agave Bulletproof U128, optional AuditorAssetProof. |
0x04 | Merge | Consolidate two same-asset shielded notes via 2 Triptych proofs + CrossBase1 (128 B) + Agave Bulletproof U64. |
0x05 | SwapViaRouter | Non-custodial 1-tx private DEX swap through 16 sharded swap_escrow PDAs into any external Solana router (Jupiter, Orca, Raydium, Meteora, Phoenix, etc.). |
0x06 | Withdraw | Unshield exact amount to any recipient wallet/ATA with optional shielded change note. |
0x07 | SetPaused | Emergency authority circuit breaker for deposits/transfers/swaps (never grants vault withdrawal custody). |
0x08 | WriteProofBuffer | Upload parallel out-of-order <= 768 B payload chunks into an ephemeral ProofBuffer PDA tracked via u16 bitmask (strict <= 1,232 B Solana MTU). |
0x09 | ExecBuffered | Zero-copy execute Transfer, Merge, SwapViaRouter, or Withdraw from a completed ProofBuffer and atomically refund 100% of buffer rent to payer. |
0x0A | CloseProofBuffer | Reclaim 100% of rent lamports from an abandoned or unexecuted ProofBuffer back to its authority. |
2. Structure-of-Arrays EpochPage (6,240 B)
Every EpochPage PDA (["audren_page", pool_id_le, page_id_le]) holds up to 32 notes in column-major order, strictly under Solana’s 10 KiB CPI allocation cap. Standard RPC getMultipleAccounts and Agave programSubscribe pass dataSlice: { offset: 64, length: 1056 } to scan 3,200 notes in ~106 KB.
| Offset | Size | Slice | Role |
|---|---|---|---|
0..64 | 64 B | PageHeader | AUDRNPG1 magic, version, bump, closed flag, count (0..=32), pool_id, page_id, slots |
64..96 | 32 B | view_tags[32] | 1-byte fast scan filter (included in RPC & WS dataSlice) |
96..1,120 | 1,024 B | ephemeral_pks[32] | Stealth ECDH R_k points (included in dataSlice → 1,056 B total) |
1,120..2,144 | 1,024 B | stealth_pks[32] | One-time spend keys P_k read zero-copy under Direct Mapping (SIMD-0460) |
2,144..3,168 | 1,024 B | asset_tags[32] | Re-randomized hidden asset commitments A_k = G_mint + a·H |
3,168..4,192 | 1,024 B | commitments[32] | Pedersen value commitments V_k = v·A_k + r·H |
4,192..6,240 | 2,048 B | ciphertexts[32] | AES-256-GCM note memos (48 B payload + 16 B authentication tag) |
3. Multi-Base Binary Triptych Verification Equations
For ring size N = 2ᵐ (m = 5: 32 notes; m = 6: 64 notes; m = 7: 128 notes), random Fiat-Shamir weights μ₂..μ₇ batch all equations into chunked 8 KiB invocations of Agave’s native sol_curve_multiscalar_mul syscall inside Solana’s default 32 KiB heap.
| Eq | Property | Verification Equation |
|---|---|---|
Eq 1 | Bit linearity | A + ξ·B − Σ fⱼ·Hⱼ − z_A·H = 0 |
Eq 2 | Bit booleanity (lⱼ ∈ {0,1}) | ξ·C + D − Σ fⱼ(ξ − fⱼ)·Hⱼ − z_C·H = 0 |
Eq 3 | Stealth ownership (Pₗ = x·G) | Σ pₖ(ξ)·Pₖ − Σ ξʲ·Xⱼ − z_x·G = 0 |
Eq 4 | Unique nullifier (x·J = U) | ξᵐ·U − Σ ξʲ·Yⱼ − z_x·J = 0 |
Eq 5 | Multi-asset & value balance | Σ pₖ(ξ)·(Aₖ + α·Vₖ) − ξᵐ·(A_spend + α·V_spend) − Σ ξʲ·Wⱼ − z_q·H = 0 |
Eq 6 | Audited ElGamal S₁ = rₛ·G | ξᵐ·S₁ − Σ ξʲ·Tⱼ − z_aud·G = 0 (InstitutionalAudited) |
Eq 7 | Audited ElGamal S₂ = Pₗ + rₛ·K_aud | ξᵐ·S₂ − Σ pₖ(ξ)·Pₖ − Σ ξʲ·Eⱼ − z_aud·K_aud = 0 (InstitutionalAudited) |
4. Measured sBPFv3 Compute Units
Measured directly on the deployed 274,672-byte sBPFv3 ELF (SHA-256 3a4b8b2a53dd5c97…) with radix-29 scalar arithmetic and Agave native Ristretto255 + ZkElGamal Proof syscalls.
| Instruction | Measured CU | Notes |
|---|---|---|
Deposit (Tag 2) | 19,030 CU | Native SOL, SPL, or safe Token-2022 · 0 ZK proof |
Withdraw full (Tag 6) | 237,386 CU | Unshield with optional shielded change note |
SwapViaRouter (Tag 5) | 405,291 CU | Isolated swap_escrow CPI · leaves ~995k CU for DEX |
Transfer m=5 (32 ring) | 451,591 CU | Multi-Base Triptych + Agave Bulletproof U128 |
Transfer audited (m=5) | 506,766 CU | Enforces ElGamal (S₁,S₂) + (M₁,M₂) to K_aud |
Merge 2→1 (Tag 4) | 573,054 CU | Two m=5 proofs consolidated into 1 output note |
Transfer m=6 (64 ring) | 824,512 CU | 2 EpochPages · chunked 8 KiB MSM buffer |
Transfer m=7 (128 ring) | 1,113,133 CU | 4 EpochPages inside default 32 KiB Solana heap |