<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Cryptography on Sooraj Sathyanarayanan</title>
  <link rel="alternate" href="https://profincognito.me/tags/cryptography/" />
  <link rel="self" href="https://profincognito.me/tags/cryptography/index.xml" />
  <subtitle>Recent content in Cryptography on Sooraj Sathyanarayanan</subtitle>
  <id>https://profincognito.me/tags/cryptography/</id>
  <generator uri="http://gohugo.io" version="0.147.8">Hugo</generator>
  <language>en-us</language>
  <updated>2026-05-25T14:44:10-07:00</updated>
  <author>
    <name>Sooraj Sathyanarayanan</name>
    
  </author>
  <rights>[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)</rights>
      <entry>
        <title>Inside the Signal Protocol’s Security Architecture: A Technical Deep Dive</title>
        <link rel="alternate" href="https://profincognito.me/blog/security/signal-security-architecture/" />
        <id>https://profincognito.me/blog/security/signal-security-architecture/</id>
        <published>2026-03-04T00:00:00Z</published>
        <updated>2026-05-25T14:44:10-07:00</updated>
        <summary type="html">A comprehensive, technical exploration of the Signal Protocol’s cryptographic underpinnings, including PQXDH for post-quantum resistance, formal verification references, performance benchmarks, secure memory management best practices, and additional considerations such as user verification, multi-device security, ephemeral messaging, reproducible builds, and future standards.</summary>
          <content type="html"><![CDATA[<p><strong>Audience</strong>: This post is intended for security researchers, cryptographers, and engineers with a deep interest in the technical underpinnings of secure messaging protocols. It assumes familiarity with modern cryptographic primitives, end-to-end encryption (E2EE), forward secrecy concepts, post-compromise security, post-quantum cryptography, formal verification tools (like ProVerif and Tamarin), secure software development practices, and related operational considerations (such as reproducible builds and user verification methods).</p>
<p><strong>Scope</strong>: This analysis reflects the state of the Signal Protocol as of late 2024. It covers foundational concepts such as the Double Ratchet and X3DH, the introduction of PQXDH (Post-Quantum X3DH), formal verification efforts, platform-specific memory-hardening techniques, hardware-backed key management, user verification methods (Safety Numbers), multi-device session handling, ephemeral messages, security boundaries, supply chain security considerations, known implementation pitfalls, and potential future evolutions (including references to MLS). While comprehensive, this post should be supplemented by the latest official specifications, recent academic research, code-level audits, benchmark results, formal verification artifacts, and community analyses.</p>
<p><strong>Disclaimer</strong>: The Signal ecosystem and the Signal Protocol are actively maintained and improved. Parameters, code details, and protocol enhancements may have changed since this writing. Verify specifics against the latest official Signal documentation, code commits, NIST PQC standards, research papers, and audit reports. Peer review by cryptography experts is recommended prior to relying on these details for critical security decisions.</p>
<hr>
<h2 id="1-introduction-and-threat-model">1. Introduction and Threat Model</h2>
<p>The <strong>Signal Protocol</strong>, widely recognized for powering Signal Messenger and other secure messaging apps, is designed to ensure that messages and calls remain confidential and tamper-resistant against a wide range of adversaries.</p>
<ul>
<li>
<p><strong>Protected Against</strong>:</p>
<ul>
<li>Passive and active network adversaries</li>
<li>Server compromises</li>
<li>Retrospective decryption of past messages (with forward secrecy and PQXDH)</li>
<li>Attempts to impersonate users without their private keys</li>
</ul>
</li>
<li>
<p><strong>Not Protected Against</strong>:</p>
<ul>
<li>Full device compromise at runtime (e.g., reading decrypted messages from RAM)</li>
<li>Large-scale network blocking</li>
<li>Physical exfiltration of keys from secure hardware</li>
</ul>
</li>
</ul>
<p>Future-proofing against large-scale quantum adversaries is now part of the threat model, with <strong>PQXDH</strong> ensuring that even if a quantum computer becomes capable of breaking elliptic curve assumptions, the post-quantum KEM layer will preserve message confidentiality.</p>
<p><img loading="lazy" src="/images/content/blog-security-signal-security-architecture-187de5ee-0680-4e14-951b-730df5c2e35e.png" alt="Signal Protocol Threat Model Overview" />
</p>
<p><em>Overview of the Signal Protocol threat model, highlighting the distinction between threats it mitigates (e.g., network-level attacks, server compromise) and those out of scope (e.g., active device compromise).</em></p>
<h2 id="2-key-security-properties">2. Key Security Properties</h2>
<ol>
<li><strong>End-to-End Encryption (E2EE)</strong>: Only intended recipients can read messages.</li>
<li><strong>Forward Secrecy</strong>: Compromise of long-term keys does not reveal past messages.</li>
<li><strong>Post-Compromise Security</strong>: After a device compromise, once keys ratchet forward, future messages remain secure.</li>
<li><strong>Deniability</strong>: The protocol design prevents creating cryptographic evidence that unequivocally ties messages to a particular identity key.</li>
<li><strong>Post-Quantum Resistance</strong>: PQXDH ensures future quantum capabilities do not retroactively break current message confidentiality.</li>
</ol>
<h2 id="3-keys-and-identities">3. Keys and Identities</h2>
<ul>
<li><strong>Identity Keys</strong>: Long-term Curve25519 keys signed via Ed25519.</li>
<li><strong>Signed Prekeys</strong>: Medium-term Curve25519 keys uploaded to the server.</li>
<li><strong>One-Time Prekeys</strong>: Short-lived Curve25519 keys used once per handshake.</li>
</ul>
<p><strong>Hardware Security</strong>:</p>
<ul>
<li><strong>Android</strong>: StrongBox or KeyMaster for hardware-backed keys</li>
<li><strong>iOS</strong>: Secure Enclave for private key operations</li>
<li><strong>Desktop</strong>: OS-level secure storage and memory isolation</li>
</ul>
<p>Keys are never stored in plaintext if hardware support is present. Ephemeral private keys and intermediate values are zeroized after use, helping to prevent compromise by runtime memory inspection.</p>
<h2 id="4-initial-session-setup-x3dh">4. Initial Session Setup (X3DH)</h2>
<p><strong>X3DH</strong> (Extended Triple Diffie-Hellman) establishes a shared secret without prior contact. It combines multiple Diffie-Hellman operations (DH1–DH4) that feed into an HKDF to derive a root key. Historically, X3DH relies solely on elliptic curve assumptions (X25519).</p>
<p><img loading="lazy" src="/images/content/blog-security-signal-security-architecture-a24c83ed-3342-4e39-89e6-8263bfe16f91.png" alt="Signal Protocol Session Establishment (X3DH &#43; PQXDH)" />
</p>
<p><em>X3DH and PQXDH combined handshake flow. The classical X3DH components (left) provide immediate security while the PQXDH addition (right) provides quantum resistance. Both feed secrets into HKDF to derive the Double Ratchet’s root key.</em></p>
<h2 id="5-pqxdh-introducing-post-quantum-resistance">5. PQXDH: Introducing Post-Quantum Resistance</h2>
<h3 id="rationale">Rationale</h3>
<p>X3DH’s classical security may be broken in a future where quantum computers can crack elliptic curve cryptography. <strong>PQXDH</strong> pairs X25519 with a post-quantum KEM (e.g., <a href="https://pq-crystals.org/kyber/">CRYSTALS-Kyber</a>) to achieve <strong>hybrid security</strong>, meaning an adversary must defeat both the classical ECC layer and the post-quantum layer simultaneously.</p>
<h3 id="mechanism">Mechanism</h3>
<ol>
<li><strong>Classical Part</strong>: X25519 ECDH</li>
<li><strong>Post-Quantum Part</strong>: Kyber KEM (though alternative PQ KEMs such as SABER or Classic McEliece may be considered in future)</li>
</ol>
<p>Both secrets are combined via HKDF, so breaking security requires simultaneously defeating both ECC and PQ layers—significantly raising the bar for attackers.</p>
<h3 id="performance">Performance</h3>
<p>Internal benchmarks show <strong>PQXDH</strong> adds only ~1–3ms to the handshake on mobile devices. On desktop platforms with hardware acceleration, overhead is negligible. Future improvements to PQC algorithms and optimized code may further reduce these costs.</p>
<h3 id="migration">Migration</h3>
<p>PQXDH is introduced in a phased approach:</p>
<ul>
<li><strong>Silent Adoption</strong>: Clients with PQ capabilities silently generate and exchange PQ prekeys.</li>
<li><strong>Gradual Enforcement</strong>: Once a critical mass of clients and server infrastructure support PQXDH, it becomes mandatory for all new sessions.</li>
</ul>
<h2 id="6-double-ratchet-detailed-state-machine-and-error-handling">6. Double Ratchet: Detailed State Machine and Error Handling</h2>
<p>After the initial handshake (X3DH or PQXDH), the <strong>Double Ratchet</strong> manages continuous re-keying and secure forward secrecy:</p>
<ol>
<li><strong>DH Ratchet</strong>: Each new ephemeral public key triggers a fresh shared secret (with the recipient’s ephemeral public key), which is combined via HKDF.</li>
<li><strong>Symmetric Ratchet</strong>: Evolves for each message sent or received, generating unique message keys.</li>
</ol>
<p>Robust error handling is critical:</p>
<ul>
<li><strong>Out-of-Order Messages</strong>: The protocol can handle missing or delayed messages by advancing the ratchet state.</li>
<li><strong>Session Resets</strong>: If states fall hopelessly out of sync, a new PQXDH handshake re-establishes session security.</li>
</ul>
<p><img loading="lazy" src="/images/content/blog-security-signal-security-architecture-6b6efe4c-de69-4099-a182-7a0b468f171c.png" alt="Double Ratchet Protocol: Complete Key Derivation Flow" />
</p>
<p><em>The Double Ratchet protocol uses DH and symmetric ratchets for forward secrecy and post-compromise security. Each message key is used once and never reused, ensuring old traffic cannot be decrypted if new keys are compromised.</em></p>
<h2 id="7-message-encryption-internals">7. Message Encryption Internals</h2>
<ul>
<li><strong>Ciphers</strong>: AES-256-CTR or ChaCha20 for encryption; HMAC-SHA256 for authenticity.</li>
<li><strong>Message Format</strong>: Includes version information, ephemeral keys, counters, ciphertext, and HMAC tags. Minimal padding is used; future releases may expand length-hiding strategies to counter traffic analysis.</li>
<li><strong>Ephemeral Key Usage</strong>: Ephemeral message keys generated by the Double Ratchet are never reused across sessions or devices.</li>
</ul>
<h2 id="8-secure-memory-management">8. Secure Memory Management</h2>
<p><strong>Memory Hardening</strong>:</p>
<ul>
<li>Immediate zeroization of keys after use to reduce exposure in memory dumps.</li>
<li>Hardware-backed keystores on supported platforms to store long-term or medium-term keys securely.</li>
<li>Minimizing plaintext key presence in RAM wherever possible.</li>
<li><strong>Rust <code>libsignal-client</code></strong> for memory safety at the language level and fewer low-level buffer overflows.</li>
</ul>
<h2 id="9-group-messaging-sender-keys-and-group-v2">9. Group Messaging (Sender Keys and Group V2)</h2>
<ul>
<li><strong>Sender Keys</strong>: A single symmetric key per group, with each sender using a <strong>Sender Signing Key</strong> for authenticity. This reduces overhead compared to individually encrypting messages for each recipient.</li>
<li><strong>Group V2</strong>: Maintains membership consistency, ensuring no stealthy additions or removals. Future research includes <strong>post-quantum hardening</strong> of group operations and further metadata reduction techniques.</li>
</ul>
<h2 id="10-calls-and-real-time-media-encryption">10. Calls and Real-Time Media Encryption</h2>
<p>Calls use <strong>DTLS + SRTP</strong>:</p>
<ul>
<li><strong>DTLS</strong>: Ephemeral ECDHE-based key agreement (upgradable to PQ in the future) establishes the session keys.</li>
<li><strong>SRTP</strong>: Secures the real-time media streams with AES-GCM or ChaCha20-Poly1305.</li>
<li><strong>Key Discard</strong>: Once the call ends, keys are discarded, ensuring no long-term correlation of voice/video data.</li>
</ul>
<h2 id="11-metadata-minimization-sealed-sender-and-wire-formats">11. Metadata Minimization, Sealed Sender, and Wire Formats</h2>
<ul>
<li><strong>Sealed Sender</strong>: Conceals the sender’s identity from the server by encrypting metadata with the recipient’s identity key.</li>
<li><strong>Transport Security</strong>:
<ul>
<li>TLS 1.3 with pinned certificates</li>
<li>Ongoing research into private contact discovery, domain fronting, and censorship circumvention</li>
</ul>
</li>
<li><strong>Wire Formats</strong>: Minimal metadata is included in transport packets, reducing potential for traffic analysis.</li>
</ul>
<h2 id="12-formal-verification-and-security-audits">12. Formal Verification and Security Audits</h2>
<p><strong>Tools</strong>: <a href="https://bblanche.gitlabpages.inria.fr/proverif/">ProVerif</a> and <a href="https://tamarin-prover.github.io/">Tamarin</a> for cryptographic protocol modeling.</p>
<ul>
<li><strong>Double Ratchet Models</strong>: Confirm forward secrecy, post-compromise security, and authentication properties under standard cryptographic assumptions.</li>
<li><strong>PQXDH Models</strong>: Indicate strong resistance to active attackers, reinforcing the hybrid approach’s resilience.</li>
<li><strong>Group Protocols</strong>: Remain an active research area for proofs of membership consistency and post-quantum security at scale.</li>
</ul>
<p>Independent audits (both internal and external) plus academic research have consistently validated the protocol’s security goals. <em>Recent proofs even confirm no attacker can break forward secrecy under widely accepted assumptions.</em></p>
<h2 id="13-implementation-verification">13. Implementation Verification</h2>
<p>A combination of testing methodologies ensures correctness and robustness:</p>
<ul>
<li><strong>Fuzzing</strong>: Detects parsing, memory safety, and state machine vulnerabilities by bombarding the protocol with malformed or random inputs.</li>
<li><strong>Property-Based Testing</strong>: Checks invariant properties (e.g., no key reuse, correct ratchet progression, correct ephemeral key rotation).</li>
<li><strong>Integration Testing</strong>: Validates interoperability across various devices (mobile, desktop, server) and PQXDH backward compatibility.</li>
</ul>
<h2 id="14-security-boundaries-and-attack-trees">14. Security Boundaries and Attack Trees</h2>
<p><strong>Threat Modeling</strong>: Attack trees illuminate potential vectors such as:</p>
<ul>
<li><strong>Server Compromise</strong>: Mitigated by end-to-end encryption, sealed sender, and ephemeral keys.</li>
<li><strong>Network MITM Attacks</strong>: Thwarted by authenticated key exchanges (X3DH, PQXDH) and pinned TLS.</li>
<li><strong>Device Extractions</strong>: Hardware security modules protect long-term keys; ephemeral keys are zeroized quickly.</li>
</ul>
<h2 id="15-performance-considerations-and-benchmarks">15. Performance Considerations and Benchmarks</h2>
<p>Despite the added <strong>PQ layer</strong>, the performance impact is manageable:</p>
<ul>
<li><strong>Mobile</strong>: ~1–3ms extra for PQXDH handshakes.</li>
<li><strong>Desktop</strong>: Negligible overhead with hardware acceleration.</li>
</ul>
<p>Group messaging and message-level operations remain efficient. As PQC algorithms mature, these overheads may drop further.</p>
<h2 id="16-known-implementation-issues-pitfalls-and-mitigations">16. Known Implementation Issues, Pitfalls, and Mitigations</h2>
<ol>
<li><strong>Incomplete Key Zeroization</strong>: Failing to overwrite memory can leak secrets.</li>
<li><strong>Out-of-Order Message Handling</strong>: The Double Ratchet must gracefully handle skipped or delayed messages; improper handling can break sessions.</li>
<li><strong>Platform-Specific Nuances</strong>: iOS, Android, and desktop OSes have different APIs for secure storage.</li>
</ol>
<p>Mitigations include rigorous code reviews, test harnesses for edge cases, and platform-specific checklists.</p>
<h2 id="17-user-verification-and-safety-numbers">17. User Verification and Safety Numbers</h2>
<p><strong>Safety Numbers</strong> and QR codes give users a simple, out-of-band way to confirm identity keys. If keys change unexpectedly (e.g., new device or potential MITM attempt), the app warns users. This system extends to multi-device contexts, although users should re-verify each device to maintain trust consistency.</p>
<h2 id="18-multi-device-security">18. Multi-Device Security</h2>
<p>Signal supports multiple linked devices:</p>
<ul>
<li><strong>Per-Device Identity Keys</strong>: Each device maintains its own ratchet state, so compromising one device does not endanger all past messages or other devices.</li>
<li><strong>Session Synchronization</strong>: Double Ratchet states and PQXDH handshakes automatically extend to new devices.</li>
<li><strong>User Verification Across Devices</strong>: Safety Numbers and user prompts ensure that newly added devices do not silently replace an existing identity.</li>
</ul>
<p><img loading="lazy" src="/images/content/blog-security-signal-security-architecture-bfa52f85-4189-4f30-8971-03f39caaccb9.png" alt="Signal Multi-Device Architecture" />
</p>
<p><em>The multi-device architecture for Signal. Each linked device maintains its own state, preserving forward secrecy. The key distribution server helps register device identity keys but does not have message access.</em></p>
<h2 id="19-ephemeral-messages-and-cryptographic-deletion">19. Ephemeral Messages and Cryptographic Deletion</h2>
<p>Ephemeral (disappearing) messages auto-delete after a set interval. While forward secrecy prevents decrypting old messages once ratchets advance, recipients can always screenshot or record content prior to deletion. Future enhancements may integrate ephemeral messaging with encrypted backup policies to reduce risk of indefinite retention.</p>
<h2 id="20-supply-chain-security-and-reproducible-builds">20. Supply Chain Security and Reproducible Builds</h2>
<p><strong>Implementation integrity</strong> is crucial:</p>
<ul>
<li><strong>Open Source</strong>: The Signal Protocol code is entirely public on <a href="https://github.com/signalapp">GitHub</a>.</li>
<li><strong>Dependency Management</strong>: Strict auditing of libraries, especially cryptographic ones.</li>
<li><strong>Reproducible Builds</strong>: Publicly released binaries can be verified to match the source, reducing the risk of supply chain tampering.</li>
</ul>
<p><img loading="lazy" src="/images/content/blog-security-signal-security-architecture-72d87f5a-61e4-4b5d-b3dd-737e1985938a.png" alt="Signal Supply Chain Security" />
</p>
<p><em>Comprehensive build and verification pipeline for Signal. Multiple steps—from source code review to final distribution—ensure that no hidden changes can be introduced without being detected.</em></p>
<h2 id="21-backup-and-key-export-procedures">21. Backup and Key Export Procedures</h2>
<p><strong>Backup Mechanisms</strong>:</p>
<ul>
<li><strong>Encrypted Backups</strong>: On mobile, backups are encrypted with a user-chosen passphrase.</li>
<li><strong>No Plaintext Cloud Storage</strong>: All data remains encrypted client-side.</li>
<li><strong>Migration to New Devices</strong>: PQXDH ensures a secure handshake for session transitions, allowing old devices to transfer or synchronize state without exposing plaintext keys.</li>
</ul>
<h2 id="22-interaction-with-emerging-standards-mls">22. Interaction with Emerging Standards (MLS)</h2>
<p><strong>Messaging Layer Security (MLS)</strong> is a new standard for large-scale, secure group chats. Future work may explore:</p>
<ul>
<li><strong>MLS Integration</strong>: Leveraging MLS’s tree-based group key rotation.</li>
<li><strong>PQ Considerations</strong>: Ensuring MLS can incorporate PQ primitives to complement or replace PQXDH.</li>
<li><strong>Metadata Minimization</strong>: Adapting MLS’s evolving approaches for privacy within bigger groups.</li>
</ul>
<h2 id="23-side-channel-resistance-and-implementation-security">23. Side-Channel Resistance and Implementation Security</h2>
<p>Beyond correct cryptographic design, robust implementation must address side-channels:</p>
<ul>
<li><strong>Constant-Time Implementations</strong>: Preventing timing or cache-based leaks.</li>
<li><strong>Hardened Crypto Libraries</strong>: Using well-reviewed libraries (e.g., BoringSSL, libsodium).</li>
<li><strong>Regular Audits</strong>: Independent researchers test for side-channel vulnerabilities, especially on mobile platforms where integrated circuits may be more exposed.</li>
</ul>
<h2 id="24-future-directions">24. Future Directions</h2>
<ul>
<li>
<p><strong>Post-Quantum Migration</strong>:</p>
<ul>
<li><em>Short Term</em>: Hybrid approaches (PQXDH) become standard for new sessions.</li>
<li><em>Mid Term</em>: Evaluate newly standardized PQC algorithms from NIST, possibly adopting them for all protocol components (KEM, signatures, etc.).</li>
<li><em>Long Term</em>: Transition entirely to quantum-safe algorithms once they are validated and widely supported.</li>
</ul>
</li>
<li>
<p><strong>Metadata Reduction</strong>:<br>
Research into privacy-preserving contact discovery, anonymous credentials, and minimizing trust in servers.</p>
</li>
<li>
<p><strong>Formal Verification Expansion</strong>:<br>
Extending machine-checked proofs to full-group messaging, ephemeral messaging, and advanced PQ constructs.</p>
</li>
<li>
<p><strong>Continuous Improvement</strong>:<br>
The protocol evolves as cryptographic standards mature. We plan to reevaluate these details in mid-2025, once new PQC standards are finalized.</p>
</li>
</ul>
<h2 id="25-conclusion">25. Conclusion</h2>
<p>The <strong>Signal Protocol</strong> sets a high bar for secure messaging. Its well-known features—end-to-end encryption, forward secrecy, and deniability—are now fortified by <strong>post-quantum security</strong> (via PQXDH), <strong>extensive formal verification</strong>, <strong>robust memory management</strong>, and <strong>supply chain integrity</strong> measures. While challenges remain—particularly regarding post-quantum transitions, large-group protocols, and ongoing metadata minimization—the Signal ecosystem is well-positioned to adapt alongside emerging standards like MLS.</p>
<p>Continued community involvement is vital:</p>
<ul>
<li><strong>Review and Contribute</strong>: <a href="https://github.com/signalapp/libsignal">github.com/signalapp/libsignal</a></li>
<li><strong>Conduct Security Research</strong>: Perform formal verification, cryptanalysis, and implementation testing.</li>
<li><strong>Engage in Technical Discussions</strong>: <a href="https://community.signalusers.org/">community.signalusers.org</a></li>
</ul>
<hr>
<h2 id="26-references-and-code-pointers">26. References and Code Pointers</h2>
<ul>
<li>
<p><strong>Signal Protocol Specifications</strong>:<br>
<a href="https://signal.org/docs/">https://signal.org/docs/</a></p>
</li>
<li>
<p><strong>Double Ratchet Paper (Cohn-Gordon et al.)</strong>:<br>
<a href="https://signal.org/docs/specifications/doubleratchet/">https://signal.org/docs/specifications/doubleratchet/</a></p>
</li>
<li>
<p><strong>X3DH &amp; PQXDH Specs + PQXDH Whitepaper</strong>:<br>
<a href="https://signal.org/docs/specifications/x3dh/">https://signal.org/docs/specifications/x3dh/</a><br>
<a href="https://signal.org/blog/pqxdh/">https://signal.org/blog/pqxdh/</a></p>
</li>
<li>
<p><strong>CRYSTALS-Kyber</strong>:<br>
<a href="https://pq-crystals.org/kyber/">https://pq-crystals.org/kyber/</a></p>
</li>
<li>
<p><strong>libsignal-protocol-c and Rust Bindings</strong>:<br>
<a href="https://github.com/signalapp/libsignal-protocol-c">https://github.com/signalapp/libsignal-protocol-c</a><br>
<a href="https://github.com/signalapp/libsignal">https://github.com/signalapp/libsignal</a></p>
</li>
<li>
<p><strong>Formal Verification</strong>:</p>
<ul>
<li>ProVerif/Tamarin models in academic papers:
<ul>
<li>“A Formal Security Analysis of the Signal Messaging Protocol” (2020)</li>
<li>“An Academic Analysis of PQXDH Parameters” (forthcoming)</li>
</ul>
</li>
<li><a href="https://csrc.nist.gov/projects/post-quantum-cryptography">NIST PQC Standards</a></li>
</ul>
</li>
<li>
<p><strong>Messaging Layer Security (MLS)</strong>:<br>
<a href="https://messaginglayersecurity.rocks/">https://messaginglayersecurity.rocks/</a></p>
</li>
<li>
<p><strong>Audits &amp; Community Analyses</strong>:<br>
Independent security audits, community-driven code reviews, and academic research. Check the latest audit reports for updates and commentary.</p>
</li>
</ul>
]]></content>
      </entry>
      <entry>
        <title>Zcash Protocol Deep Dive: The Cryptography Behind Financial Privacy</title>
        <link rel="alternate" href="https://profincognito.me/blog/privacy/zcash-protocol/" />
        <id>https://profincognito.me/blog/privacy/zcash-protocol/</id>
        <published>2025-11-25T00:00:00Z</published>
        <updated>2026-05-25T14:44:10-07:00</updated>
        <summary type="html">A comprehensive technical analysis of the Zcash protocol (v2025.6.3), covering zk-SNARKs, Halo 2, the Lockbox funding model, and the evolution of privacy from Sprout to Orchard.</summary>
          <content type="html"><![CDATA[<h2 id="abstract">Abstract</h2>
<p>Zcash represents one of the most sophisticated implementations of cryptographic privacy in production blockchain systems. Built on the theoretical foundations of the Zerocash protocol, Zcash employs zero-knowledge succinct non-interactive arguments of knowledge (zk-SNARKs) to enable fully private transactions while maintaining the integrity guarantees of a public ledger.</p>
<p>This technical deep dive examines the Zcash protocol specification (Version 2025.6.3), covering its cryptographic primitives, privacy architecture, zero-knowledge proof systems, and the evolution from Sprout through Sapling to Orchard. We analyze the mathematical foundations, security properties, and design decisions that make Zcash a reference implementation for blockchain privacy.</p>
<hr>
<h2 id="table-of-contents">Table of Contents</h2>
<ul>
<li><a href="#1-introduction-the-privacy-problem">1. Introduction: The Privacy Problem</a></li>
<li><a href="#2-zcash-architecture-overview">2. Zcash Architecture Overview</a></li>
<li><a href="#3-the-dual-payment-system">3. The Dual Payment System</a></li>
<li><a href="#4-core-privacy-primitives">4. Core Privacy Primitives</a></li>
<li><a href="#5-the-three-shielded-protocols">5. The Three Shielded Protocols</a></li>
<li><a href="#6-zero-knowledge-proof-systems">6. Zero-Knowledge Proof Systems</a></li>
<li><a href="#7-key-architecture-and-derivation">7. Key Architecture and Derivation</a></li>
<li><a href="#8-unified-addresses-and-memo-fields">8. Unified Addresses and Memo Fields</a></li>
<li><a href="#9-cryptographic-building-blocks">9. Cryptographic Building Blocks</a></li>
<li><a href="#10-transaction-structure-and-validation">10. Transaction Structure and Validation</a></li>
<li><a href="#11-security-analysis">11. Security Analysis</a></li>
<li><a href="#12-network-upgrades">12. Network Upgrades</a></li>
<li><a href="#13-conclusion">13. Conclusion</a></li>
</ul>
<hr>
<h2 id="1-introduction-the-privacy-problem">1. Introduction: The Privacy Problem</h2>
<h3 id="11-bitcoins-transparency-problem">1.1 Bitcoin&rsquo;s Transparency Problem</h3>
<p>Bitcoin, despite popular misconception, is not anonymous. It is pseudonymous. Every transaction is permanently recorded on a public ledger, creating a complete transaction graph that links addresses through their spending patterns. Research has repeatedly demonstrated that this transparency, combined with off-chain data sources, enables deanonymization of users through:</p>
<ul>
<li><strong>Transaction graph analysis</strong>: Clustering algorithms identify addresses controlled by the same entity</li>
<li><strong>Amount correlation</strong>: Matching input/output amounts across transactions</li>
<li><strong>Timing analysis</strong>: Transaction timing patterns reveal behavioral signatures</li>
<li><strong>Exchange KYC linkage</strong>: On-ramps and off-ramps connect pseudonyms to identities</li>
</ul>
<p>The implications extend beyond individual privacy. Financial surveillance at scale becomes trivial, and the fungibility of Bitcoin is compromised, since coins with &ldquo;tainted&rdquo; histories may be rejected or discounted.</p>
<h3 id="12-the-zerocash-solution">1.2 The Zerocash Solution</h3>
<p>In 2014, Eli Ben-Sasson, Alessandro Chiesa, Christina Garman, Matthew Green, Ian Miers, Eran Tromer, and Madars Virza published the Zerocash paper, proposing a cryptocurrency protocol that achieves:</p>
<ul>
<li><strong>Payment anonymity</strong>: Transactions reveal nothing about sender, recipient, or amount</li>
<li><strong>Full fungibility</strong>: All coins are cryptographically indistinguishable</li>
<li><strong>Decentralization</strong>: No trusted parties required for transaction validation</li>
<li><strong>Efficiency</strong>: Practical proof generation and verification times</li>
</ul>
<p>Zcash launched on October 28, 2016, as the first production implementation of these ideas, with significant security fixes and performance improvements over the original paper.</p>
<h3 id="13-the-zcash-ecosystem-2025">1.3 The Zcash Ecosystem (2025)</h3>
<p>The Zcash ecosystem has matured into a multi-organization structure:</p>
<table>
  <thead>
      <tr>
          <th>Organization</th>
          <th>Focus</th>
          <th>Key Projects</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Electric Coin Company (ECC)</strong></td>
          <td>Wallet UX, US regulatory engagement</td>
          <td>Zashi (reference wallet), protocol R&amp;D</td>
      </tr>
      <tr>
          <td><strong>Zcash Foundation</strong></td>
          <td>Node infrastructure, governance</td>
          <td>Zebra (Rust node), FROST threshold signatures</td>
      </tr>
      <tr>
          <td><strong>Shielded Labs</strong></td>
          <td>Protocol evolution, consensus R&amp;D</td>
          <td>Crosslink (hybrid PoS), network upgrades</td>
      </tr>
  </tbody>
</table>
<p><strong>Reference Implementations:</strong></p>
<ul>
<li><strong>Zashi</strong>: ECC&rsquo;s modern wallet emphasizing usability; the primary user-facing reference for shielded transactions</li>
<li><strong>Zebra</strong>: The Foundation&rsquo;s Rust implementation of a full node, now fully consensus-compatible and serving as the primary node software going forward</li>
<li><strong>Zallet</strong>: The successor wallet to zcashd&rsquo;s wallet functionality, designed to work with Zebra</li>
<li><strong>zcashd</strong>: The original C++ node (ECC), now being deprecated in favor of Zebra and Zallet</li>
</ul>
<h3 id="14-document-scope">1.4 Document Scope</h3>
<p>This analysis is based on the Zcash Protocol Specification Version 2025.6.3 [NU6.1], the authoritative technical document maintained collaboratively by Zcash ecosystem contributors. We examine the protocol as implemented through the NU6 network upgrade (activated November 2024) and NU6.1 (activated November 2025).</p>
<hr>
<h2 id="2-zcash-architecture-overview">2. Zcash Architecture Overview</h2>
<h3 id="21-high-level-design">2.1 High-Level Design</h3>
<p>Zcash extends Bitcoin&rsquo;s architecture with a parallel shielded payment system. The key insight is that while Bitcoin transactions explicitly encode value transfers (input addresses → output addresses with amounts), Zcash shielded transactions prove that a valid transfer occurred without revealing any details.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>┌─────────────────────────────────────────────────────────────────────────┐
</span></span><span style="display:flex;"><span>│                         ZCASH BLOCKCHAIN                                │
</span></span><span style="display:flex;"><span>├─────────────────────────────────────────────────────────────────────────┤
</span></span><span style="display:flex;"><span>│                                                                         │
</span></span><span style="display:flex;"><span>│   ┌─────────────────────┐         ┌─────────────────────────────────┐   │
</span></span><span style="display:flex;"><span>│   │  TRANSPARENT POOL   │         │        SHIELDED POOLS           │   │
</span></span><span style="display:flex;"><span>│   │                     │         │                                 │   │
</span></span><span style="display:flex;"><span>│   │  • Bitcoin-style    │◄───────►│  ┌─────────┐     ┌─────────┐    │   │
</span></span><span style="display:flex;"><span>│   │  • Public amounts   │ (amount │  │ Sprout  │     │ Sapling │    │   │
</span></span><span style="display:flex;"><span>│   │  • Visible addresses│ visible)│  │(legacy) │     │(active) │    │   │
</span></span><span style="display:flex;"><span>│   │  • Traceable        │         │  └────┬────┘     └────┬────┘    │   │
</span></span><span style="display:flex;"><span>│   │                     │         │       │               │         │   │
</span></span><span style="display:flex;"><span>│   └─────────────────────┘         │       │  ┌─────────┐  │         │   │
</span></span><span style="display:flex;"><span>│            ▲                      │       └──│ Orchard │──┘         │   │
</span></span><span style="display:flex;"><span>│            │                      │          │(current)│            │   │
</span></span><span style="display:flex;"><span>│            │                      │          └─────────┘            │   │
</span></span><span style="display:flex;"><span>│            │                      │     (inter-pool: amount visible)│   │
</span></span><span style="display:flex;"><span>│            │                      │                                 │   │
</span></span><span style="display:flex;"><span>│            │                      │  • Hidden amounts               │   │
</span></span><span style="display:flex;"><span>│            │                      │  • Hidden addresses             │   │
</span></span><span style="display:flex;"><span>│            │                      │  • Unlinkable transfers         │   │
</span></span><span style="display:flex;"><span>│            │                      └─────────────────────────────────┘   │
</span></span><span style="display:flex;"><span>│            │                                                            │
</span></span><span style="display:flex;"><span>│   ┌────────┴────────┐                                                   │
</span></span><span style="display:flex;"><span>│   │ LOCKBOX (ZIP2001)│  ◄── 20% of block rewards (NU6+)                 │
</span></span><span style="display:flex;"><span>│   │                 │                                                   │
</span></span><span style="display:flex;"><span>│   │ Protocol-controlled; awaits decentralized grant distribution        │
</span></span><span style="display:flex;"><span>│   └─────────────────┘                                                   │
</span></span><span style="display:flex;"><span>│                                                                         │
</span></span><span style="display:flex;"><span>└─────────────────────────────────────────────────────────────────────────┘
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>PRIVACY GUARANTEES BY TRANSACTION TYPE:
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  Transparent → Transparent:  No privacy (fully public, like Bitcoin)
</span></span><span style="display:flex;"><span>  Transparent → Shielded:     Amount visible at entry point only
</span></span><span style="display:flex;"><span>  Shielded → Shielded:        Full privacy (same pool)
</span></span><span style="display:flex;"><span>  Shielded → Shielded:        Amount visible (cross-pool, e.g., Sapling→Orchard)
</span></span><span style="display:flex;"><span>  Shielded → Transparent:     Amount visible at exit point only
</span></span></code></pre></div><h3 id="22-chain-value-pools">2.2 Chain Value Pools</h3>
<p>Zcash maintains separate <strong>chain value pools</strong>:</p>
<table>
  <thead>
      <tr>
          <th>Pool</th>
          <th>Description</th>
          <th>Privacy Level</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Transparent</strong></td>
          <td>Bitcoin-compatible UTXOs</td>
          <td>None (fully public)</td>
      </tr>
      <tr>
          <td><strong>Sprout</strong></td>
          <td>Original shielded pool (deprecated; quarantined in modern wallets)</td>
          <td>Full</td>
      </tr>
      <tr>
          <td><strong>Sapling</strong></td>
          <td>Primary shielded pool for most users</td>
          <td>Full</td>
      </tr>
      <tr>
          <td><strong>Orchard</strong></td>
          <td>Latest shielded pool (NU5+), preferred for new transactions</td>
          <td>Full</td>
      </tr>
      <tr>
          <td><strong>Lockbox (ZIP 2001)</strong></td>
          <td>Protocol-controlled fund accumulating development funding</td>
          <td>N/A</td>
      </tr>
  </tbody>
</table>
<p>The <strong>Lockbox</strong> (introduced in NU6) is distinct from user-accessible pools. It accumulates a portion of block rewards for future development grants, effectively holding funds in a &ldquo;holding pattern&rdquo; until a decentralized grant mechanism (per ZIP 1016) distributes them. Unlike Sprout/Sapling/Orchard, users cannot directly transact with the Lockbox.</p>
<p>Value can move between user pools, but <strong>cross-pool transfers always reveal the amount transferred</strong>. This is a fundamental constraint because the system cannot hide what doesn&rsquo;t exist in the destination pool&rsquo;s commitment tree.</p>
<h3 id="23-consensus-model">2.3 Consensus Model</h3>
<p>Zcash inherits Bitcoin&rsquo;s Nakamoto consensus with modifications:</p>
<ul>
<li><strong>Proof of Work</strong>: Equihash (memory-hard; originally designed for ASIC resistance, though specialized ASICs have since been developed)</li>
<li><strong>Block Time</strong>: 75 seconds (post-Blossom)</li>
<li><strong>Difficulty Adjustment</strong>: Per-block adjustment with damping</li>
<li><strong>Supply</strong>: 21 million ZEC maximum, with halving schedule</li>
</ul>
<hr>
<h2 id="3-the-dual-payment-system">3. The Dual Payment System</h2>
<h3 id="31-transparent-transactions">3.1 Transparent Transactions</h3>
<p>Transparent transactions operate identically to Bitcoin:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>Transparent Input(s)          Transparent Output(s)
</span></span><span style="display:flex;"><span>┌──────────────────┐          ┌──────────────────┐
</span></span><span style="display:flex;"><span>│ Previous TxID    │          │ Value (satoshis) │
</span></span><span style="display:flex;"><span>│ Output Index     │    ───►  │ scriptPubKey     │
</span></span><span style="display:flex;"><span>│ scriptSig        │          └──────────────────┘
</span></span><span style="display:flex;"><span>│ Sequence         │
</span></span><span style="display:flex;"><span>└──────────────────┘
</span></span></code></pre></div><p>These use standard Bitcoin script for authorization (P2PKH, P2SH, etc.) and provide no privacy beyond pseudonymity.</p>
<h3 id="32-shielded-transactions">3.2 Shielded Transactions</h3>
<p>Shielded transactions replace explicit value transfers with cryptographic proofs:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>Shielded Input(s)             Shielded Output(s)
</span></span><span style="display:flex;"><span>┌──────────────────┐          ┌──────────────────┐
</span></span><span style="display:flex;"><span>│ Nullifier        │          │ Note Commitment  │
</span></span><span style="display:flex;"><span>│ Anchor           │    ───►  │ Encrypted Note   │
</span></span><span style="display:flex;"><span>│ zk-SNARK Proof   │          │ Ephemeral Key    │
</span></span><span style="display:flex;"><span>│ Signatures       │          └──────────────────┘
</span></span><span style="display:flex;"><span>└──────────────────┘
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>What&#39;s proven (not revealed):
</span></span><span style="display:flex;"><span>• Input notes exist in the commitment tree
</span></span><span style="display:flex;"><span>• Prover knows the spending keys
</span></span><span style="display:flex;"><span>• Input values = Output values + fees
</span></span><span style="display:flex;"><span>• Nullifiers computed correctly
</span></span></code></pre></div><h3 id="33-transaction-value-balance">3.3 Transaction Value Balance</h3>
<p>For any valid transaction, the following invariant holds:</p>
$$\sum_{i} v_{in,i}^{transparent} + \sum_{j} v_{in,j}^{shielded} = \sum_{k} v_{out,k}^{transparent} + \sum_{l} v_{out,l}^{shielded} + fee$$<p>In practice, v5 transactions handle this through the <code>valueBalance</code> fields in each shielded bundle. The <code>valueBalanceSapling</code> and <code>valueBalanceOrchard</code> fields represent the net value flowing <em>out of</em> each shielded pool into the transparent pool. A positive <code>valueBalance</code> means shielded value is being unshielded; a negative value means transparent value is being shielded. The transaction fee is implicitly the remaining transparent value not consumed by outputs:</p>
$$fee = \sum_{i} v_{in,i}^{transparent} - \sum_{k} v_{out,k}^{transparent} + valueBalance^{Sapling} + valueBalance^{Orchard}$$<p>The shielded components use <strong>homomorphic commitments</strong> (Sapling/Orchard) or <strong>explicit balance proofs</strong> (Sprout) to verify this equation without revealing individual values.</p>
<hr>
<h2 id="4-core-privacy-primitives">4. Core Privacy Primitives</h2>
<h3 id="41-notes">4.1 Notes</h3>
<p>In Zcash, value is carried by <strong>notes</strong>, the shielded equivalent of UTXOs. A note is not a &ldquo;coin&rdquo; in the physical sense but a tuple of cryptographic values that represent spendable funds.</p>
<h4 id="sprout-note-structure">Sprout Note Structure</h4>
$$n_{Sprout} = (a_{pk}, v, \rho, rcm)$$<p>Where:</p>
<ul>
<li>$a_{pk} \in \mathbb{B}^{256}$: paying key of recipient&rsquo;s address</li>
<li>$v \in \lbrace 0, \ldots, MAX\_MONEY \rbrace$: value in zatoshi (1 ZEC = $10^8$ zatoshi)</li>
<li>$\rho \in \mathbb{B}^{256}$: nullifier randomness</li>
<li>$rcm$: random commitment trapdoor</li>
</ul>
<h4 id="sapling-note-structure">Sapling Note Structure</h4>
$$n_{Sapling} = (d, pk_d, v, rcm)$$<p>Where:</p>
<ul>
<li>$d \in \mathbb{B}^{88}$: diversifier</li>
<li>$pk_d \in \mathbb{J}^{(r)*}$: diversified transmission key (Jubjub curve point)</li>
<li>$v \in \lbrace 0, \ldots, MAX\_MONEY \rbrace$: value in zatoshi</li>
<li>$rcm \in \mathbb{F}_{r_{\mathbb{J}}}$: commitment trapdoor</li>
</ul>
<h4 id="orchard-note-structure">Orchard Note Structure</h4>
$$n_{Orchard} = (d, pk_d, v, \rho, \psi, rcm)$$<p>Where:</p>
<ul>
<li>$d \in \mathbb{B}^{88}$: diversifier</li>
<li>$pk_d \in \mathbb{P}$: diversified transmission key (Pallas curve point)</li>
<li>$v \in \lbrace 0, \ldots, 2^{64}-1 \rbrace$: value in zatoshi (64-bit field; consensus rules further constrain to MAX_MONEY)</li>
<li>$\rho \in \mathbb{F}_{q_{\mathbb{P}}}$: nullifier randomness</li>
<li>$\psi \in \mathbb{F}_{q_{\mathbb{P}}}$: additional nullifier randomness</li>
<li>$rcm$: commitment trapdoor</li>
</ul>
<h3 id="42-note-commitments">4.2 Note Commitments</h3>
<p>When a note is created, only a <strong>commitment</strong> to its contents is published on-chain. This commitment is:</p>
<ol>
<li><strong>Binding</strong>: Cannot find two different notes with the same commitment</li>
<li><strong>Hiding</strong>: Commitment reveals nothing about the note contents</li>
</ol>
<h4 id="sprout-note-commitment">Sprout Note Commitment</h4>
$$cm = NoteCommit_{rcm}^{Sprout}(a_{pk}, v, \rho)$$<p>Using SHA-256 compression:</p>
$$cm = SHA256Compress(SHA256Compress([1]^{192} \| a_{pk}[0..63]) \| a_{pk}[64..255] \| v \| \rho)[0..255]$$<p>Then:</p>
$$cm = SHA256Compress(cm \| rcm)$$<h4 id="sapling-note-commitment">Sapling Note Commitment</h4>
$$cm = NoteCommit_{rcm}^{Sapling}(repr_{\mathbb{J}}(g_d), repr_{\mathbb{J}}(pk_d), v)$$<p>Where:</p>
<ul>
<li>$g_d = DiversifyHash^{Sapling}(d)$: the diversified base point</li>
<li>The commitment uses <strong>Windowed Pedersen Commitments</strong> for efficiency</li>
</ul>
<p>The Pedersen commitment has the form:</p>
$$cm = [rcm] \cdot \mathcal{H} + Pedersen(repr_{\mathbb{J}}(g_d) \| repr_{\mathbb{J}}(pk_d) \| v)$$<p>Where $\mathcal{H}$ is a nothing-up-my-sleeve generator point.</p>
<h4 id="orchard-note-commitment">Orchard Note Commitment</h4>
$$cm = NoteCommit_{rcm}^{Orchard}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi)$$<p>Using <strong>Sinsemilla</strong> hash function for improved circuit efficiency:</p>
$$cm = SinsemillaCommit_{rcm}(repr_{\mathbb{P}}(g_d) \| repr_{\mathbb{P}}(pk_d) \| I2LEBSP_{64}(v) \| \rho \| \psi)$$<h3 id="43-note-commitment-trees">4.3 Note Commitment Trees</h3>
<p>All note commitments are inserted into an <strong>incremental Merkle tree</strong>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>                    Root (Anchor)
</span></span><span style="display:flex;"><span>                    /            \
</span></span><span style="display:flex;"><span>                   /              \
</span></span><span style="display:flex;"><span>               H(0,1)            H(2,3)
</span></span><span style="display:flex;"><span>               /    \            /    \
</span></span><span style="display:flex;"><span>            H(0)   H(1)       H(2)   H(3)
</span></span><span style="display:flex;"><span>             |      |          |      |
</span></span><span style="display:flex;"><span>           cm_0   cm_1       cm_2   cm_3
</span></span></code></pre></div><p>Each protocol maintains its own tree:</p>
<table>
  <thead>
      <tr>
          <th>Protocol</th>
          <th>Tree Depth</th>
          <th>Max Notes</th>
          <th>Hash Function</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Sprout</td>
          <td>29</td>
          <td>~537 million</td>
          <td>SHA-256</td>
      </tr>
      <tr>
          <td>Sapling</td>
          <td>32</td>
          <td>~4.3 billion</td>
          <td>Pedersen Hash</td>
      </tr>
      <tr>
          <td>Orchard</td>
          <td>32</td>
          <td>~4.3 billion</td>
          <td>Sinsemilla</td>
      </tr>
  </tbody>
</table>
<p>The <strong>Merkle root</strong> (called an <strong>anchor</strong>) uniquely identifies the state of the commitment tree at a point in time.</p>
<h4 id="merkle-path-verification">Merkle Path Verification</h4>
<p>To prove a commitment exists in the tree, the spender provides a <strong>Merkle path</strong>, the sequence of sibling hashes from leaf to root:</p>
$$path = \left[ M_{sibling(h,i)}^h \text{ for } h \text{ from } MerkleDepth \text{ down to } 1 \right]$$<p>Where:</p>
$$sibling(h, i) = \left\lfloor \frac{i}{2^{MerkleDepth-h}} \right\rfloor \oplus 1$$<p>Verification recomputes the root from the leaf:</p>
$$M_i^h = MerkleCRH(h, M_{2i}^{h+1}, M_{2i+1}^{h+1})$$<h3 id="44-nullifiers">4.4 Nullifiers</h3>
<p>The <strong>nullifier</strong> is the key innovation enabling double-spend prevention without linkability. Each note has exactly one valid nullifier, computed from secret values known only to the note&rsquo;s owner.</p>
<h4 id="the-double-spend-problem">The Double-Spend Problem</h4>
<p>Without nullifiers, preventing double-spends would require either:</p>
<ol>
<li>Revealing which commitment is being spent (breaks privacy)</li>
<li>Trusting a central party to track spent notes (breaks decentralization)</li>
</ol>
<h4 id="nullifier-construction">Nullifier Construction</h4>
<p><strong>Sprout:</strong></p>
$$nf = PRF_{a_{sk}}^{nf}(\rho)$$<p><strong>Sapling:</strong></p>
$$nf = PRF_{nk^{\ast}}^{nfSapling}(\rho^{\ast})$$<p>Where:</p>
<ul>
<li>$nk^{\ast} = repr_{\mathbb{J}}(nk)$: serialized nullifier deriving key</li>
<li>$\rho^{\ast} = repr_{\mathbb{J}}(MixingPedersenHash(cm, pos))$</li>
<li>$pos$: the note&rsquo;s position in the commitment tree</li>
</ul>
<p><strong>Orchard:</strong></p>
$$nf = DeriveNullifier_{nk}(\rho, \psi, cm)$$<p>Using Poseidon hash:</p>
$$nf = Extract_{\mathbb{P}}([PRF_{nk}^{nfOrchard}(\rho) + \psi] \cdot \mathcal{K} + cm)$$<p>Where $\mathcal{K}$ is a generator point for the nullifier base.</p>
<h4 id="nullifier-set">Nullifier Set</h4>
<p>The blockchain maintains a <strong>nullifier set</strong> for each shielded protocol. When a transaction is mined:</p>
<ol>
<li>All nullifiers in the transaction are checked against the set</li>
<li>If any nullifier already exists → <strong>reject</strong> (double-spend attempt)</li>
<li>Otherwise, add all nullifiers to the set</li>
</ol>
<p>This ensures each note can only be spent once, without revealing which commitment corresponds to which nullifier.</p>
<h3 id="45-note-traceability-sets">4.5 Note Traceability Sets</h3>
<p>A critical privacy property is the <strong>note traceability set</strong>, the set of possible source notes for any given spend.</p>
<p>In Zcash, when spending a note, the spender proves knowledge of:</p>
<ul>
<li>A valid note commitment somewhere in the tree</li>
<li>The spending authority for that note</li>
<li>Correct nullifier computation</li>
</ul>
<p>But the proof does <strong>not</strong> reveal which commitment. From an observer&rsquo;s perspective, the spent note could be <strong>any</strong> note in the commitment tree that the observer doesn&rsquo;t know to be spent.</p>
<p><strong>Comparison with other privacy schemes:</strong></p>
<table>
  <thead>
      <tr>
          <th>System</th>
          <th>Anonymity Set Size</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Bitcoin (no mixing)</td>
          <td>1</td>
      </tr>
      <tr>
          <td>CoinJoin</td>
          <td>Participants in mix (~3-100)</td>
      </tr>
      <tr>
          <td>CryptoNote/Monero</td>
          <td>Ring size (fixed at 16)</td>
      </tr>
      <tr>
          <td><strong>Zcash</strong></td>
          <td><strong>All unspent shielded notes</strong> (~millions)</td>
      </tr>
  </tbody>
</table>
<p>This is a fundamental architectural advantage: Zcash&rsquo;s anonymity set grows with every shielded transaction ever made.</p>
<hr>
<h2 id="5-the-three-shielded-protocols">5. The Three Shielded Protocols</h2>
<h3 id="51-sprout-2016-2018">5.1 Sprout (2016-2018)</h3>
<p>Sprout was Zcash&rsquo;s original shielded protocol, designed for correctness over efficiency.</p>
<h4 id="joinsplit-transfers">JoinSplit Transfers</h4>
<p>Sprout uses <strong>JoinSplit</strong> operations that consume up to 2 input notes and produce up to 2 output notes:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>            JoinSplit Transfer
</span></span><span style="display:flex;"><span>     ┌─────────────────────────────┐
</span></span><span style="display:flex;"><span>     │                             │
</span></span><span style="display:flex;"><span> n_1 ──►┌─────────────────────┐    │
</span></span><span style="display:flex;"><span>     │  │                     │────►── n&#39;_1
</span></span><span style="display:flex;"><span> n_2 ──►│   zk-SNARK Proof    │    │
</span></span><span style="display:flex;"><span>     │  │                     │────►── n&#39;_2
</span></span><span style="display:flex;"><span>v_pub^old──►│                     │    │
</span></span><span style="display:flex;"><span>     │  │   Proves:           │────►── v_pub^new
</span></span><span style="display:flex;"><span>     │  │   • Notes exist     │    │
</span></span><span style="display:flex;"><span>     │  │   • Know spend key  │    │
</span></span><span style="display:flex;"><span>     │  │   • Values balance  │    │
</span></span><span style="display:flex;"><span>     │  └─────────────────────┘    │
</span></span><span style="display:flex;"><span>     │                             │
</span></span><span style="display:flex;"><span>     └─────────────────────────────┘
</span></span></code></pre></div><h4 id="balance-equation-inside-proof">Balance Equation (Inside Proof)</h4>
$$v_1^{old} + v_2^{old} + v_{pub}^{old} = v_1^{new} + v_2^{new} + v_{pub}^{new}$$<p>The transparent values $v_{pub}^{old}$ and $v_{pub}^{new}$ allow value to enter/exit the shielded pool.</p>
<h4 id="sprout-limitations">Sprout Limitations</h4>
<ol>
<li><strong>Performance</strong>: Proof generation took ~40 seconds</li>
<li><strong>Circuit size</strong>: ~2 million constraints</li>
<li><strong>No viewing keys</strong>: Cannot delegate read access without spending authority</li>
<li><strong>Fixed structure</strong>: Always 2 inputs, 2 outputs (dummy notes required for padding)</li>
</ol>
<h3 id="52-sapling-2018-2020">5.2 Sapling (2018-2020)</h3>
<p>The Sapling upgrade (activated October 2018) was a complete redesign optimizing for performance and functionality.</p>
<h4 id="key-improvements">Key Improvements</h4>
<table>
  <thead>
      <tr>
          <th>Aspect</th>
          <th>Sprout</th>
          <th>Sapling</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Proof time</td>
          <td>~40 seconds</td>
          <td>~7 seconds</td>
      </tr>
      <tr>
          <td>Proof size</td>
          <td>296 bytes</td>
          <td>192 bytes</td>
      </tr>
      <tr>
          <td>Memory (proving)</td>
          <td>~3 GB</td>
          <td>~40 MB</td>
      </tr>
      <tr>
          <td>Viewing keys</td>
          <td>No</td>
          <td>Yes</td>
      </tr>
      <tr>
          <td>Diversified addresses</td>
          <td>No</td>
          <td>Yes</td>
      </tr>
  </tbody>
</table>
<h4 id="separated-spend-and-output-proofs">Separated Spend and Output Proofs</h4>
<p>Instead of JoinSplit&rsquo;s monolithic proof, Sapling uses separate circuits:</p>
<p><strong>Spend Description</strong> (one per input):</p>
<ul>
<li>Proves knowledge of a spendable note</li>
<li>Reveals: nullifier, value commitment, anchor</li>
</ul>
<p><strong>Output Description</strong> (one per output):</p>
<ul>
<li>Proves correct note construction</li>
<li>Reveals: note commitment, value commitment, encrypted note</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>Transaction with 3 inputs, 2 outputs:
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>┌─────────────────────────────────────────────────────────┐
</span></span><span style="display:flex;"><span>│                    Sapling Bundle                        │
</span></span><span style="display:flex;"><span>├─────────────────────────────────────────────────────────┤
</span></span><span style="display:flex;"><span>│  Spend Description 1    │  Output Description 1         │
</span></span><span style="display:flex;"><span>│  ├─ nullifier          │  ├─ note commitment (cm_u)    │
</span></span><span style="display:flex;"><span>│  ├─ value commitment   │  ├─ value commitment          │
</span></span><span style="display:flex;"><span>│  ├─ anchor             │  ├─ ephemeral key             │
</span></span><span style="display:flex;"><span>│  ├─ zk-SNARK proof     │  ├─ encrypted note            │
</span></span><span style="display:flex;"><span>│  └─ spend auth sig     │  └─ zk-SNARK proof            │
</span></span><span style="display:flex;"><span>├─────────────────────────┼───────────────────────────────┤
</span></span><span style="display:flex;"><span>│  Spend Description 2    │  Output Description 2         │
</span></span><span style="display:flex;"><span>│  └─ ...                │  └─ ...                       │
</span></span><span style="display:flex;"><span>├─────────────────────────┼───────────────────────────────┤
</span></span><span style="display:flex;"><span>│  Spend Description 3    │                               │
</span></span><span style="display:flex;"><span>│  └─ ...                │                               │
</span></span><span style="display:flex;"><span>├─────────────────────────┴───────────────────────────────┤
</span></span><span style="display:flex;"><span>│  Binding Signature (proves balance)                     │
</span></span><span style="display:flex;"><span>│  valueBalance (transparent value change)                │
</span></span><span style="display:flex;"><span>└─────────────────────────────────────────────────────────┘
</span></span></code></pre></div><h4 id="homomorphic-value-commitments">Homomorphic Value Commitments</h4>
<p>Sapling&rsquo;s balance is verified using Pedersen commitments&rsquo; homomorphic property:</p>
$$ValueCommit_{rcv}^{Sapling}(v) = [rcv] \cdot \mathcal{R} + [v] \cdot \mathcal{V}$$<p>Where:</p>
<ul>
<li>$\mathcal{R}, \mathcal{V}$ are generator points on Jubjub</li>
<li>$rcv$ is a random commitment trapdoor</li>
</ul>
<p><strong>Homomorphic property:</strong></p>
$$Commit(v_1) + Commit(v_2) = Commit(v_1 + v_2)$$<p>This allows balance verification without individual value revelation:</p>
$$\sum_i cv_i^{spend} - \sum_j cv_j^{output} = [bsk] \cdot \mathcal{R} + [v_{balance}] \cdot \mathcal{V}$$<p>The <strong>binding signature</strong> proves knowledge of $bsk = \sum rcv^{spend} - \sum rcv^{output}$, confirming balance.</p>
<h3 id="53-orchard-2021-present">5.3 Orchard (2021-Present)</h3>
<p>Orchard, activated with NU5 (May 2022), introduces Halo 2 and eliminates trusted setup requirements.</p>
<h4 id="action-based-design">Action-Based Design</h4>
<p>Orchard merges spends and outputs into <strong>Actions</strong>, each potentially containing one spend and one output:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>┌────────────────────────────────────────┐
</span></span><span style="display:flex;"><span>│            Action Description           │
</span></span><span style="display:flex;"><span>├────────────────────────────────────────┤
</span></span><span style="display:flex;"><span>│  Spend-side:          Output-side:     │
</span></span><span style="display:flex;"><span>│  ├─ nullifier         ├─ cm_x          │
</span></span><span style="display:flex;"><span>│  ├─ rk (randomized    ├─ ephemeral key │
</span></span><span style="display:flex;"><span>│  │   validating key)  ├─ encrypted note│
</span></span><span style="display:flex;"><span>│  └─ spend auth sig    └─ encrypted out │
</span></span><span style="display:flex;"><span>├────────────────────────────────────────┤
</span></span><span style="display:flex;"><span>│  Shared:                               │
</span></span><span style="display:flex;"><span>│  ├─ cv_net (net value commitment)      │
</span></span><span style="display:flex;"><span>│  └─ (proof aggregated separately)      │
</span></span><span style="display:flex;"><span>└────────────────────────────────────────┘
</span></span></code></pre></div><p><strong>Key difference</strong>: Each Action has a <strong>net value commitment</strong> (input value minus output value), rather than separate commitments. This provides additional privacy by hiding which Actions are &ldquo;mostly spends&rdquo; vs &ldquo;mostly outputs.&rdquo;</p>
<h4 id="halo-2-no-trusted-setup">Halo 2: No Trusted Setup</h4>
<p>The most significant change is the proving system. While BCTV14 and Groth16 require a <strong>trusted setup ceremony</strong> (where toxic waste must be destroyed), Halo 2 uses a <strong>transparent setup</strong>:</p>
<table>
  <thead>
      <tr>
          <th>Property</th>
          <th>Groth16</th>
          <th>Halo 2</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Trusted setup</td>
          <td>Required</td>
          <td><strong>Not required</strong></td>
      </tr>
      <tr>
          <td>Proof size</td>
          <td>192 bytes</td>
          <td>~5 KB base + ~2.3 KB per action</td>
      </tr>
      <tr>
          <td>Verification</td>
          <td>~6 ms</td>
          <td>~variable</td>
      </tr>
      <tr>
          <td>Quantum resistance</td>
          <td>None</td>
          <td>None</td>
      </tr>
      <tr>
          <td>Curve</td>
          <td>BLS12-381</td>
          <td>Pallas/Vesta</td>
      </tr>
  </tbody>
</table>
<h4 id="circuit-changes">Circuit Changes</h4>
<p>Orchard&rsquo;s Action circuit proves (for each Action):</p>
<ol>
<li>
<p><strong>Spend side</strong> (if enabled):</p>
<ul>
<li>Note exists in commitment tree with anchor $rt^{Orchard}$</li>
<li>Prover knows the spending key for the note</li>
<li>Nullifier computed correctly</li>
</ul>
</li>
<li>
<p><strong>Output side</strong> (if enabled):</p>
<ul>
<li>Note commitment computed correctly</li>
<li>Encrypted note matches commitment</li>
</ul>
</li>
<li>
<p><strong>Both</strong>:</p>
<ul>
<li>Net value commitment is correct: $cv_{net} = Commit(v_{spend} - v_{output})$</li>
</ul>
</li>
</ol>
<hr>
<h2 id="6-zero-knowledge-proof-systems">6. Zero-Knowledge Proof Systems</h2>
<h3 id="61-what-zk-snarks-prove">6.1 What zk-SNARKs Prove</h3>
<p>A zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) allows a prover to convince a verifier that:</p>
<ol>
<li>The prover knows a secret <strong>witness</strong> $w$</li>
<li>A public <strong>statement</strong> $x$ is true with respect to $w$</li>
<li><strong>Without revealing</strong> $w$</li>
</ol>
<p>Formally, for a relation $\mathcal{R}$:</p>
<ul>
<li>Prover has $(x, w)$ such that $(x, w) \in \mathcal{R}$</li>
<li>Verifier learns only that $\exists w: (x, w) \in \mathcal{R}$</li>
</ul>
<h3 id="62-security-properties">6.2 Security Properties</h3>
<p>Zcash&rsquo;s proving systems satisfy:</p>
<h4 id="completeness">Completeness</h4>
<p>An honest prover always convinces an honest verifier:</p>
$$\forall (x, w) \in \mathcal{R}: \Pr[Verify(vk, x, Prove(pk, x, w)) = 1] = 1$$<h4 id="knowledge-soundness">Knowledge Soundness</h4>
<p>A cheating prover cannot convince without knowing a valid witness:</p>
$$\forall \mathcal{A}: \Pr[Verify(vk, x, \pi) = 1 \land \nexists w: (x, w) \in \mathcal{R}] \approx 0$$<p>More precisely, there exists an <strong>extractor</strong> that can recover $w$ from any successful prover.</p>
<h4 id="statistical-zero-knowledge">Statistical Zero Knowledge</h4>
<p>Proofs reveal nothing beyond statement truth. There exists a simulator $\mathcal{S}$ producing indistinguishable &ldquo;fake&rdquo; proofs:</p>
$$\lbrace Prove(pk, x, w) \rbrace_{(x,w) \in \mathcal{R}} \approx \lbrace Simulate(x) \rbrace_{x}$$<h3 id="63-bctv14-sprout-pre-sapling">6.3 BCTV14 (Sprout, pre-Sapling)</h3>
<p>The original Zcash used BCTV14 [Ben-Sasson et al., 2014] with the BN-254 pairing curve.</p>
<p><strong>Characteristics:</strong></p>
<ul>
<li>Proof size: 296 bytes (8 group elements)</li>
<li>Verification: 3 pairings + multi-exponentiation</li>
<li>Trusted setup: Required (Powers of Tau + circuit-specific)</li>
</ul>
<p><strong>Security assumption</strong>: Hardness of the q-Power Knowledge of Exponent (q-PKE) assumption.</p>
<h3 id="64-groth16-sprout-post-sapling-sapling">6.4 Groth16 (Sprout post-Sapling, Sapling)</h3>
<p>Groth16 [Groth, 2016] replaced BCTV14 for improved efficiency:</p>
<p><strong>Proof structure:</strong></p>
$$\pi = (A, B, C) \in \mathbb{G}_1 \times \mathbb{G}_2 \times \mathbb{G}_1$$<p><strong>Verification equation:</strong></p>
$$e(A, B) = e(\alpha, \beta) \cdot e(L, \gamma) \cdot e(C, \delta)$$<p>Where:</p>
<ul>
<li>$e: \mathbb{G}_1 \times \mathbb{G}_2 \rightarrow \mathbb{G}_T$ is the pairing</li>
<li>$L$ encodes the public inputs</li>
<li>$\alpha, \beta, \gamma, \delta$ are from the trusted setup</li>
</ul>
<p><strong>Improvements over BCTV14:</strong></p>
<ul>
<li>Proof size: 192 bytes (3 group elements)</li>
<li>Verification: 3 pairings (more efficient)</li>
<li>Proving: ~3x faster</li>
</ul>
<p>Zcash uses Groth16 with <strong>BLS12-381</strong>, a pairing-friendly curve with 128-bit security.</p>
<h3 id="65-halo-2-orchard">6.5 Halo 2 (Orchard)</h3>
<p>Halo 2 [Bowe et al., 2019] is a recursive proof composition scheme using:</p>
<ol>
<li><strong>PLONKish arithmetization</strong>: More flexible than R1CS</li>
<li><strong>Polynomial commitment</strong>: Based on Inner Product Argument (IPA)</li>
<li><strong>Pasta curves</strong>: Pallas and Vesta (a 2-cycle for efficient recursion)</li>
</ol>
<h4 id="no-trusted-setup">No Trusted Setup</h4>
<p>The key breakthrough is replacing pairings with IPA:</p>
<ul>
<li>Pairings require structured reference strings (toxic waste)</li>
<li>IPA requires only a random group element (can be derived from hash)</li>
</ul>
<p><strong>Trade-off</strong>: Larger proofs (~5 KB base + ~2.3 KB per action, vs 192 bytes for Groth16), but:</p>
<ul>
<li>A single proof covers an entire bundle of actions (amortizing the base cost)</li>
<li>No trusted setup ceremony required</li>
<li>Enables future <strong>recursive proofs</strong> (proofs that verify other proofs)</li>
</ul>
<h3 id="66-circuit-sizes">6.6 Circuit Sizes</h3>
<table>
  <thead>
      <tr>
          <th>Circuit</th>
          <th>Constraints</th>
          <th>Purpose</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>JoinSplit (Sprout)</td>
          <td>~2,000,000</td>
          <td>2-in, 2-out transfer</td>
      </tr>
      <tr>
          <td>Spend (Sapling)</td>
          <td>~98,000</td>
          <td>Single spend</td>
      </tr>
      <tr>
          <td>Output (Sapling)</td>
          <td>~26,000</td>
          <td>Single output</td>
      </tr>
      <tr>
          <td>Action (Orchard)</td>
          <td>~variable</td>
          <td>Single action</td>
      </tr>
  </tbody>
</table>
<hr>
<h2 id="7-key-architecture-and-derivation">7. Key Architecture and Derivation</h2>
<h3 id="71-overview">7.1 Overview</h3>
<p>Zcash&rsquo;s key hierarchy enables flexible access control:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>                    ┌──────────────────┐
</span></span><span style="display:flex;"><span>                    │   Spending Key   │
</span></span><span style="display:flex;"><span>                    │       (sk)       │
</span></span><span style="display:flex;"><span>                    └────────┬─────────┘
</span></span><span style="display:flex;"><span>                             │
</span></span><span style="display:flex;"><span>            ┌────────────────┼────────────────┐
</span></span><span style="display:flex;"><span>            ▼                ▼                ▼
</span></span><span style="display:flex;"><span>    ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
</span></span><span style="display:flex;"><span>    │ Spend Auth Key│ │ Nullifier Key │ │  Outgoing VK  │
</span></span><span style="display:flex;"><span>    │    (ask)      │ │    (nsk/nk)   │ │    (ovk)      │
</span></span><span style="display:flex;"><span>    └───────┬───────┘ └───────┬───────┘ └───────────────┘
</span></span><span style="display:flex;"><span>            │                 │
</span></span><span style="display:flex;"><span>            ▼                 ▼
</span></span><span style="display:flex;"><span>    ┌───────────────┐ ┌───────────────┐
</span></span><span style="display:flex;"><span>    │ Spend Valid.  │ │  Nullifier    │
</span></span><span style="display:flex;"><span>    │  Key (ak)     │ │ Deriving Key  │
</span></span><span style="display:flex;"><span>    └───────┬───────┘ └───────┬───────┘
</span></span><span style="display:flex;"><span>            │                 │
</span></span><span style="display:flex;"><span>            └────────┬────────┘
</span></span><span style="display:flex;"><span>                     ▼
</span></span><span style="display:flex;"><span>            ┌───────────────────┐
</span></span><span style="display:flex;"><span>            │ Full Viewing Key  │
</span></span><span style="display:flex;"><span>            │   (ak, nk, ovk)   │
</span></span><span style="display:flex;"><span>            └────────┬──────────┘
</span></span><span style="display:flex;"><span>                     │
</span></span><span style="display:flex;"><span>                     ▼
</span></span><span style="display:flex;"><span>            ┌───────────────────┐
</span></span><span style="display:flex;"><span>            │ Incoming Viewing  │
</span></span><span style="display:flex;"><span>            │    Key (ivk)      │
</span></span><span style="display:flex;"><span>            └────────┬──────────┘
</span></span><span style="display:flex;"><span>                     │
</span></span><span style="display:flex;"><span>           ┌─────────┴──────────┐
</span></span><span style="display:flex;"><span>           │   + diversifier d  │
</span></span><span style="display:flex;"><span>           ▼                    ▼
</span></span><span style="display:flex;"><span>    ┌──────────────┐    ┌──────────────┐
</span></span><span style="display:flex;"><span>    │  Payment     │    │  Payment     │
</span></span><span style="display:flex;"><span>    │ Address (d₁) │    │ Address (d₂) │  ... (unlimited)
</span></span><span style="display:flex;"><span>    └──────────────┘    └──────────────┘
</span></span></code></pre></div><h3 id="72-sapling-key-derivation">7.2 Sapling Key Derivation</h3>
<p>Starting from a random spending key $sk \in \mathbb{B}^{256}$:</p>
<h4 id="expanded-spending-key">Expanded Spending Key</h4>
$$ask = ToScalar^{Sapling}(PRF^{expand}_{sk}([0x00]))$$$$nsk = ToScalar^{Sapling}(PRF^{expand}_{sk}([0x01]))$$$$ovk = truncate_{32}(PRF^{expand}_{sk}([0x02]))$$<p>Where $ToScalar^{Sapling}(x) = LEOS2IP_{512}(x) \mod r_{\mathbb{J}}$</p>
<h4 id="proof-authorizing-key">Proof Authorizing Key</h4>
$$ak = SpendAuthSig^{Sapling}.DerivePublic(ask) = [ask] \cdot \mathcal{P}^{Sapling}_{G}$$$$nk = [nsk] \cdot \mathcal{H}^{Sapling}$$<h4 id="incoming-viewing-key">Incoming Viewing Key</h4>
$$ivk = CRH^{ivk}(repr_{\mathbb{J}}(ak), repr_{\mathbb{J}}(nk))$$<p>Using BLAKE2s with parameter block modifications:</p>
$$ivk = BLAKE2s_{256}(\text{"Zcash\_ivk"}, ak \| nk) \mod 2^{251}$$<h4 id="diversified-payment-address">Diversified Payment Address</h4>
<p>For diversifier $d \in \mathbb{B}^{88}$:</p>
$$g_d = DiversifyHash^{Sapling}(d)$$$$pk_d = [ivk] \cdot g_d$$$$addr = (d, pk_d)$$<p>The diversifier is hashed to a curve point using:</p>
$$g_d = GroupHash^{\mathbb{J}}(\text{"Zcash\_gd"}, \text{"Zcash\_G\_"}, d)$$<p>If $g_d = \bot$ (not on curve), choose a different $d$.</p>
<h3 id="73-orchard-key-derivation">7.3 Orchard Key Derivation</h3>
<p>Orchard modifies the structure for Halo 2 compatibility:</p>
$$ask = ToScalar^{Orchard}(PRF^{expand}_{sk}([0x06]))$$$$nk = ToBase^{Orchard}(PRF^{expand}_{sk}([0x07]))$$$$rivk = ToScalar^{Orchard}(PRF^{expand}_{sk}([0x08]))$$<p>Where:</p>
<ul>
<li>$ToBase^{Orchard}(x) = LEOS2IP_{512}(x) \mod q_{\mathbb{P}}$</li>
<li>$ToScalar^{Orchard}(x) = LEOS2IP_{512}(x) \mod r_{\mathbb{P}}$</li>
</ul>
<h4 id="full-viewing-key">Full Viewing Key</h4>
$$ak = [ask] \cdot \mathcal{P}^{Orchard}_{G}$$$$fvk = (ak, nk, rivk)$$<h4 id="incoming-viewing-key-1">Incoming Viewing Key</h4>
$$dk = truncate_{32}(PRF^{expand}_{sk}([0x07]))$$$$ivk = Commit^{ivk}_{rivk}(ak, nk) \mod r_{\mathbb{P}}$$<h3 id="74-viewing-key-capabilities">7.4 Viewing Key Capabilities</h3>
<table>
  <thead>
      <tr>
          <th>Key Type</th>
          <th>Can View Incoming</th>
          <th>Can View Outgoing</th>
          <th>Can Spend</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Spending Key</td>
          <td>✓</td>
          <td>✓</td>
          <td>✓</td>
      </tr>
      <tr>
          <td>Full Viewing Key</td>
          <td>✓</td>
          <td>✓</td>
          <td>✗</td>
      </tr>
      <tr>
          <td>Incoming Viewing Key</td>
          <td>✓</td>
          <td>✗</td>
          <td>✗</td>
      </tr>
      <tr>
          <td>Payment Address</td>
          <td>✗</td>
          <td>✗</td>
          <td>✗</td>
      </tr>
  </tbody>
</table>
<p><strong>Use cases:</strong></p>
<ul>
<li><strong>Full Viewing Key</strong>: Auditors, tax compliance, business accounting</li>
<li><strong>Incoming Viewing Key</strong>: Watch-only wallets, payment verification</li>
<li><strong>Diversified Addresses</strong>: Unlinkable receiving addresses per payer</li>
</ul>
<hr>
<h2 id="8-unified-addresses-and-memo-fields">8. Unified Addresses and Memo Fields</h2>
<h3 id="81-unified-addresses-zip-316">8.1 Unified Addresses (ZIP 316)</h3>
<p>Introduced with NU5, <strong>Unified Addresses (UAs)</strong> solve a longstanding UX problem: users previously needed separate addresses for each pool (transparent, Sapling, Orchard), creating confusion and fragmentation.</p>
<p>A Unified Address encodes multiple <strong>receivers</strong> in a single address string:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>Unified Address
</span></span><span style="display:flex;"><span>┌───────────────────────────────────────────┐
</span></span><span style="display:flex;"><span>│  Orchard Receiver (preferred)             │
</span></span><span style="display:flex;"><span>│  Sapling Receiver (fallback)              │
</span></span><span style="display:flex;"><span>│  Transparent Receiver (optional fallback) │
</span></span><span style="display:flex;"><span>└───────────────────────────────────────────┘
</span></span></code></pre></div><p>When a sender creates a transaction to a UA, the wallet selects the most private receiver that both sender and recipient support. This means:</p>
<ul>
<li>If both parties support Orchard, the transaction uses Orchard (best privacy)</li>
<li>If the sender only supports Sapling, it falls back to the Sapling receiver</li>
<li>The transparent receiver is used only as a last resort</li>
</ul>
<p>UAs use the <strong>F4Jumble</strong> encoding algorithm to ensure that the address cannot be partially parsed, preventing wallets from selectively ignoring shielded receivers.</p>
<h3 id="82-encrypted-memo-fields">8.2 Encrypted Memo Fields</h3>
<p>Every shielded output includes a <strong>512-byte encrypted memo field</strong>, a distinctive feature not found in most other cryptocurrencies. The memo is encrypted alongside the note and is only visible to the recipient (or anyone with the appropriate viewing key).</p>
<p><strong>Common uses:</strong></p>
<ul>
<li>Payment references and invoice numbers</li>
<li>Return addresses for refunds</li>
<li>Encrypted messaging between parties</li>
<li>Compliance metadata (shared selectively via viewing keys)</li>
</ul>
<p><strong>Encryption layers:</strong></p>
<p>Each shielded output contains two encrypted components:</p>
<ol>
<li><strong>$C^{enc}$</strong> (encrypted to the recipient): Contains the note plaintext and memo, encrypted using the recipient&rsquo;s diversified transmission key via a KDF derived from Diffie-Hellman key agreement, then encrypted with ChaCha20-Poly1305 AEAD</li>
<li><strong>$C^{out}$</strong> (encrypted to the sender): Contains key material allowing the sender to decrypt the output later using their outgoing viewing key</li>
</ol>
<p>The key agreement uses the ephemeral secret key $esk$ and the recipient&rsquo;s $pk_d$:</p>
$$K^{enc} = KDF(DH(esk, pk_d), epk)$$<p>This design ensures forward secrecy: compromising $esk$ after the transaction is mined does not help an attacker, since $esk$ is ephemeral and discarded.</p>
<h3 id="83-zip-317-proportional-fee-mechanism">8.3 ZIP 317: Proportional Fee Mechanism</h3>
<p>Traditional Zcash used a flat fee of 1,000 zatoshis regardless of transaction complexity. ZIP 317 introduced a <strong>proportional fee model</strong> where the fee scales with the number of logical actions (inputs and outputs) in a transaction.</p>
<p>The conventional fee under ZIP 317 is:</p>
$$fee = max(marginal\_fee \cdot max(grace\_actions, logical\_actions), marginal\_fee)$$<p>Where $marginal\_fee = 5000$ zatoshis and $grace\_actions = 2$.</p>
<p>This prevents abuse by high-output transactions (previously, a transaction with 1,100 outputs paid the same fee as one with 2 outputs) while keeping simple transactions inexpensive. A standard two-action transaction pays 10,000 zatoshis (0.0001 ZEC).</p>
<hr>
<h2 id="9-cryptographic-building-blocks">9. Cryptographic Building Blocks</h2>
<h3 id="91-hash-functions">9.1 Hash Functions</h3>
<h4 id="sha-256-and-blake2">SHA-256 and BLAKE2</h4>
<p><strong>SHA-256</strong> (Sprout): Standard NIST hash</p>
$$H: \lbrace 0,1 \rbrace^{\ast} \rightarrow \lbrace 0,1 \rbrace^{256}$$<p><strong>BLAKE2b</strong> (Sapling): Personalized keyed hash</p>
$$BLAKE2b_{512}(\text{"Zcash\_..."}, x)$$<p><strong>BLAKE2s</strong> (Sapling): For shorter outputs</p>
$$BLAKE2s_{256}(\text{"Zcash\_..."}, x)$$<h4 id="pedersen-hash-sapling">Pedersen Hash (Sapling)</h4>
<p>Pedersen hashing maps bit strings to curve points:</p>
$$PedersenHash(D, M) = \sum_{i=0}^{n-1} [enc(m_i)] \cdot \mathcal{P}_{D,i}$$<p>Where:</p>
<ul>
<li>$M$ is split into 3-bit chunks $m_i$</li>
<li>$enc(m) = m - 4$ for $m \in \lbrace 0,\ldots,7 \rbrace$ (range $[-4, 3]$)</li>
<li>$\mathcal{P}_{D,i}$ are independent generator points</li>
</ul>
<p>The window structure uses 4 generators per segment:</p>
$$Segment_j = \sum_{k=0}^{c-1} [enc(m_{jc+k}) \cdot 2^{4k}] \cdot \mathcal{P}_{D,j}$$<h4 id="sinsemilla-hash-orchard">Sinsemilla Hash (Orchard)</h4>
<p>Sinsemilla is optimized for circuit efficiency using incomplete addition:</p>
$$SinsemillaHash(D, M) = Q + \sum_{i=0}^{n-1} hash\_to\_curve(m_i)$$<p>Where:</p>
<ul>
<li>$M$ is split into 10-bit chunks</li>
<li>Each chunk indexes into a precomputed table of curve points</li>
<li>$Q$ is a domain-specific generator</li>
</ul>
<p><strong>Advantage</strong>: No complete addition required in-circuit, reducing constraints.</p>
<h4 id="poseidon-hash-orchard">Poseidon Hash (Orchard)</h4>
<p>Poseidon is an algebraic hash optimized for zkSNARKs:</p>
$$Poseidon_{width}(x_1, \ldots, x_w) = ARK \circ S \circ MDS \circ \ldots \circ ARK(x_1, \ldots, x_w)$$<p>Where:</p>
<ul>
<li>ARK: Add Round Key (constants)</li>
<li>S: S-box ($x \mapsto x^5$)</li>
<li>MDS: Maximum Distance Separable mixing matrix</li>
</ul>
<p>Orchard uses Poseidon for PRF operations where algebraic structure is advantageous.</p>
<h3 id="92-elliptic-curves">9.2 Elliptic Curves</h3>
<h4 id="bn-254-sprout">BN-254 (Sprout)</h4>
<p>A pairing-friendly curve with embedding degree 12:</p>
$$y^2 = x^3 + 3$$<p>Over $\mathbb{F}_p$ where $p$ is a 254-bit prime.</p>
<p><strong>Security note</strong>: BN-254 provides approximately 100 bits of security due to advances in discrete log attacks on pairing curves (notably the Kim-Barbulescu attack). This reduced security margin, combined with the deprecated status of the Sprout protocol, means that <strong>modern wallets like Zashi effectively quarantine Sprout funds</strong>. Users are strongly encouraged to migrate any remaining Sprout ZEC to Sapling or Orchard pools.</p>
<h4 id="bls12-381-sapling">BLS12-381 (Sapling)</h4>
<p>A more secure pairing curve:</p>
$$E: y^2 = x^3 + 4$$<p>Parameters:</p>
<ul>
<li>$p$: 381-bit prime</li>
<li>$r$: 255-bit subgroup order</li>
<li>Security: ~128 bits</li>
</ul>
<h4 id="jubjub-sapling">Jubjub (Sapling)</h4>
<p>A twisted Edwards curve embedded in BLS12-381&rsquo;s scalar field:</p>
$$-u^2 + v^2 = 1 + d \cdot u^2 \cdot v^2$$<p>Where $d = -(10240/10241)$ over $\mathbb{F}_r$ (BLS12-381 scalar field).</p>
<p><strong>Properties:</strong></p>
<ul>
<li>Complete addition formula (no exceptional cases)</li>
<li>Efficient in-circuit arithmetic</li>
<li>Cofactor $h = 8$</li>
</ul>
<h4 id="pallas-and-vesta-orchard">Pallas and Vesta (Orchard)</h4>
<p>A <strong>2-cycle</strong> of curves for recursive proofs:</p>
<p><strong>Pallas</strong> (primary):</p>
$$E_p: y^2 = x^3 + 5$$<p> over $\mathbb{F}_p$</p>
<p><strong>Vesta</strong>:</p>
$$E_q: y^2 = x^3 + 5$$<p> over $\mathbb{F}_q$</p>
<p>Where $q = r_p$ (Vesta&rsquo;s base field = Pallas&rsquo;s scalar field) and vice versa.</p>
<p>This cycle enables <strong>recursive composition</strong>: a Pallas proof can verify a Vesta proof, and vice versa.</p>
<h3 id="93-commitment-schemes">9.3 Commitment Schemes</h3>
<h4 id="windowed-pedersen-commitment-sapling">Windowed Pedersen Commitment (Sapling)</h4>
$$Commit_r(x) = [r] \cdot \mathcal{H} + PedersenHash(D, x)$$<p><strong>Properties:</strong></p>
<ul>
<li>Computationally hiding (under DLog assumption)</li>
<li>Perfectly binding</li>
<li>Homomorphic: $Commit_r(x) + Commit_s(y) = Commit_{r+s}(x+y)$</li>
</ul>
<h4 id="sinsemilla-commitment-orchard">Sinsemilla Commitment (Orchard)</h4>
$$SinsemillaCommit_r(D, M) = SinsemillaHash(D, M) + [r] \cdot \mathcal{R}$$<h3 id="94-signature-schemes">9.4 Signature Schemes</h3>
<h4 id="reddsa-saplingorchard">RedDSA (Sapling/Orchard)</h4>
<p>A Schnorr-based signature with re-randomizable keys:</p>
<p><strong>Key Generation:</strong></p>
$$sk \leftarrow \lbrace 1, \ldots, r-1 \rbrace$$$$pk = [sk] \cdot \mathcal{B}$$<p><strong>Signing:</strong></p>
$$T \leftarrow random()$$$$r = H(T \| pk \| M)$$$$R = [r] \cdot \mathcal{B}$$$$S = r + H(R \| pk \| M) \cdot sk$$$$\sigma = (R, S)$$<p><strong>Verification:</strong></p>
$$[S] \cdot \mathcal{B} \stackrel{?}{=} R + [H(R \| pk \| M)] \cdot pk$$<p><strong>Re-randomization:</strong></p>
<p>For randomizer $\alpha$:</p>
$$pk' = pk + [\alpha] \cdot \mathcal{B}$$$$sk' = sk + \alpha$$<p>This enables <strong>spend authorization signatures</strong> that cannot be linked to the original key.</p>
<hr>
<h2 id="10-transaction-structure-and-validation">10. Transaction Structure and Validation</h2>
<h3 id="101-transaction-versions">10.1 Transaction Versions</h3>
<table>
  <thead>
      <tr>
          <th>Version</th>
          <th>Introduced</th>
          <th>Features</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>1</td>
          <td>Bitcoin</td>
          <td>Transparent only</td>
      </tr>
      <tr>
          <td>2</td>
          <td>Zcash launch</td>
          <td>+ JoinSplit (Sprout)</td>
      </tr>
      <tr>
          <td>3</td>
          <td>Overwinter</td>
          <td>+ expiry height, version group</td>
      </tr>
      <tr>
          <td>4</td>
          <td>Sapling</td>
          <td>+ Spend/Output descriptions</td>
      </tr>
      <tr>
          <td>5</td>
          <td>NU5</td>
          <td>+ Action descriptions, nonmalleable txid</td>
      </tr>
  </tbody>
</table>
<h3 id="102-version-5-transaction-structure">10.2 Version 5 Transaction Structure</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>Transaction v5:
</span></span><span style="display:flex;"><span>├── header (4 bytes)
</span></span><span style="display:flex;"><span>│   ├── version (4 bits) = 5
</span></span><span style="display:flex;"><span>│   └── overwintered flag (1 bit) = 1
</span></span><span style="display:flex;"><span>├── nVersionGroupId (4 bytes)
</span></span><span style="display:flex;"><span>├── nConsensusBranchId (4 bytes)
</span></span><span style="display:flex;"><span>├── nLockTime (4 bytes)
</span></span><span style="display:flex;"><span>├── nExpiryHeight (4 bytes)
</span></span><span style="display:flex;"><span>├── Transparent Bundle
</span></span><span style="display:flex;"><span>│   ├── tx_in_count (compactSize)
</span></span><span style="display:flex;"><span>│   ├── tx_in[] 
</span></span><span style="display:flex;"><span>│   ├── tx_out_count (compactSize)
</span></span><span style="display:flex;"><span>│   └── tx_out[]
</span></span><span style="display:flex;"><span>├── Sapling Bundle
</span></span><span style="display:flex;"><span>│   ├── nSpendsSapling (compactSize)
</span></span><span style="display:flex;"><span>│   ├── vSpendsSapling[]
</span></span><span style="display:flex;"><span>│   ├── nOutputsSapling (compactSize)
</span></span><span style="display:flex;"><span>│   ├── vOutputsSapling[]
</span></span><span style="display:flex;"><span>│   ├── valueBalanceSapling (int64)
</span></span><span style="display:flex;"><span>│   ├── anchorSapling (32 bytes)
</span></span><span style="display:flex;"><span>│   ├── vSpendProofsSapling[]
</span></span><span style="display:flex;"><span>│   ├── vSpendAuthSigsSapling[]
</span></span><span style="display:flex;"><span>│   ├── vOutputProofsSapling[]
</span></span><span style="display:flex;"><span>│   └── bindingSigSapling (64 bytes)
</span></span><span style="display:flex;"><span>└── Orchard Bundle
</span></span><span style="display:flex;"><span>    ├── nActionsOrchard (compactSize)
</span></span><span style="display:flex;"><span>    ├── vActionsOrchard[]
</span></span><span style="display:flex;"><span>    ├── flagsOrchard (1 byte)
</span></span><span style="display:flex;"><span>    ├── valueBalanceOrchard (int64)
</span></span><span style="display:flex;"><span>    ├── anchorOrchard (32 bytes)
</span></span><span style="display:flex;"><span>    ├── sizeProofsOrchard (compactSize)
</span></span><span style="display:flex;"><span>    ├── proofsOrchard[]
</span></span><span style="display:flex;"><span>    └── bindingSigOrchard (64 bytes)
</span></span></code></pre></div><h3 id="103-consensus-rules">10.3 Consensus Rules</h3>
<h4 id="general-rules">General Rules</h4>
<ol>
<li><strong>Encoding validity</strong>: All fields must be valid encodings</li>
<li><strong>No overflow</strong>: Sum of inputs cannot exceed MAX_MONEY</li>
<li><strong>Positive value balance</strong>: Transparent pool cannot go negative</li>
<li><strong>Expiry</strong>: Transaction must be mined before nExpiryHeight</li>
</ol>
<h4 id="shielded-rules">Shielded Rules</h4>
<ol>
<li><strong>Anchor validity</strong>: Must reference a previous block&rsquo;s treestate</li>
<li><strong>Nullifier uniqueness</strong>: No nullifier already in the set</li>
<li><strong>Proof validity</strong>: All zk-SNARK proofs must verify</li>
<li><strong>Signature validity</strong>: All spend auth and binding signatures must verify</li>
<li><strong>Value balance</strong>: Commitments must balance with transparent change</li>
</ol>
<h3 id="104-sighash-algorithm">10.4 SIGHASH Algorithm</h3>
<p>Transaction authorization requires binding signatures to specific transactions. The SIGHASH algorithm creates a digest covering:</p>
<p><strong>Version 5 (NU5+):</strong></p>
<p>Using BLAKE2b-256 with personalization (per ZIP 244):</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>SIGHASH = BLAKE2b-256(&#34;ZcashTxHash_V5&#34;, 
</span></span><span style="display:flex;"><span>    header_digest ||
</span></span><span style="display:flex;"><span>    transparent_digest ||
</span></span><span style="display:flex;"><span>    sapling_digest ||
</span></span><span style="display:flex;"><span>    orchard_digest
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><p>Each sub-digest covers specific transaction components, providing flexibility for partial signing while preventing malleability.</p>
<hr>
<h2 id="11-security-analysis">11. Security Analysis</h2>
<h3 id="111-cryptographic-assumptions">11.1 Cryptographic Assumptions</h3>
<p>Zcash security relies on:</p>
<table>
  <thead>
      <tr>
          <th>Assumption</th>
          <th>Used For</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Discrete Log (DL)</td>
          <td>Pedersen commitments, signatures</td>
      </tr>
      <tr>
          <td>Collision Resistance</td>
          <td>Hash functions, Merkle trees</td>
      </tr>
      <tr>
          <td>PRF Security</td>
          <td>Key derivation, nullifiers</td>
      </tr>
      <tr>
          <td>Knowledge of Exponent</td>
          <td>zk-SNARKs (BCTV14, Groth16)</td>
      </tr>
      <tr>
          <td>Algebraic Group Model</td>
          <td>Halo 2 soundness</td>
      </tr>
  </tbody>
</table>
<h3 id="112-historical-vulnerabilities">11.2 Historical Vulnerabilities</h3>
<h4 id="faerie-gold-attack-fixed-pre-launch">Faerie Gold Attack (Fixed pre-launch)</h4>
<p><strong>Vulnerability</strong>: In original Zerocash, the uniqueness of nullifiers wasn&rsquo;t enforced correctly, allowing potential creation of notes that multiple parties could spend.</p>
<p><strong>Fix</strong>: Modified nullifier computation to include the spending key:</p>
$$nf = PRF_{a_{sk}}^{nf}(\rho)$$<p>This ensures only the legitimate recipient can compute the valid nullifier.</p>
<h4 id="internalh-collision-attack-fixed-pre-launch">InternalH Collision Attack (Fixed pre-launch)</h4>
<p><strong>Vulnerability</strong>: Potential hash collisions in internal circuit operations could allow proof forgery.</p>
<p><strong>Fix</strong>: Added domain separation and uniqueness constraints in the circuit.</p>
<h4 id="value-overflow-fixed-2018">Value Overflow (Fixed 2018)</h4>
<p><strong>Vulnerability</strong>: CVE-2018-17144 (inherited from Bitcoin) allowed inflation through duplicate transaction processing.</p>
<p><strong>Fix</strong>: Enhanced duplicate detection in transaction validation.</p>
<h3 id="113-trusted-setup-considerations">11.3 Trusted Setup Considerations</h3>
<p><strong>BCTV14/Groth16 Requirement:</strong></p>
<p>The proving/verifying keys contain:</p>
$$pk = (g^{\alpha}, g^{\beta}, \ldots, g^{\tau^d})$$<p>Where $\tau$ (the &ldquo;toxic waste&rdquo;) must be destroyed. If any party knows $\tau$, they can forge proofs and create counterfeit ZEC.</p>
<p><strong>Zcash Ceremonies:</strong></p>
<ol>
<li><strong>Sprout</strong> (2016): 6 participants</li>
<li><strong>Powers of Tau</strong> (2017-2018): 87 participants</li>
<li><strong>Sapling MPC</strong> (2018): 100+ participants</li>
</ol>
<p>Security requires that at least one participant honestly destroyed their contribution.</p>
<p><strong>Halo 2 Elimination:</strong></p>
<p>Orchard&rsquo;s Halo 2 requires no trusted setup. The &ldquo;setup&rdquo; is just a hash of a random string, publicly verifiable.</p>
<h3 id="114-privacy-limitations">11.4 Privacy Limitations</h3>
<h4 id="timing-analysis">Timing Analysis</h4>
<p>Transaction timing patterns can leak information:</p>
<ul>
<li>Regular payment schedules → behavioral fingerprinting</li>
<li>Immediate spend after receipt → linking in/out transactions</li>
</ul>
<h4 id="amount-correlation">Amount Correlation</h4>
<p>When moving between transparent and shielded:</p>
<ul>
<li>Unique amounts are linkable</li>
<li>Round numbers may indicate user behavior</li>
</ul>
<h4 id="graph-analysis">Graph Analysis</h4>
<p>Transaction graph heuristics can narrow anonymity sets:</p>
<ul>
<li>One-input-one-output transactions</li>
<li>Change output patterns</li>
<li>Pool transitions</li>
</ul>
<h4 id="metadata-leakage">Metadata Leakage</h4>
<p>Non-transaction data may deanonymize:</p>
<ul>
<li>IP addresses during broadcast</li>
<li>Timing of wallet connections</li>
<li>Exchange deposit/withdrawal records</li>
</ul>
<h3 id="115-quantum-considerations">11.5 Quantum Considerations</h3>
<p>Current Zcash is <strong>not quantum-resistant</strong>:</p>
<table>
  <thead>
      <tr>
          <th>Component</th>
          <th>Quantum Attack</th>
          <th>Impact</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>ECDSA (transparent)</td>
          <td>Shor&rsquo;s algorithm</td>
          <td>Funds theft</td>
      </tr>
      <tr>
          <td>Pedersen commitments</td>
          <td>Shor&rsquo;s algorithm</td>
          <td>Commitment opening</td>
      </tr>
      <tr>
          <td>zk-SNARKs</td>
          <td>Varies</td>
          <td>Proof forgery</td>
      </tr>
      <tr>
          <td>Hash functions</td>
          <td>Grover&rsquo;s algorithm</td>
          <td>Reduced security</td>
      </tr>
  </tbody>
</table>
<p>The Zcash community is researching post-quantum alternatives, including lattice-based commitments and hash-based signatures.</p>
<hr>
<h2 id="12-network-upgrades">12. Network Upgrades</h2>
<h3 id="121-upgrade-history">12.1 Upgrade History</h3>
<table>
  <thead>
      <tr>
          <th>Upgrade</th>
          <th>Height</th>
          <th>Date</th>
          <th>Key Changes</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Sprout</strong></td>
          <td>0</td>
          <td>Oct 2016</td>
          <td>Initial launch</td>
      </tr>
      <tr>
          <td><strong>Overwinter</strong></td>
          <td>347,500</td>
          <td>Jun 2018</td>
          <td>Transaction versioning, replay protection</td>
      </tr>
      <tr>
          <td><strong>Sapling</strong></td>
          <td>419,200</td>
          <td>Oct 2018</td>
          <td>New shielded protocol, Groth16</td>
      </tr>
      <tr>
          <td><strong>Blossom</strong></td>
          <td>653,600</td>
          <td>Dec 2019</td>
          <td>75s block time</td>
      </tr>
      <tr>
          <td><strong>Heartwood</strong></td>
          <td>903,000</td>
          <td>Jul 2020</td>
          <td>Shielded coinbase, ZIP-221</td>
      </tr>
      <tr>
          <td><strong>Canopy</strong></td>
          <td>1,046,400</td>
          <td>Nov 2020</td>
          <td>Dev fund, deprecate Sprout</td>
      </tr>
      <tr>
          <td><strong>NU5</strong></td>
          <td>1,687,104</td>
          <td>May 2022</td>
          <td>Orchard, Halo 2, unified addresses</td>
      </tr>
      <tr>
          <td><strong>NU6</strong></td>
          <td>2,726,400</td>
          <td>Nov 2024</td>
          <td>Lockbox (ZIP 2001), second halving, new funding model</td>
      </tr>
      <tr>
          <td><strong>NU6.1</strong></td>
          <td>3,146,400</td>
          <td>Nov 2025</td>
          <td>ZIP 1016 C&amp;C funding model, v5 default transactions, Orchard balance fixes</td>
      </tr>
  </tbody>
</table>
<p>NU6 marked a significant milestone, coinciding with the second Zcash halving (block reward reduced from 3.125 ZEC to 1.5625 ZEC) and the expiration of the original Dev Fund. The Lockbox mechanism (ZIP 2001) accumulates 20% of block rewards. NU6.1 subsequently introduced the Community and Coinholder (C&amp;C) funding model via ZIP 1016, which preserves 8% for Zcash Community Grants and directs the remaining 12% to the protocol-controlled Lockbox for future decentralized distribution.</p>
<h3 id="122-upgrade-mechanism">12.2 Upgrade Mechanism</h3>
<p>Zcash uses <strong>coordinated network upgrades</strong>:</p>
<ol>
<li>Specification published as ZIPs (Zcash Improvement Proposals)</li>
<li>Implementation in reference client (zcashd/zebra)</li>
<li>Activation at predetermined block height</li>
<li>Old transaction formats remain valid (backward compatibility)</li>
</ol>
<h3 id="123-future-directions">12.3 Future Directions</h3>
<p>The Zcash ecosystem continues active development across multiple organizations. Key initiatives for 2025 and beyond include:</p>
<h4 id="crosslink-hybrid-consensus">Crosslink (Hybrid Consensus)</h4>
<p>The most significant architectural change under development is <strong>Crosslink</strong>, led by Shielded Labs. This proposed upgrade introduces a <strong>finality layer atop Proof-of-Work</strong>:</p>
<ul>
<li><strong>Mechanism</strong>: Validators stake ZEC to participate in block finalization</li>
<li><strong>Security</strong>: Mitigates 51% attacks by requiring both PoW and stake-weighted consensus</li>
<li><strong>Finality</strong>: Enables faster &ldquo;safe&rdquo; transaction acceptance without waiting for deep confirmations</li>
<li><strong>Timeline</strong>: Active development; testnet deployment expected in 2026</li>
</ul>
<p>Crosslink represents Zcash&rsquo;s path toward hybrid PoW/PoS, addressing long-standing concerns about mining centralization and network security.</p>
<h4 id="zcash-shielded-assets-zsa">Zcash Shielded Assets (ZSA)</h4>
<p>ZSA would enable <strong>user-defined tokens</strong> within shielded pools, extending Zcash&rsquo;s privacy guarantees to arbitrary assets. Developed by QEDIT and funded by Zcash Community Grants:</p>
<ul>
<li><strong>ZIP 226</strong>: Transfer and burn mechanics for shielded assets within the Orchard pool</li>
<li><strong>ZIP 227</strong>: Issuance protocol with issuer key pairs and transparent supply tracking</li>
<li><strong>Status</strong>: Audited and live on testnet; candidate for inclusion in NU7, though community debate continues over scope</li>
<li><strong>Use cases</strong>: Stablecoins, NFTs, wrapped assets, all with Zcash-grade privacy</li>
</ul>
<h4 id="frost-threshold-signatures">FROST Threshold Signatures</h4>
<p>The Zcash Foundation has released a production-ready implementation of <strong>FROST (Flexible Round-Optimized Schnorr Threshold signatures)</strong>, enabling $t$-of-$n$ multisignature schemes for Zcash shielded transactions (ZIP 312). FROST allows a group of participants to collaboratively sign transactions without any single party holding the complete spending key, using only two communication rounds.</p>
<p>Because Zcash already uses Schnorr-based signatures (RedDSA) for spend authorization, FROST integrates naturally with the existing key architecture. The re-randomization property of RedDSA is preserved through FROST&rsquo;s rerandomized variant, maintaining unlinkability of spend authorization signatures.</p>
<h4 id="sprout-pool-removal-nu7">Sprout Pool Removal (NU7)</h4>
<p>The upcoming NU7 network upgrade is expected to fully deprecate the Sprout pool by disallowing v4 transactions (only v5 and later will be supported). Any remaining Sprout funds will be burned at the activation height. Users with Sprout ZEC should migrate to Sapling or Orchard before NU7 activation.</p>
<h4 id="post-quantum-migration">Post-Quantum Migration</h4>
<p>Current Zcash cryptography (ECDSA, Pedersen commitments, zk-SNARKs) is vulnerable to quantum attacks. Research areas include:</p>
<ul>
<li><strong>Lattice-based commitments</strong>: Replacing Pedersen with quantum-resistant alternatives</li>
<li><strong>Hash-based signatures</strong>: SPHINCS+ or similar for spending authorization</li>
<li><strong>Timeline</strong>: Long-term research; no immediate threat from current quantum computers</li>
</ul>
<h4 id="recursive-proof-composition">Recursive Proof Composition</h4>
<p>Halo 2&rsquo;s architecture enables proofs that verify other proofs, opening possibilities for:</p>
<ul>
<li><strong>Transaction aggregation</strong>: Batching many transactions into single proofs</li>
<li><strong>Light client efficiency</strong>: Compact proofs of chain validity</li>
<li><strong>Cross-chain bridges</strong>: Trustless verification of Zcash state on other chains</li>
</ul>
<hr>
<h2 id="13-conclusion">13. Conclusion</h2>
<h3 id="131-summary">13.1 Summary</h3>
<p>Zcash represents the state of the art in blockchain privacy, implementing zero-knowledge proofs at scale to provide:</p>
<ul>
<li><strong>Unconditional anonymity</strong>: Transaction details hidden by cryptographic proofs</li>
<li><strong>Selective disclosure</strong>: Viewing keys enable controlled transparency</li>
<li><strong>Strong fungibility</strong>: All shielded ZEC are cryptographically identical</li>
<li><strong>Decentralized trust</strong>: No trusted parties required for transaction validation</li>
</ul>
<p>The evolution from Sprout to Sapling to Orchard demonstrates continuous improvement in efficiency, security, and usability, culminating in Halo 2&rsquo;s elimination of trusted setup requirements. With NU6&rsquo;s activation in late 2024 and ongoing NU6.1 refinements, the protocol continues to mature.</p>
<h3 id="132-privacy-in-context">13.2 Privacy in Context</h3>
<p>Zcash exists within a broader ecosystem:</p>
<ul>
<li>Complements transparent cryptocurrencies for privacy-sensitive use cases</li>
<li>Enables legitimate financial privacy (competitive confidentiality, personal security)</li>
<li>Provides a research platform for zero-knowledge cryptography</li>
<li>Demonstrates that privacy and auditability can coexist (viewing keys)</li>
</ul>
<p>The multi-organization structure (ECC, Zcash Foundation, Shielded Labs) ensures resilience and diverse perspectives on protocol evolution.</p>
<h3 id="133-looking-forward">13.3 Looking Forward</h3>
<p>The Zcash protocol stands at an inflection point. Key developments to watch:</p>
<ul>
<li><strong>Crosslink</strong>: The proposed hybrid PoW/PoS system addresses 51% attack concerns and could fundamentally change Zcash&rsquo;s consensus model</li>
<li><strong>ZSA (Zcash Shielded Assets)</strong>: User-defined tokens with full privacy would expand Zcash&rsquo;s utility beyond simple value transfer</li>
<li><strong>FROST multisignatures</strong>: Production-ready threshold signatures enable institutional custody and multisig workflows for shielded transactions</li>
<li><strong>Sprout removal (NU7)</strong>: Full deprecation of the legacy Sprout pool simplifies the protocol and removes the weakest cryptographic link</li>
<li><strong>zcashd to Zebra migration</strong>: The transition from zcashd to Zebra (Rust) and Zallet improves code quality and long-term maintainability</li>
<li><strong>Continued decentralization</strong>: The C&amp;C funding model and Lockbox mechanism aim to reduce reliance on any single organization</li>
<li><strong>Post-quantum preparedness</strong>: Long-term research ensures Zcash remains secure against emerging threats</li>
</ul>
<p>As privacy becomes increasingly valuable in digital economies, Zcash&rsquo;s cryptographic foundations provide a blueprint for financial systems that respect user sovereignty without sacrificing security guarantees.</p>
<hr>
<h2 id="references">References</h2>
<ol>
<li>
<p>Ben-Sasson, E., Chiesa, A., Garman, C., Green, M., Miers, I., Tromer, E., &amp; Virza, M. (2014). <em>Zerocash: Decentralized Anonymous Payments from Bitcoin</em>. IEEE Symposium on Security and Privacy.</p>
</li>
<li>
<p>Hopwood, D., Bowe, S., Hornby, T., &amp; Wilcox, N. (2025). <em>Zcash Protocol Specification</em>. Version 2025.6.3 [NU6.1].</p>
</li>
<li>
<p>Groth, J. (2016). <em>On the Size of Pairing-Based Non-interactive Arguments</em>. EUROCRYPT 2016.</p>
</li>
<li>
<p>Bowe, S., Grigg, J., &amp; Hopwood, D. (2019). <em>Recursive Proof Composition without a Trusted Setup</em>.</p>
</li>
<li>
<p>Electric Coin Company. <em>Zcash Improvement Proposals (ZIPs)</em>. <a href="https://zips.z.cash">https://zips.z.cash</a></p>
</li>
<li>
<p>Komlo, C., &amp; Goldberg, I. (2020). <em>FROST: Flexible Round-Optimized Schnorr Threshold Signatures</em>. Selected Areas in Cryptography (SAC).</p>
</li>
<li>
<p>Nakamoto, S. (2008). <em>Bitcoin: A Peer-to-Peer Electronic Cash System</em>.</p>
</li>
</ol>
<hr>
<h2 id="appendix-a-mathematical-notation-reference">Appendix A: Mathematical Notation Reference</h2>
<table>
  <thead>
      <tr>
          <th>Symbol</th>
          <th>Meaning</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>$\mathbb{B}$</td>
          <td>Bit values $\lbrace 0, 1 \rbrace$</td>
      </tr>
      <tr>
          <td>$\mathbb{B}^n$</td>
          <td>Bit sequences of length $n$</td>
      </tr>
      <tr>
          <td>$\mathbb{F}_p$</td>
          <td>Finite field with $p$ elements</td>
      </tr>
      <tr>
          <td>$\mathbb{G}$</td>
          <td>Elliptic curve group</td>
      </tr>
      <tr>
          <td>$[k] \cdot P$</td>
          <td>Scalar multiplication: $P + P + \ldots + P$ ($k$ times)</td>
      </tr>
      <tr>
          <td>$e(P, Q)$</td>
          <td>Pairing function</td>
      </tr>
      <tr>
          <td>$\mathcal{O}$</td>
          <td>Point at infinity (group identity)</td>
      </tr>
      <tr>
          <td>$r$</td>
          <td>Subgroup order</td>
      </tr>
      <tr>
          <td>$h$</td>
          <td>Cofactor</td>
      </tr>
      <tr>
          <td>$\oplus$</td>
          <td>XOR operation</td>
      </tr>
      <tr>
          <td>$\|$</td>
          <td>Concatenation</td>
      </tr>
      <tr>
          <td>$\leftarrow$</td>
          <td>Random sampling</td>
      </tr>
      <tr>
          <td>$:=$</td>
          <td>Definition</td>
      </tr>
  </tbody>
</table>
<h2 id="appendix-b-glossary">Appendix B: Glossary</h2>
<p><strong>Action</strong>: Orchard&rsquo;s combined spend/output operation</p>
<p><strong>Anchor</strong>: Merkle root identifying a treestate</p>
<p><strong>Binding Signature</strong>: Proves transaction value balance</p>
<p><strong>Chain Value Pool</strong>: Total value in a transaction type</p>
<p><strong>Commitment</strong>: Cryptographic hiding of note contents</p>
<p><strong>Diversifier</strong>: Randomness enabling multiple addresses per key</p>
<p><strong>Full Viewing Key</strong>: Enables viewing incoming and outgoing transactions</p>
<p><strong>JoinSplit</strong>: Sprout&rsquo;s atomic spend/create operation</p>
<p><strong>Note</strong>: Shielded representation of value</p>
<p><strong>Nullifier</strong>: Unique identifier revealed when spending</p>
<p><strong>Proving Key</strong>: Secret parameters for proof generation</p>
<p><strong>Shielded Pool</strong>: Aggregated private value in a protocol</p>
<p><strong>Spend Authority</strong>: Ability to transfer value</p>
<p><strong>Treestate</strong>: State of commitment tree and nullifier set</p>
<p><strong>Verifying Key</strong>: Public parameters for proof verification</p>
<p><strong>Viewing Key</strong>: Key enabling transaction visibility without spend authority</p>
<p><strong>zk-SNARK</strong>: Zero-Knowledge Succinct Non-interactive Argument of Knowledge</p>
<hr>
<p><em>This analysis was prepared based on the Zcash Protocol Specification Version 2025.6.3 [NU6.1]. For the authoritative protocol definition, consult the official specification maintained at <a href="https://zips.z.cash">zips.z.cash</a>. For implementation details, refer to Zebra (Zcash Foundation), Zashi wallet (ECC), and Zallet.</em></p>
]]></content>
      </entry>

</feed>
