-
Notifications
You must be signed in to change notification settings - Fork 272
MPT description #136
base: master
Are you sure you want to change the base?
MPT description #136
Conversation
specs/mpt-proof.md
Outdated
- `sel2` | ||
|
||
Whether the factor 16 is used or not is determined by `sel1/sel2` columns. | ||
`sel1/sel2` are boolean values and it holds `sel1 + sel2 = 0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess sel1 + sel2 = 0
would indicate both sel1
and sel2
are 0. Should it be sel1 + sel2 = 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @noel2004 , I haven't seen the question until now. But you are totally right, I will fix it!
A dumb question: What does the s_/c_ stand for? state & change? |
Not dumb at all. I am not sure whether I thought of being state & change when I named it, but it's actually a very good description of what it is about! :) Not sure, maybe it would cause less confusion if I rename it to |
maybe they make less confusion, but personally I just thought a new pair of words like these instead of prev_/curr_ is fancier. :) |
Ok, will leave it for now :). Thanks for looking into it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slowly crawling through the doc 🐢
specs/mpt-proof.md
Outdated
Let's say we have a leaf: | ||
|
||
``` | ||
key = [10,6,3,5,7,0,1,2,12,1,10,3,10,14,0,10,1,7,13,3,0,4,12,9,9,2,0,3,1,0,3,8,2,13,9,6,8,14,11,12,12,4,11,1,7,7,1,15,4,1,12,6,11,3,0,4,2,0,5,11,5,7,0,16] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow the part.
A hashed output should be 32 bytes, but the array has 64 elements. Are we representing the key in nibbles here?
If the key is in nibbles, the value in the array should range from 0~15. Why is the last one 16?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a bit of info in 49a36c6.
It's nibbles, yes, just for demonstration, but as it's written down below this gets transformed into bytes (actually a compact form) for a proof witness.
The last byte is a terminator - this is to distinguish between a leaf and extension node (both are using ShortNode struct).
No description provided.