freecoding.school100% FREE · NO SIGNUP
Proof PeaksISSUE #32 of 38

hotstuff · pipelined bft

ZeekaVSThe Collision
Zeeka saysHotStuff pipelines a 3-phase BFT commit so each view advances multiple proposals at once — linear messages per view, and the basis of Aptos and Diem.

Classic PBFT spends three message rounds per block and O(n²) messages per round, which does not scale to hundreds of validators. HotStuff compresses each phase into a single round with a threshold signature and pipelines the three phases. At view v, the leader simultaneously proposes block v (prepare), precommits block v−1, and commits block v−2.

The result is linear messages per view (good under honest leaders) and crisp 3-view finality: block N is committed at view N+2. HotStuff is the backbone of HotStuff-2, DiemBFT, and Aptos consensus. The demo walks the pipeline for five views and shows block-1 reaching commit at view 3.

Power-ups you unlock

The Collision attacks — common mistakes

Boss battleSimulate five views of pipelined HotStuff and show block-N reaches commit at view N+2.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>
// HotStuff pipeline: at view v, prepare block v, precommit v-1, commit v-2.
const log = [];
for(let v = 1; v <= 5; v++){
  const tasks = [];
  tasks.push('prepare(block-' + v + ')');
  if(v >= 2) tasks.push('precommit(block-' + (v-1) + ')');
  if(v >= 3) tasks.push('commit(block-' + (v-2) + ')');
  log.push('view ' + v + ': ' + tasks.join(', '));
}
document.getElementById('o').textContent = [
  ...log,
  'block-N reaches commit at view N+2  (3-phase pipeline)',
  'linear messages per view via threshold sigs → fast under honest leaders'
].join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ Single-Slot Finality · The EndgameDag Consensus · Narwhal · Bullshark ›