0

Can we make the following changes to the current POW protocol to better avoid double-spending:

a) For full/mining nodes that receive two chains, check if there are identical addresses that occur on both chains that perform double-spending. If there are any, ignore the chain that would result in the node doing a reorganization (reorg), choose the other chain;

b) If there is none, choose the longer chain;

c) For nodes that receive only one chain, accept it if it does not require a reorganization.

Wouldn't this be better in avoiding double-spending than the current protocol, i.e. accepting the longest chain blindly? Shouldn't we check the block contents from both chains before deciding which one to accept?

  • What do you mean by "that perform double-spending" exactly? Do you mean that the two chains have two different transactions that each spend the same output? If so, are you suggesting every node just stick to the one it saw first? – David Schwartz Jul 6 '18 at 1:11
1

If there is a double spend attempt, there is no way for a node to know "which chain (transaction) actually came first and is legitimate". Some nodes may hear about the 'legit' chain first, some may hear about the double-spend chain first.

So, if the rule states that nodes work to avoid reorgs in case of a double spend, then we would expect the network to split at the occurrence of a double spend. Consider: what happens if there is a double-spend attempt, and the first chain your node hears about is the one that is soon-to-be the shorter chain? You would be stuck on an orphan chain, while the rest of the network marches onward. This is obviously not good, as network consensus and reliability is important.

c) For nodes that receive only one chain, accept it if it does not require a reorganization.

If the node only receives one chain, then it will never require a reorg. Only a node that receives an alternative, longer chain will reorg.

..accepting the longest chain blindly? Shouldn't we check the block contents from both chains before deciding which one to accept?

I would not say chains are accepted blindly, acceptance requires the chain to be valid according to all of the network's rules. Your node will check the contents of new blocks, but as I mentioned above, there is no way to reliably distinguish a 'legit' transaction from a 'double spend' transaction, at a network-consensus level.

1

Wouldn't this be better in avoiding double-spending than the current protocol, i.e. accepting the longest chain blindly? Shouldn't we check the block contents from both chains before deciding which one to accept?

Where do you read that the longest chain is accepted blindly? Of course, no chain with double spending in it is valid - that would completely defeat the purpose.

What does happen (at least in Bitcoin Core) is that the check for double spending and signature validity only happens after a particular chain becomes the most-work chain. But it isn't treated as the accepted best chain until it is fully validated. If a double spend or invalid signature is found in a candidate best chain, that chain is discarded, and the selection algorithm will revert to the second most work chain, and fully verify that.

The reason for delaying the double spending and script checks until a block is in the most work chain is to save resources. These checks are many times more computationally expensive to perform than all other validation rules combined, so we perform them lazily.

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.