<p>It is a left over API design from bare multisig transactions.</p>

<p>The example you provided is a P2SH multisig - in this, the actual output script has no way of telling Bitcoin Core that it is a multisig output. It can be any script. Thus, Bitcoin Core just decodes it to a regular P2SH address.</p>

<p>Although no longer commonly used, there are also bare multisig outputs, which use multisig scripts that are not wrapped in a P2SH. These would be of the form <code>M &lt;pub1&gt; &lt;pub2&gt; ... &lt;pubN&gt; N OP_CHECKMULTISIG</code> for a M-of-N multisig (this is the redeem script for a P2SH multisig).</p>

<p>When Bitcoin Core used to decode these, you'd get one address per public key, hence the array.</p>

CC BY-SA 4.0
2019-10-23T02:02:24.823Z
I think MULTISIG public keys are hashed to addresses and are shown in the addresses list as well. See `script/standard.cpp` line 212 (in `ExtractDestinations`). For each pubkey, it does ```CTxDestination address = PKHash(pubKey); addressRet.push_back(address);```
Jose Fonseca
CC BY-SA 4.0
2019-10-23T02:11:55.463Z
Correct - p2pkh (1..) addresses are based on the public key hash, but the public key is not hashed in the bare multisig script. Bitcoin Core will hash it as part of converting it for display purposes.
Raghav Sood
CC BY-SA 4.0
2019-10-23T02:14:29.970Z
Understood, but doesn't this subroutine hash the pubkeys found inside the script?
Jose Fonseca
CC BY-SA 4.0
2019-10-23T02:25:43.977Z
It does, yes. But it will only hash it for pubkeys in a bare multisig output. In a P2SH multisig output, the pubkeys are disclosed when spending the coins, not when receiving them.
Raghav Sood
CC BY-SA 4.0
2019-10-23T06:19:23.850Z
thanks for your answer.So,now when sending what type of transaction script will result in multiple entries in the address array ?
user100196
CC BY-SA 4.0
2019-10-23T06:20:01.470Z
Or can we ignore this type of transaction because it's abandoned?
user100196
CC BY-SA 4.0
2019-10-23T07:36:42.443Z
@user100196 As far as I'm aware, only a bare multisig output will create multiple entries. I wouldn't ignore it, since it is possible to still send those transactions (although you might find it a bit difficult, as no regular wallet will support creating them). But it is possible that someone is doing them via some program.
Raghav Sood
CC BY-SA 4.0
2019-10-23T01:53:21.450Z
2019-10-23T01:53:21.450Z
Raghav Sood
<p>i have a confuse about the "getrawtransaction" RPC function,it returns a json object, which contains the addresses list in the "vout" object,like below.It took me some time to understand when the multiple addresses will contains many items,as i see, it always only one item, After reading the source code, I also found that even for multi signature transactions, there will not be multiple addresses. I need somebody help！please！</p>



<pre><code> {
      "value": 1000000,
      "script": "a914d550ecfc60d9f976de1f2a43bdf4e491b684cd6887",
      "spent_by": "cd2494071876f91e1f9505f5c5421088c7df2e6f939c17f742d3638bc7df789a",
      "addresses": [
        "3M8voDot82tBrQE7QWGy9WUWxp7gDU7owx"
      ],
      "script_type": "pay-to-script-hash"
 }
</code></pre>

<p>full url is: <a href="https://api.blockcypher.com/v1/btc/main/txs/46001fade64b8fa23815066ec62cc4a91ee0c8f4a4fad26e428bc4c0a2146290" rel="nofollow noreferrer">https://api.blockcypher.com/v1/btc/main/txs/46001fade64b8fa23815066ec62cc4a91ee0c8f4a4fad26e428bc4c0a2146290</a></p>

<hr>

<p>I tried to send a multi sign transaction to the test network, and then looked at the data, and found that there was only one address.</p>

<address><getrawtransaction>
address list in "getrawtransaction"
user100196
# address list in "getrawtransaction"

(Asked by: username_0 on 2019-10-23)

i have a confuse about the "getrawtransaction" RPC function,it returns a json object, which contains the addresses list in the "vout" object,like below.It took me some time to understand when the multiple addresses will contains many items,as i see, it always only one item, After reading the source code, I also found that even for multi signature transactions, there will not be multiple addresses. I need somebody help！please！

```
 {
      "value": 1000000,
      "script": "a914d550ecfc60d9f976de1f2a43bdf4e491b684cd6887",
      "spent_by": "cd2494071876f91e1f9505f5c5421088c7df2e6f939c17f742d3638bc7df789a",
      "addresses": [
        "3M8voDot82tBrQE7QWGy9WUWxp7gDU7owx"
      ],
      "script_type": "pay-to-script-hash"
 }

```

full url is: <https://api.blockcypher.com/v1/btc/main/txs/46001fade64b8fa23815066ec62cc4a91ee0c8f4a4fad26e428bc4c0a2146290>

---

I tried to send a multi sign transaction to the test network, and then looked at the data, and found that there was only one address.

**Tags:** address, getrawtransaction


---

## 1 answers

### Answer by username_1 on 2019-10-23. Score: 1

It is a left over API design from bare multisig transactions.

The example you provided is a P2SH multisig - in this, the actual output script has no way of telling Bitcoin Core that it is a multisig output. It can be any script. Thus, Bitcoin Core just decodes it to a regular P2SH address.

Although no longer commonly used, there are also bare multisig outputs, which use multisig scripts that are not wrapped in a P2SH. These would be of the form `M <pub1> <pub2> ... <pubN> N OP_CHECKMULTISIG` for a M-of-N multisig (this is the redeem script for a P2SH multisig).

When Bitcoin Core used to decode these, you'd get one address per public key, hence the array.

> **Comments:**
> **username_2**: I think MULTISIG public keys are hashed to addresses and are shown in the addresses list as well. See `script/standard.cpp` line 212 (in `ExtractDestinations`). For each pubkey, it does ```CTxDestination address = PKHash(pubKey); addressRet.push_back(address);```  
> **username_1**: Correct - p2pkh (1..) addresses are based on the public key hash, but the public key is not hashed in the bare multisig script. Bitcoin Core will hash it as part of converting it for display purposes.  
> **username_2**: Understood, but doesn't this subroutine hash the pubkeys found inside the script?  
> **username_1**: It does, yes. But it will only hash it for pubkeys in a bare multisig output. In a P2SH multisig output, the pubkeys are disclosed when spending the coins, not when receiving them.  
> **username_0**: thanks for your answer.So,now when sending what type of transaction script will result in multiple entries in the address array ?  
> **username_0**: Or can we ignore this type of transaction because it's abandoned?  
> **username_1**: @username_0 As far as I'm aware, only a bare multisig output will create multiple entries. I wouldn't ignore it, since it is possible to still send those transactions (although you might find it a bit difficult, as no regular wallet will support creating them). But it is possible that someone is doing them via some program.  

---

