Transactions that are sent to the blockchain are unconfirmed initially. What does this mean?
A blockchain is made up of blocks linked to each other and these blocks contain transactions. To be valid, a transaction must be inserted into a block and possibly at least one more block must be added to the blockchain.
The transaction is considered confirmed only when it has been inserted in a block and counts as many confirmations as there are subsequent blocks added to the blockchain, including the block in which it has been inserted.
In fact, when a user sends cryptocurrencies to a public address, the transaction is not immediately inserted in the blockchain because it must be validated.
Depending on the consensus protocol used by each blockchain, validation involves different procedures. On the Bitcoin blockchain, for example, and all those based on Proof-of-Work, miners perform this validation.
Sticking with Bitcoin, initially the transaction is not sent directly to the blockchain, but to the so-called mempool, which is a sort of temporary repository of transactions waiting to be inserted in a block and then confirmed.
As far as Bitcoin is concerned, the mempool always counts many thousands of transactions, reaching even tens of thousands of transactions waiting to be validated, at times when there is a lot of congestion.
Miners use this mempool to verify whether the transactions are correct, whether the digital signature corresponds to the sender’s signature, and what are the fees to be paid to the miners.
In fact, the fees set by the sender are what determines which transactions the miners choose to confirm.
Considering that, for instance, a block of the Bitcoin blockchain is not able to contain more than 3,000 transactions, and since an average of one is mined every 10 minutes, it is logical to imagine that the Bitcoin mempool is always full and very often contains more transactions than there are in a block.
As a result, miners are forced to choose which ones to include, and generally choose those with higher fees.
This means that if the fees set by the sender of the transaction are too low, the transaction not only runs the risk of not being selected to be included in the next block, and therefore confirmed in a few minutes, but also runs the risk of not even being included in the next block.
For this reason, there are several thousand unconfirmed transactions waiting to be included in a Bitcoin block, and sometimes they may have to wait several days before finding a miner who agrees to validate them.
It should be noted that a transaction sent to the mempool is not final at all, and can be cancelled or modified, for instance, to increase fees in order to make it more attractive to miners.
Unfortunately, not all wallets support these features, especially those managed by third parties (i.e. custodians).
Actually, the best wallets are those that suggest to the users how many fees to set so that their transactions are included in the next block, or at least in one of the next 5 or 10 blocks so that they can choose how much to spend on the transaction according to their needs.
It should be remembered that a transaction is not considered valid until it is confirmed by being included in a block, so unconfirmed transactions are transactions that have not yet been validated, awaiting validation.
In fact, if the transaction were not recognized as correct, it would not be included in any block, and therefore effectively cancelled, which is why it is absolutely necessary to wait for at least one confirmation before it can be considered valid.
Keep in mind that the more confirmations it has, the more secure it is, so it is not recommended to consider a transaction that still has only one confirmation as final.
In order to get more confirmations, simply wait until more blocks are mined after the one in which it has been included.