<p>I had an problem equals and I used The client bitcoin for C++, but if you want to get the address of the transaction with the command decodescript and the hex script,</p>

<p>with your example with your I ran in the console bitcoin-qt this command</p>

<pre><code>decodescript 76a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac
</code></pre>

<p>￼an I got this information</p>

<pre><code>{
  "asm": "OP_DUP OP_HASH160 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0 OP_EQUALVERIFY OP_CHECKSIG",
  "reqSigs": 1,
  "type": "pubkeyhash",
  "addresses": [
    "1LXnPYpHTwQeWfBVnQZ4yDP23b57NwoyrP"
  ],
  "p2sh": "3Mn9qFsLMF4AQK2MMadtUW9im7GF95piQo",
  "segwit": {
    "asm": "0 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0",
    "hex": "0014d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0",
    "reqSigs": 1,
    "type": "witness_v0_keyhash",
    "addresses": [
      "bc1q6c7vrcakqz0rr5pm6huqgm97palr06xq5xedry"
    ],
    "p2sh-segwit": "3BmcGFkh7jJTsWGRSt4zBFJGyBuGWtFsUN"
  }
}
</code></pre>

<p>the value of bitcoin in the transaction is into json the blockchain.info with propriety <code>value</code>, but if you want to get transaction information to the client bitcoin you can use this command, with your case</p>

<pre><code>decoderawtransaction 020000000200f0b766f005a605f5f9537e726b4b1749a87ac34fae1edfe5a3b1a121bc6c0d000000006a47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7efeffffffe9d3b1736f598fd7d936cbcd5eef0db543b295b44c707d2381ee509d2798c4aa010000006b483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9feffffff0110440a01000000001976a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac15a10700
</code></pre>

<p>and I got this result</p>

<pre><code>{
  "txid": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "hash": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "version": 2,
  "size": 339,
  "vsize": 339,
  "weight": 1356,
  "locktime": 499989,
  "vin": [
    {
      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,
      "scriptSig": {
        "asm": "304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc[ALL] 025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e",
        "hex": "47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e"
      },
      "sequence": 4294967294
    },
    {
      "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9",
      "vout": 1,
      "scriptSig": {
        "asm": "3045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb6[ALL] 0349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9",
        "hex": "483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.17450000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1LXnPYpHTwQeWfBVnQZ4yDP23b57NwoyrP"
        ]
      }
    }
  ]
}
</code></pre>

<p>For my opinion exist and alternative more simple and is use the client bitcoin, this is <a href="https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)" rel="nofollow noreferrer">reference</a>, I have used the C++ with this library <a href="https://github.com/minium/bitcoin-api-cpp" rel="nofollow noreferrer">bitcoin-api-cpp</a> is very simple get all information to the node</p>

<p>The documentation of the command is <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow noreferrer">there</a></p>

<p>I hope I understand your question and sorry my terrible English</p>

CC BY-SA 4.0
2019-07-19T02:51:59.047Z
Thanks. However, it cannot get the amount and address of the sender of the transaction yet.
Jun Fang
CC BY-SA 4.0
2019-07-19T08:19:46.703Z
The decodescript returned also the addresses, in the json and the amount is the json of the decoderawtransaction with propriety "value"
vincenzopalazzo
CC BY-SA 4.0
2019-07-21T03:28:20.277Z
Thanks for your replay. I have found the answer and will post it soon.
Jun Fang
CC BY-SA 4.0
2019-07-18T11:25:41.803Z
2019-07-18T11:35:31.487Z
2019-07-18T11:35:31.487Z
vincenzopalazzo
<p>The address and amount of the sender can be gotten from the 'txid' and 'vout' by using getrawtransaction command. Let's see the example, the vin part of the block is as follows:</p>

<pre><code>"vin": [
    {
      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,
      "scriptSig": {
        "asm": "304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc[ALL] 025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e",
        "hex": "47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e"
      },
      "sequence": 4294967294
    },
    {
      "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9",
      "vout": 1,
      "scriptSig": {
        "asm": "3045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb6[ALL] 0349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9",
        "hex": "483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9"
      },
      "sequence": 4294967294
    }
  ]
</code></pre>

<p>It means that there are two inputs, the first input is from the "vout" 0 of the transaction "txid" "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000", the second input is from the "vout" 1 fo the transaction "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9". Since the vout part of one transaction has address and amount, we can get the input address and corresponding amount.</p>

<p>For instance, let's look the first input:</p>

<pre><code>      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,
</code></pre>

<p>run following core rpc command (note that we need let the server index each transaction to support getrawtransaction, it can be done by add "txindex=1" in the bitcoin.conf)</p>

<pre><code>bitcoin-cli -rpcuser=jun -rpcpassword=123 getrawtransaction "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000" true
</code></pre>

<p>We get following vouts part as follows:</p>

<pre><code> "vout": [
    {
      "value": 0.01040000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 af9e84db382823b9c36c40d70090ff81890c5ef5 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914af9e84db382823b9c36c40d70090ff81890c5ef588ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1H1b9fN7wYYwTSweyPjE7wCGSHuduCcE2o"
        ]
      }
    },
    {
      "value": 147.75014395,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 35f72ce8b9123a055e27be9a0bb723b6cb502419 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91435f72ce8b9123a055e27be9a0bb723b6cb50241988ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "15vLvDZyAjWCrfWyazMtvHRe8hDJBxXJEC"
        ]
      }
    }
  ],
</code></pre>

<p>Then we have the address and amount which are the first part of the vout. It is the first input of our transaction.</p>

<pre><code>"addresses": ["1H1b9fN7wYYwTSweyPjE7wCGSHuduCcE2o"]
"value": 147.75014395
</code></pre>

<p>There is a very nice blog about the vin and vout explanation 
<a href="http://www.michaelnielsen.org/ddi/how-the-bitcoin-protocol-actually-works/" rel="nofollow noreferrer">http://www.michaelnielsen.org/ddi/how-the-bitcoin-protocol-actually-works/</a></p>

CC BY-SA 4.0
2019-07-22T10:41:31.077Z
2019-07-22T10:41:31.077Z
Jun Fang
<p>I am trying to find details of every transaction using bitcoin core rpc. First, I using bitcoin-cli getblock to get the block data, then use bitcoin-cli getrawtransaction to get the transaction details.</p>

<p>For instance:</p>

<pre><code> bitcoin-cli getrawtransaction "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc" true "00000000000000000024fb37364cbf81fd49cc2d51c09c75c35433c3a1945d04" 

get:

{
  "in_active_chain": true,
  "txid": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "hash": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "version": 2,
  "size": 339,
  "vsize": 339,
  "weight": 1356,
  "locktime": 499989,
  "vin": [
    {
      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,
      "scriptSig": {
        "asm": "304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc[ALL] 025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e",
        "hex": "47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e"
      },
      "sequence": 4294967294
    },
    {
      "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9",
      "vout": 1,
      "scriptSig": {
        "asm": "3045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb6[ALL] 0349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9",
        "hex": "483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.17450000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1LXnPYpHTwQeWfBVnQZ4yDP23b57NwoyrP"
        ]
      }
    }
  ],
  "hex": "020000000200f0b766f005a605f5f9537e726b4b1749a87ac34fae1edfe5a3b1a121bc6c0d000000006a47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7efeffffffe9d3b1736f598fd7d936cbcd5eef0db543b295b44c707d2381ee509d2798c4aa010000006b483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9feffffff0110440a01000000001976a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac15a10700",
  "blockhash": "00000000000000000024fb37364cbf81fd49cc2d51c09c75c35433c3a1945d04",
  "confirmations": 85927,
  "time": 1513622125,
  "blocktime": 1513622125
}

</code></pre>

<p>I know some web api such as blockchain.info provide these information for every transaction. How can I get the address and corresponding amount of vin using other bitcoin core rpc? </p>

<p>Thanks.</p>

<p>There some related links:
<a href="https://bitcoin.stackexchange.com/questions/51902/how-to-get-address-from-scriptsig">How to get address from scriptSig?</a></p>

<p><a href="https://bitcoin.stackexchange.com/questions/25540/how-to-get-the-input-address-from-vin-where-only-a-txid-is-given-insight-api">How to get the Input Address from vin where only a txid is given (Insight-Api)</a></p>

<bitcoin-core><bitcoind><address><transaction-input>
How to get input address and amount from vin using bitcoin core rpc
Jun Fang
# How to get input address and amount from vin using bitcoin core rpc

(Asked by: username_0 on 2019-07-18)

I am trying to find details of every transaction using bitcoin core rpc. First, I using bitcoin-cli getblock to get the block data, then use bitcoin-cli getrawtransaction to get the transaction details.

For instance:

```
 bitcoin-cli getrawtransaction "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc" true "00000000000000000024fb37364cbf81fd49cc2d51c09c75c35433c3a1945d04" 

get:

{
  "in_active_chain": true,
  "txid": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "hash": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "version": 2,
  "size": 339,
  "vsize": 339,
  "weight": 1356,
  "locktime": 499989,
  "vin": [
    {
      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,
      "scriptSig": {
        "asm": "304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc[ALL] 025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e",
        "hex": "47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e"
      },
      "sequence": 4294967294
    },
    {
      "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9",
      "vout": 1,
      "scriptSig": {
        "asm": "3045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb6[ALL] 0349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9",
        "hex": "483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.17450000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1LXnPYpHTwQeWfBVnQZ4yDP23b57NwoyrP"
        ]
      }
    }
  ],
  "hex": "020000000200f0b766f005a605f5f9537e726b4b1749a87ac34fae1edfe5a3b1a121bc6c0d000000006a47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7efeffffffe9d3b1736f598fd7d936cbcd5eef0db543b295b44c707d2381ee509d2798c4aa010000006b483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9feffffff0110440a01000000001976a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac15a10700",
  "blockhash": "00000000000000000024fb37364cbf81fd49cc2d51c09c75c35433c3a1945d04",
  "confirmations": 85927,
  "time": 1513622125,
  "blocktime": 1513622125
}

```

I know some web api such as blockchain.info provide these information for every transaction. How can I get the address and corresponding amount of vin using other bitcoin core rpc?

Thanks.

There some related links:
[How to get address from scriptSig?](https://bitcoin.stackexchange.com/questions/51902/how-to-get-address-from-scriptsig)

[How to get the Input Address from vin where only a txid is given (Insight-Api)](https://bitcoin.stackexchange.com/questions/25540/how-to-get-the-input-address-from-vin-where-only-a-txid-is-given-insight-api)

**Tags:** bitcoin-core, bitcoind, address, transaction-input


---

## 2 answers

### Answer by username_0 on 2019-07-22. Score: 4 | Accepted answer

The address and amount of the sender can be gotten from the 'txid' and 'vout' by using getrawtransaction command. Let's see the example, the vin part of the block is as follows:

```
"vin": [
    {
      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,
      "scriptSig": {
        "asm": "304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc[ALL] 025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e",
        "hex": "47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e"
      },
      "sequence": 4294967294
    },
    {
      "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9",
      "vout": 1,
      "scriptSig": {
        "asm": "3045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb6[ALL] 0349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9",
        "hex": "483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9"
      },
      "sequence": 4294967294
    }
  ]

```

It means that there are two inputs, the first input is from the "vout" 0 of the transaction "txid" "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000", the second input is from the "vout" 1 fo the transaction "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9". Since the vout part of one transaction has address and amount, we can get the input address and corresponding amount.

For instance, let's look the first input:

```
      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,

```

run following core rpc command (note that we need let the server index each transaction to support getrawtransaction, it can be done by add "txindex=1" in the bitcoin.conf)

```
bitcoin-cli -rpcuser=jun -rpcpassword=123 getrawtransaction "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000" true

```

We get following vouts part as follows:

```
 "vout": [
    {
      "value": 0.01040000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 af9e84db382823b9c36c40d70090ff81890c5ef5 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914af9e84db382823b9c36c40d70090ff81890c5ef588ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1H1b9fN7wYYwTSweyPjE7wCGSHuduCcE2o"
        ]
      }
    },
    {
      "value": 147.75014395,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 35f72ce8b9123a055e27be9a0bb723b6cb502419 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91435f72ce8b9123a055e27be9a0bb723b6cb50241988ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "15vLvDZyAjWCrfWyazMtvHRe8hDJBxXJEC"
        ]
      }
    }
  ],

```

Then we have the address and amount which are the first part of the vout. It is the first input of our transaction.

```
"addresses": ["1H1b9fN7wYYwTSweyPjE7wCGSHuduCcE2o"]
"value": 147.75014395

```

There is a very nice blog about the vin and vout explanation
<http://www.michaelnielsen.org/ddi/how-the-bitcoin-protocol-actually-works/>


---

### Answer by username_1 on 2019-07-18. Score: 0

I had an problem equals and I used The client bitcoin for C++, but if you want to get the address of the transaction with the command decodescript and the hex script,

with your example with your I ran in the console bitcoin-qt this command

```
decodescript 76a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac

```

￼an I got this information

```
{
  "asm": "OP_DUP OP_HASH160 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0 OP_EQUALVERIFY OP_CHECKSIG",
  "reqSigs": 1,
  "type": "pubkeyhash",
  "addresses": [
    "1LXnPYpHTwQeWfBVnQZ4yDP23b57NwoyrP"
  ],
  "p2sh": "3Mn9qFsLMF4AQK2MMadtUW9im7GF95piQo",
  "segwit": {
    "asm": "0 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0",
    "hex": "0014d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0",
    "reqSigs": 1,
    "type": "witness_v0_keyhash",
    "addresses": [
      "bc1q6c7vrcakqz0rr5pm6huqgm97palr06xq5xedry"
    ],
    "p2sh-segwit": "3BmcGFkh7jJTsWGRSt4zBFJGyBuGWtFsUN"
  }
}

```

the value of bitcoin in the transaction is into json the blockchain.info with propriety `value`, but if you want to get transaction information to the client bitcoin you can use this command, with your case

```
decoderawtransaction 020000000200f0b766f005a605f5f9537e726b4b1749a87ac34fae1edfe5a3b1a121bc6c0d000000006a47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7efeffffffe9d3b1736f598fd7d936cbcd5eef0db543b295b44c707d2381ee509d2798c4aa010000006b483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9feffffff0110440a01000000001976a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac15a10700

```

and I got this result

```
{
  "txid": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "hash": "1024cb12a576b69defa67dbc2f1899700ab58e5ad3d5e058edefb907f59865bc",
  "version": 2,
  "size": 339,
  "vsize": 339,
  "weight": 1356,
  "locktime": 499989,
  "vin": [
    {
      "txid": "0d6cbc21a1b1a3e5df1eae4fc37aa849174b6b727e53f9f505a605f066b7f000",
      "vout": 0,
      "scriptSig": {
        "asm": "304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc[ALL] 025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e",
        "hex": "47304402203f198d9695a293c41d2124e790d473e68f4b35a09ece5517c7adfffc797f91760220304feb1cc2829d3c937665bcb4b7f9735acbcac50e9169bc53c9e689ce20b3bc0121025743bce4e775bb754e784dd2cfdc8dabc2023154eee539bb155612101a583e7e"
      },
      "sequence": 4294967294
    },
    {
      "txid": "aac498279d50ee81237d704cb495b243b50def5ecdcb36d9d78f596f73b1d3e9",
      "vout": 1,
      "scriptSig": {
        "asm": "3045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb6[ALL] 0349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9",
        "hex": "483045022100b763b986b17beddac1ac96c3656fa7af188a28cfacfc87390e1e796b7fdbc0d102201e76f77db6093306028e681e2fe6354ae12649afb5c27c549243b67d505a1bb601210349ebb9d180938ab3a571d8c2e9771fb4fecb9f4484c337bb35d8fd8b48283ca9"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.17450000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c0 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914d63cc1e3b6009e31d03bd5f8046cbe0f7e37e8c088ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1LXnPYpHTwQeWfBVnQZ4yDP23b57NwoyrP"
        ]
      }
    }
  ]
}

```

For my opinion exist and alternative more simple and is use the client bitcoin, this is [reference](https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)), I have used the C++ with this library [bitcoin-api-cpp](https://github.com/minium/bitcoin-api-cpp) is very simple get all information to the node

The documentation of the command is [there](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)

I hope I understand your question and sorry my terrible English

> **Comments:**
> **username_0**: Thanks. However, it cannot get the amount and address of the sender of the transaction yet.  
> **username_1**: The decodescript returned also the addresses, in the json and the amount is the json of the decoderawtransaction with propriety "value"  
> **username_0**: Thanks for your replay. I have found the answer and will post it soon.  

---

