Skip to main content

Crate merkleforge_hash

Crate merkleforge_hash 

Source
Expand description

§merkle-hash

Pluggable cryptographic hash adapters for MerkleForge.

Each adapter wraps a well-tested upstream crate and implements the HashFunction trait so it can drive any tree variant in merkle-variants.

§Available adapters

TypeAlgorithmDigestBest for
Sha256SHA-25632 bytesHardware-accelerated production deployments
Keccak256Keccak-25632 bytesEthereum-compatible Patricia Tries
Blake3BLAKE332 bytesMaximum throughput on modern CPUs

§Choosing a hash function

  • SHA-256: Excellent choice when targeting x86-64 hardware with SHA extensions. Widely used in Bitcoin and many Ethereum-adjacent systems.
  • Keccak-256: Required for any tree that must produce state roots readable by Ethereum tooling (e.g. the MerklePatriciaTrie variant).
  • BLAKE3: Fastest on software paths, good for throughput-sensitive workloads where Ethereum compatibility is not required.

Concrete benchmark numbers will be published in the Phase 5 report.

Structs§

Blake3
BLAKE3 implementation of HashFunction.
Keccak256
Keccak-256 implementation of HashFunction.
Sha256
SHA-256 implementation of HashFunction.

Traits§

HashFunction
Re-export of the HashFunction trait for convenience. Abstraction over a cryptographic hash function used by Merkle trees.