Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dust limit defined as 5460 satoshi instead of 5430 in Bitcoin core #50

Closed
dexX7 opened this issue Feb 13, 2014 · 2 comments
Closed

Dust limit defined as 5460 satoshi instead of 5430 in Bitcoin core #50

dexX7 opened this issue Feb 13, 2014 · 2 comments

Comments

@dexX7
Copy link
Member

dexX7 commented Feb 13, 2014

This issue has rather an impact on MSC related applications than the specification itself, but as the dust limit is explicitly mentioned as 5430 satoshi, it's probably worth to discuss.

When first introduced, the dust transaction threshold was falsely advertised as 5430 satoshi, but in fact it's 5460 satoshi. (see: fix comment about dust logic #2760)

To quote the reference implementation of Bitcoin:

bool IsDust(int64_t nMinRelayTxFee) const
{
    // "Dust" is defined in terms of CTransaction::nMinRelayTxFee,
    // which has units satoshis-per-kilobyte.
    // If you'd pay more than 1/3 in fees
    // to spend something, then we consider it dust.
    // A typical txout is 34 bytes big, and will
    // need a CTxIn of at least 148 bytes to spend,
    // so dust is a txout less than 54 uBTC
    // (5460 satoshis) with default nMinRelayTxFee
    return ((nValue*1000)/(3*((int)GetSerializeSize(SER_DISK,0)+148)) < nMinRelayTxFee);
}

Source: https://github.com/bitcoin/bitcoin/blob/master/src/core.h#L151 (or main.cpp in earlier versions)

As a direct result any transaction with an output value lower than 5460 satoshi gets rejected with the message "TX rejected (code -22)".

As secondary result this allows zero confirmation double spends where one transaction is broadcasted via a client that accepts such transactions and one that does not (e.g. via https://blockchain.info/pushtx and bitcoind).

After some testing it furthermore became clear that semi-dust transactions have a significant longer confirmation time compared to those that are accepted by the Bitcoin core client.

@zathras-crypto
Copy link
Contributor

Thanks - spec should be updated to reflect 5460 if that's what's in the bitcoin source.

@marv-engine
Copy link

Corrected in #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants