A Rust implementation of the Istanbul Byzantine Fault Tolerance (IBFT) consensus algorithm.
IBFT-Rust is a clean, modular implementation of the IBFT consensus protocol in Rust. It provides Byzantine fault tolerance for distributed systems, allowing them to reach consensus even when up to ⌊(n-1)/3⌋ nodes are faulty or malicious.
- Complete IBFT Implementation: All four phases of the consensus protocol
- ROUND-CHANGE
- PRE-PREPARE
- PREPARE
- COMMIT
- Modular Architecture: Clean separation of concerns with dedicated modules
- Byzantine Fault Tolerance: Handles up to ⌊(n-1)/3⌋ faulty nodes
- Cryptographic Security: Message signing and validation
- Network Layer: P2P communication between validators
src/
├── consensus/ # Core IBFT consensus logic
│ ├── ibft.rs # Main consensus coordinator
│ ├── round_change.rs # ROUND-CHANGE phase handler
│ ├── pre_prepare.rs # PRE-PREPARE phase handler
│ ├── prepare.rs # PREPARE phase handler
│ └── commit.rs # COMMIT phase handler
├── network/ # Network communication
├── message/ # Message types and validation
├── state/ # Consensus state management
└── crypto/ # Cryptographic utilities
The Istanbul Byzantine Fault Tolerance consensus follows these phases:
- ROUND-CHANGE: Validators agree on moving to a new round
- PRE-PREPARE: Primary validator proposes a block
- PREPARE: Validators validate and vote on the proposal
- COMMIT: Validators commit to the agreed block
Ensure you have Rust installed, then clone and build:
git clone https://github.com/yourusername/ibft-rust.git
cd ibft-rust
cargo build
cargo run
# Build the project
cargo build
# Run tests
cargo test
This implementation follows the IBFT specification as outlined in EIP-650.
Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest features.
This project is licensed under the MIT License - see the LICENSE file for details.
🚧 Work in Progress - This is an early-stage implementation. The core structure is in place, but individual consensus phases are still being developed.