3

My question is rather simple, and I found this question in the Bitcoin StackExchange that somehow relates to mine, although, for the Bitcoin Blockchain, which I'm not sure if Ethereum solves the problem the same way.

Let's say I have a mining node, and for the sake of exampling, I have 1 Ether under my pkey. What prevents me from trying to mine a block in which I spend 2 Ether? At what point in the process is the balance of my address checked to make sure I do have enough Ether? Is it after I mine the block and then broadcast it to other nodes? Does it mean my mined block will become orphan after the other nodes validate that this particular transaction aint valid?

Will appreciate every help, reference.

3

So you are sending a transaction in which you try to spend more Ether that you own. And you try to mine a block with that transaction.

Miners validate the transactions they include in blocks. So they are responsible for validating that you don't try to spend more than you have. If the transaction is invalid it's simply refused.

If you yourself try to mine the transaction and have the necessary hash power to solve the PoW puzzle you can include the transaction in a block. However when you submit the block to the blockchain other nodes should validate it as well and should simply reject it. In theory you will get the Ether rewards for that block but only in your own branch of the blockchain - it will not get included in the main blockchain so your Ethers are useless.

Propagated blocks are validated by mining nodes: https://github.com/ethereum/wiki/wiki/white-paper#blockchain-and-mining . Non-mining nodes are not interested in real block validation as they won't try to mine on top of it so they just check some basic stuff and propagate it forward.

Orphan blocks are valid blocks with valid transactions. They are simply blocks which tried to enter the canonical chain (the main blockchain) but due to latency problems the consensus mechanism sidestepped them - they are no longer part of the canonical chain but are still valid blocks. So invalid blocks can't become orphan blocks, they are simply ignored.

| improve this answer | |
  • Ok, this is exactly what I want to understand: "However when you submit the block to the blockchain other nodes should validate it as well and should simply reject it." -- How is this validation done? Would you mind editing your answer with that? Nevertheless, what you said is already pretty clear on a "big picture" plan – João Quintanilha Jan 31 at 14:11
  • Thanks for the comment. Edited – Lauri Peltonen Feb 2 at 6:46
1

This will be a little over-simplified but hopefully illustrate why this isn't a vulnerability.

Mining is about transaction order. When a block is mined and observed by others, this establishes a canonical order of the inputs the nodes can agree on.

Given this, the nodes can compute the result independently.

Success or failure depends on what the protocol allows, so nodes will mark a transaction that overspend as a failure.

There is no particular advantage to being the miner that included the invalid transaction.

Hope it helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.