How can there be multiple outputs with same address in the same transaction?

3

2

I received a transaction such as below: (I changed the actual numbers but the format is exactly the same)

{
"amount" : 0.3,
"confirmations" : 739,
"blockhash" : "0000000000000000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"blockindex" : 390,
"blocktime" : 1392284453,
"txid" : "aaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbxxxxxxxxxxxxxxxxxxxx",
"time" : 1388888888,
"timereceived" : 1388888888,
"details" : [
{
"account" : "abc",
"address" : "address1",
"category" : "receive",
"amount" : 0.1
},
{
"account" : "abc",
"address" : "address1",
"category" : "receive",
"amount" : 0.2
}
]
}

When I check this transaction on blockchain.info. The site shows a single output to "address1" and the amount is 0.3.

When I try to replicate this situation with QT using Add Recipient, it does not allow me to enter the same address twice. I assume the sender was able to do this using sendrawtransaction.

Is it normal? Is it a non-standard transaction? Shouldn't this transaction be rejected by miners?

Emre Kenci

Posted 2014-02-17T11:59:34.287

Reputation: 3 008

I do not see why you need to hide the information. If this is a genuine transaction you can provide the blockchain.info URL and we can look into it. It's already public knowledge.T9b 2014-02-17T18:54:22.643

I don't want to expose a possible weakness in our solution. I also don't want to associate my SE account with my company.Emre Kenci 2014-02-17T19:50:19.823

It's likely any weaknesses will get exposed whatever you do to try to conceal them. It's arguably more useful to be open when you are developing - at least you won't suffer a zero-day exploit.T9b 2014-02-17T21:41:02.363

It is. It's also likely that exposing the weakness publicly will speed up the exposure -if it exists. The actual tx data is irrelevant to the question.Emre Kenci 2014-02-17T22:31:11.473

Answers

2

It definitely seems weird to have two outputs towards the same address, but if it was picked up by your bitcoind node, then miners will probably accept it, because they're also using bitcoind.

It would be interesting to read the raw scripts of the outputs. Most likely, as you say, it was created by someone using the raw commands.

One scenario that I could think for someone doing this is that you'd want the receiver to claim the outputs in separate transactions. If there was a single 0.3 output, the receiver would need to claim all 0.3 to use them.

However, I'm not sure when this would be useful.

Luca Matteis

Posted 2014-02-17T11:59:34.287

Reputation: 4 784

Thanks. But I really need a more definitive answer on this. I'll end up writing a bunch of code according to the answer :) Can this be legally done or is it my client that just messed things up? Like I said, bc.info shows a single output to that address where the amount is the sum of the two outputs I see.Emre Kenci 2014-02-17T15:25:12.557

It would be useful for creating change in advance. If it was all in one output, and you then spent 0.14 BTC, that would generate change of 0.16 BTC that would be difficult to spend without fees for a while. As two outputs, you would get change of 0.04 BTC that would be hard to spend, but you'd still have the other output that would be "old" and hence easier to spend without fees.Brangdon 2014-04-19T17:17:46.717