Bitcoin 101 question here on how exactly are crypto transaction confirmed - I know the basics - that miners confirm the transactions but I am still not clear on what exactly happens:
1) Let's say I pay my chocolate milkshake using BTC. The transaction instantly appears on the blockchain (X)- is this based on information from payer, recipient or from some independent miner processing the transaction? Are the miners processing the transactions before the block is finalised?
2) After about 10 minutes the transaction is confirmed along with all transactions in the same block. Now - who exactly confirms it - is it > 50% of the network? A randomly chosen miner? A miner based on certain criteria?
3) Since blocks are 10 minutes apart... is it possible to be lucky and have the transactions confirmed in just a few seconds if it occurs at the end of the block?
Wrong thread perhaps?
1) The payer broadcasts it to the network, which picks it up.
2) The miner mining the block confirms it
3) Yes, 10 minutes is just the average time. It can be confirmed in 1 second or 60 minutes.
1) To further clarify, the transaction does NOT instantly appear on the blockchain. If you're watching something like blockchain.info, they are running a NODE that picks up the transaction almost immediately. It doesn't get stored on the blockchain until "2)".
2) The block finder indeed confirms it is valid before adding it to its newly minted block, but every other NODE also confirms the transaction(s) is/are valid before
accepting the newly minted block in its own local blockchain. Indeed, 100% of the nodes confirm the transaction (otherwise they would reject the block and get left behind), however, the network will continue to function properly as long as a majority of the hashing power has consensus. Other nodes can go their own way and reject the TX/block (creating their own fork), but no one will care; the "mishaving" node(s) will be left behind.
3) +1 to previous reply. Additionally, the "recommended" amount of confirms is 6 (5 blocks minted after your TX was included). However, the receiver is free to do whatever they want. Bitpay for example requires 0 confirms (pay for something at Newegg for example, and you'll see it say that your payment is accepted, usually within 1-5 seconds of you hitting "Send").