research / shielded-pool

topic 01 · flagship · zero-knowledge · CashTokens

The Shielded
Pool

Zero-knowledge payments on the UTXO model — measured, not promised.

A complete Groth16 shielded pool for CashTokens — note commitments, nullifiers, a Merkle tree, and the pool rules running inside a full on-chain Groth16 verifier — deployed and measured on Bitcoin Cash, chipnet and mainnet. It runs today: one standard transaction, one scripting VM, no fork required.

live on mainnetno consensus changesasset-generic — category is a private witnessreviewed sound verifier — deployed
183,472
constraints · 2-out circuit
[measured]
184,528
constraints · 3-out circuit (deployed demo)
[measured]
+0.58%
3-out delta vs 2-out
[measured]
2
public inputs
[measured]
27,624 B
reviewed sound verifier · deployed
[cited + measured]
7,834 B
deployed program · pool rules inside the verifier
[measured]
20/20
acceptance suite · theft replay rejects
[measured]
146/0
red-team runs rejected · deployed program
[measured]

live · chipnet · the current generation

The Current Pool:
Rules Inside the Verifier

The successor to every pool below: the independently reviewed bch-groth16-bn254-sound-native verifier with the pool rules running as a role-2 hook inside the same program — no separate covenant, no step-UTXO fleet. Every pool UTXO (state NFT, deposits, fee fuel) is locked to the one program P2SH32, and every action is a signature-free 3-input spend: the script satisfaction is its own authorization. Deployed on chipnet 2026-11-24 under our solo-ceremony VK, with deposit tags binding fuel to the funded action, a minting guard making burn and FT-inflation consensus-impossible, and permissionless blank vending — all confirmed on chain.

PRIVATE — WITNESSES + PROOF, NEVER ON-CHAINnotes cmᵢ · nullifiers nfᵢ · Groth16 proof 128 B (22.8 s witness)witness + proof ride the unlockingTHE ONE PROGRAM — P2SH32 aa203e40…2987reviewed sound verifier · 27,624 B · roles 1/2/3role-2 hook = THE POOL RULES · 524 B · 37,198 opcarrier binding · tags 4c/4g · nullifier archive · payoutsignature-free — the script satisfaction IS the authorizationin0 · FUEL UTXOtag = SHA256(nf0‖nf1)in1 · FUEL UTXOtag = SHA256(nf0‖nf1)in2 · STATE NFTroot ‖ nullifier set · FT = balance3 inputs, one lockingout0 · OP_RETURN carriernf0‖nf1‖cm0‖cm1‖root‖pv‖signout1 · NEW STATE NFTnewRoot ‖ newNull · FT = newBalanceout2 · PAYOUT (unshield)pv FT → any address · public by design2 + sign outputschipnet · deploy 2eaeb97f… block 345,467 · minting guard aa2066a2… · blank vending aa206b51…
01

Deploy

the pool is born

  • anchor 480e30ff… = the category → mint 5ea499ff… → deploy
  • state NFT at :0 — the PUBLIC bootstrap root 551108f6…510f ‖ zeros
  • minting NFT passed forward at :1 — the tag supply's source
chipnetblock 345,467program 7,834 B
02

Shield

1,000,000 units enter, tagged

  • lock 97d135f9… tags the fuel: SHA256(nf0‖nf1) as NFT commitments
  • action broadcast ATOMICALLY with its unconfirmed lock — 28,127 B
  • balance 0 → 1,000,000 FT in the state NFT; 2 tag NFTs burned
chipnetfee 30,000 sats · 1.067 sat/B
03

Transfer

private notes change hands

  • lock 5db06be7… (tag 620e2824…) + action, atomic
  • 28,211 B · 30,000 sats (1.063 sat/B) · public value moved: zero
  • sender, receiver, amount: invisible on chain
chipnetfee 30,000 sats · 1.063 sat/B
04

Unshield

250,000 units exit, proven honest

  • lock 70ab2a1f… (tag cec1170e…) + action, atomic
  • the public payout output EXECUTED: 250,000 FT to the wallet
  • 28,175 B · 29,000 sats (1.029 sat/B) · Hush lifecycle final root 1829766…, balance 750,000; the browser acceptance then advanced the state to f52008f4… (760,400 FT, 44 leaves)
chipnetpayout executed

every tx confirmed on chipnet [measured] · each action was broadcast ATOMICALLY with its tagged lock (the action spends the lock's unconfirmed outputs — first-seen wins, closing the theft window to ~zero) · fees are BARE per the fee policy: 1 sat/B floor, fuel prepaid in the lock · Hush lifecycle final state: root 1829766…, balance 750,000, notes at tree 6,7 · the nito.cash browser acceptance then advanced the state to f52008f4… (760,400 FT, 44 leaves) — see Notes Management

custody, settled

The minting guard

The category's minting NFT is locked at the guard P2SH32 aa2066a2…, and the ONLY spendable shape recreates it at the guard's own locking while minting exactly K=64 NFT-only empty-commitment blanks. Burning the minting NFT and minting any fungible amount are consensus-impossible — the 100M supply is frozen; a fully compromised operator key can only choose WHEN a batch runs. Adopted live with no redeploy (block 345,503); the first guarded batch executed on chain at block 345,504 — consensus 157,733 op / standard 178,853 op, both ACCEPT.

permissionless acquisition

The blank vending machine

A P2SH32 machine per blank with NO signature anywhere: the buyer's tokenless funding input pays the exact pinned price (1,000 sats) to the operator's P2PKH and the blank is delivered to the funding input's OWN locking — the blank follows the money. Proven live by a total stranger: the load put 2 blanks in the machine (block 345,663) and a key never seen by the operator bought BOTH (blocks 345,664 and 345,666) using only its own signature — the covenant executed on chain, 7,545 op consensus / 8,057 op standard, both ACCEPT.

client integration: the nito.cash browser acceptance PASSED — SHIELD 1ca58773… → TRANSFER 50644d00… → UNSHIELD f52008f4…, registry live, CI green. The next client surface is the 3-out v3 (201-B carrier, 9-field actionHash, new VK/MPC) — the verifier and hook are built and a chipnet demo is live; see Notes Management · browser acceptance handoff ↗ · v3 design ↗

live · mainnet

Live on Bitcoin Cash mainnet

real PUSD · real Groth16 proof · every stage linked to its mainnet transaction [measured] · the first generation's architecture, demo grade

01

Prep

pool category created

  • genesis input = any input spending a vout-0 outpoint
  • its txid becomes the pool state-NFT category
  • zero-value carrier — no tokens minted yet
mainnet219 B [measured]
02

Genesis

state NFT minted

  • mutable NFT commitment = merkle root ‖ nullifier-set hash
  • root = 49bda9bd…830f (the proof vector’s anchored root)
  • the pool’s whole state lives in 64 bytes
mainnet459 B [measured]
03

Deploy

covenant + verifier funded

  • P2SH32 covenant aa20a8d375c44dfa… pins poolCategory
  • 5 Groth16 verifier step UTXOs pre-funded (36,649 B)
  • 100 base units (1.00 PUSD) holdings locked under the same covenant
mainnet909 B [measured]
04

Transfer

100 base units (1.00 PUSD) shielded

  • real Groth16 proof · 2 public inputs · 183,472 constraints
  • 7 inputs VM-validated before broadcast, all OK
  • state root advanced to d5ec91ad…d508; 100 base units (1.00 PUSD) conserved
mainnet38,475 B · 1 sat/B [measured]

all four txs broadcast on BCH mainnet, 2026-11-20 [measured] · setup grade: demo — solo 1-of-1 ceremony, entropy published (c490ce06…17b931) · production remains gated on the public ceremony

01 · the first lifecycle · chipnet 2026-10

Shield, Transfer, Unshield

the sibling-split generation's first full pass through the pool — every stage linked to the transaction that performed it [measured]

01

Shield

public tokens enter

  • 500,000 units of asset 98690dba… enter publicly
  • afterwards, on-chain: a note commitment only
  • shielded asset ≠ pool category — multi-asset on the first op
block 33045937,212 B [measured]
02

Transfer

private notes change hands

  • shielded → shielded; sender, receiver, amount: invisible
  • 3 chained transfers confirmed in ONE block
  • ~36.8 KB each · no public value moved
block 3297643 chained txs
03

Unshield

value exits, proven honest

  • note spent; covenant pays the public leg
  • Groth16 proof authorizes the spend
  • nullifier fold archives the spends (a hash chain, not a set — see the R2-NULLIFIER-DOUBLING disclosure); stale roots block replay
block 329736confirmed

all three txs confirmed on chipnet [measured] · the mainnet matrix above ran the same circuit and covenant with real PUSD · production deployment remains gated on the trusted-setup ceremony

02 · what this is

Payments that
leave no trace

The pool is a join-split state machine: users deposit CashTokens publicly (SHIELD), move them privately between notes (TRANSFER), and withdraw them publicly (UNSHIELD). Inside the pool, notes are commitments — value, owner and history are never visible on-chain.

Every operation is authorized by a Groth16 zero-knowledge proof that the transition is honest: spent notes existed in the pool's Merkle tree, their nullifiers are unique, value is conserved per asset, and only the owner could spend. The chain stores just two public inputs per proof: the tree root and a hash binding the whole action.

  • Works on today's scripting: the full verifier runs as one standard transaction on the BCH 2026 VM — no CHIP, no fork, no new opcodes.
  • Asset-generic by construction: the CashToken category is a private witness — the same circuit and verifying key serve any token.
  • Not a black box: covenant + verifier + circuit are all reproducible from source; the gate trail below is linked on-chain.

03 · the machine

Architecture

generation 1 — verifier as sibling inputs · rendered from GENERALIZED-SHIELDING.md / COVENANT-DESIGN.md · the current generation is diagrammed in the role-2 section above

PRIVATE — WITNESSES, NEVER ON-CHAINCᵢ = Poseidon(value, ρ, r, pk)nfᵢ = H(nullifierKey, ρ)encrypted tag → receiver scanwitnessesGROTH16 JOINSPLIT CIRCUIT — pool.circom183,472 constraints · 2 public inputs · BN254Merkle membership · value conservation · spend authorizationpublic: [merkleRoot, actionHash]actionHashproofASSETPOOL COVENANTP2SH32 · 347 B redeem (category = ctor param)state NFT { merkleRoot, nullifierSet }6-input / 7-output tx shapeON-CHAIN GROTH16 VERIFIER35,626 B · one standard tx · BCH 2026 VMvk_x recomputed in-script5 sibling step-inputsBitcoin Cash chipnet — no fork · CashTokens · P2SH32
1

Prove

The wallet builds the action locally, generates the Groth16 witness and proof — 22.8 s measured for the deployed role-2 witness under our ceremony zkey (16.967 s for the same circuit on the build runner) — and assembles one transaction.

2

Verify

The action has three inputs, all spending the one program P2SH32 — the reviewed sound verifier (27,624 B) runs inside it, and the role-2 hook checks the pool rules in the same script. No signature: the script satisfaction is the authorization.

3

Settle

The hook recomputes the actionHash from the on-chain carrier and binds it to the proof, archives the nullifiers, adopts the new tree root in the state NFT and pays the unshield leg — all in the same transaction.

04 · the numbers

Measured Results

[ measured ] = live measurement with a recorded source · nothing on this page is estimated

quantityvaluesource
Circuit (single-asset)183,472 constraints · 107 private inputs · 181,959 wiressnarkjs r1cs info build256/pool.r1cs ↗
Circuit (3-out v3)184,528 constraints (+1,056, +0.58%) · 112 private inputs · 183,017 wires · 2 public inputs · 20.2 s compilecircom 2.2.3 --O2 on apecsdev, 2026-11-26 · circuits/pool3.circom ↗
3-out carrier + actionHashcarrier 169 → 201 B · actionHash 8 → 9 fields (cm2) · action +32 B · r1cs 39,449,264 B · wasm 3,380,815 Bmeasured 2026-11-26 · v3 design ↗
3-out verifier + hook + witnessBUILT: plain sound verifier 7,310 B sha256 6ec7ca8e… (6.01% std margin); hooked program 7,848 B sha256 628207b1…, locking aa200240…; hook 39,082/37,930 op, 537 B; acceptance 21/21; red team 146/0; sweep 69/69 (min 6.00% std). The Nito client 3-out witness path is built and byte-exact against the live UNSHIELD (ec31a41c…); the UI and the browser acceptance remain, while 3-out blanks ARE permissionless (vending aa2020bd…, first stranger buy 569a6e6d…); the proving assets are live on prover.nito.cash.POOL_3OUT=1 pool-info / pool-cost / pool-test / pool-redteam / pool-sweep, 2026-11-26 ↗
3-out demo pool · chipnetDEPLOYED 2f650791… (category bc607a96…, program 7,848 B sha256 73cb0ccb…, locking aa204a6c…); SHIELD e847ef56… (28,326 B, 1.059 sat/B), TRANSFER ef64f3dd… (28,389 B, 1.057 sat/B), UNSHIELD 300 ec31a41c… (28,368 B, 1.022 sat/B, out 112+84+84), a ZERO-VALUE-DUMMY transfer 30f0f9d4… (out 400+20+0) and the spend of that zero note cbfb0503… (out 200+100+100) confirmed; final state 700 FT, notes 112/84/84/20/200/100/100, 17 leaveschipnet 2026-11-26 · docs/ROLE2-3OUT-V3-DESIGN.md §6 ↗
Role-2 browser acceptanceSHIELD 1ca58773… → TRANSFER 50644d00… → UNSHIELD f52008f4… · state 760,400 FT · wallet A 19,986,800 + 600 FT, 128,323 plain, 0 blanks · pool history 48nito.cash browser acceptance 2026-11-26 · docs/ROLE2-BROWSER-ACCEPTANCE-HANDOFF-2026-11-26.md ↗
Notes management · v33-out change splitting: BUILT + DEPLOYED as a chipnet demo (SHIELD e847ef56…, TRANSFER ef64f3dd…, UNSHIELD 300 ec31a41c…); deposit path (0-in/2-out onboarding) and encrypted note delivery remain DESIGN; UNMEASURED. The nullifier gap is a DEMONSTRATED full-balance drain — see the R2-NULLIFIER-DOUBLING disclosure on this pagedocs/ROLE2-3OUT-V3-DESIGN.md §6 ↗
Failed acceptance locks2,200 FT + 150,000 fuel sats standing: 3db76294… is public-bootstrap-tagged (1,000 FT + 30,000 sats, sweepable); 10f26fa3…, 1946084e…, c3e21c7a…, dff42ddb… carry lost notes (1,200 FT + 120,000 sats, stuck)docs/ROLE2-BROWSER-ACCEPTANCE-REVIEW-2026-11-26.md ↗
Transfer note deliverythe TRANSFER 50644d00… 400 FT recipient note is UNDELIVERED; the 169-B carrier has no encrypted note; the 201-B 3-out carrier still cannot carry a full note — the off-chain channel is UNMEASUREDnito handoff caveat 1 · v3 design ↗
Public inputs2 — [merkleRoot, actionHash]pool.r1cs + verification_key.json (ic.length = 3) ↗
Circuit (multi-asset, variant b)186,007 constraints (+1.38%) · Poseidon(6) commitments bind the full 256-bit categorycircom 2.2.3 --O2 compile, 2026-11-01 build record ↗
On-chain verifier · generation 135,626 B inside ONE standard transaction (densless-msm — withdrawn, see below)chipnet on-chain measurement ↗
Verifier soundness · generation 1WITHDRAWN by its author 2026-10-26 — densless-msm, finding F6: the Miller slopes are not constrained by the tangent/chord equations and the terminal compares a value with itself instead of checking the B endpoint. Carried by every pool deployed before 2026-11-24 (gate3, gate6, gate6b, mainnet, nito v2/v4)groth16_cashscript chunked/bn254/densless-msm README · issue #32 ↗
Deployed verifier · generation 2bch-groth16-bn254-sound-native — 27,624 B, 3 inputs, one standard tx, independently reviewed 2026-10-26 — DEPLOYED 2026-11-24 inside chipnet-role2-pool-v2-tagged (block 345,467) with the pool rules as a role-2 hookchipnet deploy 2eaeb97f… · verifiers.md ↗
Covenant verifier-sibling pinMISSING in every pool deployed before 2026-11-24 — spend() read the genesis sibling's unlocking at fixed offsets and never checked that input's locking bytecode, so a 1-byte OP_1 script at that index was ACCEPTED on the BCH-2026 VM. Resolved two ways: the generation-1 covenant got the sibling pin in source (358 B, covenant op-cost 36,805 → 42,478; gate 6/6) — and the deployed role-2 pool eliminated the sibling entirely, moving the pool rules INSIDE the verifierpin-sibling-test.mjs — 6/6 cases · role-2 deployment 2026-11-24 ↗
Role-2 hook price37,198 op standard / 36,046 op consensus · 524 B of role-2 code inside the 7,834-B program (code pin d71851a1…)pool-cost.mjs statement→slices diff · pool-registry.json ↗
Role-2 acceptance suite20/20 — including the theft replay: a valid proof consuming fuel tagged for ANOTHER action REJECTS at check 4g (deposit tags bind fuel to the funded action's own nullifiers)wip-role2-hook/STATUS.md · pool-registry.json ↗
Red team · deployed program146 runs, 0 accepted · both positive controls acceptedpool-redteam-tagged-report.json (verified from the committed report) ↗
Liveness sweep · deployed program69 funded-pool scenarios, 0 failed · worst per-input margin 6.00% standard / 6.49% consensus · max proof nq 123pool-sweep-tagged-report.json (verified from the committed report) ↗
Role-2 action size + fee~28.1–28.2 KB per action · BARE fees 29,000–30,000 sats ≈ 1.03–1.07 sat/B, prepaid by the user's lock txPOOL-DEPLOYMENT.md §16 ↗
Witness generation (role-2)22.8 s for the deployed SHIELD witness under our ceremony zkeywip-role2-hook/STATUS.md ↗
Covenant redeem bytecode347 B — identical for every asset (category = constructor param)decoded from transfer tx input 0 witness ↗
Proof generation16.967 s (183,472) / 17.6 s (186,007) · build runner (hardware spec UNMEASURED)snarkjs fullProve, session records
Covenant op-cost (Gate 6, input 0)84,819 / 556,800 budget (15.2%)libauth BCH-2026 VM debug on the broadcast tx ↗
Verifier step op-costs (Gate 6)82.4% – 92.3% of the per-input budgetlibauth BCH-2026 VM debug on the broadcast tx ↗
Pool-op tx size~36.8 – 37.8 KB per shielded operationon-chain transactions ↗

build records: APECSdev/pusd-shielded-pool (CHIPNET.md · wip-role2-hook/STATUS.md) · hushyourmoney (POOL-DEPLOYMENT.md §15–§18) — measured on chipnet 2026-10/11 and 2026-11-24.

05 · the trail

Gate-by-Gate Evidence

seven launch gates · six passed · one in design

G1

Full pipeline reproduction

passed

4th chained TRANSFER built, proved (16.967 s) and broadcast; VM-eval passed on all 7 inputs; confirmed in block 330142.

G2

Compile-from-source parity

passed

pool.r1cs + pool.wasm + pool.sym byte-identical (sha256-verified) against the canonical build256 artifacts.

G3

Path A lifecycle — fresh deploy

passed

PREP → GENESIS → DEPLOY → SHIELD 1,000,000 units, all in block 330438; first pool-registry entry.

G4

Multi-asset circuit

passed

Variant (b) Poseidon(6): 186,007 constraints (+1.38%). Anti-converter negative test (1 unit moved across categories) REJECTED in-circuit.

G5

Multi-category covenant

passed

All 6 tx shapes ACCEPTED on the BCH-2026 VM; worst op-cost 49,549 / 195,200 (~25%).

G6

Multi-asset E2E on chipnet

passed

Fresh 1-of-1 setup + deploy + SHIELD 500,000 units of a DIFFERENT category than the pool — block 330459.

G6b

Two-asset lifecycle, one pool

in flight

SHIELD A → SHIELD B → TRANSFER → UNSHIELD B on one multi-asset pool; all four ops VM-verified and broadcast 2026-11-10/11 — never confirmed: the op set was RBF-replaced with a fresh set and the replacements also remain unconfirmed on chain, so there is no explorer link.

G7

MPC trusted setup → mainnet

in design

Perpetual Powers-of-Tau ceremony — in design. Public landing page live; monitor UI marked [demo].

06 · on-chain state

Live Pools

from pool-registry.json · chipnet

chipnet-role2-pool-v2-tagged

deployed · current
locking
aa203e40…2987
tree root
551108f6…510f
first tx
DEPLOYED 2026-11-24 · role-2 · reviewed sound verifier · block 345,467 · 2eaeb97f…83b8 ↗

The current generation: the pool rules run INSIDE the independently reviewed sound verifier as a role-2 hook (program 7,834 B, locking aa203e40…). Signature-free 3-input actions — every pool UTXO spends the one program P2SH32; there is no separate covenant and no step fleet. Deposit tags (checks 4c+4g) bind the fuel to the funded action's own nullifiers — the theft replay REJECTS at 4g. Minting guard + permissionless blank vending live (see above). Full lifecycle confirmed: SHIELD 9d9aa97a… → TRANSFER 5262417b… → UNSHIELD 250,000 e54d19fb… (payout executed), each broadcast atomically with its tagged lock. Under OUR solo-ceremony VK (sha256 05250429…). The nito.cash browser acceptance then ran the full lifecycle through the real UI: SHIELD 1ca58773… → TRANSFER 50644d00… → UNSHIELD f52008f4… (state 760,400 FT, 44 leaves; wallet A 19,986,800 + 600 FT). The 400 FT transfer note is undelivered; four failed locks (1,200 FT + 120,000 sats) are stuck, one (3db76294…, 1,000 FT + 30,000 sats) is sweepable. The 3-out v3 is the next generation — see Notes Management.

chipnet-role2-pool

superseded
locking
aa20cd37…cd87
tree root
551108f6…510f
first tx
DEPLOYED 2026-11-24 · role-2 · untagged · block 345,413 · f8f215c3…3319 ↗

The first role-2 deployment — full lifecycle confirmed on chain (SHIELD 582cefee… block 345,415 → TRANSFER 17f1322b… 345,423 → UNSHIELD 250,000 24cd6b42… 345,427, payout executed; final root 19318325…, balance 750,000). Superseded the same day by the tagged v2: its hook binds no author (standing fuel was consumable by any valid action between lock- and action-confirmation — user-surfaced), and its minting NFT was burned in the deploy, so it can never mint tag blanks. Its 750,000 shielded FT remain spendable.

chipnet-pusd-v4-covenant0

spendable
locking
aa209dd6…5587
tree root
551108f6…510f
first tx
DEPLOYED 2026-11-23 · covenant-at-input-0 · block 344638 · efd3314e…857c ↗

Wallet-originated actions confirmed: SHIELD 43ca7bca…2e4d (block 344641) and TRANSFER fdd2981d…7b8b (block 344646, encrypted note carrier at out[6]). Same seeded tree root as v2 — the two deploys' state-NFT commitments are byte-identical.

chipnet-pusd-v2

not spendable
locking
aa20e6b3…5587
tree root
551108f6…510f
first tx
DEPLOYED 2026-11-22 · wallet-committed key · block 343322 · 53014fd4…66da ↗

Deployed with the five-input fixture verifier program: its terminal pins inputs == 5 and its steps read input 3 as the genesis witness, while every wallet action emits seven inputs. No action can satisfy those scripts. Its pool UTXO is still the deploy output, unspent since block 343322 — zero actions. Successor: v4 above.

gate3-demo-pool

deployed
locking
aa207c0c…2087
tree root
2c0f5336…4525
first tx
SHIELD 1,000,000 units · block 330438 · f5927a0b…7426 ↗

gate6-multi-pool

deployed
locking
aa201754…8e87
tree root
6fefb09c…7e20
first tx
SHIELD 500,000 units (foreign category) · block 330459 · fc585fc9…912f ↗

A fifth pool (Gate 6b) demonstrates the full two-asset lifecycle — SHIELD A, SHIELD B, TRANSFER, UNSHIELD — on a single multi-asset instance; its operations were VM-verified and broadcast 2026-11-10/11 but never confirmed: the op set was RBF-replaced with a fresh set and the replacements also remain unconfirmed on chain, so there is no explorer link. Full registry: pool-registry.json ↗

07 · notes management

Notes Management
The 3-Output Generation

The current pool is 2-in / 2-out. The v3 3-out circuit adds one output note: a SHIELD can create two wallet-owned notes plus the Hush change in one action, and a TRANSFER can split change cleanly. It is the note-management layer, not the whole solution — the deposit path, a real nullifier set and encrypted note delivery are the v3 core. The 3-out is measured and deployed as a chipnet demo: the SHIELD, TRANSFER and UNSHIELD are confirmed.

disclosure · measured 2026-11-26 · both role-2 pools

The nullifier fold permits a full-balance drain — demonstrated, not hypothetical

Finding R2-NULLIFIER-DOUBLING: a valid Groth16 proof can use one note as BOTH in-notes. Neither circuit (2-out or 3-out) constrains the two in-notes to be distinct, the on-chain hook's check 7 only foldsnewNull = SHA256(oldNull ‖ nf0 ‖ nf1) — a hash chain with no membership test — and both verifying keys have exactly 2 public inputs, so the nullifier archive is not verifiable by the proof system. The same note's value counts twice against the conservation law.

Measured, proven, not executed: two draining proofs exist (one per pool), both verify with snarkjs against their own deployed verifying keys, and neither was broadcast — no funds moved, the state was untouched. The worst case is the 2-out pool: its 450,600-FT note as both in-notes gives 901,200 ≥ the pool balance 762,400, so a single UNSHIELD action pays out the entire balance. The 3-out pool drains in three actions. Unlike the withdrawn verifier (F6 — soundness not established, no forged proof demonstrated), here the honest prover produces the draining proof.

Standing rule until the v3 nullifier set ships: no valued asset may enter any pool running this hook. The nullifier set is now a mainnet gate alongside the MPC ceremony. Full record — proofs, commands, drain arithmetic: handoff §12 ↗ · the fix design: v3 design §3.2 ↗.

measured · 2026-11-26

184,528 constraints

The 3-out circuit adds one note: +1,056 constraints (+0.58%) over the 183,472 2-out circuit. 2 public inputs, 112 private inputs, 20.2 s compile, r1cs 39,449,264 B, wasm 3,380,815 B.

circuits/pool3.circom · circom 2.2.3 · apecsdev

the carrier grows

201 B · 9 fields

The carrier grows 169 → 201 B; the actionHash grows 8 → 9 fields (cm2); the action grows +32 B. The 2-public-input verifier contract is unchanged.

cm2 is bound exactly as cm0/cm1

the gate

A new setup

The 1-of-1 demo setup is built (new VK d4ed12ee…, zkey b0177dbe…, wasm c806e561…); the 3-out verifier program, the 201-B hook, the 9-field actionHash and the 3-out witness are built and measured. The new MPC (Gate 7) and the Nito client UI remain pending; 3-out blanks are permissionless (machine aa2020bd…, first stranger buy 569a6e6d…); the 3-out witness path is built and byte-exact, and the proving assets are live. A demo pool is deployed on chipnet.

demo ≠ mainnet · Gate 7 is the gate

measured · the 3-out program

Built under the new VK

Plain sound verifier 7,310 B sha256 6ec7ca8e… (6.01% standard margin); hooked program 7,848 B sha256 628207b1…, locking aa200240…; hook 39,082 / 37,930 op (537 B of role-2 code); acceptance 21/21; red team 146 / 0; sweep 69 / 69 (min 6.00% standard, input 2). The 2-out hooked program is byte-identical after the carrier change (sha256 d71851a1…).

POOL_3OUT=1 · apecsdev · 2026-11-26

deployed · chipnet demo

Five confirmed 3-out actions

Category bc607a96…; deploy 2f650791…; program 7,848 B sha256 73cb0ccb…, locking aa204a6c…. SHIELD e847ef56… (28,326 B, 1.059 sat/B, out 400+300+300) → TRANSFER ef64f3dd… (28,389 B, 1.057 sat/B, spends notes 2+3, out 280+210+210) → UNSHIELD 300 ec31a41c… (28,368 B, 1.022 sat/B, spends notes 4+5, out 112+84+84, 300 FT payout at :2) → ZERO-VALUE DUMMY 30f0f9d4… (28,252 B, 1.062 sat/B, spends notes 6+7, out 400+20+0 — a 2-out flow through the 3-out circuit) → the zero note is spentcbfb0503… (28,262 B, 1.061 sat/B, in-notes 11+13 i.e. 400 and 0, out 200+100+100). Final state 700 FT; notes 112 / 84 / 84 / 20 / 200 / 100 / 100; 17 leaves. Every input VM-ACCEPTED consensus + standard.

the note shapes

2-out (current)                     3-out (v3 demo, chipnet)
in0 ─┐                              in0 ─┐
in1 ─┴─▶ out0, out1                  in1 ─┴─▶ out0, out1, out2
        wallet note + change                  wallet note + wallet note + change

The 3-out is the note-management layer: it lets a SHIELD create two wallet-owned notes plus the Hush change in one action, and lets a TRANSFER split change cleanly. It is not the onboarding fix — the deposit path is.

A 2-out flow still fits: the third output can be a zero-value dummy note. `circuits/pool3.circom` only RangeChecks each out value and constrains sumIn + signedPublic === sumOut, so a 0 is legal — and it was exercised on chain both ways: created in 30f0f9d4… (out 400+20+0) and then spent as an in-note in cbfb0503… (in-notes 400 and 0). A dummy is a real tree member, not a dead leaf — it costs a leaf and is recoverable.

live · permissionless

3-out blanks: the machine is loaded

The 3-out category's vending machine is live at aa2020bd… (157-B redeem, price 1,000 sats, operator wallet A). The load put 6 blanks in (784ef9c4…); a key the operator had never seen bought the first one (569a6e6d…, block 348,775, 487 B) with no operator signature — the covenant's input 0 accepted consensus 7,545 / standard 8,057 op, byte-identical to the 2-out machine because only the category / price / operator constructor bytes differ. 5 blanks remain; blank conservation 12 + 5 + 1 = 18, nothing minted or burned. The 2-out machine aa206b51… is category-specific and does not dispense bc607a96… blanks.

01 · shield

A public deposit becomes notes

The current 2-out SHIELD needs two in-notes; the 3-out lets one action create two wallet-owned notes plus the Hush change. The onboarding fix is the deposit path, not the 3-out.

02 · transfer

Notes change hands privately

The browser acceptance's 400 FT recipient note is undelivered; the 169-B carrier has no encrypted note. The 201-B 3-out carrier still cannot carry a full note; the off-chain channel is the missing piece.

03 · unshield

A note becomes a public payout

The 600 FT payout at f52008f4…:2 is the successful unshield; the public leg is public by design.

04 · change

Change without spending the first note

Two wallet-A notes + the Hush change in one SHIELD; the 2-out circuit forces the one-note workaround. This is the note-management win.

v3 core · onboarding

The deposit path

0-in/2-out; public FT deposit; signed deposit input; two private notes; no prior pool notes. DESIGN — UNMEASURED.

v3 core · double-spend

A real nullifier set — now the drain fix

The current state is root ‖ rolling nullifier hash; hook check 7 only folds — and the gap is no longer hypothetical: it is a demonstrated full-balance drain (see the disclosure above). The v3 needs a Merkle nullifier tree with membership. DESIGN — UNMEASURED; the exploit is measured.

v3 core · usability

Encrypted note delivery

The 400 FT transfer note is undelivered; the carrier cannot carry it. NIP-44/Nostr or a dedicated channel; recovery from the seed. DESIGN — UNMEASURED.

v3 core · note management

The 3-out circuit

Measured and deployed as a chipnet demo: SHIELD e847ef56…, TRANSFER ef64f3dd… and UNSHIELD ec31a41c… confirmed. It is not a substitute for onboarding, the nullifier set or note delivery.

measured · the browser acceptance

The second lifecycle

SHIELD 1ca58773… (27,773 B) → TRANSFER 50644d00… (28,157 B) → UNSHIELD f52008f4… (28,036 B). State f52008f4…:1 = 760,400 FT; payout :2 = 600 FT; wallet A = 19,986,800 + 600 FT, 128,323 plain, 0 blanks; pool history 48.

Two caveats: the 400 FT transfer note is undelivered; four failed locks (1,200 FT + 120,000 sats) are stuck; the one public lock (3db76294…, 1,000 FT + 30,000 sats) is sweepable.

the migration

Current pool → v3

The 3-out demo pool is deployed; the Hush 750,000 notes and the wallet A notes still need to re-shield into it. The four stuck locks remain; the one public lock is swept; the new MPC (Gate 7), the deposit path, the nullifier set (the demonstrated drain fix) and note delivery are the gate. The current 2-out pool stays as a read-only historical record — no valued asset may enter either pool until the nullifier set ships (see the R2-NULLIFIER-DOUBLING disclosure).

the 3-out is measured and deployed as a chipnet demo · the new MPC (Gate 7) is a mainnet gate, and the nullifier set is now a second one (R2-NULLIFIER-DOUBLING is demonstrated) · the verifier/hook/witness are built; the Nito client witness path is built and byte-exact, the UI remains, the blanks are permissionless · the deposit path, the nullifier set and note delivery are the v3 core · the community presentation is docs/ROLE2-3OUT-V3-DESIGN.md

sources: ROLE2-3OUT-V3-DESIGN.md ↗ · pool3.circom ↗ · browser acceptance handoff ↗ · Hush review ↗ · nito response ↗

08 · integration

What a Partner
Integration Taught Us

The nito.cash wallet was the first client built on this pool. Its first deployment was confirmed on chain and unusable. That failure is more instructive than any green gate row, so it is recorded here in full rather than quietly replaced.

the failure

A pool nobody could spend

chipnet-pusd-v2 deployed fine — correct covenant, correct state NFT, correct verifying key. Its five step scripts, though, were the five-input test fixture: the terminal pinned inputs == 5 and the executor scripts read input 3 as the genesis witness. Every wallet action emits seven inputs. No proof, however valid, could ever satisfy those scripts.

Verified on chain: the pool UTXO is still the deploy output, unspent since block 343322, and the covenant's address history holds exactly one entry — the deploy. Zero actions in ~1,340 blocks.

the cause

The verifier is a loader

The Groth16 verifier is split across five inputs, and three of them load an assembled shared program carried as data inside their witnesses — hashed, defined as function 100, and invoked at runtime. The transaction layout is therefore baked in three times: in the redeems, in the generator sources, and in the assembled program's own dispatch.

That third layer is invisible to byte comparison — the fragments are witness data, so two builds look identical and the divergence only exists at runtime. Four attempts failed on chain while every static diff came back clean. The fix was 30 size-preserving source edits across five files, regenerating the program from source rather than patching bytecode.

the method that found it

Reproduce the failure offline

Build a synthetic seven-input transaction — covenant, three executors, genesis, terminal, funding — and evaluate every input on the BCH-2026 VM before any broadcast. The synthetic run failed identically to the wallet's real transaction, which exonerated the wallet port and isolated the artifact. A failure that reproduces in the harness is a bug in our own program, not in the counterparty's integration.

This is the same discipline the pool's own gates use: every input VM-evaluated before broadcast. It is the reason a dead pool cost zero sats to discover.

the fix

Same key, same tree, new shape

chipnet-pusd-v4-covenant0 is the spendable successor: the same wallet-committed verifying key, the same two public bootstrap seed notes — its genesis state-NFT commitment is byte-identical to v2's — with the program generalized to the final shape. Two wallet-originated actions are confirmed: a SHIELD at block 344641 and a TRANSFER at block 344646 carrying an encrypted note to a second wallet.

The covenant script itself did not change. Its 347-byte redeem contains no input-count check at all — the seven-input pin lives in the terminal step. The covenant is shape-agnostic; the program around it is not.

the successor

The role-2 pool is the next integration

The browser acceptance closed the client question: the nito.cash wallet ran the full lifecycle through the real UI — SHIELD 1ca58773… → TRANSFER 50644d00… → UNSHIELD f52008f4… — against the role-2 pool under our VK (05250429…), and the registry is live. The next integration surface is the 3-out v3: 201-B carrier, 9-field actionHash, new VK/MPC — built and deployed as a chipnet demo (SHIELD e847ef56… → TRANSFER ef64f3dd…) — and the off-chain note delivery the 400 FT transfer still lacks; see 07 · notes management.

research conclusion · a deployed pool's locking bytecode is a loader, not the constraint system · static review of chain data cannot tell you which transaction shape a pool accepts · reproducible generator source is a review requirement, not a convenience

09 · posture

Security
& Limits

What was attacked: the first generation's on-chain verifier survived a red-team pass on its public-input binding — 5/5 valid proofs accepted, 9/9 mutated public inputs rejected, 26/26 red-team runs rejected. vk_x is recomputed in-script, so the public-input vector cannot be forged by a malicious spender. The deployed role-2 program carries its own gates under our verifying key: acceptance 20/20 (the theft replay REJECTS at check 4g), red team 146/0, and a 69-scenario liveness sweep with 0 failures — worst per-input margin 6.00% standard / 6.49% consensus, re-verified from the committed reports.

What was withdrawn — and what replaced it: the first generation's verifier is the densless-msm construction, and its author withdrew the soundness claims on 2026-10-26: the shared Miller event consumes slopes without the tangent/chord equations, and the terminal's carried-R predicate compares a value with itself instead of checking the B endpoint (finding F6). Every pool deployed before 2026-11-24 — gate3, gate6, gate6b, mainnet, nito v2/v4 — still runs it, and that record stands. The current pool does not: it runs the independently reviewed bch-groth16-bn254-sound-native (27,624 B, reviewed 2026-10-26), which verifies the same relation under the same verifying key — no new trusted setup — with the pool rules as a role-2 hook.

A second, independent gap — ours. The covenant reads the proven public inputs out of the genesis sibling's unlocking bytecode at fixed offsets (n0 at 1825, n1 at 1792). That read authenticates nothing on its own: the stored root is public (it is the pool's own NFT commitment) and the actionHash is recomputed from values the spender supplies. The covenant never checked which script it was reading from, and never checked the input count — verified by disassembling the deployed 347-byte redeem, whose whole introspection set contains no TXINPUTCOUNT and no sibling UTXOBYTECODE read. A one-byte OP_1 script at that index was ACCEPTED on the BCH-2026 VM: no proof, no verifier, full drain. Resolved on both routes: the generation-1 covenant got the sibling pin in source (all five step lockings and the genesis index as constructor arguments; regression gate 6/6), and the deployed role-2 pool went further — the sibling is gone entirely, because the pool rules moved inside the verifier and every input of an action spends the one program locking. There is no script position left to substitute.

DISCLOSURE · (1) the first generation's verifier (densless-msm) is WITHDRAWN by its author under finding F6 — every pool deployed before 2026-11-24 still carries it · (2) that generation's covenant did not pin its verifier sibling, so a substituted script was accepted — pinned in source, and eliminated structurally by the role-2 redesign · the current pool (chipnet-role2-pool-v2-tagged, deployed 2026-11-24) carries the reviewed sound verifier with the rules inside role 2 — the nito.cash browser acceptance then passed (SHIELD 1ca58773… → TRANSFER 50644d00… → UNSHIELD f52008f4…; state 760,400 FT) — but the hook is our own code, with no independent review · the 3-out v3 is measured AND deployed as a chipnet demo (SHIELD e847ef56… → TRANSFER ef64f3dd… → UNSHIELD ec31a41c…; 184,528 constraints, +0.58%): the 3-out verifier, the 201-B hook, the 9-field actionHash and the witness are built; the new MPC (Gate 7) and the Nito client UI are not, while 3-out blanks ARE permissionless (vending aa2020bd…, first stranger buy 569a6e6d…); the 3-out witness path is built and byte-exact, and the proving assets are live · the 400 FT transfer note is UNDELIVERED · four failed locks (1,200 FT + 120,000 sats) are STUCK; one (3db76294…, 1,000 FT + 30,000 sats) is public-bootstrap-tagged and sweepable · the deposit path, nullifier set and note delivery are DESIGN and UNMEASURED · every setup remains 1-of-1

withdrawal record: densless-msm README ↗ · verifiers.md (F6) ↗ · sound replacement ↗

What cannot happen: the pool cannot convert value across asset categories — per-category conservation is enforced inside the circuit, and the anti-converter negative test is rejected at witness time (Gate 4).

What is NOT done: every trusted setup so far was a disclosed single-party (1-of-1) contribution on chipnet — appropriate for a testnet only. Mainnet requires a genuine multi-party ceremony (Gate 7). A proof is bound to its verifying key and public inputs, never to a txid. The current nullifier state is a rolling hash, not a set: hook check 7 only folds SHA256(oldNull ‖ nf0 ‖ nf1), so the spent bootstrap notes were reusable. The v3 needs a real Merkle nullifier set with membership. The 3-out circuit is measured at 184,528 constraints (+1,056, +0.58%); its 1-of-1 demo setup is built (new VK d4ed12ee…, zkey b0177dbe…, wasm c806e561…), and the 3-out verifier, the 201-B hook, the 9-field actionHash and the witness are BUILT; a demo pool is deployed on chipnet (SHIELD e847ef56… → TRANSFER ef64f3dd… → UNSHIELD ec31a41c…). The new MPC (Gate 7) and the Nito client UI are NOT built, while the 3-out blank path IS (vending machine aa2020bd…, first stranger buy 569a6e6d…, block 348,775); the 3-out witness path is built and byte-exact, and the proving assets are live. The deposit path (onboarding) and encrypted note delivery are DESIGN and UNMEASURED. The browser acceptance's 400 FT transfer note is undelivered; four failed locks (1,200 FT + 120,000 sats) are stuck, one public lock (3db76294…, 1,000 FT + 30,000 sats) is sweepable. The 3-out is the note-management layer; it is not the whole solution.

testnet only · 1-of-1 trusted setup · no audits yet · the 3-out v3 needs a NEW MPC (Gate 7) · the deposit/nullifier/note-delivery are UNMEASURED · /ceremony is the path to mainnet

[cited · third-party] — the pool sits inside an active research conversation, and we place it there deliberately. Confidential-transaction designs pursue amount-hiding at the protocol level (topic 1724, continued as topic 2028); this pool is the complementary opt-in covenant route — no consensus change required. The community's Verifier.cash initiative (topic 1896) explores the same on-chain Groth16-verifier design space; our measured verifier sizes and op-costs are inputs for exactly those discussions. What the pool does not touch: network-layer metadata — IP-linked transaction propagation is a separate research axis (topic 1524).

10 · go deeper

Design Docs

11 · questions

Reviewer FAQ

Does this need a fork or a new opcode?

No. The Groth16 verifier runs as an ordinary script inside one standard transaction on the BCH 2026 VM, using CashTokens and P2SH32 — all shipped features. The withdrawn generation measured 35,626 bytes; the reviewed sound verifier now deployed is 27,624 bytes. That is the point of the exercise: the existence proof came before any proposal. Which programs are sound is a separate question — see 09 · posture.

Can the pool convert asset A into asset B?

No. Value conservation is enforced per category inside the circuit. In the Gate 4 negative test, moving a single unit across categories was rejected at witness generation. The covenant additionally enforces per-category holdings continuity on-chain.

Why did the pool rules move inside the verifier?

Because the reviewed sound build forced the question. Its graph pins exactly three inputs, every one of them spending the same P2SH32, and forbids any funding or fee input with another locking — so a covenant cannot sit beside it. The artifact documents the integration itself: applications that release funds add output rules in role 2. The pool's state machine, carrier binding, deposit tags and payout rules are that hook — 524 B of role-2 code, priced at 37,198 op. A side effect worth stating: the old sibling-substitution hole is structurally gone, because there is no sibling left to substitute.

Can the operator censor users or inflate the supply?

Both are closed on chain. The minting NFT lives in the minting guard, whose only spendable shape recreates the NFT at the guard and mints exactly K=64 NFT-only, empty-commitment blanks — burning it and minting fungible tokens are consensus-impossible, so the 100M supply is frozen. A compromised operator key can only choose when a batch runs. And acquisition is permissionless: the blank vending machine delivers a blank to any buyer's funding input against the exact pinned price, with no signature and no operator involvement — proven live by a total stranger who bought both machine blanks with only its own key. The operator's residual discretion is machine stock depth only.

What do you trust today?

Every chipnet deployment used a disclosed, single-party (1-of-1) trusted setup — deliberately fine for a testnet and explicitly not for mainnet. Mainnet is gated on a multi-party Powers-of-Tau ceremony. That machine is being designed in public: see /ceremony.

Why not a CHIP first?

Because we could build it first. The pool needs no consensus change, so the right order was: build, measure, publish evidence — then discuss what (if anything) the protocol should standardize. The measured op-costs and verifier sizes are inputs for exactly those discussions.

Is the on-chain verifier sound?

The current pool's verifier is the reviewed sound build (bch-groth16-bn254-sound-native, 27,624 B, 3 inputs, one standard tx, independently reviewed 2026-10-26): every accept-relevant value is computed on-chain, a baked VK constant, hash-committed before any challenge it meets, or fixed by an exact field or integer equation. The first generation ran densless-msm, whose author withdrew the full-verifier soundness claims on 2026-10-26 (finding F6) — every pool deployed before 2026-11-24 still runs it, and that record stands. The swap needed no new trusted setup: both builds verify the same relation under the same verifying key. Still not established: the role-2 hook is our own code with no independent review, and every setup so far is 1-of-1. See 09 · posture.

What is the 3-out / Notes Management?

The current pool is 2-in/2-out. The v3 3-out circuit is measured at 184,528 constraints (+1,056, +0.58%) and adds a third out-note: a SHIELD can create two wallet-owned notes plus the Hush change, and a TRANSFER can split change cleanly. It is the note-management layer, not the whole solution: the deposit path (onboarding), a real nullifier set and encrypted note delivery are the other v3 pieces. The 3-out is measured AND deployed as a chipnet demo: SHIELD e847ef56… (out 400+300+300) → TRANSFER ef64f3dd… (out 280+210+210) → UNSHIELD 300 ec31a41c… (out 112+84+84, 300 FT payout), all confirmed; the 3-out verifier, 201-B hook, 9-field actionHash and witness are built; the new MPC (Gate 7) and the Nito client UI are not, while 3-out blanks are permissionless (vending aa2020bd…); the 3-out witness path is built and byte-exact, and the proving assets are live. See 07 · notes management.

Did the browser acceptance pass?

Yes. The nito.cash wallet ran SHIELD 1ca58773… → TRANSFER 50644d00… → UNSHIELD f52008f4… through the real UI; the state is 760,400 FT and wallet A holds 19,986,800 + 600 FT. Two caveats: the 400 FT transfer note is undelivered (the 169-B carrier has no encrypted note), and four failed locks (1,200 FT + 120,000 sats) are stuck; one public-bootstrap lock (3db76294…, 1,000 FT + 30,000 sats) is sweepable. The 3-out v3 is the next client surface.

Are the failed locks recoverable?

One is. 3db76294… carries the public bootstrap tag and can be swept by any holder of the public seeds. The other four — 10f26fa3…, 1946084e…, c3e21c7a…, dff42ddb… — carry the lost notes' private tags; their preimages are gone, so they are stuck, not stealable. The total is 2,200 FT + 150,000 fuel sats.

Is there a working wallet?

Yes, on chipnet. The nito.cash browser acceptance ran the full lifecycle through the real UI — SHIELD 1ca58773… → TRANSFER 50644d00… → UNSHIELD f52008f4… — against the role-2 pool under our VK, and the registry is live. The state is 760,400 FT; wallet A holds 19,986,800 + 600 FT. Two caveats: the 400 FT transfer note is undelivered, and four failed locks are stuck (one public lock is sweepable). The 3-out v3 is the next client surface: 201-B carrier, 9-field actionHash, new VK/MPC. See 07 · notes management.

gate 7 · the last gate

Before mainnet,
break the waste

The trusted-setup ceremony is the one thing standing between chipnet and mainnet. Bring your entropy — one honest participant is all it takes.

[ discussion link pending publication ]