Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: jon_smark on October 15, 2012, 03:10:16 PM



Title: More than one address within each vout?
Post by: jon_smark on October 15, 2012, 03:10:16 PM
If you run bitcoind getrawtransaction abcd1234... 1 you get a fairly complex JSON object with all the information about the given transaction.  My question concerns the "addresses" field deep inside each "vout": if I understand regular Bitcoin transactions correctly, this array should usually contain only one address; on what circumstances would it contain more than one address?  Also, could someone point me towards one transaction (either mainchain or testchain) where more than one address is used?


Title: Re: More than one address within each vout?
Post by: salfter on October 15, 2012, 03:46:28 PM
If you run bitcoind getrawtransaction abcd1234... 1 you get a fairly complex JSON object with all the information about the given transaction.  My question concerns the "addresses" field deep inside each "vout": if I understand regular Bitcoin transactions correctly, this array should usually contain only one address; on what circumstances would it contain more than one address?  Also, could someone point me towards one transaction (either mainchain or testchain) where more than one address is used?


Have a look at output #1 in the following testnet transaction:

http://blockexplorer.com/testnet/tx/829ce39233f7a073e4ffc4c7b594209a06f1987c86c51c17fcfcbdd2393bcdbf

This has two addresses.  Multi-signature transactions would use more than one address, but I'm not sure if this is an example of such.


Title: Re: More than one address within each vout?
Post by: kjj on October 15, 2012, 04:02:04 PM
I think never.

It may contain multiple vouts, but each should have only one address.  Even with multisig, I think the address shown would be the hash of the multisig script.


Title: Re: More than one address within each vout?
Post by: jon_smark on October 15, 2012, 05:26:37 PM
Thanks guys!

And if someone can find a counterexample, please let me know!


Title: Re: More than one address within each vout?
Post by: dserrano5 on October 18, 2012, 02:12:22 PM
I think never.

It may contain multiple vouts, but each should have only one address.  Even with multisig, I think the address shown would be the hash of the multisig script.

Then it's funny that the field is called "addresses" instead of "address" and that it's actually an array, instead of a plain scalar:

Code:
    "vout" : [
        {
            "value" : 0.01055000,
            "n" : 0,
            "scriptPubKey" : {
                [some stuff],
                "addresses" : [
                    "17BXw4qwrKv8bd8gLZtYj75V368K88GJW6"
                ]
            }
        },

vs (hypothetical):

Code:
    "vout" : [
        {
            "value" : 0.01055000,
            "n" : 0,
            "scriptPubKey" : {
                [some stuff],
                "address" : "17BXw4qwrKv8bd8gLZtYj75V368K88GJW6"
            }
        },

There must be some reason to this.


Title: Re: More than one address within each vout?
Post by: kjj on October 18, 2012, 03:29:10 PM
In theory, you should be able to create scripts that could be satisfied with multiple keys.  In practice, you'd usually do this with P2SH, at least now, and the hash of the script becomes the address.