chronaeon / beigepaper

Rewrite of the Yellowpaper in non-Yellowpaper syntax.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RLP encoding steps missing (Section 2.1.3)

deepakraous opened this issue · comments

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

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]

Partially fixed in 8851fbc.

(Still need to add the rules)

Yep, makes sense