<p>You need to pass the option <code>-txindex=1</code> at the command line, or include <code>txindex=1</code> in bitcoin.conf.</p>

CC BY-SA 3.0
2015-04-09T14:29:13.053Z
and than I can look up transactions where all outputs are already spend, right?
user599464
CC BY-SA 3.0
2015-04-09T04:12:36.567Z
2015-04-09T04:12:36.567Z
Nick ODell
<p>Yes, you can.
Open bitcoind with -txindex=1
If you didn't use txindex=1, you might need to add -reindex to recreate transactions indice.
Therefore, you can use getrawtransaction to look up  spent transactions which are not belonging to you.</p>

CC BY-SA 3.0
2015-04-09T16:28:19.103Z
2015-04-09T16:28:19.103Z
mhchia
<p>I want to get the input addresses of a transaction with a known id. If I use getrawtransaction I get something like:</p>

<pre><code>"vin" : [
{
"txid" : "470a499101b7042b225dab4f15fa252cdc7f3a16153e33d66d0c8c53b1d83aaa",
"vout" : 1,
"scriptSig" : {
"asm" : "304502206917b333161de796bed7770615ebf66669092a53877b3dba2582bad7dfc0b56c022100f9926a5e82d15666122b1f8703d94116eec0c98ddbf922a72467b05953532e1a01 03864670304932f91c85f38e80aebcd6c37fa36529b7135f7fa21b36585df5ab49",
"hex" : "48304502206917b333161de796bed7770615ebf66669092a53877b3dba2582bad7dfc0b56c022100f9926a5e82d15666122b1f8703d94116eec0c98ddbf922a72467b05953532e1a012103864670304932f91c85f38e80aebcd6c37fa36529b7135f7fa21b36585df5ab49"
},
</code></pre>

<p>If I want to further look of the transaction 470a499101b7042b225dab4f15fa252cdc7f3a16153e33d66d0c8c53b1d83aaa with getrawtransaction I get a:
"No information availabe about transaction (code -5)"</p>

<p>So is it at all possible to get the input addresses of a random transaction (not belonging to your wallet) with bitcoind?</p>

<transactions><bitcoind><raw-transaction><gettransaction>
How to get the input address from an txid with bitcoind
user599464
# How to get the input address from an txid with bitcoind

(Asked by: username_0 on 2015-04-09)

I want to get the input addresses of a transaction with a known id. If I use getrawtransaction I get something like:

```
"vin" : [
{
"txid" : "470a499101b7042b225dab4f15fa252cdc7f3a16153e33d66d0c8c53b1d83aaa",
"vout" : 1,
"scriptSig" : {
"asm" : "304502206917b333161de796bed7770615ebf66669092a53877b3dba2582bad7dfc0b56c022100f9926a5e82d15666122b1f8703d94116eec0c98ddbf922a72467b05953532e1a01 03864670304932f91c85f38e80aebcd6c37fa36529b7135f7fa21b36585df5ab49",
"hex" : "48304502206917b333161de796bed7770615ebf66669092a53877b3dba2582bad7dfc0b56c022100f9926a5e82d15666122b1f8703d94116eec0c98ddbf922a72467b05953532e1a012103864670304932f91c85f38e80aebcd6c37fa36529b7135f7fa21b36585df5ab49"
},

```

If I want to further look of the transaction 470a499101b7042b225dab4f15fa252cdc7f3a16153e33d66d0c8c53b1d83aaa with getrawtransaction I get a:
"No information availabe about transaction (code -5)"

So is it at all possible to get the input addresses of a random transaction (not belonging to your wallet) with bitcoind?

**Tags:** transactions, bitcoind, raw-transaction, gettransaction


---

## 2 answers

### Answer by username_1 on 2015-04-09. Score: 1

You need to pass the option `-txindex=1` at the command line, or include `txindex=1` in bitcoin.conf.

> **Comments:**
> **username_0**: and than I can look up transactions where all outputs are already spend, right?  

---

### Answer by username_2 on 2015-04-09. Score: 1

Yes, you can.
Open bitcoind with -txindex=1
If you didn't use txindex=1, you might need to add -reindex to recreate transactions indice.
Therefore, you can use getrawtransaction to look up spent transactions which are not belonging to you.


---

