Skip to content

andyrobert3/ibft-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IBFT-Rust

A Rust implementation of the Istanbul Byzantine Fault Tolerance (IBFT) consensus algorithm.

Overview

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.

Features

  • 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

Architecture

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

IBFT Protocol

The Istanbul Byzantine Fault Tolerance consensus follows these phases:

  1. ROUND-CHANGE: Validators agree on moving to a new round
  2. PRE-PREPARE: Primary validator proposes a block
  3. PREPARE: Validators validate and vote on the proposal
  4. COMMIT: Validators commit to the agreed block

Installation

Ensure you have Rust installed, then clone and build:

git clone https://github.com/yourusername/ibft-rust.git
cd ibft-rust
cargo build

Usage

Running a Node

cargo run

Development

# Build the project
cargo build

# Run tests
cargo test

Protocol Specification

This implementation follows the IBFT specification as outlined in EIP-650.

Contributing

Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest features.

License

This project is licensed under the MIT License - see the LICENSE file for details.

References

Status

🚧 Work in Progress - This is an early-stage implementation. The core structure is in place, but individual consensus phases are still being developed.

About

Istanbul BFT consensus algorithm in Rust.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages