Polygon RPC: "only replay-protected (EIP-155) transactions allowed over RPC"

I am trying to broadcast a transaction via a https://polygon-mainnet.infura.io/v3 endpoint that normally succeeds on Ethereum public networks like mainnet, rinkeby, kovan etc. However, I receive this error response:

only replay-protected (EIP-155) transactions allowed over RPC

I was able to fix this by reading this thread and hardcoding chainId: 137 into my transaction config.

If Infura’s polygon nodes do enforce transaction replay-protection, like geth does by default as of v1.10, then this is confusing for users because the ethereum nodes empirically do not enforce this because I can send ethereum transactions without specifying chainId.

1 Like

you need to start passing chainId in your raw transactions

Yeah, minor inconvenience. Hopefully someone else finds this thread helpful. Does Infura plan to start enforcing replay-protection for its Ethereum nodes also?

Hi @nicholaspai - we’re currently reviewing this as a team to see what the potential best way to roll it out would be. We don’t have any updates yet, but when we do, we’ll be sure to inform the community.

my first time using Polygon, faced the same issue. But where is this Transaction config file? I’m using truffle, can you help please?

Hi @Amit_Raina, and welcome to the Infura community! Check out this tutorial - it should have all the info you need :slight_smile:

Hi

I get the same error response when sending erc-20 token on polygon chain:

only replay-protected (EIP-155) transactions allowed over RPC

When the chainId is added, I get the same response.

let rawTx = {
  nonce: this.web3.utils.toHex(123),
  gasLimit: this.web3.utils.toHex(150000000000),
  gasPrice: this.web3.utils.toHex(30000), // 10-15 gwei should do it
  to: contractAddress,
  value: "0x00",
  data: data,
  chainId: 137
};

I’m working with the following versions:

const Web3 = require('web3'); // 1.5.3
const Tx = require('@ethereumjs/tx').Transaction; // 3.3.0

I really don’t know what I can do left. Does anybody have a full working example of how to send erc20 token on polygon mainnet from one address to other?

Important: I DO NOT want send erc20 (eth-chain) to matic-chain !!

All I want to do is moving erc20 funds from one address to an other address on the matic mainnet. This question was also asked several times in the Polygon Discord channel without any answer.

1 Like