Ethereum basic concept

ling1998 2022-04-06 05:10:55 阅读数:1,005

ethereum basic concept

Catalog

Part of Ethereum

P2P The Internet

transaction (Transaction)

Ethereum virtual machine (EVM)

database (Blockchain)- Ethereum ledger

client

Important concepts in Ethereum

Account (Account)

General account (EOA)

Contract account (Contract)

Address (Address)

transaction (Transaction)

gas

Ethereum money

Ether distribution rules

Before mining (Pre-mine, Genesis)

Mining produces (Mining)

Future changes in ether production

Ethereum's mining output

Block rewards (Block rewards)

I'll give you a reward (Uncle rewards)

Uncle block citation reward (Uncle referencing rewards)

Ethereum block revenue

Ordinary block income

Uncle income

“ ghost ” agreement (GHOST)

Ethereum and Turing are complete


Part of Ethereum

P2P The Internet

Ethereum runs on the Ethereum master network , The network is available at TCP End port 30303 Upper addressing , And run a program called ÐΞVp2p The agreement .

Ð :DApp

Ξ : Ethereum logo

transaction (Transaction)

Ethereum transactions are network messages , This includes the sender (send), The receiver (receiver), value (value) And data payload (payload).

Ethereum virtual machine (EVM)

Ethereum state transition is controlled by Ethereum virtual machine (EVM) Handle , This is an execution bytecode ( Machine language instructions ) Stack based virtual machines .

database (Blockchain)- Ethereum ledger

Ethereum's blockchain as a database ( Usually Google Of LevelDB) Stored on each node , Contains the serialized transaction And system status .

LevelDB It's a non relational database .

client

Ethereum has several operational customer software implementations , The most prominent one is Go-Ethereum(Geth).

Important concepts in Ethereum

Account (Account)

Include address , Balances and random numbers , as well as Optional storage and code object .

General account (EOA)

The storage and code of ordinary account are empty

Contract account (Contract)

Contract accounts contain storage and codes

Address (Address)

Generally speaking , This represents a EOA Or a contract , It can receive or send transactions on the blockchain . More specifically , It is ECDSA Public key keccak The rightmost of the hash 160 position .

Ethereum address generation is the same as bitcoin address generation : Private key generates public key , Public key generation address

transaction (Transaction)

You can send Ethernet and messages

The transaction sent to the contract can call the contract code , And take the information data as the function parameter

Send a message to an empty user , Contract accounts with information as code blocks can be automatically generated

gas

Ethereum's virtual fuel for executing smart contracts . Ethereum virtual machines use accounting mechanisms to measure gas And limit the consumption of computing resources .

Ethereum money

The monetary unit of Ethereum is called ether (ether), It can also be expressed as ETH Or symbols  Ξ .

Ether distribution rules

Before mining (Pre-mine, Genesis)

2014 year 7 Month to 8 Between months , For crowdfunding, about 7200 Ten thousand ethers . These coins are sometimes called “ Before mining ”. After the crowdfunding stage , The annual output of Ethereum is basically stable , Limited to no more than 7200 Ten thousand 25%, Not more than 1800 ten thousand .

Mining produces (Mining)

Block rewards (block reward)

I'll give you a reward (uncle reward)

Uncle block citation reward (uncle referencing reward)

Future changes in ether production

Proof of Ethereum blocking mechanism from workload (PoW) Conversion to proof of interest (PoS) after , What will happen to the issuance of Ethereum has not been decided yet . The proof of interest mechanism will use a mechanism called Casper The agreement . stay Casper Under the agreement , The issuance rate of Ethereum will be much lower than the current ghost agreement (GHOST) The circulation rate under . 

Ethereum's mining output

Block rewards (Block rewards)

Every time a new block is produced, there will be a fixed award to the miners , Is the initial 5 An ether , Now it is 2 An ether ( The Byzantine stage consists of 5ETH Down to 3ETH, The Constantine stage consists of 3ETH Down to 2ETH).

I'll give you a reward (Uncle rewards)

Some blocks were dug later , Therefore, it cannot be part of the main blockchain . Bitcoin calls these blocks “ Solitary block ”, And abandon them completely . But Ethereum calls them “ Uncle block ”, And they can be referenced in subsequent blocks . If the tertiary block is referenced as a tertiary block in the subsequent blockchain , Each uncle block will produce a block reward for the miner 7/8, This is called the uncle reward .

Uncle block citation reward (Uncle referencing rewards)

Every time a miner quotes a uncle , Who can get the block reward 1/32 As a reward ( At most 2 A piece of Uncle ).

Such a set is based on POW The reward mechanism of , Called Ethereum “ Ghost protocol ”.

Ethereum block revenue

Ordinary block income

Fixed reward ( Mining rewards ), Every ordinary block has

The block contains all programs gas The total cost

If a normal block references a tertiary block , You can get a fixed reward for each uncle block 1/32

Uncle income

There is only one income , It's the uncle reward , The formula is :

I'll give you a reward = ( Uncle block height + 8 - The block height of the reference block ) * Ordinary block rewards / 8

“ ghost ” agreement (GHOST)

Ethereum has a piece of time : Designed as 12 second , Actually 14~15 About seconds

Rapid confirmation will lead to high void rate of blocks , Thus, the security of the chain will also be reduced

“ ghost ” agreement :Greedy Heaviest Observed SubTree

When calculating the proof of workload , Not only the ancestor blocks of the current block 、 Parent block , It also contains obsolete descendant blocks of ancestor blocks ( Uncle block ), Take them into consideration .

The current agreement requires going down to the seventh layer ( The earliest simplified design was five floors ), in other words , Waste blocks can only be referenced by their parents' second to seventh generation blocks as Uncle blocks , Not the younger generation of further relationship .

Ethereum gives “ Shu block ” Identify the waste block that contributes to the confirmation of the new block 7/8 Reward , Put them into the calculation “ Nephew block ” Who will receive the block reward 1/32, however , Transaction fees will not be awarded to the uncle .

 P2P The network broadcasts information to the whole network 99% The node needs about 2s

  Quote uncle block to encourage everyone to dig , Solve the bifurcation problem

Ethereum and Turing are complete

1936 year , Allen, British mathematician . Turing (Alan Turing) Created a mathematical model of the computer , It consists of a controller 、 A read-write head and an infinitely long working paper tape . Paper tape plays the role of storage , Divided into small squares ( It can be regarded as tape ); The read-write head can read the information on the paper tape , And write the calculation results into paper tape ; The controller is responsible for processing the collected information according to the program . At every moment , The machine head is reading a square message from the current paper tape , Then look up the program table with your own internal state , Output information to the paper tape grid according to the program , And change your internal state , Then move the paper tape .

If a system can simulate any Turing machine , It is defined as “ Turing Complete ”(Turing Complete) Of . This system is called a universal Turing machine (UTM).

Ethereum can execute stored programs in the state machine of Ethereum virtual machine , Read and write data to memory at the same time , Make it Turing's complete system , So it becomes a universal Turing machine . Considering the limitation of limited memory , Ethereum can calculate any algorithm calculated by any Turing machine .

Simply speaking , Circular statements are supported in Ethereum , Theoretically, it can run “ Infinite loop ” Program .

版权声明:本文为[ling1998]所创,转载请带上原文链接,感谢。 https://netfreeman.com/2022/03/202203211804075922.html