0

There is this part of Ethereum whitepaper which describes accounts:

An Ethereum account contains four fields:
- The nonce, a counter used to make sure each transaction can only be processed once
- The account's current ether balance
- The account's contract code, if present
- The account's storage (empty by default)

It sounds like an Account is a type/structure so I wanted to find it in Ethereum implementation but I am struggling to do so.
I have found Account struct in accounts.go file in accounts package.
This struct contains only Address and URL. So all four "fields" mentioned in the whitepaper are missing.
Am I looking in the wrong place or is whitepaper not fully consistent with the actual code?

1 Answer 1

2

accounts.go that you mention is for the user account management (think wallet software) on the Geth node like opening a wallet, closing a wallet, signing a transaction and so on.

For the actual account model implementation, including nonce, balance, code, storage look into statestatedb.go and state_object.go in particular.

1
  • It seems statedb.go uses StateAccount struct (package: types, file: state_account.go)
    – bridgemnc
    Feb 13 at 20:51

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.