[Ethereum] “invalid sender” error with web3 on a PoA private net

go-ethereumpoaweb3js

I am using web3 to sign the following transaction and send it to a node using sendSignedTransaction. However I keep getting "invalid sender" error.

I have set the network id to 6454 in genesis.json and the node was started with the same network id. I have used the same for signing the transaction too.

{
"to": "0x609be532b4411da754c55295f9a067819d2b563c",
"value": "0xff",
"gas": "0x61a8",
"gasPrice": "0x1e8f1c10800",
"from": "0x55eb76b1d8ff63ffbe211913a7f91a17cb98063c",
"nonce": "0x0",
"chainId": 6454,
"data": ""

}

EDIT;
Here is my genesis.json

{
"config": {
    "chainId": 6454,
    "homesteadBlock": 1,
    "eip150Block": 2,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 3,
    "eip158Block": 3,
    "byzantiumBlock": 4,
    "clique": {
    "period": 1,
    "epoch": 30000
    }
},
"nonce": "0x0",
"timestamp": "0x5b33af98",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000240ebbd4e36bce0071994d62c78319d028fb651bac65b46b5c6257bd7c790fa51eb54d9f68f559d20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
    "240ebbd4e36bce0071994d62c78319d028fb651b": {
    "balance": "0x500000000000000000000000000000000000000000000000000000000000000"
    },
    "ac65b46b5c6257bd7c790fa51eb54d9f68f559d2": {
    "balance": "0x500000000000000000000000000000000000000000000000000000000000000"
    }
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

Best Answer

The most probable error is that you used wrong chainId, or your private chain has not configured EIP155 block number. Set EIP155 block number to 1 to fix this. Also the wallet you are using to send the transaction must be EIP155 enabled.

Otherwise, you have to debug your signing process, because your question doesn't provide any detailed info to make a more certain guess.

From the sources:

// Make sure the transaction is signed properly
from, err := types.Sender(pool.signer, tx)
if err != nil {
    return ErrInvalidSender
}
Related Topic