3

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.

  • trying different thresholds I've found out that minimal accepted amount is ฿0.00005460. No idea why is that, but that's it. – user1450663 Nov 1 '13 at 22:25
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 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.

  • 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 Nov 3 '13 at 13:02
  • I took the liberty of copying the relevant code into a pastie: bitbin.it/iDVgHPnn there should be all the information you need. – cdecker Nov 3 '13 at 13:40
  • Ok, but I don't speak Java. Is the formula coded there is: min_nondust = (fee_per_kb*(148+33))/1024 ? – user1450663 Nov 3 '13 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.