3

Question: Am I able to specify the transaction size in a raw transaction without having to send "change" back to myself?

I get some unspent bitcoins

listunspent()

I grab the txid, vout, and scriptPubKey for each Then I get the list of all the addresses and quantities that I want to send to

createrawtransaction(source, destination)

Let's say my total unspent is 1.00000000 BTC, the total I want to send out to all the addresses is 0.50000000, and it'll be about a 3100 byte transfer that I need to pay 0.00040000 fees for. The way I currently build the destination addresses is to place the address it's coming from (myself) as unspent - tx fees - outgoing, so that would be 0.49600000, the destinations would all be specified, and the fee remains unspecified but deduced by the remainder.

So, this is working for my purposes, but is a little inconvenient. The amount that I'm not sending to anyone sends back to myself and has to be reconfirmed so the funds aren't available until then.

If I had a single unspent address with 100 BTC and needed to send 1 BTC to 15 people, it doesn't seem to make sense to temporarily lock up 85 BTC in the process. If I were to use a client and manually send 1 BTC at a time, the unused funds would remain available, so I feel pretty confident what I'm asking for is possible. Any assistance would be most appreciated.

NOTE: I'm using bitcoind now.

2 Answers 2

1

Inputs are always spent completely! Any amount of the sum of inputs that your transaction doesn't spend, implicitly becomes available to the validating miner to assign as a transaction fee to an address of his choosing.

Most clients recognize change as coming from another address that you also control and thus allow you to immediately spend it. So, your money is not frozen due to being change in another transaction.

1

The fee is the difference between the inputs and outputs, so you can specify the fee by leaving that amount unaccounted for in your transaction.

Be careful though, this has lead to 200BTC transaction fees in the past when someone forgot to include a change address: http://www.reddit.com/r/Bitcoin/comments/1lb5my/asicminer_refunds_the_accidental_200_btc/

3
  • So is there a way to reduce the input?
    – jchysk
    Dec 3, 2013 at 17:43
  • no, see this for more information: bitcoin.stackexchange.com/questions/11411/…
    – Scrybe
    Dec 3, 2013 at 18:28
  • I did a bad job with the title of the question for the true question I had. To the question: "Am I able to specify the transaction size in a raw transaction without having to send "change" back to myself?" It seems the answer is no. Since this is the answer the question in the title I'll mark it as the answer.
    – jchysk
    Dec 3, 2013 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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