HotStuff-2 Blockchain
A Go implementation of the HotStuff-2 two-phase Byzantine Fault Tolerant (BFT) consensus protocol. Features threshold signatures (ted25519), libp2p P2P networking, and a complete blockchain layer with transaction verification and smart contract support.
Overview
A research prototype implementing HotStuff-2 (Malkhi & Nayak, 2023), a cutting-edge two-phase responsive BFT consensus protocol. Unlike traditional 3-phase protocols (PBFT, HotStuff-1), HotStuff-2 achieves optimal commit latency through a novel double certificate mechanism (a certificate on a certificate that reduces the commit path from 3 phases to 2).
Consensus Protocol
The protocol runs in 5 steps per view across a 4-node network tolerating 1 Byzantine fault:
- Propose : Leader broadcasts a block with the highest QC and double certificate
- Vote : Parties vote if the proposal's QC meets the locking rule
- Prepare : Leader aggregates 2t+1 votes into a Quorum Certificate (QC)
- Vote2 : Parties confirm the QC and send vote2 to the next leader
- Commit :Next leader forms a double certificate, triggering atomic block commits
Threshold Signatures
Uses a ted25519 3-of-4 threshold signature scheme (Coinbase Kryptology). Three partial signatures from any 3 of the 4 nodes are aggregated to form valid certificates, ensuring no single node can forge consensus.
P2P Networking
Built on libp2p with GossipSub for broadcast messages (Propose, Prepare) and direct streams for unicast messages (Vote, Vote2, NewView). Peer discovery uses Kademlia DHT with a shared rendezvous point.
Blockchain Layer
Full blockchain implementation with:
- SHA256-based block chaining and chain validation
- ECDSA P256 transaction signing and verification
- Merkle root computation for transaction integrity
- Thread-safe mempool with deduplication
- Basic smart contract state transitions
Deployment
Dockerized 4-node network via Docker Compose; one bootstrap node and three regular nodes coordinated through a shared volume for peer ID exchange.
Reference
Dahlia Malkhi & Kartik Nayak. "HotStuff-2: Optimal Two-Phase Responsive BFT." ePrint 2023/397.