Cloak
Dashboard
cs.CR/arXiv:2604.0391/v0.1 · draft

Cloak: Non-Custodial Private Spending
for Payment Cards

Cloak Labs Research@cloakfi · anonymous contributions
Submitted · 2026-04-20·Revision · 3·Length · 14 pages
Abstract

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.

Contributions
  • 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

SystemPool anonymityOff-rampNon-custodialCard issuance
Zcash SaplingYesChain-internal onlyYesNo
Tornado CashYesChain-internal onlyYesNo
Aztec Connect [6]YesBridge-mediatedYesNo
Centralized crypto cardsNoMerchant railsNo (custodial)Yes
CloakYesMerchant rails (Visa)YesYes
Table 1. Feature comparison with adjacent systems.

3Protocol Specification

Let be the BN254 scalar field and a Poseidon permutation instantiated at . A note is the tuple

(1)

where is the note private key, is a fresh randomness, is the amount bounded by , and identifies the asset. The commitment is

(2)

and the nullifier is

(3)

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

(4)

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
   │                                          │     │
              
Figure 1. End-to-end flow: deposit → shielded pool → relayer hops → issuer.

4Security Analysis

Theorem 1Nullifier uniqueness.
Assuming the discrete-log hardness of BN254 and the collision resistance of Poseidon, no PPT adversary can produce two valid spend packets sharing a nullifier except with negligible probability.

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.

Theorem 2Indistinguishability of spends.
For any two spends drawn from the honest distribution with equal public fees and equal pool anonymity sets, the tuples and are computationally indistinguishable to any PPT observer.

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.

Theorem 3Conservation.
For any valid spend, . The pool therefore remains solvent: the sum of hidden values equals the asset balance of the pool's program account minus the total paid fees.

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.

ComponentMetricValue
Spend circuitR1CS constraints94,712
.zkey size47 MB
Prover (M1, WASM)1.12 s
Prover (mobile ARM)~4.8 s
VerifierCompute units (Solana)168,402
Wall clock3.1 ms
Fee (priority 0)~5,000 lamports
RelayerThroughput (single node)480 spends/s
p50 latency to issuer1.21 s
Table 2. End-to-end performance characteristics.

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. [1]A. Pertsev, R. Semenov, R. Storm. Tornado Cash Privacy Solution v1.4. 2020.
  2. [2]D. Hopwood et al. Zcash Protocol Specification (Sapling). Electric Coin Company, 2019.
  3. [3]J. Groth. On the Size of Pairing-Based Non-interactive Arguments. EUROCRYPT 2016.
  4. [4]L. Grassi et al. Poseidon: A New Hash Function for Zero-Knowledge Proof Systems. USENIX Security 2021.
  5. [5]Visa Inc. Member Letter: Program Manager Governance Guidelines, AI-2024-03. 2024.
  6. [6]Aztec Protocol. Aztec Connect: A Privacy Layer for Ethereum DeFi. Whitepaper, 2022.
  7. [7]G. Danezis, I. Goldberg. Sphinx: A Compact and Provably Secure Mix Format. IEEE S&P 2009.
  8. [8]iden3. circom 2.1: A circuit compiler for zero-knowledge proofs. 2024.
  9. [9]T. Xie et al. GPU-Accelerated MSM for Mobile ZK Provers. CRYPTO 2025.
  10. [10]N. Hopper, E. Vasserman, E. Chan-Tin. How Much Anonymity Does Network Latency Leak? ACM TISSEC 2010.
  11. [11]FinCEN. 31 CFR § 1022.380: Prepaid Access Rule. 2011.
  12. [12]D. Le, A. Miller. Kaleidoscope: A Privacy-Preserving Exchange with Incentive Compatibility. NDSS 2020.