Consensus algorithm comparison with simulated market data.
Compare consensus algorithms using the same test blocks to understand performance trade-offs and trilemma characteristics.
strategy.execute(block) start to endNote: The table and chart below show a sample of 10 blocks for illustration. The actual experiment uses 100 blocks per round for statistical significance.
Each block contains simulated BTC price data. Example block structure (10-block sample):
| Block Hash | BTC Price (USD) | Source | Timestamp |
|---|---|---|---|
| a3f8c2d1e9b4... | 50,240 | CoinGecko | 2025-01-17 08:00:00 |
| 7b2e9f4a1c6d... | 49,890 | CoinGecko | 2025-01-17 08:10:00 |
| 5d1a8c9e3b7f... | 50,560 | CoinGecko | 2025-01-17 08:20:00 |
| 2e4b9f7a8d3c... | 51,120 | CoinGecko | 2025-01-17 08:30:00 |
| 9a3d7e2f6b8c... | 50,680 | CoinGecko | 2025-01-17 08:40:00 |
| 4c1f9e8b7a2d... | 49,950 | CoinGecko | 2025-01-17 08:50:00 |
| 8e5b3a9d2f7c... | 50,430 | CoinGecko | 2025-01-17 09:00:00 |
| 3f7a2e9c6b4d... | 51,290 | CoinGecko | 2025-01-17 09:10:00 |
| 6b8d4f2a9e7c... | 50,710 | CoinGecko | 2025-01-17 09:20:00 |
| 1d5a8f3e9b7c... | 50,180 | CoinGecko | 2025-01-17 09:30:00 |
Note: Price pattern: simulated fluctuations around 50,000 USD (sample of 10 blocks shown, simulated for demonstration).
| Strategy | Latency (ms) | Throughput (blocks/sec) | Commit Rate (%) | Error Rate (%) |
|---|---|---|---|---|
| PBFT | 1500.0 ± 50.0 | 66.67 | 100.0 | 0.0 |
| Gossip | 300.0 ± 10.0 | 333.33 | 100.0 | 0.0 |
| Eventual | 500.0 ± 5.0 | 200.0 | 100.0 | 0.0 |
| Quorum-less | 0.5 ± 0.1 | 2000.0 | 100.0 | 0.0 |
| Flexible Paxos | 800.0 ± 30.0 | 125.0 | 100.0 | 0.0 |
15 metrics across three dimensions: Decentralization (5), Scalability (3), Security (4). Metric taxonomy based on Aliyu, Kannengießer & Sunyaev (2025).
| Strategy | Block Proposal Randomness | Geographic Diversity | Hash Power Distribution | Token Concentration | Wealth Distribution |
|---|---|---|---|---|---|
| PBFT | 0.80 | N/A | N/A | N/A | N/A |
| Gossip | 0.80 | N/A | N/A | N/A | N/A |
| Eventual | 0.80 | N/A | N/A | N/A | N/A |
| Quorum-less | 0.80 | N/A | N/A | N/A | N/A |
| Flexible Paxos | 0.80 | N/A | N/A | N/A | N/A |
| Strategy | Availability (%) | Confirmation Latency (ms) | Max Throughput (TPS) |
|---|---|---|---|
| PBFT | 100.0 | 1500.0 | 66.67 |
| Gossip | 100.0 | 300.0 | 333.33 |
| Eventual | 100.0 | 500.0 | 200.0 |
| Quorum-less | 100.0 | 0.5 | 2000.0 |
| Flexible Paxos | 100.0 | 800.0 | 125.0 |
| Strategy | Cost of Attack | Fault Tolerance | Reliability (%) | Stale Block Rate (%) |
|---|---|---|---|---|
| PBFT | 0.75 | 0.25 | 100.0 | 0.0 |
| Gossip | 0.30 | 0.10 | 100.0 | 0.0 |
| Eventual | 0.30 | 0.10 | 100.0 | 0.0 |
| Quorum-less | 0.30 | 0.10 | 100.0 | 0.0 |
| Flexible Paxos | 0.75 | 0.25 | 100.0 | 0.0 |
Scored from 1 (low) to 5 (high) based on algorithm characteristics.
Decentralization: 4.0/5.0
Security: 5.0/5.0
Scalability: 2.0/5.0
Decentralization: 5.0/5.0
Security: 3.0/5.0
Scalability: 5.0/5.0
Decentralization: 4.0/5.0
Security: 2.0/5.0
Scalability: 4.0/5.0
Decentralization: 4.0/5.0
Security: 3.5/5.0
Scalability: 4.5/5.0
Decentralization: 4.0/5.0
Security: 4.5/5.0
Scalability: 3.0/5.0
GitHub Repository:
https://github.com/egpivo/rust-market-ledger
Project Structure:
src/etl/ - ETL pipeline (extract, transform, load)src/consensus/ - Consensus algorithms and comparison frameworksrc/consensus/algorithms/ - Individual consensus implementations (PBFT, Gossip, Eventual, Quorum-less, Flexible Paxos)examples/ - Example code and experimentsexamples/shared/ - Shared utilities for metrics calculationCompare all consensus algorithms with performance metrics and trilemma scores:
cargo run --example trilemma_comparison
This runs the full comparison experiment shown in the Results tab.
Individual consensus algorithm experiments:
cargo run --example no_consensus_examplecargo run --example simple_majority_examplecargo run --example pbft_baseline_examplecargo run --example run_all_comparisonsgit clone https://github.com/egpivo/rust-market-ledger.gitcargo build