Issue
- You attempt to send a transaction through an EVM-based node.
- The node rejects the transaction wth the following error message:
only replay-protected (EIP-155) transactions allowed over RPC
Cause
The node rejects transactions that do not provide the chain ID to protect from being able to replay them on other EVM chains.
See EIP-155: Simple replay attack protection.
Solution
Provide a chain ID in your transaction. Example of payload:
transaction = { 'to': '0xRecipientAddress',
'value': web3.toWei(0.1, 'ether'),
'gas': 2000000,
'gasPrice': web3.toWei('50', 'gwei'),
'nonce': web3.eth.getTransactionCount('0xYourAddress'),
'chainId': 1 }
For the available chain IDs of EVM networks, see Chainlist.
Comments
0 comments
Article is closed for comments.