Iroha Overview
Sumeragi Consensus
Sumeragi Consensus
Section titled “Sumeragi Consensus”Sumeragi is the Byzantine Fault Tolerant (BFT) consensus algorithm used in Hyperledger Iroha. Named after the imperial lineage of Japan, Sumeragi provides deterministic finality with high performance, making it ideal for enterprise blockchain deployments and the SORA v3 network.
What is BFT Consensus?
Section titled “What is BFT Consensus?”BFT consensus allows a distributed network to reach agreement even when some participants behave maliciously or fail unexpectedly.
The Byzantine Generals Problem
Section titled “The Byzantine Generals Problem”The classic thought experiment:
Several generals must coordinate an attack. They can only communicate via messengers who might be traitors. How can they reach reliable agreement?
BFT algorithms solve this by tolerating up to f faulty nodes in a network of 3f + 1 total nodes:
| Total Nodes | Max Faulty Nodes | Required Honest |
|---|---|---|
| 4 | 1 | 3 |
| 7 | 2 | 5 |
| 10 | 3 | 7 |
| 100 | 33 | 67 |
How Sumeragi Works
Section titled “How Sumeragi Works”Consensus Rounds
Section titled “Consensus Rounds”Sumeragi operates in rounds, each producing one block:
Round N:┌─────────────────────────────────────────────────────┐│ 1. Leader 2. Propose 3. Vote 4. Commit ││ Selection → Block → Phase → Block │└─────────────────────────────────────────────────────┘Leader Selection
Section titled “Leader Selection”Each round has a designated leader who proposes blocks:
- Deterministic ordering — Peers are sorted by cryptographic hash
- Round-robin rotation — Leader changes each round
- Predictable — All peers know who leads each round
Round 1: Peer A leadsRound 2: Peer B leadsRound 3: Peer C leadsRound 4: Peer D leadsRound 5: Peer A leads (cycle repeats)Voting Topology
Section titled “Voting Topology”Sumeragi uses a specific topology for vote propagation:
The first 2f + 1 peers in the sorted order form the voting set:
- Required for block commitment
- Must all sign the block
- Remaining peers are observing proxies
Consensus Phases
Section titled “Consensus Phases”Phase 1: Block Proposal
Section titled “Phase 1: Block Proposal”The leader creates a block:
// Pseudocode for block creationfn create_block(transactions: Vec<Transaction>) -> Block { Block { height: current_height + 1, previous_hash: last_block.hash(), transactions, timestamp: now(), leader_signature: sign(block_hash), }}Phase 2: Vote Collection
Section titled “Phase 2: Vote Collection”Voting peers validate and sign:
- Validate transactions — Check permissions and signatures
- Verify block structure — Hash chains, timestamps
- Sign block hash — Add signature to block
- Forward to next peer — Chain voting pattern
Leader → Peer 1 → Peer 2 → ... → Peer 2f → Commit ↓ ↓ ↓ Sign Sign SignPhase 3: Commitment
Section titled “Phase 3: Commitment”When 2f + 1 signatures are collected:
- Block is committed to storage
- Broadcast to proxy tail
- State changes are applied
- Next round begins
View Changes
Section titled “View Changes”When a leader fails or acts maliciously, the network performs a view change:
Failure Detection
Section titled “Failure Detection”- Timeout — Leader doesn’t propose in time
- Invalid block — Proposal fails validation
- Byzantine behavior — Conflicting proposals detected
View Change Protocol
Section titled “View Change Protocol”1. Peer detects failure2. Broadcasts ViewChange message3. Collects 2f + 1 ViewChange messages4. New leader takes over5. Round continues with new leaderLeader Replacement
Section titled “Leader Replacement”The view change promotes the next peer in line:
Original: A (leader) → B → C → DAfter VC: B (leader) → C → D → A* *moved to endPerformance Characteristics
Section titled “Performance Characteristics”Latency
Section titled “Latency”Sumeragi achieves low latency through:
| Factor | Optimization |
|---|---|
| Network hops | Linear voting chain |
| Signature aggregation | Batch verification |
| Block pipeline | Parallel execution |
Typical latency: 1-3 seconds for finality
Throughput
Section titled “Throughput”Performance depends on:
- Network bandwidth between peers
- Transaction complexity
- Number of voting peers
Benchmarks on modern hardware:
| Scenario | Transactions/Second |
|---|---|
| Simple transfers | 10,000+ |
| Complex WASM | 1,000+ |
| Mixed workload | 5,000+ |
Sumeragi vs Other Consensus
Section titled “Sumeragi vs Other Consensus”vs Proof of Work (Bitcoin)
Section titled “vs Proof of Work (Bitcoin)”| Aspect | Sumeragi | PoW |
|---|---|---|
| Finality | Instant | Probabilistic |
| Energy | Minimal | Massive |
| Throughput | High | Low |
| Decentralization | Permissioned | Open |
vs Tendermint/PBFT
Section titled “vs Tendermint/PBFT”| Aspect | Sumeragi | Tendermint |
|---|---|---|
| Communication | Linear | All-to-all |
| Complexity | O(n) | O(n²) |
| View changes | Simple | Complex |
| Implementation | Rust | Go |
vs GRANDPA (Polkadot)
Section titled “vs GRANDPA (Polkadot)”| Aspect | Sumeragi | GRANDPA |
|---|---|---|
| Block production | Integrated | Separate (BABE) |
| Finality | Per-block | Batch |
| Latency | 1-3s | 12-60s |
| Use case | Enterprise | Public chain |
Security Properties
Section titled “Security Properties”Safety
Section titled “Safety”Sumeragi guarantees safety as long as less than 1/3 of peers are Byzantine:
- No forks — Only one valid chain exists
- No double-spending — Transactions are ordered
- No rollbacks — Committed blocks are permanent
Liveness
Section titled “Liveness”The network continues producing blocks if:
- 2f + 1 peers are online and honest
- Network partitions eventually heal
- View changes recover from failures
Sumeragi in SORA v3
Section titled “Sumeragi in SORA v3”Validator Selection
Section titled “Validator Selection”SORA v3 validators are selected through:
- Staking — VAL tokens locked as collateral
- Reputation — Historical performance
- Governance — Parliament approval for major validators
Economic Security
Section titled “Economic Security”| Mechanism | Purpose |
|---|---|
| Staking | Collateral for honest behavior |
| Slashing | Penalty for Byzantine actions |
| Rewards | Incentive for participation |
| Unbonding | Delay prevents quick exit after attack |
Integration with Governance
Section titled “Integration with Governance”The SORA Parliament can:
- Adjust validator set
- Modify consensus parameters
- Respond to security incidents
- Upgrade the consensus protocol
Implementation Details
Section titled “Implementation Details”Rust Implementation
Section titled “Rust Implementation”Sumeragi is implemented in Rust for:
- Memory safety without garbage collection
- High performance
- Compile-time guarantees
- Excellent concurrency support
Key Data Structures
Section titled “Key Data Structures”pub struct Block { pub header: BlockHeader, pub transactions: Vec<Transaction>, pub signatures: Vec<Signature>,}
pub struct BlockHeader { pub height: u64, pub previous_block_hash: Hash, pub transactions_hash: Hash, pub timestamp: u128, pub view_change_index: u32,}Configuration
Section titled “Configuration”{ "sumeragi": { "block_time_ms": 2000, "commit_time_ms": 4000, "max_transactions_in_block": 512, "actor_channel_capacity": 100 }}Further Reading
Section titled “Further Reading”Smart Contracts
SORA v3
Official Docs