Skip to content

Commit

Permalink
policy: document we intentionally don't lower the dust threshold for …
Browse files Browse the repository at this point in the history
…Taproot

A "correction" of what seemed to be an overlook was initially proposed in
PR bitcoin#22779. It was deemed unnecessary to further reduce the dust level,
so document the intention.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
  • Loading branch information
darosior committed Sep 2, 2021
1 parent b997dd2 commit d873db7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/policy/policy.cpp
Expand Up @@ -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).
Expand All @@ -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.
Expand Down

0 comments on commit d873db7

Please sign in to comment.