How pending transactions are given to the miners to mine in Ethereum?

252 Views Asked by At

I need to know about how pending transactions are given to the miner to mine and how they get a reward for each transaction.

1

There are 1 best solutions below

0
On

Transactions are not given to the miners, instead, miners are given the work for a particular block for which they have to find a hash which is below a certain target (target is computed from difficulty). The work consists of a Header Hash on which the hashing is actually performed. Each full node first creates a block, puts all the transactions in the block computes the state root and other parameters and then creates the work which is then sent to the miners. Once the miner finds a hash which is below the target, the miner then sends the solution back to the node. The node checks for the solution and accepts the block if the solution is correct.

Transaction's reward is the transaction fees which are collected by all the transactions fees from a given block. So, if a miner mines a block with 10 transactions and each transaction of 0.5eth fees then the total fees collected will be 5eth. However, in reality, the transaction fees are calculated by the amount of Gas consumed multiplied by the gas price paid by the sender.

Hope this helps.