Author

Topic: Two separate outputs to the same address in one transaction? (Read 1479 times)

legendary
Activity: 1260
Merit: 1000
Drunk Posts
You can use my library to do it if you know a little bit of C#

See the first commented out section of code here,
https://github.com/mb300sd/Bitcoin-Tool/blob/fb782fcc7d70f0a7c9c0acf79add281206658f95/Bitcoin%20Tool/Program.cs
kjj
legendary
Activity: 1302
Merit: 1026
You can't use createrawtransaction to do this.  You have to make the transaction by hand (or using some other tool that you'll probably have to write yourself, but it is pretty easy either way).

Once made, the stock client can sign and broadcast it as usual.  It causes absolutely no problems in the client, network or protocol.  TxOuts are identified by {txhash:sequence} so each output has a unique name and can be spent as usual.

The main problem is that JSON does not allow duplicate keys, and the only interfaces in the stock client to create multi-output transactions are through JSON.
newbie
Activity: 44
Merit: 0
Like someone said you can maybe use the raw transactions API to create one of such transactions. But be careful... Already 2 times someone paid 100 BTC on fees using such raw transactions.

Warning duly noted! I'm not planning to create raw transactions, myself, as I've read at least two posts in the past two days about accidental fee payments. I'm more interested conceptually about whether it's possible with a new client, since it could help further streamline the idea I'm brainstorming for a web-based alternative to bitcoin-otc. (Two outputs to the same address in one transaction could eliminate the need for an "open" and a "close" signal to appear in separate transactions, thereby potentially reducing fees.)

Maybe someone here will want to teach you, or you may read up on it here: https://en.bitcoin.it/wiki/Raw_Transactions

Thanks for the link.
legendary
Activity: 1372
Merit: 1002
Not possible. The Bitcoin client will not send it and give you an error.
All the outputs need to be different addresses.
I do not see, that this would be a requirement on the protocol level.

Well, may not be a requirement at the protocol level, but if you use sendmany, be it trough Bitcoin-qt or bitcoind, it will throw a error if you insert the same address more than 1 time.

Does this mean it would be possible, if you wrote your own client, to construct a 2-outputs-to-the-same-address transaction?

Two McFlys, with the SAME GUN!!

LOL

Like someone said you can maybe use the raw transactions API to create one of such transactions. But be careful... Already 2 times someone paid 100 BTC on fees using such raw transactions. Not telling you how to do it because I really don't know how.
Maybe someone here will want to teach you, or you may read up on it here: https://en.bitcoin.it/wiki/Raw_Transactions
newbie
Activity: 44
Merit: 0
Not possible. The Bitcoin client will not send it and give you an error.
All the outputs need to be different addresses.
I do not see, that this would be a requirement on the protocol level.

Well, may not be a requirement at the protocol level, but if you use sendmany, be it trough Bitcoin-qt or bitcoind, it will throw a error if you insert the same address more than 1 time.

Does this mean it would be possible, if you wrote your own client, to construct a 2-outputs-to-the-same-address transaction?

Two McFlys, with the SAME GUN!!

LOL
legendary
Activity: 1064
Merit: 1001
Two McFlys, with the SAME GUN!!
legendary
Activity: 1372
Merit: 1002
Not possible. The Bitcoin client will not send it and give you an error.
All the outputs need to be different addresses.
I do not see, that this would be a requirement on the protocol level.

Well, may not be a requirement at the protocol level, but if you use sendmany, be it trough Bitcoin-qt or bitcoind, it will throw a error if you insert the same address more than 1 time.
Been there, done that, got the error "You can only send once to one address on the same transaction"(or something like that, can't remember the exact wording on it)
full member
Activity: 225
Merit: 101
You can do this with the Satoshi client using the raw transaction API. Just make sure you're careful not to spend too much in fees.
hero member
Activity: 836
Merit: 1030
bits of proof
Not possible. The Bitcoin client will not send it and give you an error.
All the outputs need to be different addresses.
I do not see, that this would be a requirement on the protocol level.
newbie
Activity: 44
Merit: 0
Not possible. The Bitcoin client will not send it and give you an error.
All the outputs need to be different addresses.

Thank you!
legendary
Activity: 1372
Merit: 1002
Not possible. The Bitcoin client will not send it and give you an error.
All the outputs need to be different addresses.
newbie
Activity: 44
Merit: 0
Is it possible (or considered good/bad form) to have two separate outputs in a Bitcoin transaction that go to the same Bitcoin address?

If it is possible, are there any negative ramifications for the user, the blockchain, etc.?

Thanks.
Jump to: