beigepaper icon indicating copy to clipboard operation
beigepaper copied to clipboard

RLP encoding steps missing (Section 2.1.3)

Open deepakraous opened this issue 6 years ago • 4 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

deepakraous avatar Mar 07 '18 11:03 deepakraous

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]

deepakraous avatar Mar 14 '18 00:03 deepakraous

Partially fixed in 8851fbcc5e9e3eaa25225b83d1bb15f4949ffc84.

(Still need to add the rules)

chronaeon avatar Mar 15 '18 05:03 chronaeon

Yep, makes sense

deepakraous avatar Mar 15 '18 07:03 deepakraous

May I know the reason why?

On Wed, Apr 4, 2018 at 3:47 AM, Micah Dameron [email protected] wrote:

@deepakraous https://github.com/deepakraous I'm trying to put together some analogues from other forms of encoding, like UTF-8 or ASCII to make some comparisons. Do you think that would be possible or profitable?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chronaeon/beigepaper/issues/5#issuecomment-378558695, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUP8A3LF_kNQ_k2khQkf1Mak3N0iL0Gks5tlKStgaJpZM4SgTSM .

deepakraous avatar Apr 04 '18 21:04 deepakraous