Bitcoin wouldn’t be here today if Satoshi Nakamoto hadn’t of solved the ‘double-spend’ problem.
Double spending has to be looked at in the context of having no centralised authority to confirm a transaction. So what is stopping me from sending my funds to one person, then quickly sending my funds to another before, those two people communicate and work out that I have sent the same funds to both. This could be in the context of buying items from two different vendors.
To solve the problem of double spend, the Bitcoin network put in place a confirmation system that is maintained on a universal ledger (the blockchain). The blockchain prevents double spend by maintaining a chronological (time stamped) record of transactions since the genesis block.
Let’s delve a little deeper into what would occur if a double spend was attempted with Bitcoin. All transactions first go to an unconfirmed pool and then miners take those transactions and confirm them in blocks to add to the blockchain.
If I have 1 BTC and try to send the same value to two others in quick succession, whichever transaction was confirmed first would be considered legitimate and the second transaction would automatically be judged as invalid. If both transactions occurred simultaneously then it would need further resolution. This is where ‘confirmations’ come into play. Every time a transaction is in a block and that block is verified by the network it is called a confirmation. So if your transaction was included in block 1000, then if another 5 blocks (block 1005) of new transactions are successfully confirmed after, then it is considered that your transaction has 6 ‘confirmations’.
So in the case of transactions that occur simultaneously, the transaction with the most number of confirmations will be the one chosen as legitimate. This means it is virtually impossible to double spend within Bitcoins Proof of Work system.