Skip to content

Instantly share code, notes, and snippets.

@killerstorm
Created April 13, 2020 21:40
Show Gist options
  • Save killerstorm/6201dfcd449647cbb4044665cea6d4cb to your computer and use it in GitHub Desktop.
Save killerstorm/6201dfcd449647cbb4044665cea6d4cb to your computer and use it in GitHub Desktop.

If our interest is an append-only database, then each operation can be described as adding entry

E = F(U, Q)

to the database, where U is user data, Q is result of query on the current state of the database, and F is a function which transforms U and Q into what we want to add.

In this case commitment to E can be replaced to commitment to pair (U, Q). So a commitment to database state can be replaced with a commitment to a transaction log, where client creates transactions in the following way:

  1. client sends a query to a database and retries result Q which is relevant to his transaction
  2. he adds hash of Q (or Q in its entirety if it is small) to his transaction T which includes operation data U
  3. Transaction T which is added to the transaction log

A proof that entry E was added to the database should consist of:

  1. U
  2. Q
  3. Merkle tree proof that T containing U and Q is contained in transaction log T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment