1

In the Ethereum yellow-paper, it's specified that creating a new account costs 25000 gas (Appendix G, entry for Gnewaccount).

We can see this if, for example, we call a function that makes a transfer:

function test (address receiver) public payable { receiver.transfer(msg.value); }

It costs 30356 if sent to an existing address and 55356 if sent to a new address.

The question is, why don't we see the same behavior if we make a regular ether transaction? Just calling receiver.transfer(msg.value); costs always 21000 gas no matter if the transaction is to a new or old address.

A new account is created, the same way as the function call, since is storing a new account on chain, shouldn't the cost be 46000?

Your Answer

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

Browse other questions tagged or ask your own question.