What is type 'pubkey' in a scriptpubkey output from getrawtransaction?

0

Here is an output from getrawtransaction:

{
  ...
  "vout": [
    {
      "value": 12.50000000,
      "n": 0,
      "scriptPubKey": {
    "asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG",
    "hex": "2103d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6aac",
    "reqSigs": 1,
    "type": "pubkey",
    "addresses": [
      "mwzWcEU4kBkJPSTgB8LSBfvyaEjdXmyGh7"
    ]
      }
    }, 
    ...
  ],
  ...
}

What is a pubkey type? I could not find any reference to this.

Here is the output of decodescript on the script:

{
    "result": {
        "asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG",
        "reqSigs": 1,
        "type": "pubkey",
        "addresses": [
            "1HUZKBP5wAK3cKz4TZN4MkieiF8vbyNvpE"
        ],
        "p2sh": "3469piMXSTikVAdrSC791pQGxQb8pNXhua"
    },
    "error": null,
    "id": null
}

Jus12

Posted 2017-12-08T17:42:42.383

Reputation: 1 243

Answers

2

The script for an output describes the condition that must be satisfied for the money to move.

It means that the public key is contained in the scriptPubKey. Usually, the scriptPubKey only contains a hash of the public key, and relies on the scriptSig to supply the public key.

Explanation of the asm field in decodescript:

"asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG",

The first element is a compressed public key. The second element is OP_CHECKSIG. To spend this output, someone must put a signature in a scriptSig.

See also the P2PK bullet point here: https://bitcoin.stackexchange.com/a/35458/2306

Nick ODell

Posted 2017-12-08T17:42:42.383

Reputation: 26 536