Skip to main content

drive_proof_verifier/
block_proof.rs

1//! Proofs of Tenderdash blocks: what `getBlocks` and `getOwnerTransactionsInBlock` return
2//! when asked to prove.
3//!
4//! Tenderdash already commits to a block's contents. The transactions and their execution
5//! results are Merkle trees whose roots are in the block header, the header hashes to the
6//! block id, and the validator quorum signs a vote for that block id. A proof carries the
7//! header, the block id and the signature, and for single transactions the Merkle paths
8//! to the two roots.
9//!
10//! This module is the one definition of every hash on that chain. DAPI builds its proofs
11//! with it and checks them before they leave ([`check_header`], [`check_block_contents`],
12//! [`check_block_fields`], [`MerkleTree`]), and a client verifies them with it ([`verify_block_proof`],
13//! [`verify_transaction_proof`]), so a node cannot hand out a proof that clients refuse.
14
15mod block;
16mod error;
17#[cfg(any(test, feature = "mocks"))]
18pub mod fixtures;
19mod header;
20mod merkle;
21mod transaction;
22
23pub use block::{check_block_fields, proof_parts, verify_block_proof};
24pub use error::BlockProofError;
25pub use header::{check_header, header_hash, header_time_ms, state_id_hash};
26pub use merkle::{merkle_root, root_from_path, MerkleTree};
27pub use transaction::{
28    check_block_contents, result_leaf, transaction_hash, verify_transaction_proof,
29};