3

In a private testnet, I sent some ether from one external account to another. There is no input data. It cost 24,000 gas, instead of 21,000. Is this normal?

> web3.eth.sendTransaction({from:eth.coinbase,to:"0x0000000000000000000000000000000000000001", value:3000000000000000000})
"0x7e55fd8ffc1a150f30ca5f5845b6e3af3507b3443d326e1d755748864886bcf7"

> eth.getTransactionReceipt("0x7e55fd8ffc1a150f30ca5f5845b6e3af3507b3443d326e1d755748864886bcf7")
{
  blockHash: "0x90cbda119916bfd9a481a9eedec6af74bce6ac4f6e8c3d7ccf6ea4a13038d5d7",
  blockNumber: 24073,
  contractAddress: null,
  cumulativeGasUsed: 24000,
  from: "0xf6de496ec5601d74937ddd77af09c8cd4ba41ab5",
  gasUsed: 24000,
  logs: [],
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  status: "0x1",
  to: "0x0000000000000000000000000000000000000001",
  transactionHash: "0x7e55fd8ffc1a150f30ca5f5845b6e3af3507b3443d326e1d755748864886bcf7",
  transactionIndex: 0
}
4

This is probably because the address 0x0000000000000000000000000000000000000001 is actually a precompile, meaning it is a contract, so it'll cost more. It's the ECDSA recovery contract. For more information, see Appendix E of the yellow paper at https://ethereum.github.io/yellowpaper/paper.pdf.

  • You are right. If I send to regular address, it always costs exactly 21,000. – sinoTrinity Jun 5 '18 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.