<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>MultiChain Developer Q&amp;A - Recent questions tagged sendfromaddress</title>
<link>https://www.multichain.com/qa/tag/sendfromaddress</link>
<description>Powered by Question2Answer</description>
<item>
<title>Private Key Of A New Address</title>
<link>https://www.multichain.com/qa/10300/private-key-of-a-new-address</link>
<description>&lt;p&gt;generated a new address using &quot;getnewaddress&quot; api command.&lt;/p&gt;&lt;p&gt;issued some assets to that newly created address.&lt;/p&gt;&lt;p&gt;now when I try to see it's private key using &quot;dumpprivkey&quot; command, it says:&lt;/p&gt;&lt;p&gt;&lt;em&gt;Private key for address &amp;lt;newly generated address&amp;gt; is not known&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;is there a way to generate private key for it ?&lt;/em&gt;&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/10300/private-key-of-a-new-address</guid>
<pubDate>Sun, 15 Jul 2018 15:09:33 +0000</pubDate>
</item>
<item>
<title>Sendfromaddress creates a 0 native units change transaction</title>
<link>https://www.multichain.com/qa/3116/sendfromaddress-creates-native-units-change-transaction</link>
<description>&lt;p&gt;We are using the native currency for Multichain, and using the api call 'sendfromaddress' somehow a 'change' transaction of amount 0 is created, which leads to a creation of a lot of unspent transactions which can't be used.&lt;/p&gt;&lt;blockquote&gt;&lt;h3&gt;Outputs&lt;/h3&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Index&lt;/th&gt;&lt;th&gt;Redeemed at input&lt;/th&gt;&lt;th&gt;Native&lt;/th&gt;&lt;th&gt;To address&lt;/th&gt;&lt;th&gt;ScriptPubKey&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;Not yet redeemed&lt;/td&gt;&lt;td&gt;3432.56&lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://network-ledger.dxmarkets.com/Network%20Blockchain/address/1FxzaEpH4MpeMpfLfUkTm8AwDAz1ji2ZMp&quot;&gt;1FxzaEpH4MpeMpfLfUkTm8AwDAz1ji2ZMp&lt;/a&gt;&lt;/td&gt;&lt;td&gt;DUP HASH160 20:a428...f6af EQUALVERIFY CHECKSIG&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Not yet redeemed&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://network-ledger.dxmarkets.com/Network%20Blockchain/address/1LcUDr9bMNG6Kj4YtPtstVGZSHp4SKkQs4&quot;&gt;1LcUDr9bMNG6Kj4YtPtstVGZSHp4SKkQs4&lt;/a&gt;&lt;/td&gt;&lt;td&gt;DUP HASH160 20:d71f...a797 EQUALVERIFY CHECKSIG&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/blockquote&gt;&lt;p&gt;We're now skipping the utxo's with amount ve0 to craft new raw transactions, but it will be good to avoid the creation of transactions with amount 0 for native currency txs&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/3116/sendfromaddress-creates-native-units-change-transaction</guid>
<pubDate>Mon, 14 Nov 2016 16:24:52 +0000</pubDate>
</item>
<item>
<title>Multichain-Cli API handling of first zero quantity asset using sendfromaddress error</title>
<link>https://www.multichain.com/qa/1602/multichain-handling-quantity-asset-sendfromaddress-error</link>
<description>&lt;pre style=&quot;text-align:justify&quot;&gt;&lt;em&gt;&quot;version&quot; : &quot;1.0 alpha 19&quot;&lt;/em&gt;&lt;/pre&gt;&lt;pre style=&quot;text-align:justify&quot;&gt;I have a native asset named msg_only in the chain. If I try to send zero quantity of asset from an address (new created address with permission send, receive) using sendfromaddress it fails, but it works if I use the sequence of createrawtransaction, signrawtransaction and sendrawtransaction. Once (lifetime once) the asset is part of the unspent transaction of the address, the command sendfromaddress works perfectly no matter if the destination address is self or different unlimited times. I am providing the sequence of commands to reproduce the scenario below. To me it looks like a bug in the wallet core and not the node core.

&lt;strong&gt;(Creating a new test address)&lt;/strong&gt;
$ multichain-cli loan getnewaddress
1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6
$ a=1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6 &lt;strong&gt;(The newly created test address)&lt;/strong&gt;
$ admin=1VUV2Ud8dokuP6e3DTpXVYVJX7U8d3HKdR3pZn &lt;strong&gt;(The address having admin and other permissions)&lt;/strong&gt;
&lt;strong&gt;(Granting send,receive permission to test address $a)&lt;/strong&gt;
{&quot;method&quot;:&quot;grantfrom&quot;,&quot;params&quot;:[&quot;1VUV2Ud8dokuP6e3DTpXVYVJX7U8d3HKdR3pZn&quot;,&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,&quot;send,receive&quot;],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}
3d4c01887e12f484d077df7bc618f71df052d71785ea39f5fbd550579359772e
&lt;strong&gt;(Checking balance of test address $a)&lt;/strong&gt;
{&quot;method&quot;:&quot;getaddressbalances&quot;,&quot;params&quot;:[&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}
[]
&lt;strong&gt;(Making attempt to send zero quantity of msg_only asset from test address $a to $a using sendfromaddress command)&lt;/strong&gt;
$ multichain-cli loan sendfromaddress $a $a '{&quot;msg_only&quot;:0}'
{&quot;method&quot;:&quot;sendfromaddress&quot;,&quot;params&quot;:[&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,{&quot;msg_only&quot;:0}],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}
&lt;strong&gt;error code: -4 error message: Insufficient funds&lt;/strong&gt;
&lt;strong&gt;(Using listunspent command to check and select an unspent txid and vout to attempt sequence of createrawtransaction, signrawtransaction and signrawtransaction)&lt;/strong&gt;
$ multichain-cli loan listunspent 0 80000000 '[&quot;'$a'&quot;]'
{&quot;method&quot;:&quot;listunspent&quot;,&quot;params&quot;:[0,80000000,[&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;]],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}
    {
&lt;strong&gt;        &quot;txid&quot; : &quot;3d4c01887e12f484d077df7bc618f71df052d71785ea39f5fbd550579359772e&quot;,
        &quot;vout&quot; : 0,&lt;/strong&gt;
        &quot;address&quot; : &quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,
        &quot;assets&quot; : [
        ],
        &quot;permissions&quot; : [
            {
                &quot;connect&quot; : false,
                &quot;send&quot; : true,
                &quot;receive&quot; : true,
                &quot;issue&quot; : false,
                &quot;mine&quot; : false,
                &quot;admin&quot; : false,
                &quot;activate&quot; : false,
            }
        ]
    }
&lt;strong&gt;(Using transactionid and vout highlighted above in createrawtransaction )&lt;/strong&gt;
$ multichain-cli loan createrawtransaction '[{&quot;txid&quot;:&quot;3d4c01887e12f484d077df7bc618f71df052d71785ea39f5fbd550579359772e&quot;,&quot;vout&quot;:0}]' '{&quot;'$a'&quot;:{&quot;msg_only&quot;:0}}'
{&quot;method&quot;:&quot;createrawtransaction&quot;,&quot;params&quot;:[[{&quot;txid&quot;:&quot;3d4c01887e12f484d077df7bc618f71df052d71785ea39f5fbd550579359772e&quot;,&quot;vout&quot;:0}],{&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;:{&quot;msg_only&quot;:0}}],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}

01000000012e7759935750d5fbf539ea8517d752f01df718c67bdf77d084f4127e88014c3d0000000000ffffffff0100000000000000003176a914e55907d8d6bacf5e8519595c5d38009de517787b88ac1673706b7117000000090100008b9200000000000000007500000000
&lt;strong&gt;(Using wallet default to sign the transaction )&lt;/strong&gt;
$ multichain-cli loan signrawtransaction 01000000012e7759935750d5fbf539ea8517d752f01df718c67bdf77d084f4127e88014c3d0000000000ffffffff0100000000000000003176a914e55907d8d6bacf5e8519595c5d38009de517787b88ac1673706b7117000000090100008b9200000000000000007500000000
{&quot;method&quot;:&quot;signrawtransaction&quot;,&quot;params&quot;:[&quot;01000000012e7759935750d5fbf539ea8517d752f01df718c67bdf77d084f4127e88014c3d0000000000ffffffff0100000000000000003176a914e55907d8d6bacf5e8519595c5d38009de517787b88ac1673706b7117000000090100008b9200000000000000007500000000&quot;],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}
{
    &quot;hex&quot; : &quot;01000000012e7759935750d5fbf539ea8517d752f01df718c67bdf77d084f4127e88014c3d000000006b483045022100aa26f9bc5aae78bfc16c0b0740a4d12a4fa611eca46955d057b7ecc23ad32061022028fe3121a3deaf5dd270f704a6650f0799e18e4913f86cc690c36b3be70ca6110121025e7b85b0be94bf6486df9c61f70e5ed6d5d6c3bea25c1b86494b1978d7a17473ffffffff0100000000000000003176a914e55907d8d6bacf5e8519595c5d38009de517787b88ac1673706b7117000000090100008b9200000000000000007500000000&quot;,
    &quot;complete&quot; : true
}
&lt;strong&gt;(Using wallet default node to send to mine )&lt;/strong&gt;
$ multichain-cli loan sendrawtransaction 010000............
{&quot;method&quot;:&quot;sendrawtransaction&quot;,&quot;params&quot;:[&quot;01000000....0000&quot;],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}

8ed45d7d5387d997582d35b8013225584cc9d1aed1ddfc4d6f7f72365717555f
&lt;strong&gt;(Checking balance )&lt;/strong&gt;
$ multichain-cli loan getaddressbalances $a
{&quot;method&quot;:&quot;getaddressbalances&quot;,&quot;params&quot;:[&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}
[
    {
        &quot;name&quot; : &quot;msg_only&quot;,
        &quot;assetref&quot; : &quot;23-265-37515&quot;,
        &quot;qty&quot; : 0.00000000
    }
]
&lt;strong&gt;(Re-Attempt using sendfromaddress - Now Works)&lt;/strong&gt;
$ multichain-cli loan sendfromaddress $a $a '{&quot;msg_only&quot;:0}'
{&quot;method&quot;:&quot;sendfromaddress&quot;,&quot;params&quot;:[&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,{&quot;msg_only&quot;:0}],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}

ad4a8fd7364a99dc23c77ffd95221112911c1b3276284073460fb906b827c73b

&lt;strong&gt;(Sending again to a diff address)&lt;/strong&gt;
$ multichain-cli loan sendfromaddress $a 1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt '{&quot;msg_only&quot;:0}'
{&quot;method&quot;:&quot;sendfromaddress&quot;,&quot;params&quot;:[&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,&quot;1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt&quot;,{&quot;msg_only&quot;:0}],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}

6431ac2f68b1554d4a2d92f1616b354e315a22a7288dffcfa1b70baecc0b7be6

&lt;strong&gt;(Sending again to a diff address - 2nd time)&lt;/strong&gt;
$ multichain-cli loan sendfromaddress $a 1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt '{&quot;msg_only&quot;:0}'
{&quot;method&quot;:&quot;sendfromaddress&quot;,&quot;params&quot;:[&quot;1XzrPzx5PAK7xVeNue2Qa7kAfjuEgmoK3xj8L6&quot;,&quot;1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt&quot;,{&quot;msg_only&quot;:0}],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}

4760cb166a0b0d35817a90a4944605ab146e0bba93216663af09dda1b57c27e8
&lt;strong&gt;(Sending from test address 2 $b to $b - Works)&lt;/strong&gt;
$ multichain-cli loan sendfromaddress 1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt 1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt '{&quot;msg_only&quot;:0}'{&quot;method&quot;:&quot;sendfromaddress&quot;,&quot;params&quot;:[&quot;1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt&quot;,&quot;1NyRG1o5E3TifvnUys5PAABJZHLucptUcxPoGt&quot;,{&quot;msg_only&quot;:0}],&quot;id&quot;:1,&quot;chain_name&quot;:&quot;loan&quot;}

02b2c7451dd907f17c0509729739f4906c2717a39be9388db25108a3051bce3b

Key Observation: Once the asset becomes as part of a unspent transaction output for the address, it continues to work (even if spent). As of now there are 2 ways for making the asset using zero asset quantity transaction to an address:
1. Use the same address (to and from), using create raw ... sequence
2. From an address which have balance of asset send zero quantity of asset to this address.
3. From an address which at some point of time had sequence of activities referred in 1&lt;/pre&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/1602/multichain-handling-quantity-asset-sendfromaddress-error</guid>
<pubDate>Tue, 19 Apr 2016 06:52:59 +0000</pubDate>
</item>
</channel>
</rss>