浅析RLP-以太坊的数据编码方式
概述
RLP(RecursiveLength Prefix)是以太坊中序列化数据的编码方式。
既然是编码方式,下面结合代码详细看看RLP的奥秘:
官方定义:
RLP encoding is defined as follows:
- For a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.
- Otherwise, if a string is 0-55 bytes long, the RLP encoding consists of a single byte with value 0x80 plus the length of the string followed by the string. The range