getrawtransaction for outputs with multiple addresses #5805

issue gbeced opened this issue on February 19, 2015
  1. gbeced commented at 1:54 PM on February 19, 2015: none

    I noted that starting with v0.10.1 the behavior of getrawtransaction when there are multiple addresses in one output has changed.

    For example:

    getrawtransaction 7657d78f1b69c875d475fe6521db5be03162a861893c462b1a335ebbb10db530 1
    

    used to return 2 addresses for the 2nd output

    {
    "value" : 0.00007800,
    "n" : 1,
    "scriptPubKey" : {
    "asm" : "1 040286a47e8b11624c510881521b73a02929b9615d219100300c651771c0cf46c04b14cfa790e3f66940d11b5ab3d8ae81a3577473fbd36e2fc2b3d69e91d9af62 1c434e54525052545900000000000000000004ebdf00000015d7a1850000000000 2 OP_CHECKMULTISIG",
    "hex" : "5141040286a47e8b11624c510881521b73a02929b9615d219100300c651771c0cf46c04b14cfa790e3f66940d11b5ab3d8ae81a3577473fbd36e2fc2b3d69e91d9af62211c434e54525052545900000000000000000004ebdf00000015d7a185000000000052ae",
    "reqSigs" : 1,
    "type" : "multisig",
    "addresses" : [
    "1Po1oXMCWobE6kxWr8rJEP1SRq71JSD3t4",
    "1HT7xU2Ngenf7D4yocz2SAcnNLW7rK8d4E"
    ]
    }
    }
    

    but now it returns only one address:

    {
    "value" : 0.00007800,
    "n" : 1,
    "scriptPubKey" : {
    "asm" : "1 040286a47e8b11624c510881521b73a02929b9615d219100300c651771c0cf46c04b14cfa790e3f66940d11b5ab3d8ae81a3577473fbd36e2fc2b3d69e91d9af62 1c434e54525052545900000000000000000004ebdf00000015d7a1850000000000 2 OP_CHECKMULTISIG",
    "hex" : "5141040286a47e8b11624c510881521b73a02929b9615d219100300c651771c0cf46c04b14cfa790e3f66940d11b5ab3d8ae81a3577473fbd36e2fc2b3d69e91d9af62211c434e54525052545900000000000000000004ebdf00000015d7a185000000000052ae",
    "reqSigs" : 1,
    "type" : "multisig",
    "addresses" : [
    "1Po1oXMCWobE6kxWr8rJEP1SRq71JSD3t4"
    ]
    }
    }
    
  2. dexX7 commented at 9:35 PM on February 20, 2015: contributor

    @gbeced: the payload:

    1c434e54525052545900000000000000000004ebdf00000015d7a1850000000000
    

    ... is not a valid public key. 0.9 still converted it into an address, but 0.10 does not.

  3. gbeced commented at 3:25 AM on February 21, 2015: none

    Would you know if this is related to the changes in CPubKey::IsFullyValid to use secp256k1_ecdsa_verify ? Thanks

  4. gbeced commented at 3:26 AM on February 21, 2015: none

    I meant secp256k1_ecdsa_pubkey_verify.

  5. dexX7 commented at 2:58 PM on February 21, 2015: contributor

    @gbeced: this one is to "blame":

    Don't return an address for invalid pubkeys: https://github.com/bitcoin/bitcoin/commit/9d7cd4c598edfff12f1f80629c9149b3f1cf75a6 And this is related to this topic: #5247

    Edit: a "valid" public key has a size of 33 or 65 byte with correct prefix. To be "fully valid", the public key must represent a valid ECDSA point. This is not new, but was not checked earlier.

    Fully valid public keys with embedded data could be created by [prefix|1 byte][payload|31 byte][ecdsa point modificator|1 byte] (or less) where the last byte is modified, until it forms a valid coordinate.

    See @petertodd's blockpop library: https://github.com/petertodd/blockpop/blob/master/blockpop/encode.py#L75-L101 or https://github.com/mastercoin-MSC/spec#class-b-transactions-also-known-as-the-multisig-method

    Anyway, OP_RETURN should be preferred, but just in case: http://redeem.bitwatch.co/

  6. paveljanik commented at 7:33 PM on October 1, 2015: contributor

    As this is a feature, not a bug, can you please close the issue? Thank you.

  7. gbeced closed this on Oct 2, 2015

  8. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC