2

This question already has an answer here:

I noticed that the bitcoin-cli getrawtransaction does not show the addresses of input transactions. For example, I execute the following command.

bitcoin-cli getrawtransaction eb9f2d61771d923d5d2945cc7a9560ef8a9dd12767f9571c24a2c132423622cb 1

Then I get this response (only relevant portion shown). Note that the output transaction addresses are shown and the input transactions have no addresses.

"vin": [
    {
      "txid": "3bd41515babcf549572b108f69a642e4097d9f3773024a8ebfca9dca67501187",
      "vout": 0,
      "scriptSig": {
        "asm": "3045022100c70eaecfb833321be10160261bfb3e7b8fe48f648008c61575f1319839498a390220275e8cbfa611dc510b8631bb674841514e4feceb0283ddd245411fe396600da1[ALL] 04ced626a3cb9ec7239bd395e8b25758a5ce724b1b50534ebcbb12bade2ac2be1b2b7b96f24070cdbb3b51147a74bd734b19b9c9c53632a505fe5d15293e545c2e",
        "hex": "483045022100c70eaecfb833321be10160261bfb3e7b8fe48f648008c61575f1319839498a390220275e8cbfa611dc510b8631bb674841514e4feceb0283ddd245411fe396600da1014104ced626a3cb9ec7239bd395e8b25758a5ce724b1b50534ebcbb12bade2ac2be1b2b7b96f24070cdbb3b51147a74bd734b19b9c9c53632a505fe5d15293e545c2e"
      },
      "sequence": 4294967295
    }, 
    {
      "txid": "d3669ecb95245d57d582e532fa1611f85e619a71b04f1bac6c2f0d0138ecb571",
      "vout": 0,
      "scriptSig": {
        "asm": "3046022100d5d7e7aca45ddc0516839163f8dda221dfa3a98e03966e15eaf6a39dd47a4549022100dabb158eb016194ba5645e45d2666a67219f8cc05ae616fa2b55f1fbcac0ee95[ALL] 042d403310f0a8595944c46c062f658c8ef044d9e83c82cb7ca882d9b7c7ac94d144096e7b4894898ec37e6086601166a1a5da21a72da342d8db45155915cee32a",
        "hex": "493046022100d5d7e7aca45ddc0516839163f8dda221dfa3a98e03966e15eaf6a39dd47a4549022100dabb158eb016194ba5645e45d2666a67219f8cc05ae616fa2b55f1fbcac0ee950141042d403310f0a8595944c46c062f658c8ef044d9e83c82cb7ca882d9b7c7ac94d144096e7b4894898ec37e6086601166a1a5da21a72da342d8db45155915cee32a"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.01582061,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 9748c285af98f565b89fe8504c6e59f9bea1d6e2 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9149748c285af98f565b89fe8504c6e59f9bea1d6e288ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1EnvCQkn3NtZnEvCGiqmdqVS9kJTSMoKmL"
        ]
      }
    }, 
    {
      "value": 0.01000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 95d00f0976e0858e84de0f13cddfe0b37787f071 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91495d00f0976e0858e84de0f13cddfe0b37787f07188ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1Ef8vkvY9Es6mZ6N9eXfUC7R1E5LQpPDSX"
        ]
      }
    }
  ]

I can call getrawtransaction again on the 2 input transaction ids.

  • 3bd41515babcf549572b108f69a642e4097d9f3773024a8ebfca9dca67501187
  • d3669ecb95245d57d582e532fa1611f85e619a71b04f1bac6c2f0d0138ecb571

The result for the first, 3bd41515babcf549572b108f69a642e4097d9f3773024a8ebfca9dca67501187, is as follows (only relevant portion shown).

  "vout": [
    {
      "value": 0.01582060,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 0eecd17bdc3ba83af0550fcffacf69d40a95ea21 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9140eecd17bdc3ba83af0550fcffacf69d40a95ea2188ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "12MvA7Lj3smCkr2xahayQcDhaY2q8cZYqM"
        ]
      }
    }, 
    {
      "value": 0.02000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 70ae216a65d1e6796867be5196135e0f0767cc58 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91470ae216a65d1e6796867be5196135e0f0767cc5888ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1BGoHHcBXajAG4R44G3gER15wZTKrx9GTE"
        ]
      }
    }
  ]

Note that there are 2 output addresses.

  • 12MvA7Lj3smCkr2xahayQcDhaY2q8cZYqM
  • 1BGoHHcBXajAG4R44G3gER15wZTKrx9GTE

How do I know which of these 2 output addresses from 3bd41515babcf549572b108f69a642e4097d9f3773024a8ebfca9dca67501187 is associated/corresponds to the first input transactions of eb9f2d61771d923d5d2945cc7a9560ef8a9dd12767f9571c24a2c132423622cb?

Are there methods on bitcoin-cli to help figure this problem out?

This is the transaction under consideration: https://blockchain.info/tx/eb9f2d61771d923d5d2945cc7a9560ef8a9dd12767f9571c24a2c132423622cb

Somehow, it is able to tell which wallet addresses is responsible from the upstream transaction.

For example, they are able to figure out that 12MvA7Lj3smCkr2xahayQcDhaY2q8cZYqM and 1FDWnFksXHFh9roq4oNyeXSpyRaJgGE46x are the associated addresses for the input transactions.

marked as duplicate by Pieter Wuille, Nick ODell Feb 18 '17 at 5:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.