In Bitcoin, many users now encounter the issue of long confirmation times for BTC transactions. Consequently, there is great concern over how these unconfirmed transactions will be handled: will they be returned to the user's wallet? Will coins be lost?
The Lifecycle of a Bitcoin Transaction:
A Bitcoin transaction starts with its creation by the owner of a private key, which is typically done automatically within a wallet application. From the user's perspective, this involves inputting the amount, recipient address, miner fee, and PIN/password on the wallet interface. The actual construction of the transaction is handled by the wallet software.
Once the transaction is constructed, the wallet broadcasts it to the P2P network.
Within the Bitcoin network, every node (usually full nodes) receives and verifies the transaction. If the verification is successful, the node forwards the transaction; if not, it discards it.
Eventually, a mining node receives and validates the transaction. If this miner successfully mines a block and finds the transaction's fee attractive enough to include it in the block, the transaction gets included, thus receiving one confirmation. The miner also claims the corresponding transaction fee.
Upon inclusion, the miner broadcasts the block to other nodes. These nodes verify and propagate the block further.
If this block receives additional confirmations from more mining nodes, the transaction gains more confirmations as well. This way, the transaction is recorded on the Bitcoin blockchain and becomes part of the ledger. After six confirmations, it is generally considered permanently immutable.
Miners Prioritize High-Fee Transactions
During the transaction lifecycle, ordinary full nodes (non-mining nodes) typically validate only the signature and address legitimacy. As long as they are valid, these nodes broadcast the transaction.
However, mining nodes, due to their ability to collect transaction fees, tend to prioritize high-fee transactions. They queue up transactions based on their fees, giving preference to those with higher fees. If a transaction has too low a fee, after a certain period, say three days, and it hasn't been mined yet, mining nodes usually remove such low-fee transactions from their memory pools.
Mining nodes operate on a 'money talks' principle.
This is why your transaction might not get confirmed if you pay a lower fee – the mining nodes simply ignore it because of the insufficient incentive.
When your transaction is removed from a mining pool's memory pool, it may appear as 'removed' within your wallet.
Note that no node informs your wallet when deleting your transaction, and your transaction could still exist in the memory pools of non-mining nodes. These nodes may continue broadcasting it, so there's a chance your transaction could be accepted by another mining node, causing it to show as 'removed' but then subsequently 'moved'. In such cases, it's possible that your transaction won't be confirmed until gradually cleared from most nodes' memory pools and the fee market adjusts downward.
Under these circumstances, it is recommended to use the 'Transaction Accelerator' function provided by your wallet.