1

For convenience purposes let's say I need to make these payments (and let's pretend that tx fees do not exist):

  • Address A: 1 BTC
  • Address B: 2 BTC
  • Address C: 3 BTC

My balance is 6 BTC that consists of these spendable inputs:

  • Tx1: 0.5 BTC
  • Tx2: 0.5 BTC
  • Tx3: 0.5 BTC
  • Tx4: 4.5 BTC

It's easy now to create a raw tx using createrawtransaction and since the inputs' sum matches the outputs' sum (and we pretend there are no tx fees whatsoever) everything will work as expected.

But what if I must (for business purposes) use specific inputs for each output?

An example would be:

  • Address A will be paid inputs: Tx1 and Tx3
  • Address B and Address C will be paid by inputs: Tx2 and Tx4

These will be batch payments and I plan to be sending batches of 20-30 logical payments per raw tx, so I would like to avoid breaking down the raw tx into small, atomic (per-logical-payments) transactions.

Is that even possible with raw transactions?

2
  • 1
    As far as I know, if you want to tie certain inputs to certain outputs, that's a matter for your internal accounting. The Bitcoin protocol doesn't provide any way to make such an association, short of breaking them into multiple transactions. Mar 23, 2014 at 20:40
  • Thanks @NateEldredge. So basically you say that if there is only one combinations where distinct inputs fit to the corresponding outputs then this is possible, buthow do we know how the coin selection works in this case? Mar 23, 2014 at 20:54

2 Answers 2

0

In Bitcoin, it is not possible to associate specific inputs with specific outputs within one transaction.

This means that you are required to create multiple transactions to achieve what you want to do.

This wiki article and this forum post explain how to do create raw transactions for spending specific outputs.

0

In a bitcoin transaction, the coins from the inputs are added together into a pool, and then sent to the outputs. There isn't a notion of particular coins; just a total number of coins.

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.