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"
}
}
],