Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos
Author:Andreas M. Antonopoulos [Antonopoulos, Andreas M.]
Language: eng
Format: azw3, epub
Publisher: O'Reilly Media
Published: 2017-06-12T04:00:00+00:00
Transaction Pools
Almost every node on the bitcoin network maintains a temporary list of unconfirmed transactions called the memory pool, mempool, or transaction pool. Nodes use this pool to keep track of transactions that are known to the network but are not yet included in the blockchain. For example, a wallet node will use the transaction pool to track incoming payments to the user’s wallet that have been received on the network but are not yet confirmed.
As transactions are received and verified, they are added to the transaction pool and relayed to the neighboring nodes to propagate on the network.
Some node implementations also maintain a separate pool of orphaned transactions. If a transaction’s inputs refer to a transaction that is not yet known, such as a missing parent, the orphan transaction will be stored temporarily in the orphan pool until the parent transaction arrives.
When a transaction is added to the transaction pool, the orphan pool is checked for any orphans that reference this transaction’s outputs (its children). Any matching orphans are then validated. If valid, they are removed from the orphan pool and added to the transaction pool, completing the chain that started with the parent transaction. In light of the newly added transaction, which is no longer an orphan, the process is repeated recursively looking for any further descendants, until no more descendants are found. Through this process, the arrival of a parent transaction triggers a cascade reconstruction of an entire chain of interdependent transactions by re-uniting the orphans with their parents all the way down the chain.
Both the transaction pool and orphan pool (where implemented) are stored in local memory and are not saved on persistent storage; rather, they are dynamically populated from incoming network messages. When a node starts, both pools are empty and are gradually populated with new transactions received on the network.
Some implementations of the bitcoin client also maintain a UTXO database or pool, which is the set of all unspent outputs on the blockchain. Although the name “UTXO pool” sounds similar to the transaction pool, it represents a different set of data. Unlike the transaction and orphan pools, the UTXO pool is not initialized empty but instead contains millions of entries of unspent transaction outputs, everything that is unspent from all the way back to the genesis block. The UTXO pool may be housed in local memory or as an indexed database table on persistent storage.
Whereas the transaction and orphan pools represent a single node’s local perspective and might vary significantly from node to node depending upon when the node was started or restarted, the UTXO pool represents the emergent consensus of the network and therefore will vary little between nodes. Furthermore, the transaction and orphan pools only contain unconfirmed transactions, while the UTXO pool only contains confirmed outputs.
Download
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos.epub
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Bad Blood by John Carreyrou(5735)
Principles: Life and Work by Ray Dalio(5294)
Rich Dad Poor Dad by Robert T. Kiyosaki(5111)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4116)
The Confidence Code by Katty Kay(3538)
Thinking in Bets by Annie Duke(3503)
American Kingpin by Nick Bilton(2947)
Delivering Happiness by Tony Hsieh(2905)
Playing to Win_ How Strategy Really Works by A.G. Lafley & Roger L. Martin(2764)
Project Animal Farm: An Accidental Journey into the Secret World of Farming and the Truth About Our Food by Sonia Faruqi(2646)
Brotopia by Emily Chang(2574)
I Live in the Future & Here's How It Works by Nick Bilton(2504)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2493)
The Content Trap by Bharat Anand(2478)
The Power of Habit by Charles Duhigg(2464)
The Marketing Plan Handbook: Develop Big-Picture Marketing Plans for Pennies on the Dollar by Robert W. Bly(2398)
The Tyranny of Metrics by Jerry Z. Muller(2381)
Building a StoryBrand by Donald Miller(2336)
Applied Empathy by Michael Ventura(2316)