8

In a plain ether transfer from one Externally Owned Account to another, for which the base fee of 21000 gas has been provided, how is the EVM involved if at all? I realize that the signature needs to be verified, and of course the ether balance fields will have to be updated. How is this accomplished?

2 Answers 2

7

Currently, no EVM instructions are needed at all - a transaction between two externally owned accounts transfers value directly, with no need to execute any code. Signature verification etc happens as part of the execution of the Ethereum system.

1
  • Wow, fascinating. But how is the EVM state updated if no EVM operations are performed? Or does the state update take place somewhere else outside of the EVM? Commented May 3, 2022 at 9:17
5

The sending of a transaction from one Externally Owned Account (EOA) to another EOA does not involve the running of the EVM.

Here are my results from my testing.

I am running geth with admin.verbosity(6).

Here are the debug logs from a transaction from one EOA to another EOA:

> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(1, "ether")})
"0x2f2bc467573740ce8dc97cf4f929f49d741b24c55e43703ff7d313a359b8d890"
...
I0414 19:02:14.966112    6451 state_processor.go:83] receipt{med=e94a45839f1d47bf00779aa5d7546cbb8da06ac7c7eeeb98c27c2f98d773a4ec cgas=21000 bloom=0000000000000...000000000 logs=[]}
...
I0414 19:02:36.743200    6451 tx_pool.go:492] removed tx (
    TX(2f2bc467573740ce8dc97cf4f929f49d741b24c55e43703ff7d313a359b8d890)
    Contract: false
    From:     8d15cd39bdb00d5362775002c342c168ee707400
    To:       043f7fdc6e789060bfad91f7bba100d20a1cdf18
    Nonce:    4
    GasPrice: 20000000000
    GasLimit  90000
    Value:    1000000000000000000
    Data:     0x
    V:        0x1c
    R:        0x614fcf44cb76c056675c5929efb7cf2eb27d753f25b45eb74de868a9a9d62baa
    S:        0x339802b777fb88f699aa0a8dbbe48c7dcb95c8347aad70d87f3021dc291e43bb
    Hex:      f86d048504a817c80083015f9094043f7fdc6e789060bfad91f7bba100d20a1cdf18880de0b6b3a7640000801ca0614fcf44cb76c056675c5929efb7cf2eb27d753f25b45eb74de868a9a9d62baaa0339802b777fb88f699aa0a8dbbe48c7dcb95c8347aad70d87f3021dc291e43bb
) from pool: low tx nonce or out of funds

And here are the debug logs from inserting the Greeter contract (Deploying the Greeter contract via the geth CLI is not registering in my private blockchain) into the blockchain - the EVM is executed:

I0414 19:06:58.157691    6451 vm.go:135] running byte VM 3551fd0f
I0414 19:06:58.158346    6451 vm.go:138] byte VM 3551fd0f done. time: 628.75µs instrc: 117
VM STAT 118 OPs
PC 00000000: PUSH1 GAS: 3940349 COST: 3
STACK = 0
MEM = 0
STORAGE = 0

PC 00000002: PUSH1 GAS: 3940346 COST: 3
STACK = 1
0000: 0000000000000000000000000000000000000000000000000000000000000060
MEM = 0
STORAGE = 0

PC 00000004: MSTORE GAS: 3940334 COST: 12
STACK = 2
0000: 0000000000000000000000000000000000000000000000000000000000000040
0001: 0000000000000000000000000000000000000000000000000000000000000060
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

...
I0414 19:06:58.183560    6451 state_processor.go:83] receipt  {med=ab56da6288edf03204f3b9ad86ddfea3ec84bec3c21b173e6779768463ee8beb cgas=173426 bloom=00000...00000000 logs=[]}



EDIT: In response to the comment, I'm sending some extra data with the transaction.

> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(1, "ether"), data:'0x12345678901234567890'})
"0x677ea32b0c4863727313c372d0e42b48b849d212fdb11e8dd7f5d2da4516bf6a"
...
I0414 19:20:16.172457    6573 state_processor.go:83] receipt{med=d973bd63b9151700e77aaee0db812d62997d219052bf84769ca43f4032e92df8 cgas=21680 bloom=000000...00000 logs=[]}

So no EVM involved even when extra data is sent with the transaction.

5
  • 2
    no evm even if you add a data in the transaction ? just curious ;)
    – euri10
    Commented Apr 14, 2016 at 9:17
  • 2
    To clarify further on the matter of attaching data to a transaction: either the recipient needs to be a contract, which has code or the recipient is empty, which creates a contract and executes the attached data as opcodes according to the EVM specification.
    – Jeffrey W.
    Commented Apr 14, 2016 at 11:05
  • 1
    @JeffreyW. Correct me if I'm wrong, but there's nothing prohibiting you sending additional data to an EOA; it just won't do anything. Commented Apr 14, 2016 at 11:26
  • 2
    @NickJohnson you're correct, nothing is preventing you from doing so. Please bear in mind that adding extra data to a transaction will cost you more gas: non-zero value will cost you an additional 68 and a zero value will cost you an additional 4. So the data 0xaa00aa would cost you 140 gas.
    – Jeffrey W.
    Commented Apr 14, 2016 at 11:30
  • This answer was very informative; taught me several things.
    – KLmoney
    Commented Apr 14, 2016 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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