README.md
1mempool
2=======
3
4[![Build Status](http://img.shields.io/travis/btcsuite/btcd.svg)](https://travis-ci.org/btcsuite/btcd)
5[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
6[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/btcsuite/btcd/mempool)
7
8Package mempool provides a policy-enforced pool of unmined bitcoin transactions.
9
10A key responsbility of the bitcoin network is mining user-generated transactions
11into blocks. In order to facilitate this, the mining process relies on having a
12readily-available source of transactions to include in a block that is being
13solved.
14
15At a high level, this package satisfies that requirement by providing an
16in-memory pool of fully validated transactions that can also optionally be
17further filtered based upon a configurable policy.
18
19One of the policy configuration options controls whether or not "standard"
20transactions are accepted. In essence, a "standard" transaction is one that
21satisfies a fairly strict set of requirements that are largely intended to help
22provide fair use of the system to all users. It is important to note that what
23is considered a "standard" transaction changes over time. For some insight, at
24the time of this writing, an example of _some_ of the criteria that are required
25for a transaction to be considered standard are that it is of the most-recently
26supported version, finalized, does not exceed a specific size, and only consists
27of specific script forms.
28
29Since this package does not deal with other bitcoin specifics such as network
30communication and transaction relay, it returns a list of transactions that were
31accepted which gives the caller a high level of flexibility in how they want to
32proceed. Typically, this will involve things such as relaying the transactions
33to other peers on the network and notifying the mining process that new
34transactions are available.
35
36This package has intentionally been designed so it can be used as a standalone
37package for any projects needing the ability create an in-memory pool of bitcoin
38transactions that are not only valid by consensus rules, but also adhere to a
39configurable policy.
40
41## Feature Overview
42
43The following is a quick overview of the major features. It is not intended to
44be an exhaustive list.
45
46- Maintain a pool of fully validated transactions
47 - Reject non-fully-spent duplicate transactions
48 - Reject coinbase transactions
49 - Reject double spends (both from the chain and other transactions in pool)
50 - Reject invalid transactions according to the network consensus rules
51 - Full script execution and validation with signature cache support
52 - Individual transaction query support
53- Orphan transaction support (transactions that spend from unknown outputs)
54 - Configurable limits (see transaction acceptance policy)
55 - Automatic addition of orphan transactions that are no longer orphans as new
56 transactions are added to the pool
57 - Individual orphan transaction query support
58- Configurable transaction acceptance policy
59 - Option to accept or reject standard transactions
60 - Option to accept or reject transactions based on priority calculations
61 - Rate limiting of low-fee and free transactions
62 - Non-zero fee threshold
63 - Max signature operations per transaction
64 - Max orphan transaction size
65 - Max number of orphan transactions allowed
66- Additional metadata tracking for each transaction
67 - Timestamp when the transaction was added to the pool
68 - Most recent block height when the transaction was added to the pool
69 - The fee the transaction pays
70 - The starting priority for the transaction
71- Manual control of transaction removal
72 - Recursive removal of all dependent transactions
73
74## Installation and Updating
75
76```bash
77$ go get -u github.com/btcsuite/btcd/mempool
78```
79
80## License
81
82Package mempool is licensed under the [copyfree](http://copyfree.org) ISC
83License.
84