Bitcoin Forum
April 27, 2024, 01:17:43 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin getrawtransaction address array in vout  (Read 136 times)
btcjoe99 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 1


View Profile
October 26, 2020, 08:46:22 PM
 #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
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
October 26, 2020, 09:38:20 PM
 #2

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.

nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5538


Self-proclaimed Genius


View Profile
October 27, 2020, 08:21:53 AM
 #3

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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
btcjoe99 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 1


View Profile
November 01, 2020, 12:49:03 PM
 #4

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?

achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
November 01, 2020, 04: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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!