HomeBitcoinbitcoind - Mud threshold for Testnet

bitcoind – Mud threshold for Testnet


The mud threshold is outlined as (output_weight+input_weight)×discard_feerate. The discard_feerate is outlined as 3 s/vB. It follows that you’ll want to know the input_weight to calculate an output’s mud threshold.

That is simple within the case of P2PKH outputs, as a result of the enter has a hard and fast weight. It’s nonetheless is unimaginable within the case of P2SH, P2WSH, and P2TR outputs, since you can’t inform from the tackle what situation script the recipient encoded of their tackle to spend the output later. It could possibly be a legacy multisig, wrapped segwit, or some customized development. In case of P2TR it could possibly be spend per the keypath or the scriptpath which might lead to completely different enter weights.

Due to this fact, the Bitcoin Core code solely makes use of two completely different mud thresholds:
Screenshot of GetDustThreshold(…) through https://github.com/bitcoin/bitcoin/blob/grasp/src/coverage/coverage.cpp

For all native segwit outputs, it makes use of the load of the particular output plus the load of a P2WPKH enter. Notice that though

nSize += (32 + 4 + 1 + (107 / WITNESS_SCALE_FACTOR) + 4);

ought to consider to 67.75 vB, since nSize is a size_t, it truly comes out as 67 vB.

This implies for P2WPKH, the place an output is 31 vB, the full comes out to 31 vB + 67 vB = 98 vB. This implies for P2WPKH mud threshold is 294 satoshis. For P2WSH and P2TR, the place outputs are 43 vB, the mud threshold comes out to 330 satoshis.

P2PKH outputs are 34 vB and inputs are 148 vB, so their roundtrip complete is 34 vB + 148 vB = 182 vB, and thus the P2PKH mud threshold is 546 satoshis. Since P2SH outputs are solely 32 vB for wrapped segwit and all different P2SH outputs, their mud threshold comes out to 540 satoshi.


You possibly can search for tackle prefixes on this desk:
https://en.bitcoin.it/wiki/List_of_address_prefixes

  • m… is a testnet P2PKH tackle
  • 2… is a testnet P2SH tackle
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments