ZEBRA: Anonymous Credentials with Practical On-chain Verification and Applications to KYC in DeFi

Deevashwer Rathee, Guru-Vamsi Policharla, Tiancheng Xie, Ryan Cottone, Dawn Song

Abstract

Decentralized Finance (DeFi) requires robust "Know Your Customer" (KYC) mechanisms to comply with global regulations, yet existing solutions often sacrifice user privacy or incur prohibitive on-chain costs. This paper introduces ZEBRA, a practical anonymous credential (AC) system designed for efficient on-chain verification. By leveraging a novel two-layer proof recursion and token caching, ZEBRA reduces verification gas costs by over 14x compared to state-of-the-art methods. ZEBRA provides a comprehensive suite of features, including unlinkable verification, asynchronous auditability, and efficient wallet traceability, making it a viable solution for privacy-preserving regulatory compliance in blockchain ecosystems.

Introduction

The rapid growth of DeFi has brought it under increasing regulatory scrutiny. Anti-money laundering (AML) and KYC mandates require protocols to verify user identities, but traditional methods—such as linking real-world identities directly to blockchain addresses—create significant privacy risks and centralized points of failure. While anonymous credentials offer a theoretical solution, their practical implementation on-chain has been hindered by the high computational cost of verification on the Ethereum Virtual Machine (EVM).

ZEBRA addresses these challenges by providing an on-chain verification mechanism that is both private and accountable. Unlike previous systems that rely on trusted oracles or expensive Sigma-protocol verifications, ZEBRA utilizes zkSNARKs to achieve constant-time verification costs, enabling scalable and affordable private access control.

System Architecture

The ZEBRA ecosystem involves several key actors: Users, a Certificate Authority (CA), an untrusted Aggregator, Auditors, and an on-chain Access Control Contract. The lifecycle of a ZEBRA credential encompasses four main phases: issuance, verification, audit, and revocation.

The ZEBRA system lifecycle: (a) Credential Issuance by a CA; (b) Aggregated Credential Verification; (c) Transaction Auditing by a committee; (d) Credential Revocation and Wallet Repudiation.
  1. Credential Issuance: A user registers with a CA, which issues a credential containing an identifier ($pk^U$), a tracing key ($tk^U$), and various attributes.
  2. Credential Verification: Users generate zero-knowledge proofs to demonstrate possession of valid credentials without revealing their identity. These proofs can be batched by an aggregator to minimize on-chain costs.
  3. Transaction Audit: If malicious activity is detected, a committee of auditors can collaborate to deanonymize a specific transaction and identify the associated user identifier.
  4. Revocation and Repudiation: The CA can revoke a user's identifier. Auditors can then trace and repudiate all wallet addresses associated with that revoked user, preventing further access.

Technical Innovations

Two-Layer Proof Recursion

A core challenge in on-chain AC verification is the mismatch between efficient cryptographic curves for SNARKs and those supported by the EVM. ZEBRA employs a "cycle" of elliptic curves—BN254 and Grumpkin—to implement a two-layer proof recursion.

  • Layer 1: Users generate a pairing-based Groth16 proof over the BN254 curve.
  • Layer 2: An untrusted aggregator collects these proofs and uses a data-parallel SNARK (Spartan) over the Grumpkin curve to verify the entire batch. This Spartan proof is then "wrapped" back into a single Groth16 proof, which the EVM can verify efficiently. This architecture allows the aggregator to be entirely untrusted; any attempt to forge a batch proof will result in a verification failure on-chain.

Token Caching

To further optimize data costs, ZEBRA introduces "token caching." Instead of submitting full identity tokens for every interaction, users register a 32-byte commitment to their tokens once. Subsequent verifications merely reference this on-chain cache, significantly reducing the calldata requirements and associated gas fees.

Accountability and Governance

ZEBRA distinguishes itself by supporting complex accountability features without requiring expensive Multi-Party Computation (MPC) for every operation.

  • Asynchronous Auditing: Using threshold encryption, auditors can deanonymize transactions without needing to be online simultaneously.
  • Efficient Traceability: ZEBRA uses a PRF-based tracing mechanism. Once a user is revoked, auditors can identify all associated wallets across millions of transactions in seconds, ensuring that a single revocation effectively blocks a user's entire presence in the system.

Performance Evaluation

The authors evaluated ZEBRA's performance through smart contract benchmarks and prover latency tests.

  • Gas Efficiency: ZEBRA achieves a 14.3x reduction in gas costs for single verifications compared to the Coconut protocol ($12 vs $176). With batching (e.g., 512 users), the amortized cost falls to $0.44** on Ethereum Layer-1 and **$0.02 on Layer-2 solutions like zkSync.
  • Latency: User-side proof generation takes approximately 2 seconds on a standard laptop. The aggregator can process a batch of 512 users in about 1.5 minutes.
  • Scalability: The system can trace a revoked user across 100 million wallet interactions in roughly 15 seconds, demonstrating its readiness for large-scale deployment.

Conclusion

ZEBRA represents a significant step toward practical, privacy-preserving compliance in DeFi. By combining recursive SNARKs with efficient batching and caching, it brings the cost of private on-chain KYC down to a level suitable for everyday use. Future work includes optimizing the aggregator bottleneck using Plonk arithmetization and exploring decentralized issuance models to further reduce trust assumptions.

Summary updated

BibTeX
@article{rathee2022zebra,
  author = {Deevashwer Rathee and Guru-Vamsi Policharla and Tiancheng Xie and Ryan Cottone and Dawn Song},
  title = {{ZEBRA: Anonymous Credentials with Practical On-chain Verification and Applications to KYC in DeFi}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2022},
  url = {https://openreview.net/forum?id=BWW4110BSt},
}
Figure