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

<p>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. </p>

<p>Explanation of the <code>asm</code> field in <code>decodescript</code>:</p>

<pre><code>"asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG",
</code></pre>

<p>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.</p>

<p>See also the P2PK bullet point here: <a href="https://bitcoin.stackexchange.com/a/35458/2306">https://bitcoin.stackexchange.com/a/35458/2306</a></p>

CC BY-SA 3.0
2017-12-08T18:08:26.983Z
2017-12-08T18:08:26.983Z
Nick ODell
<p>Here is an output from <code>getrawtransaction</code>: </p>

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

<p>What is a <code>pubkey</code> type? I could not find any reference to this.</p>

<p>Here is the output of <code>decodescript</code> on the script:</p>

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

<bitcoind><checksig><gettransaction><p2pk>
What is type 'pubkey' in a scriptpubkey output from getrawtransaction?
Jus12
# What is type 'pubkey' in a scriptpubkey output from getrawtransaction?

(Asked by: username_0 on 2017-12-08)

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
}

```

**Tags:** bitcoind, checksig, gettransaction, p2pk


---

## 1 answers

### Answer by username_1 on 2017-12-08. Score: 2 | Accepted answer

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>


---

