You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/zkEVM/architecture/zkprover/storage-state-machine/construct-key-path.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,7 +191,7 @@ $$
191
191
192
192
## Special cyclic register for leaf levels
193
193
194
-
Define a register called _LEVEL_ which is vector of four bits, three 0 bits and one 1 bit. And the operation _ROTATE_LEVEL_ which is the left rotation of _LEVEL_'s bits by one position.
194
+
Define a register called _LEVEL_ which is a vector of four bits; three 0 bits and one 1 bit. And the operation _ROTATE_LEVEL_ which is the left rotation of _LEVEL_'s bits by one position.
195
195
196
196
If _LEVEL_ is initialised as $(1,0,0,0)$, observe that applying _ROTATE_LEVEL_ four times brings _LEVEL_ back to $(1,0,0,0)$. That is,
Copy file name to clipboardExpand all lines: docs/zkEVM/architecture/zkprover/storage-state-machine/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ A standard state machine is characterized by sets of states (as inputs) stored i
2
2
3
3

4
4
5
-
State machine can be monolithic, where it is a prototype of one particular computation, while others may specialise with certain types of computations. Depending on the computational algorithm, a state machine may have to run through a number of state transitions before producing the desired output. Iterations of the same sequence of operations may be required, to the extend that most common state machines are cyclic by nature.
5
+
Some state machines can be monolithic, serving as prototypes for a specific computation, while others may specialize in performing multiple computations of the same type. Depending on the computational algorithm, a state machine may have to run through a number of state transitions before producing the desired output. Iterations of the same sequence of operations may be required, to the extend that most common state machines are cyclic by nature.
6
6
7
7
The _Storage_ state machine is one of the secondary zkProver state machines responsible for all operations on data stored in the zkProver's storage. It receives instructions from the Main state machine, called _Storage Actions_. The Main state machine performs typical database operations such as: Create, Read, Update and Delete (CRUD); and then instructs the Storage state machine to verify whether these were correctly performed.
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/sparse-merkle-trees/detailed-smt.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ That is, use two different hash functions; one hash function to hash leaves, den
103
103
Reconsider now, the Scenario A, given above. Recall that the Attacker provides the following;
104
104
105
105
- The key-value $(K_{\mathbf{fk}}, V_\mathbf{{fk}})$, where $K_{\mathbf{fk}} = 11010100$ and $V_{\mathbf{fk}} = \mathbf{L_{a}} \| \mathbf{L_{b}}$.
106
-
- The root $\mathbf{{root}_{ab..f}}$ , the number of levels to root, and the siblings $\mathbf{{S}_{\mathbf{cd}}}$ and $\mathbf{{S}_{\mathbf{ef}}}$.
106
+
- The root $\mathbf{{root}_{ab..f}}$ , the number of levels to root, and the siblings $\mathbf{{S}_{\mathbf{cd}}}$ and $\mathbf{{S}_{\mathbf{ef}}}$.
107
107
108
108
The verifier suspecting no foul, uses $K_{\mathbf{fk}} = 11010100$ to navigate the tree until he finds $V_{\mathbf{fk}}$ stored at $\mathbf{L_{fk}} := \mathbf{{B}_{ab}}$.
109
109
@@ -130,24 +130,24 @@ Whenever the verifier needs to check inclusion of the given key-value pair $(K_{
130
130
Both computations involve climbing the tree from the located leaf $\mathbf{{L}_{x}}$ back to the root, $\mathbf{{root}_{a..x}}$. And the two computations are;
131
131
132
132
1. Checking correctness of the key $K_{\mathbf{x}}$.
133
+
134
+
That is, verifier takes the Remaining Key, $\text{RK}_{\mathbf{x}}$, and reconstructs the key $K_{\mathbf{x}}$ by concatenating the key bits used to navigate to $\mathbf{{L}_{x}}$ from $\mathbf{{root}_{a..x}}$, in the reverse order.
133
135
134
-
That is, verifier takes the Remaining Key, $\text{RK}_{\mathbf{x}}$, and reconstructs the key $K_{\mathbf{x}}$ by concatenating the key bits used to navigate to $\mathbf{{L}_{x}}$ from $\mathbf{{root}_{a..x}}$, in the reverse order.
136
+
Suppose the number of levels to root is 3, and the least-significant bits used for navigation are $\text{kb}_\mathbf{2}$, $\text{kb}_\mathbf{1}$ and $\text{kb}_\mathbf{0}$.
135
137
136
-
Suppose the number of levels to root is 3, and the least-significant bits used for navigation are $\text{kb}_\mathbf{2}$, $\text{kb}_\mathbf{1}$ and $\text{kb}_\mathbf{0}$.
138
+
In order to check key-correctness, verifier takes the remaining key $\text{RK}$ and,
137
139
138
-
In order to check key-correctness, verifier the remaining key $\text{RK}$ and,
140
+
- Concatenates $\text{kb}_\mathbf{2}$ and gets $\text{ } \text{RK}\| \text{kb}_\mathbf{2}$,
139
141
140
-
- Concatenates $\text{kb}_\mathbf{2}$ and gets $\text{ } \text{RK} \| \text{kb}_\mathbf{2}$,
He then sets $\tilde{K}_{\mathbf{x}} := \text{RK} \| \text{kb}_\mathbf{2} \| \text{kb}_\mathbf{1} \| \text{kb}_\mathbf{0}$, and checks if $\tilde{K}_{\mathbf{x}}$ equals $K_{\mathbf{x}}$.
146
+
He then sets $\tilde{K}_{\mathbf{x}} := \text{RK} \| \text{kb}_\mathbf{2} \| \text{kb}_\mathbf{1} \| \text{kb}_\mathbf{0}$, and checks if $\tilde{K}_{\mathbf{x}}$ equals $K_{\mathbf{x}}$.
147
147
148
148
2. The Merkle proof: That is, checking whether the value stored at the located leaf $\mathbf{{L}_{x}}$ was indeed included in computing the root, $\mathbf{{root}_{a..x}}$.
149
-
150
-
This computation was illustrated several times in the above discussions. Note that the key-correctness and the Merkle proof are simultaneously carried out.
149
+
150
+
This computation was illustrated several times in the above discussions. Note that the key-correctness and the Merkle proof are simultaneously carried out.
151
151
152
152
### Example: Indistinguishable leaves
153
153
@@ -236,11 +236,13 @@ $$
236
236
Consequently, although the key-value pairs $(K_{\mathbf{x}}, V_\mathbf{{x}})$ and $(K_{\mathbf{z}}, V_\mathbf{{z}})$ might falsely pass the key-correctness check, they do not pass the Merkle proof test. And this is because, collision-resistance also guarantees that the following series of inequalities hold true;
where; $\mathbf{S}_\mathbf{{b}}$ is a sibling to $\mathbf{L}_{\mathbf{x}}$ and $\mathbf{S}_\mathbf{{a}}$ is a sibling to $\mathbf{B_{bx}}$, making $\mathbf{B_{bx}}$ and $\mathbf{B_{abx}}$ branches traversed while climbing the tree from $\mathbf{L_{x}}$ to root; Similarly, $\mathbf{S}'_\mathbf{{b}}$ is a sibling to $\mathbf{L}_{\mathbf{z}}$, while $\mathbf{S}'_\mathbf{{a}}$ is a sibling to $\mathbf{B_{bx}}$, also making $\mathbf{B_{bz}}$ and $\mathbf{B_{abz}}$ branches traversed while climbing the tree from $\mathbf{L_{z}}$ to root.
@@ -300,7 +302,7 @@ The verifier, on the other hand, has to adjust the Merkle proof by starting with
300
302
- Secondly, concatenating the hashed-value $\text{HV}_\mathbf{{x}}$ and the remaining key $\text{RK}_\mathbf{{x}}$,
301
303
- Thirdly, hashing the concatenation in order to form the leaf, $\mathbf{L_{x}} := \mathbf{H_{leaf}}( \text{RK}_\mathbf{x} \| \text{HV}_\mathbf{{x}})$.
302
304
303
-
### Example: Zero-Knowledge Merkle Proof
305
+
### Example. (Merkle proof on hidden values)
304
306
305
307
The following example illustrates a Merkle proof when the above strategy is applied.
0 commit comments