freecoding.school100% FREE · NO SIGNUP
The EVM CoreISSUE #9 of 48

danksharding · data availability sampling

SoliaVSThe Reentrancy Reaper
Solia saysData Availability Sampling lets a light client check just k random chunks of a blob and probabilistically prove the whole blob is available — catching withheld data with overwhelming odds.

If a rollup publishes a blob, every node must know it is actually available — otherwise a malicious publisher could hide some chunks and freeze the rollup. Data Availability Sampling (DAS) is the trick: erasure-code the data, then have each light client randomly sample k small chunks. If any sample is missing, the data is incomplete.

The math is one line: P(detect z fraction withheld) = 1 − (1 − z)^k. With just 30 samples, 25% withholding is detected ~99.98% of the time per client, and combining a thousand independent clients makes the collective detection probability astronomical. The demo computes both rates.

Power-ups you unlock

The Reentrancy Reaper attacks — common mistakes

Boss battleCompute P(detect 25% missing data) for k = 1, 10, and 30 samples, and the collective rate across 1000 independent clients.

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>
const detect = (z, k) => 1 - Math.pow(1 - z, k);
const z = 0.25;
const rows = [];
for(const k of [1, 5, 10, 20, 30, 50]) rows.push('  k=' + String(k).padStart(2) + ' samples → P(detect) = ' + (detect(z,k)*100).toFixed(4) + '%');
const N = 1000;
const collective = 1 - Math.pow(1 - detect(z, 30), N);
document.getElementById('o').textContent = [
  'DAS: each client samples k random chunks. any missing = unavailable.',
  'P(detect ' + (z*100) + '% withheld) = 1 − (1 − ' + z + ')^k',
  '',
  ...rows,
  '',
  'with ' + N + ' independent clients each sampling 30 chunks:',
  '  collective P(detect) ≈ ' + (collective*100).toFixed(10) + '%',
  '  → withheld data caught with overwhelming probability'
].join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ Eip-4844 · Blob Transactions · Proto-DankshardingProposer-Builder Separation · In-Protocol Pbs ›