Mining is the process of creating a block of transactions to be added to the Ethereum blockchain.
(*) HOW ETHEREUM TRANSACTIONS ARE MINED
1. User writes and signs a transaction request with the private key of some account.
2. User broadcasts the transaction request to the entire Ethereum network from some node.
3. Each node adds the request to their local mem pool (list of all transaction requests they’ve heard, not yet been committed to the blockchain )
4. Mining node aggregates several dozen or hundred transaction requests into a potential block ---> Verifies the validity of each transaction request --> executes the code of the request, altering the state of their local copy of the EVM. --> process of producing the proof-of-work “certificate of legitimacy” for the potential block.
5. Miner then broadcasts the completed block, which includes the certificate and a checksum of the claimed new EVM state.
6. Other nodes verify the certificate, execute all transactions on the block themselves --> verify that the checksum of their new EVM state matches the checksum of the state claimed by the miner’s block. --> these nodes append this block to the tail of their blockchain, accept the new EVM state.
7. Node removes all unfulfilled transaction request in the new block from their local mem pool.
Note: New nodes joining the network download all blocks in sequence ---> initialize a local EVM copy --> process of executing every transaction in every block on top of their local EVM copy ---> verifying state checksums at each block along the way.
Nhận xét