OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / vendor / github.com / btcsuite / btcd / mempool / README.md
1 mempool
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
8 Package mempool provides a policy-enforced pool of unmined bitcoin transactions.
9
10 A key responsbility of the bitcoin network is mining user-generated transactions
11 into blocks.  In order to facilitate this, the mining process relies on having a
12 readily-available source of transactions to include in a block that is being
13 solved.
14
15 At a high level, this package satisfies that requirement by providing an
16 in-memory pool of fully validated transactions that can also optionally be
17 further filtered based upon a configurable policy.
18
19 One of the policy configuration options controls whether or not "standard"
20 transactions are accepted.  In essence, a "standard" transaction is one that
21 satisfies a fairly strict set of requirements that are largley intended to help
22 provide fair use of the system to all users.  It is important to note that what
23 is considered a "standard" transaction changes over time.  For some insight, at
24 the time of this writing, an example of _some_ of the criteria that are required
25 for a transaction to be considered standard are that it is of the most-recently
26 supported version, finalized, does not exceed a specific size, and only consists
27 of specific script forms.
28
29 Since this package does not deal with other bitcoin specifics such as network
30 communication and transaction relay, it returns a list of transactions that were
31 accepted which gives the caller a high level of flexibility in how they want to
32 proceed.  Typically, this will involve things such as relaying the transactions
33 to other peers on the network and notifying the mining process that new
34 transactions are available.
35
36 This package has intentionally been designed so it can be used as a standalone
37 package for any projects needing the ability create an in-memory pool of bitcoin
38 transactions that are not only valid by consensus rules, but also adhere to a
39 configurable policy.
40
41 ## Feature Overview
42
43 The following is a quick overview of the major features.  It is not intended to
44 be 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
82 Package mempool is licensed under the [copyfree](http://copyfree.org) ISC
83 License.