Author

Topic: Getting error when using createrawtransaction (Read 824 times)

sr. member
Activity: 350
Merit: 250
Yup, the difference between inputs and outputs will go towards tx fee. So, please never ever forget to include the change.

This is important enough, that it's worth repeating.

The inputs provide value to the transaction.  Add up all the value from all the inputs, and that is the total transaction value.

Then the outputs assign that value to one or more outputs.

Any remaining unassigned value is a transaction fee to the miners.



If the total of all your outputs is greater than the total value supplied by all your inputs, then you have an invalid transaction.

If the total of all your outputs is equal to the total value supplied by all your inputs, then you have a valid transaction that is not paying any fee.

If the total of all your outputs is less than the total value supplied by all your inputs, then ALL REMAINING UNASSIGNED VALUE BECOMES TRANSACTION FEES FOR THE MINERS.

Can I use 'sendmany' or any other API call for sending to multiple people(multiple outputs) but paying just one fee??? When I used sendmany I had to pay fee for every address specified. Sad
legendary
Activity: 3472
Merit: 4801
Yup, the difference between inputs and outputs will go towards tx fee. So, please never ever forget to include the change.

This is important enough, that it's worth repeating.

The inputs provide value to the transaction.  Add up all the value from all the inputs, and that is the total transaction value.

Then the outputs assign that value to one or more outputs.

Any remaining unassigned value is a transaction fee to the miners.



If the total of all your outputs is greater than the total value supplied by all your inputs, then you have an invalid transaction.

If the total of all your outputs is equal to the total value supplied by all your inputs, then you have a valid transaction that is not paying any fee.

If the total of all your outputs is less than the total value supplied by all your inputs, then ALL REMAINING UNASSIGNED VALUE BECOMES TRANSACTION FEES FOR THE MINERS.
newbie
Activity: 25
Merit: 10
Thanks for all the help!
hero member
Activity: 614
Merit: 500
based on http://bitcoinfees.com/, I didn't have to pay a fee in this particular case.  Is that correct?  As it says:

Quote from: bitcoinfees.com
f any of the outputs (including any change) of your transaction are less than 0.01 XBT, then a fee of 0.0001 XBT is required

So as I was sending 0.05XBT, the fee was optional.  Is that right?

You should continue reading section 3. Smiley
Quote
If the coins you're spending are too small or too new then your transaction won't qualify as free.

Basically speaking, if you transaction qualifies as "high-priority" (https://en.bitcoin.it/wiki/Transaction_fees#Technical_info) and have no dust outputs, you can choose to not pay any transaction fee.
It may take a little bit more time to get your transaction included in a block though.
newbie
Activity: 25
Merit: 10
I have noticed that you worked out the change to be less by 0.0001BTC, which I assume goes towards fees?

Yup, the difference between inputs and outputs will go towards tx fee. So, please never ever forget to include the change.

If that is the case, how did you work out the fees?  Is it always 0.0001BTC?

It depends on the tx size in KB (number of inputs and outputs).
For details, please refer to http://bitcoinfees.com/




Thanks, based on http://bitcoinfees.com/, I didn't have to pay a fee in this particular case.  Is that correct?  As it says:

Quote from: bitcoinfees.com
f any of the outputs (including any change) of your transaction are less than 0.01 XBT, then a fee of 0.0001 XBT is required

So as I was sending 0.05XBT, the fee was optional.  Is that right?
hero member
Activity: 614
Merit: 500
I have noticed that you worked out the change to be less by 0.0001BTC, which I assume goes towards fees?

Yup, the difference between inputs and outputs will go towards tx fee. So, please never ever forget to include the change.

If that is the case, how did you work out the fees?  Is it always 0.0001BTC?

It depends on the tx size in KB (number of inputs and outputs).
For details, please refer to http://bitcoinfees.com/


newbie
Activity: 25
Merit: 10
Does this work?

Code:
createrawtransaction '[{"txid":"d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262","vout":1}]' '{"mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g":0.05000000,"mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1":1.19994817}'

Huh

It does't return the JSON error which is a step forward.  Thanks!

Looks like I also missed out the change return address.  I have noticed that you worked out the change to be less by 0.0001BTC, which I assume goes towards fees?  If that is the case, how did you work out the fees?  Is it always 0.0001BTC?
legendary
Activity: 3472
Merit: 4801
Anyone know why the following command is not working for me in bitcoin-qt [testnet] > debug window > console?

createrawtransaction [{"txid":d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262,"vout":1}]{mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g:0.05}

Error: Error parsing JSON:[{"txid":d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262,"vout":1}]{mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g:0.05}

I got the txid and vout values from listunspent:

listunspent
[
{
"txid" : "d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262",
"vout" : 1,
"address" : "mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1",
"account" : "From http://faucet.xeno-genesis.com/",
"scriptPubKey" : "76a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac",
"amount" : 1.25004817,
"confirmations" : 2
}
]


Does this work?

Code:
createrawtransaction '[{"txid":"d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262","vout":1}]' '{"mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g":0.05000000,"mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1":1.19994817}'

Huh
newbie
Activity: 25
Merit: 10
Anyone know why the following command is not working for me in bitcoin-qt [testnet] > debug window > console?

createrawtransaction [{"txid":d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262,"vout":1}]{mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g:0.05}

Error: Error parsing JSON:[{"txid":d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262,"vout":1}]{mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g:0.05}

I got the txid and vout values from listunspent:

listunspent
[
{
"txid" : "d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262",
"vout" : 1,
"address" : "mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1",
"account" : "From http://faucet.xeno-genesis.com/",
"scriptPubKey" : "76a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac",
"amount" : 1.25004817,
"confirmations" : 2
}
]
Jump to: