According to the docs here,
For a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding
I ran the following using pyrlp (similar to the code in pyethereum here):
res = rlp.encode([1, 0])
print ':'.join(x.encode('hex') for x in res)
and got a result of c2:01:80
.
The c2
refers to the list identifier (c0
+ 2 bytes for the following 2 elements). The 01
is obviously the first element in the array (1), encoded as itself. The 0 however is encoded to hex 80, which from my understanding of the documentation should not be the case.
I did notice in the examples on the RLP wiki that the null string encodes to hex 80, so is that factoring into this somehow?