4

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?

6
  • 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
    Commented Feb 17, 2014 at 18:54
  • 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 K.
    Commented Feb 17, 2014 at 19:50
  • 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
    Commented Feb 17, 2014 at 21:41
  • 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 K.
    Commented Feb 17, 2014 at 22:31
  • Although this's a quite old question, I think it's relative or duplicated with a more earlier question Can a single transaction have multiple outputs going to the same address?
    – Fogmoon
    Commented Aug 4, 2020 at 6:23

2 Answers 2

3

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.

2
  • 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 K.
    Commented Feb 17, 2014 at 15:25
  • 1
    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
    Commented Apr 19, 2014 at 17:17
2

The standard RPC apis (createrawtransaction, createpsbt, walletcreatefundedpsbt, send) of bitcoind do not allow duplicated target address in the same transaction, however it is 100% allowed by the consensus rule, and will be accepted by bitcoind if you can construct the raw transaction without using the RPC apis.

It is a very useful feature when you are maintaining a master tx-fee account to cover all of the transactions for your clients. By splitting the balance into many small utxos, only one utxo is consumed / touched by a transaction, and other utxos are available for other transactions at any time; otherwise, if the master tx-fee account keeps all of its balance in a single utxo, it can only serve one transaction (providing its tx-fee) at a time, then have to wait enough confirmations before it is available to pay tx-fee for another transaction.

Your Answer

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

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