1

Vout contains a list of addresses, which I noticed to be always with size = 1, if it exists. The following is an example from Bitcoin Testnet:

{
      "value": 0.91840581,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 1416b8f3a1c1c7e3e73a05046f002e66004accc3 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9141416b8f3a1c1c7e3e73a05046f002e66004accc388ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "mhMB2g88n42ghQ5p1VA7Mt9VgTp9QvpDXU"
        ]
      }
    }

Why is the "addresses" (address) field a list? Are there any cases when this can take more than one address? Who can spend that then?

1

This is due to historical confusion between addresses and keys.

The original goal of this field was reporting the public keys involved in raw multisig outputs. However, those public keys were referred to by the P2PKH address corresponding to them.

This is confusing because obviously every output only corresponds to a single address. The feature is also useless now due to the introduction of P2SH, where instead of putting all public keys in the output, just a hash of script involving all those keys is stored.

  • So it's never used now? It's safe to just take element number 0? – The Quantum Physicist Jul 13 '18 at 1:28
  • Raw multisig isn't used; there is no way for common wallet software to send to it. For anything but raw multisig, only a single address will be present. – Pieter Wuille Jul 13 '18 at 1:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.