Consensus Logic with an example
- Person A generates a transaction to pass some ether to person B
- The transaction is submitted on the node
- Node then passes that unconfirmed transaction to the whole connected network
- The miners pickup the unconfirmed transaction
- They start trying to randomly generate the nonce to find the correct hash
- So one of the miners finds the correct nonce to generate the block
- Now this miner sends this block to peer who then further send to the next peers and gradually everyone receives the block
- Everyone verifies the work whether it is meeting the criteria
- Once satisfied they include that block in their ledger
- Miner gets rewarded
- B's balance gets updated
- Thus A's payment is now confirmed
- Just like A think multiple transactions of passing ether were invoked at the same time
- Lets say from C->D, E->F, G-H etc.
- In Ethereum how does a miner determine how many transactions to be included in the block?
- Is it based on total count of transactions or total price or total size?
- Is there a concept of wait time also applied i.e. if there are less unconfirmed transactions the miners will wait for certain time and then group all the available transactions to generate a block?