1

I am studying about Bitcoin and Blockchain tech via the Princeton crypto course, and it mentions that Full nodes do the following checks :

i)transaction is valid with the current blockchain,

ii)whether the scripts matches whitelist,

iii)transaction hasn't been seen before and

iv)doesn't conflict with others its relayed (to avoid double spend).

However, the lecturer also mentioned these checks are not enforced on a node. Lets say a full node may have a full set of of UTXO but still decides to relay a transaction that has been spent before (effectively ignoring the fact that the TX is not on the UTXO pool) , and eventually this TX is relayed around and makes it into a block. Since the miners trust these nodes to verify transactions , wouldn't the TX be put into the consensus chain ?

I understand that the mining process (POW) and resulting block reward can only be claimed/collected if the block ends up on the long-term consensus branch, but this doesn't safeguard the malicious node behavior as I have explained since miners don't check for double spends.

  • The statement that miners trust these nodes might be wrong... a miner would want to check if his transactions and blocks are correct, otherwise he might get ignored from the network (when relaying wrong tx or blocks). Also he might loose his block reward, and would have performed the block calcs in vain? – pebwindkraft Jun 25 '18 at 22:46
2

Since the miners trust these nodes to verify transactions, ... since miners don't check for double spends.

What makes you think this? Miners are also nodes; they are a subset of nodes. Miners still receive and verify all transactions, they don't just blindly trust what some other node has given them. Miners are incentivized to check transactions as including any invalid transactions means that the block will also be invalid and thus be rejected by the other nodes and miners on the network.

If a miner produces an invalid transaction (e.g. by including a double spend), the block will be considered invalid. Miners do not determine what is valid and invalid, nodes do. So when the nodes on the network receive that invalid block, they will reject it as invalid and not add it to their blockchain. Furthermore, since miners are also nodes, other miners will reject the block and thus they will not mine on top of it.

If miners mine on top of the invalid block, there will be a blockchain fork. The nodes on the network will refuse to follow a chain that contains an invalid block, even if it has more work. They only follow the valid chain with the most work, and an invalid block makes that chain invalid.

  • thanks for your input. How long does a Miner usually take to check every single transaction in a block it is mining against the UTXO set ? – DCH Jun 26 '18 at 17:31
  • It takes the same time as it does for any other node. It usually takes a few milliseconds. Furthermore, because miners are nodes, they have likely received and checked all of the transactions before they appeared in a block, so they can skip checking them again when they get them in a block. – Andrew Chow Jun 26 '18 at 18:17
1

Miners that don't check for double spends only connect to nodes that they fully trust. And there's a good reason for this -- every non-broken node will ignore an invalid block. So were a miner to ever mine a block that contained a double spend, every other node would ignore that block and it would never become part of anyone's view of the consensus chain.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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