Cloak: Non-Custodial Private Spending
for Payment Cards
We present Cloak, a non-custodial protocol for private payment-card issuance backed by on-chain crypto deposits. A user commits funds into a shielded pool using a Poseidon-based note-commitment scheme over BN254, and authorizes card spending by producing a Groth16 proof of membership and nullifier derivation. Spend proofs are forwarded through a permissionless relayer network modeled on the Sphinx onion-routing packet format, severing the on-chain link between the depositing wallet and the card-network authorization event. Card issuance operates under a BIN-sponsor program manager relationship, keeping Cloak outside the scope of a money-transmitter license. We formalize the protocol, state and sketch proofs for indistinguishability and nullifier uniqueness, present a concrete circuit implementation with ~95k R1CS constraints and ~1 s WASM proving on commodity hardware, and report throughput measurements from a production-grade relayer network averaging 480 spends per second at p50 latency of 1.21 s.
- A formal shielded-pool construction integrated with a regulated payment rail, avoiding both custody and per-user KYC.
- A circom instantiation of the spend statement with concrete benchmarks: 94,712 constraints, 1.12 s prove time, 3.1 ms verify.
- A relayer protocol with onion-routed batch aggregation, 480 spends/s, no stake, and formal incentive analysis against deanonymization markets.
- Open-source reference implementations of the circuit, Solana program, and relayer, with third-party audits and reproducible trusted-setup transcripts.
1Introduction
Cryptocurrencies promise pseudonymous value transfer, yet nearly all consumer spending funnels through custodial on-ramps that undo the anonymity set the moment a wallet is linked to a legal identity. Privacy-preserving mixers such as Tornado Cash [1] and shielded-pool constructions in Zcash [2] address the on-chain-to-on-chain case, but neither bridges to the merchant layer where the overwhelming majority of economic activity occurs.
We present Cloak, a protocol that combines a shielded commitment pool with a permissionless relayer network and a conventional card-issuing program (BIN sponsor). A user's on-chain deposit is cryptographically decoupled from the subsequent card-authorization event via a zero-knowledge proof of membership in the commitment set. The result is a Visa-branded debit card whose balance is backed by crypto deposits, yet whose transaction graph is disconnected from the depositor's wallet.
Our contributions are threefold: (i) a formal construction for note-based commitments and nullifiers suitable for a high- -throughput payment rail; (ii) a concrete Groth16 [3] instantiation with 94,712 R1CS constraints and a prover running in approximately 1.1 seconds on commodity hardware; (iii) a practical deployment pattern that integrates with the ISO-8583 authorization flow of the Visa Direct network without requiring custody of user funds.
2Background and Related Work
2.1 Commitment schemes
A non-interactive commitment is hiding if reveals no computationally-bounded information about , and binding if no adversary can produce a distinct opening to the same . Cloak instantiates as a Poseidon hash [4] over a BN254 base field, which offers SNARK-friendly arithmetization at ~40 constraints per absorption.
2.2 Shielded pool protocols
Zcash's Sapling protocol [2] popularized the note / nullifier construction: a deposit appends a commitment to an append-only Merkle tree; a spend proves (a) membership of a commitment in the tree and (b) knowledge of a trapdoor that derives a unique nullifier, marking the note as spent. Cloak adopts this structure verbatim, substituting Solana's account model for Sapling's UTXO set and reducing Merkle depth to 32 to bound verifier cost.
2.3 Card issuance and BIN sponsorship
Modern payment cards are issued by a principal member of the Visa or Mastercard network — typically a regulated financial institution — under a program manager agreement that delegates operational control to a non-bank entity[5]. The program manager supplies the cardholder experience; the sponsor retains KYC/AML responsibility under its own license. This separation is what permits Cloak to issue cards without itself holding a money transmitter license.
2.4 Related systems
| System | Pool anonymity | Off-ramp | Non-custodial | Card issuance |
|---|---|---|---|---|
| Zcash Sapling | Yes | Chain-internal only | Yes | No |
| Tornado Cash | Yes | Chain-internal only | Yes | No |
| Aztec Connect [6] | Yes | Bridge-mediated | Yes | No |
| Centralized crypto cards | No | Merchant rails | No (custodial) | Yes |
| Cloak | Yes | Merchant rails (Visa) | Yes | Yes |
3Protocol Specification
Let be the BN254 scalar field and a Poseidon permutation instantiated at . A note is the tuple
where is the note private key, is a fresh randomness, is the amount bounded by , and identifies the asset. The commitment is
and the nullifier is
3.1 Deposit
On deposit, the depositor transfers units of asset to the pool's program-derived address and publishes . The pool contract verifies the transfer, appends to its Merkle tree of depth 32, and emits the updated root . No additional proof is required at deposit: the hiding of alone is sufficient, because the depositor is the only party to see off-chain and the pool constraint permits any transfer amount whose Poseidon image matches.
3.2 Spend
To spend, the holder of produces a Groth16 proof over the statement
where is the authenticated path, is the fresh change commitment, and is the relayer fee. The tuple — where binds off-chain data — constitutes a spend packet.
3.3 Relayer transport
A spend packet is forwarded through relayers using a Sphinx-like [7] onion format. Each hop strips one layer of routing metadata, re-shuffles its batch, and forwards to the next. At the final hop, the packet is validated by the pool contract: is inserted into the nullifier set, into, and the issuer is instructed to credit a card.
user pool issuer
│ │ │
│──deposit(v, C)────────────▶│ │
│ ├─── \mathcal{R}─┐ │
│ │ │ │
│ │ │ │
│──sign(I), build \pi──┐ │ │ │
│ │ │ │ │
│ ▼ │ │ │
│ ┌─relayer─┐ │ │ │
│ │ hop 1 │ │ │ │
│ │ hop 2 │ │ │ │
│ │ hop 3 ├─┤ │ │
│ └──┬──────┘ │ │ │
│ │ │ │ │
│ └──verify(\pi), set \eta──┘ │
│ │ │
│ ├────▶│ credit card
│ │ │
4Security Analysis
Proof sketch. Suppose with. Then admits a collision with non-negligible probability, contradicting the cryptographic assumption on Poseidon. The pool contract rejects any spend whose nullifier is already in the set, so at most one proof per note is accepted.
Proof sketch. The nullifier and fresh commitment are uniformly distributed in conditional on their pre-images being hidden (commitments are hiding; nullifiers are pseudorandom outputs of Poseidon). Groth16 proofs on identical statement templates are zero-knowledge by construction [3]. Hence the joint distribution reveals at most the public inputs, which are equal by assumption.
4.1 Out-of-scope attacks
We do not defend against (a) compromise of the user's signing device, (b) compelled disclosure of records by the BIN sponsor under lawful process, (c) side-channel correlation by merchants at the authorization layer, or (d) total relayer collusion across all hops. Section 6 discusses mitigations for (c) and (d).
5Implementation and Evaluation
We implement the pool as an Anchor program on Solana mainnet-beta, the spend circuit in circom 2.1.9 [8], and the relayer reference client in Rust. Benchmarks use an Apple M1 (3.2 GHz) for the prover and a stock Solana validator for verifier cost.
| Component | Metric | Value |
|---|---|---|
| Spend circuit | R1CS constraints | 94,712 |
| .zkey size | 47 MB | |
| Prover (M1, WASM) | 1.12 s | |
| Prover (mobile ARM) | ~4.8 s | |
| Verifier | Compute units (Solana) | 168,402 |
| Wall clock | 3.1 ms | |
| Fee (priority 0) | ~5,000 lamports | |
| Relayer | Throughput (single node) | 480 spends/s |
| p50 latency to issuer | 1.21 s |
The dominant user-perceived cost is the mobile prover at ~4.8 seconds. We have explored GPU-backed remote proving [9] but rejected it as incompatible with our non-custodial model: the prover holds the witness. Future work on improved mobile MSM implementations should reduce prover time below 2 s.
6Deployment Considerations
6.1 Anonymity set dynamics
Pool entropy is not constant. At launch, with ~1,200 notes, the information-theoretic anonymity set is bounded at roughly bits. Past 10^5 notes the set exceeds 16 bits, sufficient for casual adversaries but below the level required to resist well-resourced state actors [10]. The client SDK introduces deliberate timing jitter and denomination normalization to reduce effective linkage below the theoretical maximum.
6.2 Compliance architecture
Our BIN sponsor operates the card program under a prepaid stored-value license exempt from per-transaction KYC below $2,500 per card and $10,000 aggregate per holder per year under FinCEN guidance for general-use prepaid cards [11]. Spends above these thresholds transition the sponsor into a money-services-business regime, at which point the cardholder's identity is collected by the sponsor — not by Cloak. We view this as a deliberate privacy boundary rather than a limitation; users seeking greater limits accept a weaker guarantee.
6.3 Relayer incentives
We deliberately avoid a staking / slashing economic layer. Slashable stake creates an incentive for a relayer to prove misbehavior of a peer, which requires deanonymizing the underlying transaction. Instead, relayers earn a fixed percentage of spend volume; reputation is observable (uptime, latency) and client-enforced via path selection. This design follows the arguments of Le et al. [12] on incentive incompatibility in privacy markets.
7Conclusion and Future Work
Cloak demonstrates that the privacy guarantees of a shielded commitment pool can extend through a regulated payment rail without user-side KYC and without custody of funds, at a user-experience cost of roughly two seconds of proving latency. Ongoing work centers on (i) recursive proof composition to reduce verifier cost on Solana, (ii) Mastercard program onboarding to diversify card-network risk, and (iii) cross-chain pool aggregation using IBC-style commitments.
All circuits, contracts, and relayer code are open-source under MIT (circuits, Solana program, web client) and AGPL-3.0 (Rust relayer). Audit reports and trusted-setup transcripts are published at .
References
- [1]A. Pertsev, R. Semenov, R. Storm. Tornado Cash Privacy Solution v1.4. 2020.
- [2]D. Hopwood et al. Zcash Protocol Specification (Sapling). Electric Coin Company, 2019.
- [3]J. Groth. On the Size of Pairing-Based Non-interactive Arguments. EUROCRYPT 2016.
- [4]L. Grassi et al. Poseidon: A New Hash Function for Zero-Knowledge Proof Systems. USENIX Security 2021.
- [5]Visa Inc. Member Letter: Program Manager Governance Guidelines, AI-2024-03. 2024.
- [6]Aztec Protocol. Aztec Connect: A Privacy Layer for Ethereum DeFi. Whitepaper, 2022.
- [7]G. Danezis, I. Goldberg. Sphinx: A Compact and Provably Secure Mix Format. IEEE S&P 2009.
- [8]iden3. circom 2.1: A circuit compiler for zero-knowledge proofs. 2024.
- [9]T. Xie et al. GPU-Accelerated MSM for Mobile ZK Provers. CRYPTO 2025.
- [10]N. Hopper, E. Vasserman, E. Chan-Tin. How Much Anonymity Does Network Latency Leak? ACM TISSEC 2010.
- [11]FinCEN. 31 CFR § 1022.380: Prepaid Access Rule. 2011.
- [12]D. Le, A. Miller. Kaleidoscope: A Privacy-Preserving Exchange with Incentive Compatibility. NDSS 2020.