walt/tables/roots

roots

a single hash that commits to all of walt's rows. it moves forward once per settled ticket.

definition

leaf        = sha256(canonical(row))
node        = sha256(left || right)
table_root  = merkle(leaves of one table)
top_root    = merkle(table_root[0], ... table_root[8])

what it is

each row is written in one fixed text form and hashed. the hashes of a table's rows are paired and hashed again until one hash is left, the table root. the nine table roots are combined the same way into the top root.

the top root is stored in one account with a sequence number. when a ticket settles, the new rows it produced are added as leaves, the affected roots are recomputed and the sequence number goes up by one. there is no other way for the root to change.

this is what makes a sold row checkable. the row, a short list of sibling hashes and the root are enough to prove the row was in walt's tables at that sequence number.

the tree of the loaded trade rows

leavesdepthhash
signatureleaf hash

notes

the tree on this page is built in your browser from real trade rows, using the same pairing rule as the program. it shows the method working on real data. it is not the program's own root.

a node with no partner moves up unchanged. it is never paired with a copy of itself.

figure

the top of the tree built from the loaded trades.

columns

columntypemeaning
sequ64number of times the root has advanced
top_root[u8; 32]the root of the table roots
table_roots[[u8; 32]; 9]one root per table
last_ticketpubkeyticket that caused the last advance
walt/tables/roots: one hash for every row of every table.