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

RLP encoding steps missing (Section 2.1.3) #5

Open
deepakraous opened this issue Mar 7, 2018 · 4 comments
Open

RLP encoding steps missing (Section 2.1.3) #5

deepakraous opened this issue Mar 7, 2018 · 4 comments
Assignees

Comments

@deepakraous
Copy link

Thank you so much for this awesome work. This will greatly help me understand the yellow. I appreciate the time and effort that has been put into this document.

Related issue:
Page: 2 - Under 2.1.3. Recursive Length Prefixes. There is only step 1 in the document
"1. If the RLP-serialized byte-array contains a single byte integer value less than 128,
then the output is exactly equal to the input"

need to add the rest of the encoding logic as defined in the white paper
https://github.com/ethereum/wiki/wiki/RLP
for e.g:
2. "if the RLP-serialized byte-array contains a string... "

Many Thanks

@deepakraous
Copy link
Author

Sorry for the delay, here is my take on step 2. below, do let me know what you think I can finish up the rest in a similar format

  1. else, if the RLP-serialized byte array is a string and length of the string is 0-55 bytes long then use following encoding logic:
    RLP encoding consists of a single byte with value 0x80 plus the length of the string followed by the string. ( 0x80+length(string) )+string
    e:g ["cat"]
    byte array of string "cat" = ['c', 'a', 't']
    by applying the above encoding logic the output will be
    [ 0x80 + 3 + 'c', 'a', 't' ]
    finally to [0x83,0x63,0x61,0x74]

@chronaeon
Copy link
Owner

Partially fixed in 8851fbc.

(Still need to add the rules)

@deepakraous
Copy link
Author

Yep, makes sense

@deepakraous
Copy link
Author

deepakraous commented Apr 4, 2018 via email

Repository owner deleted a comment from synchrovision Feb 6, 2024
Repository owner deleted a comment from toykam Feb 23, 2024
Repository owner deleted a comment from duskagain Feb 23, 2024
Repository owner deleted a comment from akashakki Mar 1, 2024
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

2 participants