<p>Observe that the type of the output is:</p>
<blockquote>
<p>&quot;type&quot;: &quot;pubkey&quot;</p>
</blockquote>
<p>Pay-to-Public-Key (P2PK) outputs do not have addresses. They pay directly to a public key rather than the hash of the public key, as the name suggests. Bitcoin addresses encode public key hashes, for example, addresses starting with a <code>1</code> are known as Pay-to-Public-Key-Hash (P2PKH) addresses and encode the <code>Ripemd-160(sha-256(public key))</code>.</p>
<p>See my other answer <a href="https://bitcoin.stackexchange.com/a/111429/51948">here</a> for the same sort of question.</p>

CC BY-SA 4.0
2022-01-02T05:02:18.217Z
Thank you for your answer. I'll follow the steps provided in the wiki to see how services like blockchain.com or blockchair.com pull out such addresses.
sci9
CC BY-SA 4.0
2022-01-01T20:13:09.447Z
2022-01-01T23:44:14.377Z
2022-01-01T23:44:14.377Z
meshcollider
<p>Consider the following coinbase transaction:</p>
<p><a href="https://www.blockchain.com/btc/tx/d70ae1131d433b655d0faeae1db4efa15bb4138f1e38e60a53073a58ea1dcc34" rel="nofollow noreferrer">https://www.blockchain.com/btc/tx/d70ae1131d433b655d0faeae1db4efa15bb4138f1e38e60a53073a58ea1dcc34</a></p>
<p>How we can retrieve the recipient address, i.e. <code>1JAL1WRvwbJqWWd1Ktks4Q89zCeUYSQM12</code> using the output field of the RPC command below:</p>
<pre><code>bitcoin-cli getrawtransaction d70ae1131d433b655d0faeae1db4efa15bb4138f1e38e60a53073a58ea1dcc34 1


&quot;vout&quot;: [
    {
      &quot;value&quot;: 50.12000000,
      &quot;n&quot;: 0,
      &quot;scriptPubKey&quot;: {
        &quot;asm&quot;: &quot;0400d0ade32217e076945e0946ef7bed72d9aea035aa8891e4bf0749ae6e24f8a7d3ea56efafe472ac3943dbed3af7c093729720ac9ab04e8eba09286e3a00fe41 OP_CHECKSIG&quot;,
        &quot;hex&quot;: &quot;410400d0ade32217e076945e0946ef7bed72d9aea035aa8891e4bf0749ae6e24f8a7d3ea56efafe472ac3943dbed3af7c093729720ac9ab04e8eba09286e3a00fe41ac&quot;,
        &quot;type&quot;: &quot;pubkey&quot;
      }
    }
  ],
</code></pre>
<p>For non-coinbase transactions, the output filed contains the value of addresses.</p>
<pre><code>bitcoin-cli getrawtransaction bd20f46a4337ab787f6fbd036e9f4d65c7ae67d21cc6f9013162e783384d877c 1

&quot;vout&quot;: [
    {
      &quot;value&quot;: 1.00000000,
      &quot;n&quot;: 0,
      &quot;scriptPubKey&quot;: {
        &quot;asm&quot;: &quot;OP_DUP OP_HASH160 53c32617316707bb8ba4e1546fa8c32bd212c86d OP_EQUALVERIFY OP_CHECKSIG&quot;,
        &quot;hex&quot;: &quot;76a91453c32617316707bb8ba4e1546fa8c32bd212c86d88ac&quot;,
        &quot;address&quot;: &quot;18dts6fXXA7jVKfYMBpsFqx7iZCELCfDpk&quot;,
        &quot;type&quot;: &quot;pubkeyhash&quot;
      }
    },
    {
      &quot;value&quot;: 58.97000000,
      &quot;n&quot;: 1,
      &quot;scriptPubKey&quot;: {
        &quot;asm&quot;: &quot;OP_DUP OP_HASH160 37fdd890381f9965d620fc3d0c9fa3e511cb1449 OP_EQUALVERIFY OP_CHECKSIG&quot;,
        &quot;hex&quot;: &quot;76a91437fdd890381f9965d620fc3d0c9fa3e511cb144988ac&quot;,
        &quot;address&quot;: &quot;1674G5SSZAb7h4unJMjdxfgNwo71vxgGQg&quot;,
        &quot;type&quot;: &quot;pubkeyhash&quot;
      }
    }
  ],
</code></pre>

<bitcoin-core><transactions><address><public-key><bitcoin-cli>
Parse the output field of getrawtransaction to generate a common address hash
sci9
# Parse the output field of getrawtransaction to generate a common address hash

(Asked by: username_0 on 2022-01-01)

Consider the following coinbase transaction:

<https://www.blockchain.com/btc/tx/d70ae1131d433b655d0faeae1db4efa15bb4138f1e38e60a53073a58ea1dcc34>

How we can retrieve the recipient address, i.e. `1JAL1WRvwbJqWWd1Ktks4Q89zCeUYSQM12` using the output field of the RPC command below:

```
bitcoin-cli getrawtransaction d70ae1131d433b655d0faeae1db4efa15bb4138f1e38e60a53073a58ea1dcc34 1

"vout": [
    {
      "value": 50.12000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "0400d0ade32217e076945e0946ef7bed72d9aea035aa8891e4bf0749ae6e24f8a7d3ea56efafe472ac3943dbed3af7c093729720ac9ab04e8eba09286e3a00fe41 OP_CHECKSIG",
        "hex": "410400d0ade32217e076945e0946ef7bed72d9aea035aa8891e4bf0749ae6e24f8a7d3ea56efafe472ac3943dbed3af7c093729720ac9ab04e8eba09286e3a00fe41ac",
        "type": "pubkey"
      }
    }
  ],

```

For non-coinbase transactions, the output filed contains the value of addresses.

```
bitcoin-cli getrawtransaction bd20f46a4337ab787f6fbd036e9f4d65c7ae67d21cc6f9013162e783384d877c 1

"vout": [
    {
      "value": 1.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 53c32617316707bb8ba4e1546fa8c32bd212c86d OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91453c32617316707bb8ba4e1546fa8c32bd212c86d88ac",
        "address": "18dts6fXXA7jVKfYMBpsFqx7iZCELCfDpk",
        "type": "pubkeyhash"
      }
    },
    {
      "value": 58.97000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 37fdd890381f9965d620fc3d0c9fa3e511cb1449 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91437fdd890381f9965d620fc3d0c9fa3e511cb144988ac",
        "address": "1674G5SSZAb7h4unJMjdxfgNwo71vxgGQg",
        "type": "pubkeyhash"
      }
    }
  ],

```

**Tags:** bitcoin-core, transactions, address, public-key, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2022-01-01. Score: 3 | Accepted answer

Observe that the type of the output is:

> "type": "pubkey"

Pay-to-Public-Key (P2PK) outputs do not have addresses. They pay directly to a public key rather than the hash of the public key, as the name suggests. Bitcoin addresses encode public key hashes, for example, addresses starting with a `1` are known as Pay-to-Public-Key-Hash (P2PKH) addresses and encode the `Ripemd-160(sha-256(public key))`.

See my other answer [here](https://bitcoin.stackexchange.com/a/111429/51948) for the same sort of question.

> **Comments:**
> **username_0**: Thank you for your answer. I'll follow the steps provided in the wiki to see how services like blockchain.com or blockchair.com pull out such addresses.  

---

