1

I was trying to see the beginning of the blockchain using the RPC and looks like the first Coinbase transaction doesn't have a vout address. Btw this happens a lot actually.

$ bitcoin-cli getrawtransaction 0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000

$ bitcoin-cli decoderawtransaction 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000 true
{
  "txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
  "hash": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
  "version": 1,
  "size": 134,
  "vsize": 134,
  "weight": 536,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "04ffff001d0104",
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 50.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
        "hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
        "type": "pubkey"
      }
    }
  ]
}

when I take a look at any Bitcoin explorer, it actually shows one address: 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX https://www.blockchain.com/btc/tx/0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098

What is the explanation for this?

1 Answer 1

1

That type of output is a Pay-to-Pubkey (P2PK) output. It does not have a corresponding address, and so bitcoind does not provide one.

Block explorers will often show addresses for these types of outputs, but that is incorrect. The address will actually refer to a different script than is actually present in the output, albeit the owner of the private key for the pubkey in the P2PK script could spend coins sent to the address shown by block explorers.

2
  • hmm, got it. But is there a way to "link" this P2PK output with a specific private key or even a P2SH? For example, can I discover if there is another transaction for the "same output" (or destination) of the example above? Just saw the decodescript function, but I didn't find out if there is a way to do that "link" Apr 25 at 21:00
  • @VitorDuque As it is a pubkey, it is inherently linked with a specific private key. P2SH is a completely different kind of script that is not related to P2PK. In order to lookup other transactions that contain this P2PK script, you will need some software that indexes output scripts and allows you to do lookups. Bitcoin Core does not have this built in (nor does it have one for addresses). However if you just want UTXOs, you can use scantxoutset with a descriptor for the script. If you use 23.0, decoderawtransaction will produce that descriptor for you.
    – Andrew Chow
    Apr 26 at 1:09

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.