Ethereum White Paper original link

Ethereum

Ethereum: a blockchain with a built-in Turing-complete programming language, allowing anyone to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats and state transition functions.

Ethereum: A blockchain with a Turing-complete programming language built in. Anyone can write a smart contract; Or decentralized applications that “can create their own rules”; And the transaction format and state transition function.

#1 Smart Contract

The most important concept in Ethereum: smart contracts. Relative to the currency, “script” in intelligent contract can be said to be the currency of the upgrade version: smart contracts can support more powerful scripting language (turing-complete scripting language), and realize intelligent contract allows developers to develop any application (might think the etheric fang for an app store, users can buy any application from above).

Ethereum = Bitcoin + smart contract

A smart contract is, in concept, a computer program that runs on a ledger that can be copied and shared. It is published by the user and cannot be changed after publication. Each contract is equivalent to a piece of code and has an account address. This code is executed whenever a transaction occurs at this address.

  1. Each contract can only take blockchain as input and output.
  2. Any contract can call functions in other contracts.
  3. New transactions can be created during contract execution.

#2 Accounts

In Ethereum, states are made up of individual objects called accounts. Each account has a 20-byte address and a state transition resulting from a direct conversion of values and information between accounts. (This paragraph is a little difficult to understand, but simply means the object entity generated during the transaction of the account.)

Each ethereum account contains four parts:

  1. Random number, a counter used to ensure that each transaction can only be executed once.
  2. The current ethereum balance (the currency unit in Ethereum is “ether”).
  3. Contract code for the account, if any.
  4. Storage for the account (empty by default).

There are two types of accounts:

  1. All external accounts controlled by private keys. The account contains no code, and anyone can send messages through it by creating and signing a transaction.
  2. Contract accounts, controlled by their contract code. In a contract account, its contract code is executed every time the account receives a message. This allows the contract account to read and write to the internal store and send additional messages or create additional transactions during execution.

Note

A “contract” in Ethereum should not be seen as something that should be “filled with it” or “subject to its rules.” They are more like an “autonomous medium” within the Ethereum execution environment. They always execute a snippet of code whenever they receive a message or transaction, and directly control their own Ethernet balance and key-value store to keep track of changing state.

#3 Messages and Transactions

Transactions

“Transaction” in Ethereum: Represents a signed collection of data that holds a “message” sent to all external accounts. Contains:

  1. Message receiver
  2. The signature that identifies the sender
  3. The amount of ether transferred from sender to receiver
  4. An optional data field
  5. aSTARTAGSValue that represents the maximum number of computation steps allowed during transaction execution
  6. aGASPRICEValue that represents the cost to the sender for each calculation step

Note

STARTGAS and GASPRICE are critical to Ethereum’s anti-denial-of-service model. To prevent accidental or maliciously executed code infinite loop, and some code caused by the calculation of waste.

The basic unit of calculation is “gas”. Typically, one computation step consumes one gas, but some complex computations (including those that require expensive computation costs or that require storing more data into the state) consume more gas. Each byte of transaction data costs five gas.

Messages

All contracts can send “messages” to other contracts. The messages here are virtual objects that only exist in ethereum’s execution environment and are not serialized. A message contains:

  1. Sender of the message (included by default)
  2. Message receiver
  3. The amount of ether associated with the transaction
  4. An optional data field
  5. aSTARTGAS

It is important to note that a message, like a transaction, causes the recipient’s account to execute its association code. The difference is that the message is generated by the contract (when the contract code executes to the CALL opcode), and it is not an external actor. As a result, contracts can be associated with other contracts as well as with external actors.

Note

The existence of messaging in Ethereum gives contracts the same rights as external accounts — the ability to send messages and create other contracts.


Reading on the lotEthereum – White PaperSome notes on

  • Notes on ethereum White Paper (1) — Introduction to Bitcoin
  • Notes on the Ethereum White Paper (2) — Introduction to Ethereum. on
  • Notes on the Ethereum White Paper (3) — Introduction to Ethereum. Under the