What happens when a transaction is "unconfirmed"?
This is one of the vital questions asked when transacting on the Internet. It is also why there is a risk of double-spending, also known as a malicious transaction between a scammer and a merchant.
This is one of the main reasons why the blockchain was created and that is to prevent double-spending by creating a triple-signature ledger that everyone has. Let's get right into it, and why blockchain-using systems are secure, why we have confirmation limits on objects, and on why Bitcoin Cash is slowly growing to the point that development has been into improving the unconfirmed transaction as part of the scalability process.
Double Spending
Double spending is an internet phenomenon when a scammer can pay a merchant with an amount and use the same amount to pay someone else. It is one of the many ways to scam people from their money, and this was the main problem that Satoshi Nakamoto's white paper solved through a cryptographically signed triple-signature ledger.
Double spending can be done by anyone by creating two transactions, one for your "scammed merchant" and another for yourself at the same time. While the merchant receives your "money", you still own your money. This can be useful, but nobody knows how it could be.
If you saw the Bitcoin white paper, one of the major problems it points out is the fact that transacting on the Internet is not secure, and third parties don't help either as these third parties are the ones attacked by hackers anyway, causing you to lose funds.
The Blockchain
Satoshi's solution to minimize double-spending was to create a ledger signed cryptographically that everyone has a copy with, known as the blockchain.
The blockchain, in essence, has three signatures used to verify each transaction— The input hash, your private key, and your transaction hash.
Confirmations
Satoshi told us through his white paper that a transaction in itself is secure for small payments, and gave us six confirmations for larger money transactions.
Confirmations simply mean that your transaction has been in the blockchain. To determine the number of confirmations, check which block your transaction is and then count the number of blocks that came after it.
A transaction is confirmed when it is inside a block.
0-Confirmation Transactions
By looking at the details given above, a person would think that a 0-conf transaction isn't exactly safe.
0-conf transactions are, in itself, safe. However, when the protocol modifies the integrity of the transactions, it can result in unintended consequences.
Replace-By-Fee (RBF)
Replace-By-Fee is a protocol change added by Bitcoin Core developers in 2013. It allows the user to replace their transaction while it hasn't been confirmed. As of the moment, there are four types of RBF implemented, but the core protocol hasn't changed on every four types.
The dangers of implementing Replace-By-Fee are more apparent when you are paying a merchant, as it forces them to wait for a block to ensure you are sending an honest transaction. RBFs allow the sender to replace the transaction with another transaction through intentional transaction double-spending by the fees.
Replace-By-Fee helps Bitcoin users to get their stuck transactions from the mempool.
Double Spend Proofs (DSP)
Double Spend Proofs are, in my opinion, in the opposite spectrum where RBF also lies. Both of them deal with double-spending and the security of the 0-conf transaction.
While RBFs make sure that everyone requires 1-conf to validate the transaction, DSPs allow the merchant to receive 0-conf transactions. What double-spend proofs really are is a program within Bitcoin Cash full nodes to allow the merchant to see if the same transaction they received contains a double spend. With Bitcoin Cash's "first seen" policy, DSPs also help in mitigating it even more.
DSPs are being implemented across all six nodes at the moment.
Epilogue - Double Spend Detection
Double spending is an internet phenomenon since not all services are fully encrypted to ensure that the customer and the merchants are transacting money safely. In this day and age, however, you will only hear the words "double spending" on cryptocurrencies since it is a technical term for a financial service, which cryptocurrencies are.
With that said, there is a reason that data leaks are mostly about getting someone's name and credit card details, and this is the fact that financial services are getting better at it.
If you want to see Bitcoin Cash's double-spending attempts and how most of them fail, you can check out this website:
This is a very late article, and I hope people can understand what I mean.
I'm accepting corrections, just comment down below.
This is Rowan, signing off.