Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Data availability: blobs and sampling

After this lesson: I can work out how many random samples give a target confidence that data was published.

70 min lesson3 commandsRollup lab: batches, fraud proofs, data availability and exits in Python

A root with no data behind it

Imagine a sequencer posts a new root but never publishes the transfers behind it. Nobody can replay the batch, nobody can challenge it, and nobody knows their own balance.

A rollup is only as safe as its data is available. Today you see how the main chain makes sure it is, and for how long.

By the end of this lesson

Note

I can work out how many random samples give a target confidence that data was published.

Key words

WordWhat it meansExample
Data availabilityeverybody being able to download the data
Erasure codingadding pieces so that any half rebuilds the data
Sampleone random piece a node asks for
Bloba block of rollup data the main chain keeps for a while131072 bytes
Pruningnodes deleting old data they no longer need to keep

The cells students fill in are left blank in this preview.

Withheld data breaks every safety check

A fraud proof needs the data to replay. A user leaving the rollup needs it to prove their balance. So the main chain must be sure the data was really published, not only that a root was.

Downloading every byte proves it, but that is what made chains slow. The trick is to check a few random pieces instead.

Erasure coding makes hiding hard

First the data is stretched. k pieces become 2k, chosen so that any k of them rebuild the rest. To hide even one piece, a sequencer must now withhold more than half.

In the lab, four numbers become eight. Any four of the eight give the original four back, and three are not enough.

Stretch four numbers and rebuild them

Command
docker exec jupyter python3 steps/erasure.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Sample for withheld data

Command
docker exec jupyter python3 steps/sampling.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Worked example: 63 of 128 pieces published

Samples eachClients who noticed, of 1000Chance one client is fooled
14960.492188
27370.242249
49300.058684
89970.003444
1610000.000012

The cells students fill in are left blank in this preview.

Try it: how fast the chance falls

Code: python
chance_present = 63 / 128

for samples in [1, 5, 10, 20]:
    fooled = chance_present ** samples
    print(samples, "samples: fooled with chance", "%.8f" % fooled)
# Change 63 to 32, so only a quarter is published. How fast does the chance fall now?

Blobs are kept for about 18 days

Since 2024 rollups post their data as blobs, a space of 131072 bytes each set aside for them. The main chain keeps a short commitment to each blob for ever. Nodes keep the blob itself for 4096 epochs, about 18 days, then prune it.

Since late 2025, PeerDAS lets each node keep and check only some columns of the extended blobs. So the chain can carry more blobs.

Watch a blob get pruned

Command
docker exec jupyter python3 steps/expiry.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

A common mistake

Warning

Many people think the main chain keeps rollup data for ever. Nodes prune a blob after about 18 days and keep only its commitment. So a challenge window must end well before that, and anybody who wants the history keeps their own copy.

About this lab and its source: Rollup lab: batches, fraud proofs, data availability and exits in Python

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.