0

Does dust fee rule activate in bitcoin testnet? I create a tx in testnet with output is dust,the tx always relayed and go into block, but in main net it report dust transaction error. Why bitcoin testnet is different to mainet in dust relay fee policy.

my bitcoin-0.17.1 not set -dustrelayfee option means it default to 546 satoshi.

the testnet tx is https://chain.so/tx/BTCTEST/33e00aa06e22ea69908a1c000450cc15a7001d4a0922e5ac2b79bad569a62c0d

$ find . -name "*.cpp" -type f | xargs grep '\-dustrelayfee'
./init.cpp:    gArgs.AddArg("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kB) used to defined dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), true, OptionsCategory::NODE_RELAY);
./init.cpp:    if (gArgs.IsArgSet("-dustrelayfee"))
./init.cpp:        if (!ParseMoney(gArgs.GetArg("-dustrelayfee", ""), n))
./init.cpp:            return InitError(AmountErrMsg("dustrelayfee", gArgs.GetArg("-dustrelayfee", "")));

#src/policy/policy.cpp
CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)
 {
     // "Dust" is defined in terms of dustRelayFee,
     // which has units satoshis-per-kilobyte.
     // If you'd pay more in fees than the value of the output
     // to spend something, then we consider it dust.
     // A typical spendable non-segwit txout is 34 bytes big, and will
     // need a CTxIn of at least 148 bytes to spend:
     // so dust is a spendable txout less than
     // 182*dustRelayFee/1000 (in satoshis).
     // 546 satoshis at the default rate of 3000 sat/kB.
     // A typical spendable segwit 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).
     // 294 satoshis at the default rate of 3000 sat/kB.
     if (txout.scriptPubKey.IsUnspendable())
         return 0;

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.