<p>Anything lower than 5460 satoshis is currently considered dust, that bloats the blockchain, while transferring a value that is lower than what it costs to store the resulting output on disk. From the <a href="https://bitcoinj.googlecode.com/git-history/e4a5c6bbc98587b72573317f4efda915c4858e4a/core/src/main/java/com/google/bitcoin/core/Transaction.java" rel="nofollow">bitcoinj</a> source:</p>

<blockquote>
  <p>Any standard (ie pay-to-address) output smaller than this value (in
  satoshis) will most likely be rejected by the network. This is
  calculated by assuming a standard output will be 34 bytes, and then
  using the formula used in <code>getMinNonDustValue(BigInteger)</code>. Currently
  it's 5460 satoshis.</p>
</blockquote>

CC BY-SA 3.0
2013-11-03T13:02:55.177Z
Hmm, so dust value is not fixed to 5430 satoshis, but is calculated with some formula? What's the formula then and how do I calculate this myself? I really need to.
user1450663
CC BY-SA 3.0
2013-11-03T13:40:24.867Z
I took the liberty of copying the relevant code into a pastie: http://bitbin.it/iDVgHPnn there should be all the information you need.
cdecker
CC BY-SA 3.0
2013-11-03T15:52:23.090Z
Ok, but I don't speak Java. Is the formula coded there is:

`min_nondust = (fee_per_kb*(148+33))/1024` ?
user1450663
CC BY-SA 4.0
2024-10-08T20:19:49.680Z
`3 * (output size) + 444` (satoshis) for legacy outputs, `3 * (output size) + 201` (satoshis) for segwit outputs
bca-0353f40e
CC BY-SA 3.0
2013-11-02T10:58:55.793Z
2013-11-02T10:58:55.793Z
cdecker
<p>This is because newly created outputs must be funded with amounts greater than or equal to <a href="https://bitcoin.stackexchange.com/questions/86068/how-was-the-dust-limit-of-546-satoshis-was-chosen-why-not-550-satoshis"><strong>minimum dust limit</strong></a>.</p>
<p>For legacy outputs <a href="https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.cpp#L59" rel="nofollow noreferrer">the formula</a> reduces to:</p>
<ul>
<li><code>dust limit = 3 * (output size) + 444</code></li>
</ul>
<p>For SegWit outputs, <a href="https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.cpp#L57" rel="nofollow noreferrer">the formula</a> reduces to:</p>
<ul>
<li><code>dust limit = 3 * (output size) + 201</code></li>
</ul>
<p>Actual C++ code first sets <code>nSize</code> to size of output:</p>
<ul>
<li><code>size_t nSize = GetSerializeSize(txout);</code></li>
</ul>
<p>Then increments it by constants:</p>
<ul>
<li>In case of SegWit: <code>nSize += (32 + 4 + 1 + (107 / WITNESS_SCALE_FACTOR) + 4);</code>, where <code>WITNESS_SCALE_FACTOR = 4</code>.</li>
<li>In case of legacy: <code>nSize += (32 + 4 + 1 + 107 + 4);</code></li>
</ul>
<p>Finally, it <a href="https://github.com/bitcoin/bitcoin/blob/master/src/policy/feerate.cpp#L23" rel="nofollow noreferrer">multiplies the <code>nSize</code> by the fee rate</a>:</p>
<ul>
<li><code>return dustRelayFeeIn.GetFee(nSize);</code></li>
</ul>
<p>which defaults to <a href="https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.h#L55" rel="nofollow noreferrer">3000 sat/kvB</a>.</p>

CC BY-SA 4.0
2024-10-08T19:02:45.587Z
2024-10-08T19:15:49.143Z
2024-10-08T19:15:49.143Z
bca-0353f40e
<p>I'm trying to create a transaction via JSON-RPC API. It has low outputs, but not below "dust" threshold, yet it's still getting rejected by bitcoind with error code "-22". Transaction includes fee of ฿0.0001.</p>

<p>Transaction hex:</p>

<pre><code>0100000001bbe7bfc7db0720cc0b66b55fc63b265e07554644ff18a79c07bb2e2b9bfb1666000000008c49304602210099c8d1376a735f3cfb79d19fdf6d196cdce60e5a3555aa5080b021b649b95d1a022100e5faf1deedd45f9666e77ae97a2e7618567abb03861f3756392a5ff2e35c9f54014104e171d9dee93d16be86a6489fb9dd06bcf42b2c19d869b6302ebc4e2cff93a8576dbf6c8c5372eca8c8ea69a1bd8107475916526377e8befd15ccaf91d9dd206cffffffff0236150000000000001976a9149bd0064acb814a139db73e049f04489dd9aec76b88ace91c0000000000001976a914a4d7331e96bf019411540cfc1d6e018d31c5329a88ac00000000
</code></pre>

<p>And human readable view:</p>

<pre><code>{
    "txid" : "0c1b46a2cb0b2aef67c858503dc1cf365f2f792401ff6d2bcab9aa1fd0669702",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "6616fb9b2b2ebb079ca718ff444655075e263bc65fb5660bcc2007dbc7bfe7bb",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "304602210099c8d1376a735f3cfb79d19fdf6d196cdce60e5a3555aa5080b021b649b95d1a022100e5faf1deedd45f9666e77ae97a2e7618567abb03861f3756392a5ff2e35c9f5401 04e171d9dee93d16be86a6489fb9dd06bcf42b2c19d869b6302ebc4e2cff93a8576dbf6c8c5372eca8c8ea69a1bd8107475916526377e8befd15ccaf91d9dd206c",
                "hex" : "49304602210099c8d1376a735f3cfb79d19fdf6d196cdce60e5a3555aa5080b021b649b95d1a022100e5faf1deedd45f9666e77ae97a2e7618567abb03861f3756392a5ff2e35c9f54014104e171d9dee93d16be86a6489fb9dd06bcf42b2c19d869b6302ebc4e2cff93a8576dbf6c8c5372eca8c8ea69a1bd8107475916526377e8befd15ccaf91d9dd206c"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.00005430,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 9bd0064acb814a139db73e049f04489dd9aec76b OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9149bd0064acb814a139db73e049f04489dd9aec76b88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1FCrwY2CsLJgsmbogSunECwCa6WswBBrfz"
                ]
            }
        },
        {
            "value" : 0.00007401,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 a4d7331e96bf019411540cfc1d6e018d31c5329a OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914a4d7331e96bf019411540cfc1d6e018d31c5329a88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1G2bcoCKj8s9GYheqQgU5CHSLCtGjyP9Vz"
                ]
            }
        }
    ]
}
</code></pre>

<p>Why it's getting rejected?</p>

<p><em>Update:</em>
Minimal output that is accepted is 5460 satoshis. </p>

CC BY-SA 3.0
2013-11-01T22:25:34.193Z
trying different thresholds I've found out that minimal accepted amount is ฿0.00005460. No idea why is that, but that's it.
user1450663
<bitcoind><json-rpc><dust>
Why is a transaction with outputs of less than ฿0.00005460 rejected?
user1450663
# Why is a transaction with outputs of less than ฿0.00005460 rejected?

(Asked by: username_0 on 2013-11-01)

I'm trying to create a transaction via JSON-RPC API. It has low outputs, but not below "dust" threshold, yet it's still getting rejected by bitcoind with error code "-22". Transaction includes fee of ฿0.0001.
Transaction hex:
0100000001bbe7bfc7db0720cc0b66b55fc63b265e07554644ff18a79c07bb2e2b9bfb1666000000008c49304602210099c8d1376a735f3cfb79d19fdf6d196cdce60e5a3555aa5080b021b649b95d1a022100e5faf1deedd45f9666e77ae97a2e7618567abb03861f3756392a5ff2e35c9f54014104e171d9dee93d16be86a6489fb9dd06bcf42b2c19d869b6302ebc4e2cff93a8576dbf6c8c5372eca8c8ea69a1bd8107475916526377e8befd15ccaf91d9dd206cffffffff0236150000000000001976a9149bd0064acb814a139db73e049f04489dd9aec76b88ace91c0000000000001976a914a4d7331e96bf019411540cfc1d6e018d31c5329a88ac00000000

And human readable view:
{
    "txid" : "0c1b46a2cb0b2aef67c858503dc1cf365f2f792401ff6d2bcab9aa1fd0669702",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "6616fb9b2b2ebb079ca718ff444655075e263bc65fb5660bcc2007dbc7bfe7bb",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "304602210099c8d1376a735f3cfb79d19fdf6d196cdce60e5a3555aa5080b021b649b95d1a022100e5faf1deedd45f9666e77ae97a2e7618567abb03861f3756392a5ff2e35c9f5401 04e171d9dee93d16be86a6489fb9dd06bcf42b2c19d869b6302ebc4e2cff93a8576dbf6c8c5372eca8c8ea69a1bd8107475916526377e8befd15ccaf91d9dd206c",
                "hex" : "49304602210099c8d1376a735f3cfb79d19fdf6d196cdce60e5a3555aa5080b021b649b95d1a022100e5faf1deedd45f9666e77ae97a2e7618567abb03861f3756392a5ff2e35c9f54014104e171d9dee93d16be86a6489fb9dd06bcf42b2c19d869b6302ebc4e2cff93a8576dbf6c8c5372eca8c8ea69a1bd8107475916526377e8befd15ccaf91d9dd206c"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.00005430,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 9bd0064acb814a139db73e049f04489dd9aec76b OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9149bd0064acb814a139db73e049f04489dd9aec76b88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1FCrwY2CsLJgsmbogSunECwCa6WswBBrfz"
                ]
            }
        },
        {
            "value" : 0.00007401,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 a4d7331e96bf019411540cfc1d6e018d31c5329a OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914a4d7331e96bf019411540cfc1d6e018d31c5329a88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1G2bcoCKj8s9GYheqQgU5CHSLCtGjyP9Vz"
                ]
            }
        }
    ]
}

Why it's getting rejected?
Update:
Minimal output that is accepted is 5460 satoshis.

**Tags:** bitcoind, json-rpc, dust

> **Comments:**
> **username_0**: trying different thresholds I've found out that minimal accepted amount is ฿0.00005460. No idea why is that, but that's it.  

---

## 2 answers

### Answer by username_1 on 2013-11-02. Score: 4

Anything lower than 5460 satoshis is currently considered dust, that bloats the blockchain, while transferring a value that is lower than what it costs to store the resulting output on disk. From the [bitcoinj](https://bitcoinj.googlecode.com/git-history/e4a5c6bbc98587b72573317f4efda915c4858e4a/core/src/main/java/com/google/bitcoin/core/Transaction.java) source:

> Any standard (ie pay-to-address) output smaller than this value (in
> satoshis) will most likely be rejected by the network. This is
> calculated by assuming a standard output will be 34 bytes, and then
> using the formula used in `getMinNonDustValue(BigInteger)`. Currently
> it's 5460 satoshis.

> **Comments:**
> **username_0**: Hmm, so dust value is not fixed to 5430 satoshis, but is calculated with some formula? What's the formula then and how do I calculate this myself? I really need to.  
> **username_1**: I took the liberty of copying the relevant code into a pastie: http://bitbin.it/iDVgHPnn there should be all the information you need.  
> **username_0**: Ok, but I don't speak Java. Is the formula coded there is:  `min_nondust = (fee_per_kb*(148+33))/1024` ?  
> **username_2**: `3 * (output size) + 444` (satoshis) for legacy outputs, `3 * (output size) + 201` (satoshis) for segwit outputs  

---

### Answer by username_2 on 2024-10-08. Score: 0

This is because newly created outputs must be funded with amounts greater than or equal to [**minimum dust limit**](https://bitcoin.stackexchange.com/questions/86068/how-was-the-dust-limit-of-546-satoshis-was-chosen-why-not-550-satoshis).

For legacy outputs [the formula](https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.cpp#L59) reduces to:

* `dust limit = 3 * (output size) + 444`

For SegWit outputs, [the formula](https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.cpp#L57) reduces to:

* `dust limit = 3 * (output size) + 201`

Actual C++ code first sets `nSize` to size of output:

* `size_t nSize = GetSerializeSize(txout);`

Then increments it by constants:

* In case of SegWit: `nSize += (32 + 4 + 1 + (107 / WITNESS_SCALE_FACTOR) + 4);`, where `WITNESS_SCALE_FACTOR = 4`.
* In case of legacy: `nSize += (32 + 4 + 1 + 107 + 4);`

Finally, it [multiplies the `nSize` by the fee rate](https://github.com/bitcoin/bitcoin/blob/master/src/policy/feerate.cpp#L23):

* `return dustRelayFeeIn.GetFee(nSize);`

which defaults to [3000 sat/kvB](https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.h#L55).


---

