Author

Topic: Bitcoin getrawtransaction address array in vout (Read 156 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
November 01, 2020, 12:02:06 PM
#5
That is clear to me now. What I don't understand yet is why there is no address in VOUT for a coinbase transaction. I am referring to the getblock rpcapi that is somehow not consistant with getrawtransaction (verbosity 2).
The same code is used for address decoding. Not all outputs correspond to addresses, so not all outputs will have an addresses field. This is especially true for old coinbase outputs because those made P2PK outputs and those don't have addresses.

The only place where one can see the output "sent" to is in VOUT in the address array correct? is there any other field containing this information?
Yes.
newbie
Activity: 25
Merit: 1
The multiple address output there is misleading and never should have been added in the first place.

The multiple addresses mean that it is a multisig so that txout requires some number (defined by the scriptPubKey) of the specified pubkeys to sign the spending transaction. There are no multiple UTXOs nor does the UTXO magically split for the cosigners. It is a single UTXO that requires multiple people to spend it. It's the same thing as a normal multisig in a P2SH or P2WSH, just that the "redeemScript" is in the scriptPubKey of the output, rather than the hash of it.

That is clear to me now. What I don't understand yet is why there is no address in VOUT for a coinbase transaction. I am referring to the getblock rpcapi that is somehow not consistant with getrawtransaction (verbosity 2).

The only place where one can see the output "sent" to is in VOUT in the address array correct? is there any other field containing this information?

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Also what if its 4 out of 8 or 2 out of 2. does that make a difference?
For both P2MS and P2SH Multisig: the former is the number of required signatures and the latter is the total number of public keys it has.
eg.: 4 out of 8  = 4 signatures / 8 public keys | 2 out of 2 = 2 signatures / 2 public keys.

If it's "of 8", you'll see 8 public keys. (in your case, 8 addresses)
Bitcoin Core wont show those as addresses if you decode the RAW txn BTW.
staff
Activity: 3458
Merit: 6793
Just writing some code
The multiple address output there is misleading and never should have been added in the first place.

The multiple addresses mean that it is a multisig so that txout requires some number (defined by the scriptPubKey) of the specified pubkeys to sign the spending transaction. There are no multiple UTXOs nor does the UTXO magically split for the cosigners. It is a single UTXO that requires multiple people to spend it. It's the same thing as a normal multisig in a P2SH or P2WSH, just that the "redeemScript" is in the scriptPubKey of the output, rather than the hash of it.
newbie
Activity: 25
Merit: 1
Hi,

While doing some work on a node and playing with the data for a project, I am running into some issues with the multiple addresses in one VOUT of a transaction (addresses array)

It is clear to me (thanks to search function) that this is due to multi-sig transactions and those are the only ones with more than 1 address in 1 output.

How does that work? If a VOUT goes to 2 public keys, are both getting a UTXO to their public key and can spend it or either one of those 2 can spend it?
so if i would like to "follow the money", I would need to track both public keys for further transactions?

If someone could give me some insight, I would be very thankful. Also what if its 4 out of 8 or 2 out of 2. does that make a difference?

Cheers

Joe
Jump to: