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

dag consensus · narwhal · bullshark

ZeekaVSThe Collision
Zeeka saysNarwhal disseminates transactions as a DAG of certified batches; Bullshark orders the DAG deterministically — decoupling data spread from consensus for huge throughput.

Traditional consensus puts a single leader at the center of every block, and bandwidth bottlenecks on that leader. Narwhal rejects that design: every validator independently certifies batches of transactions and gossips them, forming a DAG of certificates across rounds. Bullshark is the tiny consensus protocol that runs over the DAG just to decide a total order of certificates — not to disseminate them.

Decoupling data dissemination from consensus means throughput scales with the entire network, not one leader. The architecture powers Sui, Aleo, and other high-throughput chains. The demo builds a small certificate DAG and produces a deterministic linearization.

Power-ups you unlock

The Collision attacks — common mistakes

Boss battleBuild a small DAG of certificates and produce a deterministic linearization.

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>
// Narwhal DAG + Bullshark linearization (simplified: order by round, then id).
const dag = [
  { id:'A1', round:1, refs:[] },
  { id:'B1', round:1, refs:[] },
  { id:'C1', round:1, refs:[] },
  { id:'A2', round:2, refs:['A1','B1','C1'] },
  { id:'B2', round:2, refs:['A1','B1'] },
  { id:'C2', round:2, refs:['A1','C1'] },
];
const ordered = [...dag].sort((a,b) => a.round - b.round || a.id.localeCompare(b.id));
document.getElementById('o').textContent = [
  'DAG of certificates (parallel data dissemination):',
  ...dag.map(c => '  ' + c.id + ' (round ' + c.round + ') refs: [' + c.refs.join(',') + ']'),
  '',
  'Bullshark linearization: ' + ordered.map(c => c.id).join(' → '),
  'throughput scales with the whole network, not one leader'
].join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ Hotstuff · Pipelined BftAvalanche · Metastable Consensus ›