What is the minimum send amount?

+1 vote
Hello, Multichain developers:)

I found a strange thing during the test about the minimum send amount.

native-currency-multiple is 100000000 and minimum-relay-fee is 1000000 in params.dat

I’ve sent 0.000000001(0.1satoshi) through the 'send' API and confirmed that it has sent.

------------result------------

test: getbalance

{"method":"getbalance","params":[],"id":1,"chain_name":"test"}

 

1085699999.75523877

test: send HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje 0.000000001

{"method":"send","params":["HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje",0.00000000],"id":1,"chain_name":"test"}

 

0118bd59cd4c79ab8697746306a25c1b5d26824daddd34535f54ebb27a067b33

test: getbalance

{"method":"getbalance","params":[],"id":1,"chain_name":"test"}

 

1085699999.74523878

--------------------------------------
0.01 is a minimum fee in my blockchain.

balance before: 1085699999.75523877

balance after: 1085699999.74523878

as you can see above, the balance difference is -0.00999999, which is lower than the minimum fee(0.01).

And I was also able to send -0.1 satoshi.

------------result------------

test: send HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje -1

{"method":"send","params":["HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje",-1],"id":1,"chain_name":"test"}

 

error code: -8

error message:

Invalid amount

test: send HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje -0.000000001

{"method":"send","params":["HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje",-0.00000000],"id":1,"chain_name":"test"}

 

9c2fd783b8e661da02ceef6b608e9cd228b4586a8b6920c0a6ac151e09115165

------------------------------

Please check those result above and provide feedback.

Thank you.
asked Dec 6, 2017 by Jeon

1 Answer

0 votes

There are two things here. First, the minimum fee parameter is per kilobyte of transaction size, so the actual fee can certainly be less. Second, when you sent a negative amount, you really sent zero, due to rounding of the JSON-RPC request. You can see the actual request sent in this line:

{"method":"send","params":["HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje",-0.00000000],"id":1,"chain_name":"test"}

answered Dec 8, 2017 by MultiChain
Hello, thanks for the feedback.

below is the transaction information of first transaction.
-------------------------------------------------------------
test: gettransaction 0118bd59cd4c79ab8697746306a25c1b5d26824daddd34535f54ebb27a067b33
{"method":"gettransaction","params":["0118bd59cd4c79ab8697746306a25c1b5d26824daddd34535f54ebb27a067b33"],"id":1,"chain_name":"test"}

{
    "amount" : 0.00000000,
    "fee" : -0.01000000,
    "confirmations" : 17,
    "blockhash" : "27e9b13e5f531eb6a84057c258ab6ca1235bf873a814cb59477fdc9423d1b419",
    "blockindex" : 1,
    "blocktime" : 1512637667,
    "txid" : "0118bd59cd4c79ab8697746306a25c1b5d26824daddd34535f54ebb27a067b33",
    "walletconflicts" : [
    ],
    "valid" : true,
    "time" : 1512637665,
    "timereceived" : 1512637665,
    "details" : [
        {
            "account" : "",
            "address" : "HCwtvswP6YsrqUJg7sEhfySbNsh1mqhtje",
            "category" : "send",
            "amount" : 0.00000000,
            "vout" : 0,
            "fee" : -0.01000000
        }
    ],
    "hex" : "0100000001db0c71511a298e5ef19f4de8ab308ef0c97106fe7714f4d4d75832716988a1b9000000006b483045022100a5678c1b7bb2ec38842ce8cb86ff87a6eb23b9d4c1acecfd0d520779ec2f259b02202aab9ef127f71800a6a7c38484715a24eb3a9491c95970d6871108e9c3ef29db012103510de2741850e60c8bd9bbdd75c811a986105c982c1dbf327abbd53eef3acbabffffffff0200000000000000001976a914467febc661b202cbf94d039e004146d87e8dd01b88acc05d634e180900001976a914838c333876da0eca93514131cf5b13e7d6623aa288ac00000000"
}
---------------------------------------------

As, you can see above, amount is 0, and fee is 0.01.

But the balance diffrence is 0.00999999.

Can you please let me know the reason for result above?
This just appears to be because of rounding, because your native-currency-multiple implies more decimal digits than is returned by the API.
...