Alpha · Multi-validator consensus not yet live · Patent Pending

4/4 node endpoints reachable · SIMULATED in staging (no real node contacted)
DEMOProtocol status: record-level verification. Cryptographic consensus checks (BFT rounds, BLS signature validation, anti-replay) are simulated — awaiting validator engine.
High-Performance Protocol Engine

Pipelined BFT Settlement Engine

Full architecture specification for a production-grade distributed settlement engine: pipelined BFT consensus, QUIC persistent peer mesh, dynamic transaction batching, parallel deterministic execution, and lock-free metrics. Designed for 1k–10k+ TPS with sub-2s finality.

Pipelined BFTQUIC Peer MeshBinary / bincodeDynamic BatchingParallel ExecutionFixed-Point OnlyZero Blocking I/O
Anti-patterns (AVOID)
  • ✗REST/HTTP per-transaction call
  • ✗JSON serialization in hot paths
  • ✗Blocking I/O anywhere
  • ✗One transaction per block
  • ✗Waiting for full consensus before next round
  • ✗Heavy logging in data path
  • ✗f32/f64 in state transitions
  • ✗Synchronous peer loops
Required Patterns
  • ✓Persistent QUIC connections
  • ✓bincode binary serialization
  • ✓Tokio full-async everywhere
  • ✓100–500 tx per batch (dynamic)
  • ✓Pipelined rounds (N, N+1, N+2 concurrent)
  • ✓Parallel execution via rayon
  • ✓Fixed-point arithmetic in state
  • ✓Lock-free atomic metrics
Cargo Workspace
Module Breakdown
Crate structure — clean interfaces, independently testable
hcp-net
QUIC / TCP

Persistent peer mesh, binary framing, parallel broadcast, QUIC streams. Zero kernel overhead per message.

hcp-batcher
Tokio

Dynamic time+size transaction batcher. 100ms window / 500tx max. Non-blocking channel to consensus.

hcp-consensus
Pipelined BFT

Pipelined 3-phase BFT. Multiple rounds concurrent. Rotating leader. BLS aggregate signatures.

hcp-exec
Rayon

Parallel deterministic execution. Partitioned by sender for independence. Fixed-point only. Non-blocking vs consensus.

hcp-state
RocksDB

State database with atomic delta application, Merkle root per block, snapshot support.

hcp-metrics
HDRHistogram

Lock-free atomic TPS counter, nanosecond-resolution latency histogram, per-stage timing.

hcp-node/ (Cargo workspace)

├── crates/hcp-net/ ← QUIC peer mesh

├── crates/hcp-batcher/ ← tx batching

├── crates/hcp-consensus/ ← pipelined BFT

├── crates/hcp-exec/ ← parallel execution

├── crates/hcp-state/ ← RocksDB state

├── crates/hcp-metrics/ ← TPS + latency

└── bin/hcp-node/ ← validator binary

bincode
Data Structures
All message types binary-encoded — no JSON, no reflection

Transaction, Block, and all ConsensusMsg variants use bincode v2 with fixed-size arrays. No heap allocation for signature or hash fields. Zero-copy decode from QUIC stream buffers.

Mandatory
Dynamic Transaction Batching
100ms time window + 500tx size cap — whichever fires first

The batcher sits between the client ingest layer and the consensus pipeline. It aggregates transactions using tokio::select! — no busy polling. Flush is triggered by whichever fires first: the time ticker or the size cap.

Critical Path
Pipelined BFT Consensus
Concurrent rounds — Block N commits while N+2 is already proposing
Time →Round NRound N+1Round N+2Round N+3
t=0msProposal———
t=50msPreVoteProposal——
t=100msVotePreVoteProposal—
t=150msCommit ✓VotePreVoteProposal
t=200msFinalizedCommit ✓VotePreVote
hcp-net
QUIC Peer Mesh
Persistent connections, parallel broadcast, binary framing — no REST, no HTTP

~12 bytes

Message overhead

vs ~200 bytes HTTP/JSON

<1ms

Broadcast latency

4-node parallel join_all

Once at startup

Connection setup

then persistent forever

hcp-exec
Parallel Deterministic Execution
Sender-partitioned parallelism via rayon — never blocks consensus pipeline

Execution is decoupled from consensus. Finalized blocks are pushed to an async execution channel. Transactions are partitioned by sender (no cross-sender dependency) and executed in parallel with rayon. State delta is applied atomically. Fixed-point arithmetic only — no f32/f64 in state transitions.

hcp-metrics
Lock-Free Metrics & TPS Measurement
Nanosecond-resolution HDR histogram — zero overhead in hot path

End-to-End Message Flow

#FromToMessageLatency
1ClientAny NodeTransaction (binary, Ed25519 signed)<1ms
2BatcherConsensusVec<Transaction> batch (100–500 tx)0–100ms window
3LeaderAll PeersProposal { Block, round }<1ms (parallel broadcast)
4Each NodeAll PeersPreVote { block_id, sig }<1ms
5Each NodeAll PeersVote { block_id, sig } (after 2f+1 PreVotes)<1ms
6Each NodeAll PeersCommit { block_id, sig } (after 2f+1 Votes)<1ms
7ExecutorStateDBBlock finalized → parallel tx execution1–10ms
8StateDBClientReceipt { block_id, tx_results, merkle_root }<1ms

Performance Targets

ConfigurationTPSFinalityBlock Time
4-node multi-region baseline1,000–2,000800ms–1.5s200ms
4-node same-region optimized5,000–10,000<300ms100ms
10-node same-region15,000–25,000<400ms100ms
FPGA MCF + DPDK (Phase 3)100,000+<80ms30ms

Core Rust Dependencies

tokio
^1.35

Async runtime + channels + timers

quinn
^0.11

QUIC transport — persistent peer connections

bincode
^2.0

Binary serialization — zero allocation decode

blst
^0.3

BLS12-381 threshold signatures

ed25519-dalek
^2.1

Transaction signing + verification

rocksdb
^0.21

State persistence + H-DAG storage

rayon
^1.8

CPU-parallel transaction execution

hdrhistogram
^7.5

Nanosecond latency percentiles

bytes
^1.5

Zero-copy payload buffers

prometheus
^0.13

Metrics export (Grafana dashboards)

Byzantine Fault Tolerance

Safety threshold: n ≥ 3f + 1 nodes. For 4 nodes: f=1 (tolerates 1 Byzantine node). For 7 nodes: f=2.

Liveness: Rotating leader with view-change protocol if leader times out (configurable: default 500ms).

Failure simulation: Inject via hcp-metrics fault flags — node drop, artificial delay, message corruption. No production code changes required.

Quorum: Phases require 2f+1 signatures. BLS aggregate signatures keep message size O(1) regardless of committee size.

Staging · simulated settlement · not network finality