1.6 KiB
1.6 KiB
Tutus Consensus
Go implementation of the dBFT 2.0 (delegated Byzantine Fault Tolerant) consensus algorithm for the Tutus blockchain.
Overview
This library provides the core consensus mechanism for Tutus blockchain nodes, enabling deterministic finality with 1-second block times.
Features
- Immediate Finality - No forks, no rollbacks
- Byzantine Fault Tolerant - Tolerates up to f = (n-1)/3 faulty nodes
- Configurable Validators - Support for dynamic validator sets
- Formal Verification - TLA+ specifications in formal-models/
Installation
import "github.com/tutus-one/tutus-consensus"
Design
- Interface-Driven - Cryptography, hashing, and block types are provided via interfaces
- Block & Transaction Abstractions - Located in block.go and transaction.go
- Timer Abstraction - timer package provides production-ready timer implementation
- Callback Architecture - Event-driven design for integration flexibility
Usage
Implement your event loop and call the provided callbacks:
Start()- Initialize consensusReset()- Reinitialize for new heightOnTransaction()- Process proposed transactionsOnReceive()- Handle incoming payloadsOnTimer()- Handle timer events
See internal/simulation/main.go for a complete 6-node example.
Documentation
License
MIT License - see LICENSE.md
Part of the Tutus blockchain infrastructure.