Belun
Belun

Reputation: 4169

How do Ethereum node compete for blocks?

I was wondering how ethereum blockchain works compared with the bitcoin blockchain.

I know that, in bitcoin, all nodes compete to mine blocks (and put to public transaction into them and thus make bitcoin as transaction processing fee), and that all nodes compete for the next block at one time with an equal chance of mining it.

But in ethereum, where you want a network of distributed apps that get executed according to the gas price they are willing to pay (and starting gas), are all nodes competing for the next block at one given time? Wouldn't this be a waste of computation?

Upvotes: 0

Views: 229

Answers (2)

lock1b
lock1b

Reputation: 11

In short, yes, there is a lot of wasted computation.

Ethereum's mining process is almost the same as bitcoin’s.

For each block of transactions, miners will run the block’s unique header metadata (including timestamp and software version) through a hash function. If the miner finds a hash that matches the current target, the miner will be awarded ether and broadcast the block across the network for each node to validate and add to their own copy of the ledger. If miner B finds the hash, miner A will stop work on the current block and repeat the process for the next block.

Upvotes: 0

YinYang16
YinYang16

Reputation: 471

Yes, all the nodes do compete for (pretty much) the same blocks, and yes - they do execute all the code in a block, even if this block is not going to be successfully mined.

Don't think of it as "waste," but rather as a mechanism to ensure proof of work.

Upvotes: 0

Related Questions