Expand description
Implementation of Zcash consensus checks.
More specifically, this crate implements semantic validity checks, as defined below.
§Verification levels.
Zebra’s implementation of the Zcash consensus rules is oriented around three telescoping notions of validity:
-
Structural Validity, or whether the format and structure of the object are valid. For instance, Sprout-on-BCTV14 proofs are not allowed in version 4 transactions, and a transaction with a spend or output description must include a binding signature.
-
Semantic Validity, or whether the object could potentially be valid, depending on the chain state. For instance, a transaction that spends a UTXO must supply a valid unlock script; a shielded transaction must have valid proofs, etc.
-
Contextual Validity, or whether a semantically valid transaction is actually valid in the context of a particular chain state. For instance, a transaction that spends a UTXO is only valid if the UTXO remains unspent; a shielded transaction spending some note must reveal a nullifier not already in the nullifier set, etc.
Structural validity is enforced by the definitions of data
structures in zebra-chain
. Semantic validity is enforced by the
code in this crate. Contextual validity is enforced in
zebra-state
when objects are committed to the chain state.
Re-exports§
pub use config::Config;
pub use error::BlockError;
pub use router::RouterError;
Modules§
- config
- Configuration for semantic verification which is run in parallel.
- ed25519
- Async Ed25519 batch verifier service
- error
- Errors that can occur when checking consensus rules.
- groth16
- Async Groth16 batch verifier service
- halo2
- Async Halo2 batch verifier service
- redjubjub
- Async RedJubjub batch verifier service
- redpallas
- Async RedPallas batch verifier service
- router
- Top-level semantic block verification for Zebra.
- transaction
- Asynchronous verification of transactions.
Structs§
- Checkpoint
List - A list of block height and hash checkpoints.
Enums§
- Request
- A request to the chain or block verifier
- Verify
Block Error - Block verification errors.
- Verify
Checkpoint Error
Constants§
- MAX_
BLOCK_ SIGOPS - The maximum allowed number of legacy signature check operations in a block.
- MAX_
CHECKPOINT_ BYTE_ COUNT - We limit the memory usage and download contention for each checkpoint, based on the cumulative size of the serialized blocks in the chain.
- MAX_
CHECKPOINT_ HEIGHT_ GAP - We limit the maximum number of blocks in each checkpoint. Each block uses a constant amount of memory for the supporting data structures and futures.
Traits§
- Parameter
Checkpoint - Network methods related to checkpoints
Functions§
- block_
subsidy BlockSubsidy(height)
as described in protocol specification §7.8- funding_
stream_ address - Return the address corresponding to given height, network and funding stream receiver.
- funding_
stream_ values - Returns the
fs.Value(height)
for each stream receiver as described in protocol specification §7.8 - miner_
subsidy MinerSubsidy(height)
as described in protocol specification §7.8- new_
coinbase_ script - Returns a new funding stream coinbase output lock script, which pays to the P2SH
address
.
Type Aliases§
- BoxError
- A boxed
std::error::Error
.