hotmint-types
Core data types for the Hotmint BFT consensus framework.
This crate defines all shared primitives used across the Hotmint ecosystem with minimal dependencies (only serde and ruc). It is the foundation that every other Hotmint crate depends on.
Types
| Type | Description |
|---|---|
Block, BlockHash, Height |
Chain primitives — block structure, 32-byte Blake3 hash, block height |
ViewNumber |
Monotonically increasing consensus view number |
Vote, VoteType |
Phase-1 and phase-2 voting messages |
QuorumCertificate |
Aggregate proof from 2f+1 validators on a block |
DoubleCertificate |
QC-of-QC that triggers commit (two-chain rule) |
TimeoutCertificate |
Aggregated timeout proof for view change |
ConsensusMessage |
Wire protocol enum covering all message types |
ValidatorId, ValidatorInfo, ValidatorSet |
Validator identity, metadata, and set management |
Signature, PublicKey, AggregateSignature |
Cryptographic primitives |
Signer, Verifier |
Abstract traits for pluggable signature schemes |
Epoch, EpochNumber |
Epoch management for validator set transitions |
Usage
use *;
// Create a validator set
let vs = new;
assert_eq!; // ceil(2*4/3)
assert_eq!; // floor((4-1)/3)
// Round-robin leader election
let leader = vs.leader_for_view.unwrap;
// Aggregate signatures
let mut agg = new;
agg.add.unwrap;
agg.add.unwrap;
assert_eq!;
Implementing Custom Signers
use ;
License
GPL-3.0-only