官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 高陵县| 武宁县| 江津市| 扶余县| 木里| 晋中市| 西吉县| 库车县| 红河县| 三台县| 临武县| 抚州市| 左权县| 阆中市| 华安县| 行唐县| 合山市| 东乡县| 晋宁县| 新沂市| 淄博市| 托克逊县| 通城县| 建昌县| 湖南省| 眉山市| 秦安县| 平陆县| 梅河口市| 保靖县| 华池县| 隆子县| 灯塔市| 营口市| 宣化县| 卓尼县| 隆德县| 洛川县| 柯坪县| 信宜市| 新巴尔虎右旗|