Questions tagged [rlp]

The purpose of RLP (Recursive Length Prefix) is to encode arbitrarily nested arrays of binary data, and RLP is the main encoding method used to serialize objects in Ethereum.

Filter by
Sorted by
Tagged with
2 votes
1 answer
71 views

How are Ethereum 2 block hashes computed?

After the merge, the block hash computation has a different formula. Before that, the following data were used to compute the hash via feeding the list of hex values to an RLP encoder and hashing the ...
Kianoush Arshi's user avatar
1 vote
1 answer
159 views

Manually RLP-encoding an ETH tx gives an incorrect result

I fetched a mempool tx AttributeDict({'blockHash': HexBytes('0x92911a95b4d4b07bb13552bfb29cc43bf43eb7d63af7c968ddaa3df9a6f22988'), 'blockNumber': 17964189, 'from': '...
user80100's user avatar
0 votes
1 answer
38 views

Why can big.Int be parsed after RLP encoding and decoding, but hexutil.big cannot be parsed?

Here are the definitions of these two types: // big.Int type Int struct { neg bool // sign abs nat // absolute value of the integer } // hexutil.Big type Big big.Int This is my test code: ...
meta's user avatar
  • 11
3 votes
2 answers
2k views

How to decode the output of an eth_call that returns a Tuple[]

I am developing a low-level library that interacts with RPC nodes directly. There is a requirement to call the AaveV2 getAllReserveTokens function, and I want to decode the output data. The particular ...
pestopasta's user avatar
1 vote
0 answers
206 views

Odd length hex issue when trying to RLP encode transaction

I'm trying to RLP encode a transaction I get from the mempool to get the signed transaction hex using ethersjs. Here's how the tx looks like initially: { "blockHash": null, "...
Javier Villanueva's user avatar
0 votes
1 answer
126 views

How is the FROM address known for historic transactions?

The rlp encoded transaction that is stored in the ethereum database does not include the from address. How is the from address known and how is it associated to the rlp transaction data when ...
Andreas Dilaveris's user avatar
0 votes
2 answers
2k views

eth_sendRawTransaction with DynamicFeeTx returns.. expected input list for types.LegacyTx

I have composed an EIP-1559 DynamicFeeTx using golang. tx = types.NewTx(&types.DynamicFeeTx{Nonce: nonce, GasFeeCap: gasMax, GasTipCap: gasTip, Gas: gasLimit, To: &to, Value: value, Data: data}...
Manolo's user avatar
  • 1
0 votes
0 answers
318 views

Why the Typed Transaction Needs to Be Encoded to RLP twice in Geth Source Code

I'm working on the Ethereum source code, but I can't understand why the EncodeRLE function in core/types/transaction.go needs to encode typed transaction twice. // EncodeRLP implements rlp.Encoder ...
learner L's user avatar
1 vote
2 answers
2k views

EIP-1559: Why does geth expect an input list for types.txdata?

I manually composed, signed, and serialized the following raw transaction: ...
q9f's user avatar
  • 32.8k
2 votes
1 answer
1k views

How to encode empty transaction fields?

I want to RLP-encode a(n unsigned) transaction. Some fields of the transaction can be empty/null/zero. I want to know how they are encoded, though. Let's assume the following transaction fields: ...
q9f's user avatar
  • 32.8k
0 votes
1 answer
392 views

rlp: non-canonical integer (leading zero bytes) for uint64, decoding into (types.LegacyTx).Nonce

I have written a program to send raw transactions via JSON-RPC. It seems to work for existing wallets, but I get this error when I try to send the very first transaction of a new wallet (nonce is zero)...
Kinjo's user avatar
  • 21
1 vote
1 answer
477 views

How to decode a raw transaction in Python? (superfluous bytes error)

I have a raw_tx in hex format. I'm using the following code to convert it from hexstr to a readable JSON text format. The issue is that I'm receiving the following error for certain transactions: ...
Ezequiel Talamona's user avatar
1 vote
1 answer
1k views

Unable to send_raw_transaction using Web3.py on Fantom Network

I am currently trying to simply send FTM from one wallet to another on Fantom mainnet, albeit encountering a Value error 'rlp: expected List' as listed below. ftm = Web3(Web3.HTTPProvider('https://...
MSalty's user avatar
  • 123
0 votes
0 answers
511 views

Getting error code -32000 (rlp: value size exceeds available input length) while sending raw matic transaction in C++

I use this repo (as well as this one) to generate raw transaction and send it to the Polygon network through JSON-RPC in C++, but I get the error code -32000 (rlp: value size exceeds available input ...
Ehsan Khodarahmi's user avatar
1 vote
0 answers
474 views

Re-create raw transaction hash from transaction object

Is there a way to re-create the signed transaction hash from tx object. I found the How to construct a raw Ethereum transaction from transaction data answer helpful, but when I try to re-create the ...
WhiteHat's user avatar
1 vote
1 answer
174 views

What is wrong with this hand-made raw transaction?

Here are two RLP-encodings of two signings of the same transaction --- for Goerli. Notice how the "Signed by" address is different. This must be implying something is wrong with my signing ...
user66567's user avatar
1 vote
1 answer
167 views

How to parse the node information in the nodes directory by leveldb?

I want to get all the node IP addresses of ETH, so I need to parse the geth/nodes directory, but I can't find the specific data format and cannot parse it. I found a same problem, but there is no ...
Z-LL's user avatar
  • 11
0 votes
1 answer
230 views

Is Ethereum block header a list?

Decoding a RLP encoded block using Eth specifications do we get header as list? But as per format i.e., [[blockHeader,transactionList,uncleList],totalDifficulty], blockHeader should have been string. ...
Genie's user avatar
  • 1
2 votes
0 answers
97 views

Calculated blockhash of PoA block mismatches with actual blockhash returned by RPC

I set up a Demo PoA chain using Parity Etheruem. I sent some transactions to it and it started producing blocks. A block on my demo PoA chain was generated with block hash ...
Soham Zemse's user avatar
  • 1,961
4 votes
2 answers
2k views

Understanding serialized unsigned raw transaction

I'm currently learning about RLP (ethereum-under-the-hood-part-ii, wiki-eth-rlp) and Ethereum transaction structure, my goal is to create an unsigned raw tx and then sign it. Right now I'm playing ...
onepix's user avatar
  • 273
1 vote
1 answer
1k views

RLP decoding for a list

in many standard documentation and many blogs, I have found the example for list with two strings like below [“cat”, “dog” ] -> C8 83 636174 83 646F67 and thats how it is decoded 1) Retrieve the ...
CaptPython's user avatar
0 votes
0 answers
489 views

sendRawTransaction insufficient funds while there is enough balance

Sorry I probably create a topic that was answered multiple times but unfortunately I couldn't find a solution. I'm trying to use RPC server of Geth to send a raw transaction. I've an address with a ...
G-Virus's user avatar
  • 51
2 votes
1 answer
2k views

Web3: Sending a signed serialized transaction throws an error: rlp: expected input list for types.txdata. Please help

I am feeding a signed serialized raw transaction to sendRawTransaction of web3. The problem is that whenever I call sendRawTransaction it throws an error: rlp: expected input list for types.txdata. ...
Brent Tudas's user avatar
2 votes
0 answers
134 views

is there a library to convert transaction receipt to rlp?

I found ethereumjs-tx for transaction to rlp, but i didnt find any libraries to convert transaction reciept to rlp. or is there a way to get rlp format transaction receipt from a service like infura ...
UncleJ's user avatar
  • 165
2 votes
1 answer
2k views

block hash from block-header rlp [duplicate]

Given the RLP of a block header, how do i get the block hash? https://github.com/ethereum/go-ethereum/blob/master/core/types/block.go#L99 The above link says: Hash returns the block hash of the ...
AnuragP's user avatar
  • 421
3 votes
1 answer
677 views

what type of encoding is used by the abi specification in solidity

the abi specification of solidity which provides functions like abi.encodePacked() using a certain type of encoding (eg: for functions, a 4 byte function signature hash followed by encoding of ...
Kombo's user avatar
  • 353
3 votes
1 answer
564 views

geth inter-node communication (devp2p/rlpx) encryption

I am currently analysing the encryption mechanisms used in geth. Currently I have gathered the following information from the source code (https://github.com/ethereum/go-ethereum/blob/master/p2p/rlpx....
ivicaa's user avatar
  • 7,519
2 votes
1 answer
697 views

Recovered Sender Address from Raw Transaction

I'm trying this code example : https://thomasclowes.com/verifying-an-ethereum-signature-on-the-server-php-2/ Expected $recoveredSenderAddress = 0xd5bfc359c3a377bb8afd41db8ffc8d1349718233 Actual $...
vincentLg's user avatar
  • 281
0 votes
1 answer
287 views

Rlp vs rlpx: the specified difference between rlp and rlpx?

Rlp vs rlpx - the specified difference between rlp and rlpx?
Nathan Aw's user avatar
  • 1,924
1 vote
2 answers
1k views

Broadcast error rlp: non-canonical integer (leading zero bytes) for uint64

Here's a transaction to broadcast: ...
user41804's user avatar
1 vote
1 answer
497 views

How does Ethereum differentiate between 0x0 and null during contract creation?

According to the EVM documentation, all values are initialized. This means to will contain the 0 address, as null is not a recognized state. The 0 address links to an external account (which we all ...
Garen Vartanian's user avatar
1 vote
0 answers
222 views

Hex Prefix Ethereum - Yellow Paper

I am trying to understand what is Hex Prefix as specified in the Yellow Paper(Appendix C), I don't see a similar reference in the whitepaper, but thank's to this awesome medium post I think I got it, ...
drao's user avatar
  • 311
2 votes
0 answers
220 views

What does "RlpInvalidIndirection" error mean?

I run my own Parity node for Ropsten network. I am sending raw transactions to the node with "eth_sendRawTransaction" api, and sometimes it returns {-32602, "Invalid RLP.", "RlpInvalidIndirection"} ...
santony's user avatar
  • 135
1 vote
1 answer
832 views

Correct way to deterministically compute contract address in Python

To begin with, I have already gone through the approach outlined in the following thread: How is the address of an Ethereum contract computed? I wanted to test if the approach actually works. On my ...
anomit's user avatar
  • 13
0 votes
1 answer
297 views

Why a length-1024 string of RLP encoding is \xb9\x04\x00?

In the Ethereum wiki RLP page, If a string is more than 55 bytes long, the RLP encoding consists of a single byte with value 0xb7 plus the length in bytes of the length of the string in binary form,...
Stonpid's user avatar
  • 103
0 votes
1 answer
468 views

How to sign a simple transfer TX with digitalbitbox python api

I'm trying to sign a simple transfer transaction using digitalbitbox's python api (see here and code snippet below). I send the following json to the HW wallet api: Sending: {"sign":{"data":[{"...
asardon's user avatar
3 votes
2 answers
3k views

How to RLP-encode messages in Solidity

I'm trying to figure out how to interact with the current version of the Casper contract from Solidity. The vote-function in the casper contract takes an array of bytes, which represents the RLP-...
Henk's user avatar
  • 4,256
3 votes
2 answers
270 views

RLP Rationale Question

I am trying to understand why RLP was chosen and developed as an in-house protocol.I stumbled up this link which provides some insights: https://github.com/ethereum/wiki/wiki/Design-Rationale Trying ...
drao's user avatar
  • 311
1 vote
1 answer
533 views

How long can a string be until it spills into the next word?

string is dynamic length storage. I imagine a string of length (bytes length) 1, 2 or 3 is all the same length on storage, probably one word. Which byte causes it to spill over into a second, third ...
William Entriken's user avatar
2 votes
1 answer
1k views

RLP decoding question

I am trying to understand what this means from the RLP white paper wiki "The only purpose of RLP is to encode structure; encoding specific data types (eg. strings, floats) is left up to higher-order ...
drao's user avatar
  • 311
7 votes
1 answer
662 views

Ethereum network messaging

I am trying to "join the dots" around the networking aspect of Ethereum. From the documents, it seems, the underlying protocol is RLPx that powers the ÐΞVp2p Wire Protocol. Though TCP provides a ...
cogitoergosum's user avatar
3 votes
2 answers
2k views

RLP ethereum decoding

Hi! I have some data, like this ( 827ab7 ), encoding RLP. How I can to know, what is it (string, list or int)?
Andrey's user avatar
  • 31
3 votes
1 answer
424 views

What is the shared nibble of this extension node?

I have an extension node here: Key: 000b17906abb9f83c5e190bc3d0bed212e66bf44d99997c53c2071e1413194b6 Value: [ 3866a6d45a815576000da23c1a017179233e9d6437806aef7c2264588739d0, ...
Fortune's user avatar
  • 502
2 votes
1 answer
273 views

How Merkle Tree obtain root node hash (example from 'Understanding the ethereum trie')?

I read Understanding the ethereum trie and try to do examples from that article. Now i am at ex1.py - first exaple. Look at code from that example: import sys sys.path.append('src') import trie, ...
Gudsaf's user avatar
  • 317
4 votes
2 answers
2k views

Block header format

Does anyone understand what each element of a block header represents? I have an example block header represented here: [ cd7bd64fba4cc782fe5474d3640882afece5887180591e72f80ce6916cf73526, ...
Fortune's user avatar
  • 502
2 votes
1 answer
322 views

Confusion over RLP encoding for byte array > 55 bytes

I am reading through the wiki on RLP (https://github.com/ethereum/wiki/wiki/RLP) and think I am missing something fundamental. For byte arrays (not lists) greater than 55 bytes, the RLP encoding is ...
jojeyh's user avatar
  • 769
0 votes
1 answer
1k views

Does RLP specify integer encoding?

The RLP specification says the following about integers: The only purpose of RLP is to encode structure; encoding specific atomic data types (eg. strings, ints, floats) is left up to higher-order ...
Sentinel's user avatar
  • 1,238
7 votes
2 answers
6k views

LevelDB in Geth, key and values

When parsing through the levelDB or RocksDB (Depending on the client you are using) there are string values representing the key and the value. These are both stored as Byte arrays as well. My ...
Fortune's user avatar
  • 502
2 votes
1 answer
238 views

binary encoding of nonce 0

Although probably not an issue in practice, I'm confused how nonce of zero is encoded in transactions. According to RLP doc, \x00 should be encoded as \x00. But the source code of pyethereum shows ...
qweruiop's user avatar
  • 251
16 votes
1 answer
4k views

Why was RLP chosen as the low level protocol encoding algorithm?

Is this an ad-hoc decision? Why RLP? Is it specifically suited to something?
Sentinel's user avatar
  • 1,238