Module sapling

Source
Expand description

§Sapling Protocol Components

The Sapling protocol is the second-generation shielded protocol in Zcash, introduced in the Sapling network upgrade (October 2018). It significantly improved upon the original Sprout protocol with better performance, security features, and usability.

This module contains types that represent various components of the Sapling protocol within the ZeWIF wallet interchange format, including:

§Key Components

  • [SaplingExpandedSpendingKey]: Core cryptographic components of a Sapling spending key (ask, nsk, ovk)
  • SaplingExtendedSpendingKey: Hierarchical deterministic key structure for Sapling according to ZIP-32
  • SaplingIncomingViewingKey: Key for detecting and viewing incoming transactions only
  • [SaplingSpendingKey]: Spending authority for Sapling addresses

§Transaction Components

  • SaplingWitness: Cryptographic witness proving a note commitment exists in the tree
  • SaplingSentOutput: Sender’s record of note data for outgoing transactions

§Protocol Characteristics

Sapling introduced significant improvements over the earlier Sprout protocol:

  • Performance: Much faster proving times (~7 seconds vs ~40 seconds in Sprout)
  • Key Separation: Full viewing keys that don’t reveal spending capability
  • HD Wallet Support: ZIP-32 hierarchical deterministic key derivation
  • Decoupled Spend/Output: Separated spend and output descriptions (unlike Sprout’s JoinSplits)

These types collectively enable the migration of Sapling shielded data between different Zcash wallet implementations while preserving all cryptographic capabilities.

Structs§

Address
A Zcash Sapling address and associated key data.
MerkleHashSapling
A node in the Sapling note commitment tree.
SaplingExtendedFullViewingKey
A Sapling Extended Full Viewing Key, encoded as specified in ZIP 32
SaplingExtendedSpendingKey
A Sapling Extended Spending Key, encoded as specified in ZIP 32
SaplingIncomingViewingKey
A Sapling Incoming Viewing Key (IVK), which allows detection and decryption of incoming transactions to a Sapling shielded address.
SaplingSentOutput
Represents a sent output in a Sapling shielded transaction within a Zcash wallet.
SaplingWitness
A cryptographic witness proving that a Sapling note commitment exists in the note commitment tree.