Each source of information I look at that tackles this problem states that this type of fraud is essentially impossible at best and highly infeasible at worst. By my (very limited) understanding, the success of this attack is actually down to timing and luck rather than it needing a 51% control of hashing compute. The scenario I've been thinking about:
Initial State and assumptions:
- All nodes are at block height 𝑛
- No forks exist; all nodes are in consensus
- Each new block takes the full normally distributed 10 minutes to confirm
- In the below case, the 'fraudulent block' contains a transaction signed by the bad actor to themselves or to a colluding partner to consume the unspent input - to prevent the 'real' transaction confirming for the 'real' recipient. Yes - advise the 'real' recipient to wait for enough block confirmations to take place so that the attack is pointless - but lets assume someone is scammed into handing over goods/services/digital assets on the basis that the 'real' transaction is submitted and pending. I want to focus more on how the technology accounts for the possibility of the problem, rather than human intuition and intervention.
Fraudulent Block Submission:
- An attacker successfully mines a fraudulent block 𝑛+1 and propagates it through the network. This block contains the double spend attack transaction, leaving the 'real' transaction in the mempool where it's rejected because its considered a spent transaction, therefore excluded from any new block
- Within a minute or two, the majority of the network receives and validates this block.
- Nodes recognize 𝑛+1 as the longest chain and switch to mining on top of it.
Mining Block 𝑛+2:
- Assume the next block 𝑛+2 takes the full (normally distributed) 10 minutes to mine after 𝑛+1 has been accepted.
- Within the first 5 minutes, almost all nodes would have received, validated, and started working on block 𝑛+1, given the propagation time is typically less than a couple of minutes.
Given these conditions, here's how the scenario unfolds:
Propagation of Block 𝑛+1:
- Once block 𝑛+1 is propagated and validated across the network, all honest nodes will switch to the chain ending in 𝑛+1.
Mining Block 𝑛+2:
- With all nodes working on the new longest chain, they will mine block 𝑛+2 on top of 𝑛+1.
- The network will be in consensus that block 𝑛+1 is part of the main chain, and thus any new blocks (including 𝑛+2) will be built on top of 𝑛+1.
In this scenario, assuming the fraudulent block 𝑛+1 propagates and is accepted as the longest chain by the majority of the network, all subsequent blocks (like 𝑛+2) will indeed be built on this chain. In Summary:
- Propagation and Validation: Block 𝑛+1 propagates and is validated quickly (within a couple of minutes), leading all nodes to switch to this chain.
- Network Consensus: By 5 minutes into the 10-minute block interval, all nodes will be mining on the 𝑛+1 chain due to its acceptance as the longest chain.
- Subsequent Blocks: The next block 𝑛+2 is highly likely to be mined on top of 𝑛+1 since the entire network considers 𝑛+1 as part of the longest chain.
So, if we assume that the above case holds true it seems to me at least that a double spend attack IS quite feasible under the right conditions, so what other protections are in place to
- Prevent this happening in the first place
- Unwind in the event that there are multiple block confirmations subsequently