Security Tokens and Stablecoins Quick Start Guide
上QQ阅读APP看书,第一时间看更新

Account

Unlike bitcoin where the term address is used, Ethereum uses the term account. However, Ethereum accounts can have addresses. That is, for bitcoin, the concepts of account and address are combined into one, while Ethereum separates them. Ethereum supports two types of accounts: externally owned accounts (owned by users who keep private keys of the accounts) and contract accounts.

The key facts about externally controlled accounts are listed as follows:

  • They maintain ether balances
  • They can initiate transactions for either transferring ether coins or triggering smart contracts
  • They are controlled by users via private keys
  • They have no associated smart contract code

Facts about contract accounts are as follows:

  • They keep ether balances
  • They have associated smart contract code
  • Smart contract code execution is triggered by transactions or calls that are received from other contracts

For both types of accounts, they consist of four components:

  • Nonce: For an externally owned account, it refers to the number of transactions sent from the account; for a contract account, it is the number of contracts associated with the account
  • Balance: It is the number of Wei owned by this account
  • StorageRoot: A 256-bit hash of contents of an account
  • CodeHash: The hash of the code of this account in EVM—this is the code that gets executed when the code is called

When ether is transferred from contract accounts to an externally owned account, there is a fee, for example, 21,000 unit of gas. When ether is sent from an externally owned account to a contract account, the fee is usually higher, which depends on the smart contract code and the data being sent along with the transaction.

Ethereum addresses of accounts have the following format:

  • They start with the prefix 0x, a common identifier for hexadecimal, followed by the number string to be constructed by following these steps:
    1. First, take the Keccak-256 hash (big-endian) of the elliptic curve digital signature algorithm (ECDSA) public key
    2. Then, take the last 20 bytes of the hash

Since, in hexadecimal, two digits are stored in one byte, a 20-bytes address is represented with 40 hexadecimal digits. The following is an example of an Ethereum address: 0xe99356bde974bbe08721d77712168fa074279267.

With a browsing tool, you can retrieve Ethereum account balances. For example, you can go to https://www.etherchain.org to obtain the top account balances in ether.