<p>Yes the previous transaction hash links the two transactions. More accurately it identifies the transaction in which money was received into the control of the person spending that money in this transaction.</p>
<p>Firstly, note that a transaction can have many inputs not just one, so there can be several previous transaction hashes linking several transactions to the current one.</p>
<p>Secondly, note that there is no link between specific inputs and specific outputs of a transaction. So you cannot trace the flow of money with any certainty. Especially if the creator of the transaction takes simple measures to improve their privacy.</p>
<hr />
<p>Related:</p>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/109460/13866">Trace fund flows between Bitcon addresses using transaction data</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/107243/13866">How can someone steal bitcoins and hide it?</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/102213/13866">Is it true that all the bitcoins in existence are on the blockchain (the ledge), but it just depends on who the owner (address) is?</a></li>
</ul>

CC BY-SA 4.0
2021-11-10T10:57:06.527Z
2021-11-10T11:09:17.780Z
2021-11-10T11:09:17.780Z
RedGrittyBrick
<p>I've spent some time analyzing Bitcoin transaction data and found out that the input column has this value called &quot;spent_transaction_hash&quot;. In the dataset, the definition of this value is &quot;the hash of the transaction which contains the output that this input spends&quot;.</p>
<p>I wonder if I can use this value to trace previous transactions. For example, let's say I have this Bitcoin transaction data:</p>
<pre><code>Hash     Input      Output      Spent_transaction_hash
1234       1          3               5678
5678       2          1               8910
</code></pre>
<p>Since spent_transaction_hash means the hash of the transactions whose output was the input to the current transaction, is it safe to say the second transaction(hash: 5678) was the previous transaction of the current transaction (1234) and they are connected?</p>
<p>Thank you.</p>

<transactions><transaction-input>
Can I trace Bitcoin transactions using spent_transaction_hash?
Sarah Grimes
# Can I trace Bitcoin transactions using spent_transaction_hash?

(Asked by: username_0 on 2021-11-10)

I've spent some time analyzing Bitcoin transaction data and found out that the input column has this value called "spent\_transaction\_hash". In the dataset, the definition of this value is "the hash of the transaction which contains the output that this input spends".

I wonder if I can use this value to trace previous transactions. For example, let's say I have this Bitcoin transaction data:

```
Hash     Input      Output      Spent_transaction_hash
1234       1          3               5678
5678       2          1               8910

```

Since spent\_transaction\_hash means the hash of the transactions whose output was the input to the current transaction, is it safe to say the second transaction(hash: 5678) was the previous transaction of the current transaction (1234) and they are connected?

Thank you.

**Tags:** transactions, transaction-input


---

## 1 answers

### Answer by username_1 on 2021-11-10. Score: 1 | Accepted answer

Yes the previous transaction hash links the two transactions. More accurately it identifies the transaction in which money was received into the control of the person spending that money in this transaction.

Firstly, note that a transaction can have many inputs not just one, so there can be several previous transaction hashes linking several transactions to the current one.

Secondly, note that there is no link between specific inputs and specific outputs of a transaction. So you cannot trace the flow of money with any certainty. Especially if the creator of the transaction takes simple measures to improve their privacy.

---

Related:

* [Trace fund flows between Bitcon addresses using transaction data](https://bitcoin.stackexchange.com/q/109460/13866)
* [How can someone steal bitcoins and hide it?](https://bitcoin.stackexchange.com/q/107243/13866)
* [Is it true that all the bitcoins in existence are on the blockchain (the ledge), but it just depends on who the owner (address) is?](https://bitcoin.stackexchange.com/q/102213/13866)


---

