2

anyone can suggest why addresses won't decode in newer versions?

example: bitcoin-core 0.21

bitcoin-cli getrawtransaction 9297132b89461da9dee0364db49eeb1c32770550bc5b82e02f1cbaab01043aa3 1
{
  "txid": "9297132b89461da9dee0364db49eeb1c32770550bc5b82e02f1cbaab01043aa3",
  "hash": "9297132b89461da9dee0364db49eeb1c32770550bc5b82e02f1cbaab01043aa3",
  "version": 1,
  "size": 404,
  "vsize": 404,
  "weight": 1616,
  "locktime": 0,
  "vin": [
    {
      "txid": "e5e4e758102d9d677e26fa1029a69e1a6dd1e4c60a89990c3c47c207b455fdde",
      "vout": 0,
      "scriptSig": {
        "asm": "3045022023ec9d65d61343eafba6498ed668d14a4f30507196eeda42789f9e1e5de471e80221008898d2243728f64e545b3fc13afaf9f3f54a7f1c8f9760708a4a8c7043901fbe[ALL] 04a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0",
        "hex": "483045022023ec9d65d61343eafba6498ed668d14a4f30507196eeda42789f9e1e5de471e80221008898d2243728f64e545b3fc13afaf9f3f54a7f1c8f9760708a4a8c7043901fbe014104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 9.70342805,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 dcfdb039e694e96dc9f49098abf5abe838ea4a2f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914dcfdb039e694e96dc9f49098abf5abe838ea4a2f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1M9VZnGuuXBw4YUsgzMPwCNGgBBnsoEGLW"
        ]
      }
    },
    {
      "value": 0.00005757,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 946cb2e08075bcbaf157e47bcb67eb2b2339d242 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"
        ]
      }
    },
    {
      "value": 0.00005757,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 966acb4de317bc06c44106c3301229aba2b4ed69 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914966acb4de317bc06c44106c3301229aba2b4ed6988ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1EiLHxqVWZ8qPFcRJ4WpZk1HPbmy2PTMs8"
        ]
      }
    },
    {
      "value": 0.00011514,
      "n": 3,
      "scriptPubKey": {
        "asm": "1 04a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0 021e7be74a6b018374c253d8a7c8530952fd8bed2169a56d6591c483c3b9916b02 2 OP_CHECKMULTISIG",
        "hex": "514104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa021021e7be74a6b018374c253d8a7c8530952fd8bed2169a56d6591c483c3b9916b0252ae",
        "reqSigs": 1,
        "type": "multisig",
        "addresses": [
          "1M9VZnGuuXBw4YUsgzMPwCNGgBBnsoEGLW",
          "1vAryhyeqrBkYBLcqGEUwPrRC4U4MfbNc"
        ]
      }
    }
  ],
  "hex": "0100000001defd55b407c2473c0c99890ac6e4d16d1a9ea62910fa267e679d2d1058e7e4e5000000008b483045022023ec9d65d61343eafba6498ed668d14a4f30507196eeda42789f9e1e5de471e80221008898d2243728f64e545b3fc13afaf9f3f54a7f1c8f9760708a4a8c7043901fbe014104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0ffffffff049541d639000000001976a914dcfdb039e694e96dc9f49098abf5abe838ea4a2f88ac7d160000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac7d160000000000001976a914966acb4de317bc06c44106c3301229aba2b4ed6988acfa2c00000000000067514104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa021021e7be74a6b018374c253d8a7c8530952fd8bed2169a56d6591c483c3b9916b0252ae00000000",
  "blockhash": "000000000000000007bd140bd5f9ec7d6195330b125c84ad24adb7f021012502",
  "confirmations": 410973,
  "time": 1409535793,
  "blocktime": 1409535793
}

bitcoin-core 22.x+

{
  "txid": "9297132b89461da9dee0364db49eeb1c32770550bc5b82e02f1cbaab01043aa3",
  "hash": "9297132b89461da9dee0364db49eeb1c32770550bc5b82e02f1cbaab01043aa3",
  "version": 1,
  "size": 404,
  "vsize": 404,
  "weight": 1616,
  "locktime": 0,
  "vin": [
    {
      "txid": "e5e4e758102d9d677e26fa1029a69e1a6dd1e4c60a89990c3c47c207b455fdde",
      "vout": 0,
      "scriptSig": {
        "asm": "3045022023ec9d65d61343eafba6498ed668d14a4f30507196eeda42789f9e1e5de471e80221008898d2243728f64e545b3fc13afaf9f3f54a7f1c8f9760708a4a8c7043901fbe[ALL] 04a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0",
        "hex": "483045022023ec9d65d61343eafba6498ed668d14a4f30507196eeda42789f9e1e5de471e80221008898d2243728f64e545b3fc13afaf9f3f54a7f1c8f9760708a4a8c7043901fbe014104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 9.70342805,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 dcfdb039e694e96dc9f49098abf5abe838ea4a2f OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(1M9VZnGuuXBw4YUsgzMPwCNGgBBnsoEGLW)#e82gnjrl",
        "hex": "76a914dcfdb039e694e96dc9f49098abf5abe838ea4a2f88ac",
        "address": "1M9VZnGuuXBw4YUsgzMPwCNGgBBnsoEGLW",
        "type": "pubkeyhash"
      }
    },
    {
      "value": 0.00005757,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 946cb2e08075bcbaf157e47bcb67eb2b2339d242 OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P)#03u9lduk",
        "hex": "76a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac",
        "address": "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P",
        "type": "pubkeyhash"
      }
    },
    {
      "value": 0.00005757,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 966acb4de317bc06c44106c3301229aba2b4ed69 OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(1EiLHxqVWZ8qPFcRJ4WpZk1HPbmy2PTMs8)#c68jlngz",
        "hex": "76a914966acb4de317bc06c44106c3301229aba2b4ed6988ac",
        "address": "1EiLHxqVWZ8qPFcRJ4WpZk1HPbmy2PTMs8",
        "type": "pubkeyhash"
      }
    },
    {
      "value": 0.00011514,
      "n": 3,
      "scriptPubKey": {
        "asm": "1 04a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0 021e7be74a6b018374c253d8a7c8530952fd8bed2169a56d6591c483c3b9916b02 2 OP_CHECKMULTISIG",
        "desc": "multi(1,04a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0,021e7be74a6b018374c253d8a7c8530952fd8bed2169a56d6591c483c3b9916b02)#vp945myn",
        "hex": "514104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa021021e7be74a6b018374c253d8a7c8530952fd8bed2169a56d6591c483c3b9916b0252ae",
        "type": "multisig"
      }
    }
  ],
  "hex": "0100000001defd55b407c2473c0c99890ac6e4d16d1a9ea62910fa267e679d2d1058e7e4e5000000008b483045022023ec9d65d61343eafba6498ed668d14a4f30507196eeda42789f9e1e5de471e80221008898d2243728f64e545b3fc13afaf9f3f54a7f1c8f9760708a4a8c7043901fbe014104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa0ffffffff049541d639000000001976a914dcfdb039e694e96dc9f49098abf5abe838ea4a2f88ac7d160000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac7d160000000000001976a914966acb4de317bc06c44106c3301229aba2b4ed6988acfa2c00000000000067514104a2d908b30291114a6cc781cb7caca48393bae2faef19189b3262ae9e957204272ff30528a289146141e350869d8b7386acfd6cf20e01e4ad38ab87bf542e2aa021021e7be74a6b018374c253d8a7c8530952fd8bed2169a56d6591c483c3b9916b0252ae00000000",
  "blockhash": "000000000000000007bd140bd5f9ec7d6195330b125c84ad24adb7f021012502",
  "confirmations": 410994,
  "time": 1409535793,
  "blocktime": 1409535793
}

as we can see there is no "addresses": ["1M9VZnGuuXBw4YUsgzMPwCNGgBBnsoEGLW", "1vAryhyeqrBkYBLcqGEUwPrRC4U4MfbNc"] in vout: 3

Why script not decoding?

1 Answer 1

2

This is mentioned in the 22.0 release notes:

The following RPCs: gettxout, getrawtransaction, decoderawtransaction, decodescript, gettransaction, and REST endpoints: /rest/tx, /rest/getutxos, /rest/block deprecated the following fields (which are no longer returned in the responses by default): addresses, reqSigs. The -deprecatedrpc=addresses flag must be passed for these fields to be included in the RPC response. This flag/option will be available only for this major release, after which the deprecation will be removed entirely. Note that these fields are attributes of the scriptPubKey object returned in the RPC response. However, in the response of decodescript these fields are top-level attributes, and included again as attributes of the scriptPubKey object. (#20286)

The reason is simply that these fields were nonsensical and misleading. Outputs only have a single address at most. The RPC output dates from a time when addresses and key identifiers were conflated - a historical mistake.

The new "address" field reports the address, under the modern interpretation. It differs in the case of bare multisig outputs. These outputs are rare nowadays, and more importantly do not have a corresponding address at all. The values reported in the older "addresses" field were not addresses for this output; they are the would-be P2PKH address for sending to the individual public keys in that multisig output. But those have barely any relation to the actual output, and confused people into thinking that e.g. one could send to these individually (which is not generally the case).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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