<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AnonGate</title>
    <description>The latest articles on DEV Community by AnonGate (@anongate).</description>
    <link>https://dev.to/anongate</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4119725%2F44baf1a4-02cc-44cc-b0d1-07537da193ff.png</url>
      <title>DEV Community: AnonGate</title>
      <link>https://dev.to/anongate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anongate"/>
    <language>en</language>
    <item>
      <title>How Zero-Knowledge Proofs Break the Deposit-Withdrawal Link On-Chain</title>
      <dc:creator>AnonGate</dc:creator>
      <pubDate>Thu, 10 Sep 2026 17:55:12 +0000</pubDate>
      <link>https://dev.to/anongate/how-zero-knowledge-proofs-break-the-deposit-withdrawal-link-on-chain-3m8j</link>
      <guid>https://dev.to/anongate/how-zero-knowledge-proofs-break-the-deposit-withdrawal-link-on-chain-3m8j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxoy1n9ifhhitk6kkkn7g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxoy1n9ifhhitk6kkkn7g.jpg" alt=" " width="800" height="538"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Public blockchains are transparent by design — every deposit, withdrawal, and balance is visible to anyone who looks. That's great for auditability, but it means your entire transaction history is permanently linked to your wallet address. For developers building anything involving payroll, treasury management, or simple user privacy, that's a real constraint.&lt;/p&gt;

&lt;p&gt;Here's how one approach — used in AnonGate's shielded pool — solves this using zero-knowledge proofs.&lt;/p&gt;

&lt;p&gt;The Core Problem&lt;/p&gt;

&lt;p&gt;If you deposit funds into a contract and withdraw them later, even to a different address, on-chain analysis can usually link the two transactions — timing, amounts, and address clustering heuristics make deanonymization straightforward in most naive implementations.&lt;/p&gt;

&lt;p&gt;To break that link cryptographically (not just obfuscate it), you need a way to prove "I deposited into this pool" without revealing which deposit you're referring to.&lt;/p&gt;

&lt;p&gt;Merkle Trees + Groth16 Proofs&lt;/p&gt;

&lt;p&gt;The architecture uses two main components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Commitment generation on deposit&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When a user deposits, the contract generates a cryptographic commitment and appends it as a leaf to an on-chain Merkle tree:&lt;/p&gt;

&lt;p&gt;commitment = Poseidon(secret, nullifier)&lt;/p&gt;

&lt;p&gt;Poseidon is used here instead of something like SHA-256 because it's optimized for zk-SNARK circuits — dramatically cheaper to prove and verify inside a circuit.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Withdrawal via zero-knowledge membership proof&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On withdrawal, instead of revealing which leaf in the tree corresponds to their deposit, the user generates a Groth16 proof demonstrating:&lt;/p&gt;

&lt;p&gt;They know a (secret, nullifier) pair that hashes to some leaf in the tree&lt;br&gt;
That leaf hasn't been spent before (via a nullifier hash check, preventing double-spends)&lt;br&gt;
All of this, without revealing which specific leaf it is&lt;/p&gt;

&lt;p&gt;The contract only needs to verify the proof and check the nullifier hasn't been used — it never learns which deposit maps to which withdrawal.&lt;/p&gt;

&lt;p&gt;Why Groth16 Specifically&lt;/p&gt;

&lt;p&gt;Groth16 is used over newer proof systems mainly for verification cost. On Ethereum, gas costs matter a lot, and Groth16 proofs are small (three group elements) and cheap to verify on-chain compared to alternatives like PLONK or STARKs — the tradeoff being a trusted setup requirement per-circuit, which is a known and accepted limitation in most current shielded pool implementations.&lt;/p&gt;

&lt;p&gt;Practical Notes for Implementers&lt;/p&gt;

&lt;p&gt;If you're experimenting with this pattern yourself:&lt;/p&gt;

&lt;p&gt;Nullifier design matters — reusing the same nullifier derivation across pools/assets can leak information&lt;br&gt;
Merkle tree depth is a tradeoff between anonymity set size and proof generation time&lt;br&gt;
Multi-asset pools (e.g. supporting ETH, DAI, LUSD) need careful handling of denomination-based anonymity sets — mixing pool sizes across assets can reduce the effective privacy set for less-used assets&lt;br&gt;
Closing Thoughts&lt;/p&gt;

&lt;p&gt;Zero-knowledge shielded pools aren't a new idea, but the combination of Poseidon (circuit-efficient hashing) and Groth16 (cheap on-chain verification) remains a practical, gas-conscious pattern for anyone building privacy-preserving transaction systems on Ethereum today.&lt;/p&gt;

&lt;p&gt;If you're curious about a live implementation of this pattern, AnonGate has this running on mainnet: &lt;a href="https://anongate.io/" rel="noopener noreferrer"&gt;anongate.io&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>ethereum</category>
      <category>cryptography</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
