The transaction pool, or txpool, is a staging area for valid transactions waiting to be added to the blockchain.
Valid transactions received from the network are usually cached in the txpool and are removed once they are mined into a block.
Full nodes typically employ txpools to increase their responsiveness, enabling them to accept and validate transactions anytime even though new blocks are only mined periodically.
Mining nodes are also incentivized to do so in order to collect larger amounts of transaction fees from groups of transactions for every block mined.
Transactions in the txpool are usually treated as if they were in an imaginary block after the current highest block in the blockchain to apply relevant policies, such as double-spending prevention and maximum block size.
Transactions in the txpool may also be tracked with respect to chaining.
Transaction chaining happens when one transaction spends the output of another transaction in the same block.
In such cases, the transactions that provide the said output are typically referred to as parent transactions, and the ones spend the said output as child transactions.
The tracking of transaction chaining is vital for nodes to remove any dependent transactions in the txpool in the event that their parent transactions are removed and thus invalidate such transactions.
Although this rarely occurs, txpools may reach their maximum capacity set by the node and may reject incoming transactions from the network or remove existing transactions from the txpool under such occasions.
The policies regarding such scenarios are at the discretion of each node.
Apart from the capacity reasons, transactions that once were considered valid may still be rejected from adding to the txpool or removed from the txpool for other reasons.
Valid transactions may be rejected by the node to enter the txpool for several typical reasons.
Under few rare circumstances, transactions that are already admitted to the txpool may be removed without being mined into the blockchain.
The reasons for such removal may include but not limited to:
Typically, transactions that provide low fees may be removed when the txpool is approaching its capacity or after prolonged periods in the txpool without being mined.
The transaction pool (txpool) was called the memory pool (or mempool) in Bitcoin/Bitcoin Cash so may still be named as such in this documentation.