aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-10-15 14:50:28 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-10-15 14:52:07 +0200
commit4dbba3bac70f78e764910f357c875c09569a8fc4 (patch)
tree4c170b459d577775a39c8a96af58db243092d5eb /src/policy
parentce19f4fd37c89bcc2dc9ca1d22edccf4359698d5 (diff)
parentd873db7f8ff37c37f9c72482d8ecd52282f4438e (diff)
downloadbitcoin-4dbba3bac70f78e764910f357c875c09569a8fc4.tar.xz
Merge bitcoin/bitcoin#22863: policy: document dust threshold for Taproot outputs
d873db7f8ff37c37f9c72482d8ecd52282f4438e policy: document we intentionally don't lower the dust threshold for Taproot (Antoine Poinsot) Pull request description: Following discussions in #22779 . ACKs for top commit: benthecarman: ACK d873db7f8ff37c37f9c72482d8ecd52282f4438e ariard: Code Review ACK d873db7 theStack: ACK d873db7f8ff37c37f9c72482d8ecd52282f4438e Tree-SHA512: 1f5d20dce767f8a74d57ece47a7f6b881741f508896131b8433600cccf9e4262892603b46521d1bb69d5c83b450f24a16731341072a471c1f2c9adad682af895
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/policy.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp
index 9e433584e7..fced397e51 100644
--- a/src/policy/policy.cpp
+++ b/src/policy/policy.cpp
@@ -22,7 +22,7 @@ CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)
// so dust is a spendable txout less than
// 182*dustRelayFee/1000 (in satoshis).
// 546 satoshis at the default rate of 3000 sat/kvB.
- // A typical spendable segwit txout is 31 bytes big, and will
+ // A typical spendable segwit P2WPKH txout is 31 bytes big, and will
// need a CTxIn of at least 67 bytes to spend:
// so dust is a spendable txout less than
// 98*dustRelayFee/1000 (in satoshis).
@@ -34,6 +34,11 @@ CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)
int witnessversion = 0;
std::vector<unsigned char> witnessprogram;
+ // Note this computation is for spending a Segwit v0 P2WPKH output (a 33 bytes
+ // public key + an ECDSA signature). For Segwit v1 Taproot outputs the minimum
+ // satisfaction is lower (a single BIP340 signature) but this computation was
+ // kept to not further reduce the dust level.
+ // See discussion in https://github.com/bitcoin/bitcoin/pull/22779 for details.
if (txout.scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
// sum the sizes of the parts of a transaction input
// with 75% segwit discount applied to the script size.