You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b44cca0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/06_0_Controlling_Bitcoin_Transactions.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,11 @@
1
1
# Chapter Six: Controlling Bitcoin Transactions
2
2
3
-
Sending a transaction isn't always the end of the story. Using the RBF (replace-by-fee) and CPFP (child-pays-for-parent) protocols, a developer can continue to control the transaction after it's been sent, to improve efficiency or to recover transactions that get stuck. These methods will begin to spotlight the true power of Bitcoin.
3
+
Sending a transaction isn't always the end of the story. Using the RBF
4
+
(replace-by-fee) and CPFP (child-pays-for-parent) protocols, a
5
+
developer can continue to control the transaction after it's been
6
+
sent, to improve efficiency or to recover transactions that get
7
+
stuck. These methods will begin to spotlight the true power of
Copy file name to clipboardExpand all lines: docs/06_1_Watching_for_Stuck_Transactions.md
+43-11Lines changed: 43 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,18 @@
1
1
# 6.1: Watching for Stuck Transactions
2
2
3
-
Sometimes a Bitcoin transaction can get stuck. Usually it's because there wasn't sufficient transaction fee, but it can also be because of a one-time network or software glitch.
3
+
Sometimes a Bitcoin transaction can get stuck. Usually it's because
4
+
there wasn't sufficient transaction fee, but it can also be because of
5
+
a one-time network or software glitch.
4
6
5
7
## Watch Your Transactions
6
8
7
-
You should _always_ watch to ensure that your transactions go out. `bitcoin-cli listtransactions` will show all of your incoming and outgoing transactions, while `bitcoin-cli gettransaction` with a txid will show a specific transaction.
9
+
You should _always_ watch to ensure that your transactions go
10
+
out. `bitcoin-cli listtransactions` will show all of your incoming and
11
+
outgoing transactions, while `bitcoin-cli gettransaction` with a txid
12
+
will show a specific transaction.
8
13
9
-
The following shows a transaction that has not been put into a block. You can tell this because it has no confirmations.
14
+
The following shows a transaction that has not been put into a
15
+
block. You can tell this because it has no confirmations.
A transaction can be considered stuck if it stays in this state for an extended amount of time. Early on, you could be sure that every transaction would go out _eventually_. But, that's no longer the case due to the increased usage of Bitcoin. Now, if a transaction is stuck too long, it will drop out of the mempool and then be lost from the Bitcoin network.
47
-
48
-
> 📖 ***What is mempool?*** Mempool (or Memory Pool) is a pool of all unconfirmed transactions at a bitcoin node. These are the transactions that a node has received from the peer-to-peer network which are not yet included in a block. Each bitcoin node can have a slightly different set of transactions in its mempool: different transactions might have propogated to a specific node. This depends on when the node was last started and also its limits on how much it's willing to store. When a miner makes a block, they use transactions from their own mempool. Then, when a block is verified, all the miners remove the transactions that block contains from their individual pools. Most mempools will not keep unconfirmed transactions forlonger than two weeks, and that number could drop dramatically (to as low as a few days)intimes of congestion.
49
-
50
-
This list of all [unconfirmed transactions on the mainnet](https://blockchain.info/unconfirmed-transactions) might not match any individual machine's mempool, but it should (mostly) be a superset of them.
52
+
A transaction can be considered stuck if it stays in this state for an
53
+
extended amount of time. Early on in the history of Bitcoin, you could
54
+
be sure that every transaction would go out _eventually_. But, that's
55
+
no longer the case due to its increased usage. Now, if a transaction
56
+
is stuck too long, it will drop out of the mempool and then be lost
57
+
from the Bitcoin network.
58
+
59
+
> 📖 ***What is mempool?*** Mempool (or Memory Pool) is a pool of all
60
+
unconfirmed transactions at a Bitcoin node. These are the transactions
61
+
that a node has received from the peer-to-peer network which are not
62
+
yet included in a block. Each Bitcoin node can have a slightly
63
+
different set of transactions in its mempool: different transactions
64
+
might have propogated to a specific node. This depends on when the
65
+
node was last started and also its limits on how much it's willing to
66
+
store. When a miner makes a block, they use transactions from their
67
+
own mempool. Then, when a block is verified, all the miners remove the
68
+
transactions that block contains from their individual pools. Most
69
+
mempools will not keep unconfirmed transactions for longer than two
70
+
weeks, and that number could drop dramatically (to as low as a few
71
+
days) intimes of congestion.
72
+
73
+
This list of all [unconfirmed transactions on the
74
+
mainnet](https://blockchain.info/unconfirmed-transactions) might not
75
+
match any individual machine's mempool, but it should (mostly) be a
76
+
superset of them.
51
77
52
78
## Decide What to Do
53
79
@@ -57,13 +83,19 @@ If your transaction is stuck longer than you want, you can typically do one of f
57
83
58
84
**2. Wait Until it Expires.** If you accidentally sent with no transaction fee, or if any number or other conditions are met, then your transaction might never go through. However, your coins aren't lost. As long as you don't have a wallet that purposefully resends unconfirmed transactions, it should eventually clear from the mempool, and then you can try again.
59
85
60
-
**3. Use RBF as the Sender.** If you are the sender of the transaction, and you opted-in to RBF (Replace-By-Fee), then you can try again with a higher fee. See [§6.2: Resending a Transaction with RBF](06_2_Resending_a_Transaction_with_RBF.md).
86
+
**3. Use RBF as the Sender.** If you are the sender of the transaction, and you opted-in to RBF (Replace-by-Fee), then you can try again with a higher fee. See [§6.2: Resending a Transaction with RBF](06_2_Resending_a_Transaction_with_RBF.md).
61
87
62
-
**4. Use CPFP as the Receiver.** Alternatively, if you are the receiver of the transaction, you can use CPFP (Child-pays-for-parent) to use the unconfirmed transaction as an input to a new transaction. See [§6.3: Funding a Transaction with CPFP](06_3_Funding_a_Transaction_with_CPFP.md)
88
+
**4. Use CPFP as the Receiver.** Alternatively, if you are the
89
+
receiver of the transaction, you can use CPFP (Child-Pays-for-Parent)
90
+
to use the unconfirmed transaction as an input to a new
91
+
transaction. See [§6.3: Funding a Transaction with
92
+
CPFP](06_3_Funding_a_Transaction_with_CPFP.md)
63
93
64
94
## Summary: Watching for Stuck Transactions
65
95
66
-
This is an introduction to the power of Bitcoin transactions. If you know that a transaction is stuck, then you can decide to free it up with features like RBF or CPFP.
96
+
This is an introduction to the power of Bitcoin transactions. If you
97
+
know that a transaction is stuck, then you can decide to free it up
0 commit comments