diff --git a/docs/compact_ranges.md b/docs/compact_ranges.md index f1bf56c..99d0e59 100644 --- a/docs/compact_ranges.md +++ b/docs/compact_ranges.md @@ -27,7 +27,9 @@ example, in the picture below, the range `[2, 9)` is covered by perfect nodes `[1.1, 2.1, 8]`, and the range `[12, 16)` is covered by a single perfect node `2.3`. -![compact_ranges](images/compact_ranges.png) +

+ +

Note that, in the picture above, range `[0, 21)` could be covered by a single node `5.0`. However, we only use the perfect nodes for a compact range, so it @@ -48,7 +50,9 @@ The core property that makes compact ranges widely usable is that they are merged into an `[L, R)` range. Consider the picture below for an intuitive understanding of how it works. -![compact_ranges_merge](images/compact_ranges_merge.png) +

+ +

Given two compact ranges, `[2, 9)` and `[9, 16)`, each represented by a set of node hashes (three green and three cyan nodes correspondingly), we “merge” two @@ -103,7 +107,9 @@ middle range `[i, i+1)` formed simply as the hash of this leaf. The result will be a compact range `[0, N)`, which can be compared with the trusted root hash. -![inclusion_proof](images/inclusion_proof.png) +

+ +

In the example above, an inclusion proof for leaf `6` consists of compact ranges `[0, 6)` and `[7, 16)`. @@ -125,7 +131,9 @@ complementary part of the tree. For example, consider the case when we want to prove the authenticity of values within the range `[6, 13)`, as shown in the picture below. -![inclusion_proof_range](images/inclusion_proof_range.png) +

+ +

To do so, the server can provide two compact ranges: `[0, 6)` and `[13, 16)`. The client will then construct the middle compact range locally (based on the @@ -153,7 +161,9 @@ individual entry inclusion proofs which could cost `O(N log N)`. A consistency proof (or proof of the append-only property) proves to a client that one tree state is the result of appending some entries to another state. -![consistency_proof](images/consistency_proof.png) +

+ +

The definition of the consistency proof already contains a hint on how to model it with compact ranges. Suppose a client knows a compact range of the old tree, @@ -192,7 +202,9 @@ Since the Merkle tree is a highly regular recursive structure, its geometry can be split into pieces of a controllable size that a single server can handle. See the picture below for an intuition how. -![distributed_tree](images/distributed_tree.png) +

+ +

The construction work is split across a number of "leaf" workers, each piece of work is based on a relatively small range of leaves. When the corresponding @@ -241,7 +253,9 @@ range `[0, N)`. The benefit of storing a compact range is in the ability to incrementally update it as the tree state evolves. See the picture below. -![witness](images/witness.png) +

+ +

Similarly to the [updatable proofs](#updatable-proofs), the accumulated space / bandwidth complexity of updating the state `O(N)` times is `O(N)`, as opposed diff --git a/docs/images/compact_ranges.png b/docs/images/compact_ranges.png deleted file mode 100644 index 1a36832..0000000 Binary files a/docs/images/compact_ranges.png and /dev/null differ diff --git a/docs/images/compact_ranges.svg b/docs/images/compact_ranges.svg new file mode 100644 index 0000000..ba73971 --- /dev/null +++ b/docs/images/compact_ranges.svg @@ -0,0 +1,509 @@ + + + + + + + + + + + Produced by OmniGraffle 7.12.1 + 2022-05-09 21:38:57 +0000 + + + compact-ranges + + + Layer 1 + + + + + + + + + 1.0 + + + + + 0 + + + + + 1 + + + + + + + + + + + + + 1.1 + + + + + 2 + + + + + 3 + + + + + + + + + + + 1.2 + + + + + 4 + + + + + 5 + + + + + + + + + + + 1.3 + + + + + 6 + + + + + 7 + + + + + + + + + + + 1.4 + + + + + + + 8 + + + + + 9 + + + + + + + + + + + 1.5 + + + + + 10 + + + + + 11 + + + + + + + + + + + 1.6 + + + + + 12 + + + + + 13 + + + + + + + + + + + 1.7 + + + + + 14 + + + + + 15 + + + + + 2.0 + + + + + + + 2.1 + + + + + 2.2 + + + + + + + 2.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3.0 + + + + + 3.1 + + + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + 16 + + + + + 17 + + + + + + + + + + + 1.9 + + + + + 18 + + + + + 19 + + + + + + + 20 + + + + + + + 2.4 + + + + + + + + + + + + 3.2 + + + + + + + + + + + + 5.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/compact_ranges_merge.png b/docs/images/compact_ranges_merge.png deleted file mode 100644 index 6a050c0..0000000 Binary files a/docs/images/compact_ranges_merge.png and /dev/null differ diff --git a/docs/images/compact_ranges_merge.svg b/docs/images/compact_ranges_merge.svg new file mode 100644 index 0000000..2694560 --- /dev/null +++ b/docs/images/compact_ranges_merge.svg @@ -0,0 +1,521 @@ + + + + + + + + + + + + + + + + Produced by OmniGraffle 7.12.1 + 2022-05-09 21:38:57 +0000 + + + compact-ranges-merge + + + Layer 1 + + + + + + + + + + + + 1.0 + + + + + 0 + + + + + 1 + + + + + + + + + + + + + 1.1 + + + + + 2 + + + + + 3 + + + + + + + + + + + 1.2 + + + + + 4 + + + + + 5 + + + + + + + + + + + 1.3 + + + + + 6 + + + + + 7 + + + + + + + + + + + + + 1.4 + + + + + + + 8 + + + + + + + 9 + + + + + + + + + + + + + 1.5 + + + + + 10 + + + + + 11 + + + + + + + + + + + 1.6 + + + + + 12 + + + + + 13 + + + + + + + + + + + 1.7 + + + + + 14 + + + + + 15 + + + + + 2.0 + + + + + + + 2.1 + + + + + + + 2.2 + + + + + + + 2.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3.0 + + + + + + + 3.1 + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + 16 + + + + + 17 + + + + + + + + + + + 1.9 + + + + + 18 + + + + + 19 + + + + + 20 + + + + + 2.4 + + + + + + + + + + + + 3.2 + + + + + + + + + + + + 5.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/consistency_proof.png b/docs/images/consistency_proof.png deleted file mode 100644 index fc5182d..0000000 Binary files a/docs/images/consistency_proof.png and /dev/null differ diff --git a/docs/images/consistency_proof.svg b/docs/images/consistency_proof.svg new file mode 100644 index 0000000..15589ad --- /dev/null +++ b/docs/images/consistency_proof.svg @@ -0,0 +1,386 @@ + + + + + + + + + + + Produced by OmniGraffle 7.12.1 + 2022-05-09 21:38:57 +0000 + + + consistency-proof + + + Layer 1 + + + + + + + + + 1.0 + + + + + 0 + + + + + 1 + + + + + + + + + + + 1.1 + + + + + 2 + + + + + 3 + + + + + + + + + + + + + 1.2 + + + + + 4 + + + + + 5 + + + + + + + + + + + + + 1.3 + + + + + 6 + + + + + 7 + + + + + + + + + + + 1.4 + + + + + 8 + + + + + 9 + + + + + + + + + + + 1.5 + + + + + 10 + + + + + 11 + + + + + + + + + + + 1.6 + + + + + 12 + + + + + 13 + + + + + + + + + + + 1.7 + + + + + 14 + + + + + 15 + + + + + + + 2.0 + + + + + 2.1 + + + + + 2.2 + + + + + 2.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3.0 + + + + + + + 3.1 + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/distributed_tree.png b/docs/images/distributed_tree.png deleted file mode 100644 index 5dbb51e..0000000 Binary files a/docs/images/distributed_tree.png and /dev/null differ diff --git a/docs/images/distributed_tree.svg b/docs/images/distributed_tree.svg new file mode 100644 index 0000000..7622479 --- /dev/null +++ b/docs/images/distributed_tree.svg @@ -0,0 +1,707 @@ + + + + + + + + + + + + + + + + Produced by OmniGraffle 7.12.1 + 2022-05-09 21:38:57 +0000 + + + distributed-tree + + + Layer 1 + + + + Worker 0 + + + + + + Coordinator + + + + + + Worker 2 + + + + + + Worker 1 + + + + + + Worker 3 + + + + + + + + + + + 1.0 + + + + + 0 + + + + + 1 + + + + + + + + + + + 1.1 + + + + + 2 + + + + + 3 + + + + + + + + + + + + + 1.2 + + + + + 4 + + + + + 5 + + + + + + + + + + + + + 1.3 + + + + + 6 + + + + + 7 + + + + + + + + + + + 1.4 + + + + + 8 + + + + + 9 + + + + + + + + + + + 1.5 + + + + + 10 + + + + + 11 + + + + + + + + + + + 1.6 + + + + + 12 + + + + + 13 + + + + + + + + + + + 1.7 + + + + + 14 + + + + + 15 + + + + + + + 2.0 + + + + + 2.2 + + + + + 2.3 + + + + + + + + + + + + + + + + + + + + + + + + + 3.1 + + + + + + + + + + + + + 16 + + + + + + + 17 + + + + + + + + + + + + + 1.9 + + + + + 18 + + + + + 19 + + + + + + + + + + + 1.10 + + + + + 20 + + + + + 21 + + + + + + + + + + + 1.11 + + + + + 22 + + + + + 23 + + + + + + + 2.5 + + + + + + + + + + + + + + + + + 1.12 + + + + + 24 + + + + + 25 + + + + + + + + + + + 1.13 + + + + + 26 + + + + + 27 + + + + + + + 2.6 + + + + + + + + + + + + + 28 + + + + + + + 29 + + + + + + + + + + + + + 1.15 + + + + + 30 + + + + + 31 + + + + + + + 1.2 + + + + + + + 1.3 + + + + + + + 2.0 + + + + + 2.1 + + + + + + + + + + + 3.0 + + + + + + + 3.1 + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + 16 + + + + + + + 17 + + + + + + + 1.9 + + + + + 2.4 + + + + + + + + + + + 3.2 + + + + + + + + 5.0 + + + + + + + + + + 2.5 + + + + + + + + + + 2.6 + + + + + 3.3 + + + + + + + + + + + + + + 1.14 + + + + + + + 28 + + + + + + + 29 + + + + + + + 1.15 + + + + + 2.7 + + + + + + + + + + + + + + 4.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compact ranges + + + + + diff --git a/docs/images/inclusion_proof.png b/docs/images/inclusion_proof.png deleted file mode 100644 index f5551de..0000000 Binary files a/docs/images/inclusion_proof.png and /dev/null differ diff --git a/docs/images/inclusion_proof.svg b/docs/images/inclusion_proof.svg new file mode 100644 index 0000000..7ee8ff3 --- /dev/null +++ b/docs/images/inclusion_proof.svg @@ -0,0 +1,391 @@ + + + + + + + + + + + Produced by OmniGraffle 7.12.1 + 2022-05-09 21:38:57 +0000 + + + inclusion-proof + + + Layer 1 + + + + + + + + + + + + 1.0 + + + + + 0 + + + + + 1 + + + + + + + + + + + 1.1 + + + + + 2 + + + + + 3 + + + + + + + + + + + + + 1.2 + + + + + 4 + + + + + 5 + + + + + + + + + + + 1.3 + + + + + + + 6 + + + + + + + 7 + + + + + + + + + + + 1.4 + + + + + 8 + + + + + 9 + + + + + + + + + + + 1.5 + + + + + 10 + + + + + 11 + + + + + + + + + + + 1.6 + + + + + 12 + + + + + 13 + + + + + + + + + + + 1.7 + + + + + 14 + + + + + 15 + + + + + + + 2.0 + + + + + 2.1 + + + + + 2.2 + + + + + 2.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3.0 + + + + + + + 3.1 + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/inclusion_proof_range.png b/docs/images/inclusion_proof_range.png deleted file mode 100644 index 037ec48..0000000 Binary files a/docs/images/inclusion_proof_range.png and /dev/null differ diff --git a/docs/images/inclusion_proof_range.svg b/docs/images/inclusion_proof_range.svg new file mode 100644 index 0000000..95b0f0e --- /dev/null +++ b/docs/images/inclusion_proof_range.svg @@ -0,0 +1,408 @@ + + + + + + + + + + + Produced by OmniGraffle 7.12.1 + 2022-05-09 21:38:57 +0000 + + + inclusion-proof-range + + + Layer 1 + + + + + + + + + 1.0 + + + + + 0 + + + + + 1 + + + + + + + + + + + 1.1 + + + + + 2 + + + + + 3 + + + + + + + + + + + + + 1.2 + + + + + 4 + + + + + 5 + + + + + + + + + + + + + 1.3 + + + + + + + 6 + + + + + + + 7 + + + + + + + + + + + + + 1.4 + + + + + + + 8 + + + + + + + 9 + + + + + + + + + + + + + 1.5 + + + + + + + 10 + + + + + + + 11 + + + + + + + + + + + 1.6 + + + + + + + 12 + + + + + + + 13 + + + + + + + + + + + + + 1.7 + + + + + 14 + + + + + 15 + + + + + + + 2.0 + + + + + 2.1 + + + + + + + 2.2 + + + + + 2.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3.0 + + + + + 3.1 + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/witness.png b/docs/images/witness.png deleted file mode 100644 index ab4412e..0000000 Binary files a/docs/images/witness.png and /dev/null differ diff --git a/docs/images/witness.svg b/docs/images/witness.svg new file mode 100644 index 0000000..e6f56c8 --- /dev/null +++ b/docs/images/witness.svg @@ -0,0 +1,745 @@ + + + + + + + + + + + + + + + + Produced by OmniGraffle 7.12.1 + 2022-05-09 21:38:57 +0000 + + + witness + + + Layer 1 + + + + Witness + + + + + + + + + + Log + + + + + + + + + + + 1.0 + + + + + 0 + + + + + 1 + + + + + + + + + + + 1.1 + + + + + 2 + + + + + 3 + + + + + + + + + + + 1.2 + + + + + 4 + + + + + 5 + + + + + + + + + + + 1.3 + + + + + 6 + + + + + 7 + + + + + + + + + + + 1.4 + + + + + 8 + + + + + 9 + + + + + + + + + + + 1.5 + + + + + 10 + + + + + 11 + + + + + + + + + + + 1.6 + + + + + + + 12 + + + + + + + 13 + + + + + + + + + + + + + 1.7 + + + + + 14 + + + + + 15 + + + + + 2.0 + + + + + + + 2.2 + + + + + 2.3 + + + + + + + + + + + + + + + + + + + + + + + 3.1 + + + + + + + + + + + 16 + + + + + 17 + + + + + + + + + + + 1.9 + + + + + 18 + + + + + 19 + + + + + + + + + + + 1.10 + + + + + + + 20 + + + + + + + 21 + + + + + + + + + + + + + 1.11 + + + + + 22 + + + + + 23 + + + + + 2.5 + + + + + + + + + + + 24 + + + + + 2.1 + + + + + + + 3.0 + + + + + + 4.0 + + + + + + + + + + + 1.8 + + + + + + + 2.4 + + + + + + + + + 3.2 + + + + + + + + + 5.0 + + + + + + + + + 4.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Old entries + + + + + Update 1 + + + + + + + + + + + = + + + + + + + + + Update 2 + + + + + + + + + + + + + + + = + + + + + Update 1: + + + + + Update 2: + + + + + + + 12 + + + + + + + 2.2 + + + + + + + 3.0 + + + + + + + + + + + 13 + + + + + + + 1.7 + + + + + + + 20 + + + + + + + 2.4 + + + + + + + + + + + 20 + + + + + + + 2.4 + + + + + + + 4.0 + + + + + + + + + + + 20 + + + + + + + 2.4 + + + + + + + 4.0 + + + + + + + + + + + 21 + + + + + + + 1.11 + + + + + + + + + + + 3.2 + + + + + + + 4.0 + + + + +