Accounts are a very beginner-friendly topic. But to help you better understand this page, we recommend you first read through our introduction to Ethereum.
nonce– a counter that indicates the number of transactions sent from the account. This ensures transactions are only processed once. If a contract account, this number represents the number of contracts created by the account
balance– the number of Wei owned by this address. Wei is a denomination of ETH and there are 1e+18 Wei per ETH.
codeHash– All such code fragments are contained in the state database under their corresponding hashes for later retrieval. For contract accounts, this is the code that gets hashed and stored as the codeHash. For externally owned accounts, the codeHash field is the hash of the empty string.
storageRoot– A 256-bit hash of the root node of a Merkle Patricia tree that encodes the storage contents of the account (a mapping between 256-bit integer values), encoded into the trie as a mapping from the Keccak 256-bit hash of the 256-bit integer keys to the RLP-encoded 256-bit integer values. This tree encodes the hash of the storage contents of this account, and is empty by default.
The public key is generated from the private key using Elliptic Curve Digital Signature Algorithm. You get a public address for your account by taking the last 20 bytes of the public key and adding
0x to the beginning.
Here's an example of creating an account in the console using GETH's
1> personal.newAccount()2Passphrase:3Repeat passphrase:4"0x5e97870f263700f46aa00d967821199b9bc5a120"56> personal.newAccount("h4ck3r")7"0x3d80b31a78c30fc628f20b2c89d7ddbf6e53cedc"8
It is possible to derive new public keys from your private key but you cannot derive a private key from public keys. This means it's vital to keep a private key safe and, as the name suggests, PRIVATE.
Know of a community resource that helped you? Edit this page and add it!