A little more information is necessary to tell you exactly what happened to your transactions that were confirmed "almost instantly" but what you've said is correct:
- The bitcoin protocol is such that new blocks should be mined, on average, every 10 minutes.
- A transaction is "confirmed" (has 1+ confirmation) only after being included in a block. Before this, the transaction is "pending". Some merchants require more than one confirmation for the transaction to be final, many choosing to wait for 3 confirmations before being deemed complete.
However, the situation can arise where after publishing your transaction a block is then mined a few seconds later that has your transaction in it. This could give the appearance that your transaction was confirmed "almost instantly".
Possible source of confusion: Blocks aren't mined 10 minutes after your transaction, they're mined 10 minutes (on average) since the previous block was mined.
Thanks I understand what you say but there must be something else.. I'm pretty sure that the "almost instant effect" is not related to a block being mined seconds after.. It happened to me many times (when mempool is clear..). for example you buy a coffee, scan the qr code, click send and boom, on the merchant screen he got received.. do you know what I mean? – Rhinoted – 2018-01-24T17:36:49.023
1Yes, in that case the merchant is accepting the payment without any confirmations. The merchant's app is likely notifying the clerk that the transaction has been broadcasted. "Received" does not mean confirmed in this case. He is trusting that the customer would not go through the hassle of a double-spend to steal a coffee.
His other option is to wait for one confirmation before giving you the coffee, which could take a while, and would lead to unhappy customers! – Matt P. – 2018-01-24T17:54:04.393
so the transaction is not even in a block yet right? – Rhinoted – 2018-01-24T17:58:52.357
Probably not. The transaction would be sitting in the mempool along with all other pending transactions waiting to be included in a block and confirmed. – Matt P. – 2018-01-24T18:07:42.833
Ok, thank you Matt – Rhinoted – 2018-01-24T18:36:33.547
Sure! If you feel this answer has helped, feel free to vote or accept it. See: What should I do when someone answers my question?
– Matt P. – 2018-01-24T18:49:10.000