Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty account should has explicity constraints #27

Open
noel2004 opened this issue Apr 13, 2023 · 0 comments
Open

Empty account should has explicity constraints #27

noel2004 opened this issue Apr 13, 2023 · 0 comments

Comments

@noel2004
Copy link
Member

There are two type of leaf nodes (leaf and empty) at the last row of a mpt circuit, which is adjacent to the rows of a account gadget. When the type of lead node is empty the value (hash) in this row is just zero so we can make the account gadget valid by flushing zero inside it (hashing (0, 0) -> 0 is valid in hash table current) but this has bring some unsound condition and should be fixed later (#17). It is also contradict to the "write on empty accont" entry of the rw table (#14)

So we should add explicity constraints in account gadget to accounting for the empty node in its adjacent mpt row that:

  • All variables in account except for code hashes (nonce, balance, codesize, storage root) is 0
  • code hash is poseidon(nil) and keccak code hash is keccak256(nil)

And make current constraints only being enabled for leaf node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant