zkvm
We look for a data structure to commit the Ethereum State Trie equivalent.
In Eth1: State Trie is a Merkle Patricia Trie
A state in the vector is
State {
Nonce 254 bits
Balance 254 bits
StorageCommit
CodeCommit
}
CodeCommit is the commitment of the bytecode.
We want to construct indexed opcode like this
t_opcodes = [0add, 1mul, 2jump, 3add, 4mul, 5jumpdest, 6term]
We index the opcode with 2 bytes, since the max code size is bounded by 0x6000
per EIP 170[1]. Opcode can be represented in 1 byte.
t_opcodes = [0x000001, 0x000102, 0x000256, 0x000301, 0x000402, 0x00055B, 0x0006F3]
replaced the last one with RETURN. The code is used for demonstration of encoding and it does not make sense.
t_opcodes
can then be encoded/serialized.
In Eth1: storageTrie is the root of the storageTrie
128 level deep binary tree using poseiden hash
too shallow: risk colliding hashes in a slot
too deep: more cost of witness
Max SLOAD people can do in a eth1 block: 5770.
Max SLOAD in the circuit: 1580.
property: storage is constantly updating
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing