Quilt·
Lesson 6 of 7

LAWS — why this is algebra, not just a protocol

Each of the 5 opcodes has a law. The laws are what make the substrate composable, replayable, and provable. If your code obeys the laws, the substrate can optimize it, parallelize it, and roll it back safely.

01The shape

Each of the 5 opcodes has a law. The laws are what make the substrate composable, replayable, and provable. If your code obeys the laws, the substrate can optimize it, parallelize it, and roll it back safely.

02Try it

lesson-6.js
Journal · cells: 0

03What the laws buy you

When your code obeys the 5 laws, the substrate can:

Replay: the journal IS the state. Replay produces the same state every time.
Roll back: the journal is a list. Remove the tail, you have the past.
Parallelize: the laws tell you which operations commute. The substrate can reorder for speed.
Prove: the substrate can verify that a sequence of events obeys the laws. The prover in quilt-substrate-meta does this.

This is what makes the substrate an algebra, not just a protocol. The laws are the algebra's axioms.

04What you can build

A substrate that can run anywhere. The same journal replays to the same state on a $2 ESP32 or a 64-core server. The laws are the contract.

05Next

Now let's build something real. Lesson 7: Build your first app →