Insufficient funds while having lots of UTXO

+1 vote

Hi,

 

I'm trying to setup a blockchain with no native currency, no assets or streams and no permissions. I've set the parameters so that there is no block reward, so each node has lots of UTXO from mining but those have 0 "amount".

 

The problem is, when I try the "sendwithdatafrom" method, I get:

error code: -6
error message:
Insufficient funds

But the node I'm trying this on has a lot of UTXO as I said. So I tried to do it via the "createrawtransaction" method and it works perfectly, so my guess is that sendwithdatafrom tries to add fee to the transaction but as there's no native currency, you can't really do so. Could you confirm this ? (I tried to use "settxfee" to 0 but it doesn't work)

 

Great work on multichain, thanks in advance !

asked Jun 27, 2017 by GCath

1 Answer

0 votes

The problem is likely that the particular address you are using with sendwithdatafrom has no confirmed unspent transaction outputs belonging specifically to that address. In any event it won't try to add a fee to the transaction unless one is necessitated by the blockchain parameters, so that's probably not the reason.

answered Jun 27, 2017 by MultiChain
As I said previously, there are lots of unspent transactions outputs that I can see with "listunspent" for my address. I'm trying to do this command:

multichain-cli MyChain sendwithdatafrom "1GYZvFd9vTdheXwDkuoZhD8Arf77kTJFDtucx8" "1GYZvFd9vTdheXwDkuoZhD8Arf77kTJFDtucx8" 0 "7F000001"

and with listunspent I've got lots of UTXO like:

{
        "txid" : "f6f1d8c23def2cccbe8f7bf3107c58e2102d5e1a2de17b6cb4ace47d668bda38",
        "vout" : 0,
        "address" : "1GYZvFd9vTdheXwDkuoZhD8Arf77kTJFDtucx8",
        "account" : "",
        "scriptPubKey" : "76a9147302c97291a63c13cefc13eab2c6d2703abfa00e88ac",
        "amount" : 0.00000000,
        "confirmations" : 20,
        "spendable" : true,
        "assets" : [
        ],
        "permissions" : [
        ]
    }

I've changed the default parameters quite a lot, including minimum-relay-fee, maximum-per-output and minimum-per-output that I've all set to 0, to try to remove all action possible on native currency, as there's no "Native-currency = false" option.

To me this seem like a bug from Multichain, I've been using it a lot and I think this bug is not on my part. Any other idea to fix this issue ? :/
Thanks - can you please post the output of getblockchainparams.
Sure! Thank you for taking the time to look into this

{
    "chain-protocol" : "bitcoin",
    "chain-description" : "Multichain MyChain",
    "root-stream-name" : "root",
    "root-stream-open" : true,
    "chain-is-testnet" : false,
    "target-block-time" : 60,
    "maximum-block-size" : 100000000,
    "default-network-port" : 4803,
    "default-rpc-port" : 4802,
    "anyone-can-connect" : true,
    "anyone-can-send" : true,
    "anyone-can-receive" : true,
    "anyone-can-receive-empty" : true,
    "anyone-can-create" : false,
    "anyone-can-issue" : false,
    "anyone-can-mine" : true,
    "anyone-can-activate" : false,
    "anyone-can-admin" : false,
    "support-miner-precheck" : true,
    "allow-p2sh-outputs" : true,
    "allow-multisig-outputs" : true,
    "setup-first-blocks" : 60,
    "mining-diversity" : 0.50000000,
    "admin-consensus-upgrade" : 1.00000000,
    "admin-consensus-admin" : 1.00000000,
    "admin-consensus-activate" : 1.00000000,
    "admin-consensus-mine" : 1.00000000,
    "admin-consensus-create" : 1.00000000,
    "admin-consensus-issue" : 1.00000000,
    "lock-admin-mine-rounds" : 10,
    "mining-requires-peers" : true,
    "mine-empty-rounds" : 1.00000000,
    "mining-turnover" : 0.50000000,
    "first-block-reward" : -1,
    "initial-block-reward" : 0,
    "reward-halving-interval" : 52560000,
    "reward-spendable-delay" : 1,
    "minimum-per-output" : 0,
    "maximum-per-output" : 0,
    "minimum-relay-fee" : 0,
    "native-currency-multiple" : 1,
    "skip-pow-check" : false,
    "pow-minimum-bits" : 8,
    "target-adjust-freq" : 240,
    "allow-min-difficulty-blocks" : true,
    "only-accept-std-txs" : false,
    "max-std-tx-size" : 4194304,
    "max-std-op-returns-count" : 2,
    "max-std-op-return-size" : 2097152,
    "max-std-op-drops-count" : 5,
    "max-std-element-size" : 8192,
    "chain-name" : "Mychain",
    "protocol-version" : 10008,
    "network-message-start" : "f4edf4f8",
    "address-pubkeyhash-version" : "001dbefa",
    "address-scripthash-version" : "05ee72dd",
    "private-key-version" : "803cdd52",
    "address-checksum-value" : "ad61a522",
    "genesis-pubkey" : "0328f4bd4332ae68bbf78688f550fe9a7d1286d6e3cb2de638d91b1ba67c788182",
    "genesis-version" : 1,
    "genesis-timestamp" : 1498571910,
    "genesis-nbits" : 536936447,
    "genesis-nonce" : 569,
    "genesis-pubkey-hash" : "7302c97291a63c13cefc13eab2c6d2703abfa00e",
    "genesis-hash" : "0082b8ad08a3cd35e7df5962b7b8e0bc3813c8f07051a2b4505cc47079ad9b04",
    "chain-params-hash" : "28b29cda3d723a3d3e2f090e06a4a2c7b2cc6c26a9498f7a965d8c8ab58160ea"
}
Thanks - we're taking a look and will reply shortly.
3 questions:

1. What is the version of MultiChain you are using?
2. If you created lot of UTXO using sendwithdatafrom, what exactly is a problem? Does it fail intermittently?
3. In your sendwithdatafrom command name of the chain is MyChain. In the output of getblockchainparams it is Mychain. Chain name is case-sensitive. Is it the same chain?
Hello Michael, thank you for your response

1) I'm using the version that is on the master branch on github as there was no releases on it.

2) The UTXO are created by mining blocks, so they are only coinbase transactions. Those UTXO were not created with sendwithdatafrom. The problem is that when I clearly have some UTXO available, sendwithdatafrom fails ("Insufficient funds" error). So technically, it's only this method that is failing while it shouldn't.

3) I purposely changed the blockchain name to MyChain because the original name is the one of the project we're working on, so I can't give out his name yet but I hope that you guys will be able to have a look at it in the near future. So MyChain is just a placeholder, and when I copy/pasted the "getblockchainparams", I did a little typo on the "chain-name" while changing it :)
Is there a reason why you're using the bitcoin instead of the multichain protocol here? This will disable most of MultiChain's functionality (permissions, assets, streams) and you don't gain anything in return.
We're using the bitcoin protocol precisely to disable those functionality. What we gain in return is that users can't use them, and I may be wrong but I believe it does reduces the size of the blockchain (even though I still see "asset" and "permission" on the transactions).
After some trial and error, it seems that the "bitcoin" protocol (first parameter) is the issue. I'll look a bit more into it and keep you guys updated, thanks again !
...