<p>A <code>TxOut</code> cannot be used to uniquely identify an UTxO, as it is just an address and a value.</p>
<p><code>TxOutRef</code> is unique as it is the transaction id and the output index within that transaction.</p>

CC BY-SA 4.0
2021-06-02T20:24:53.607Z
2021-06-02T21:38:34.160Z
2021-06-02T21:38:34.160Z
Marek Mahut - StakeNuts
<p>I'm sorry if it feels like an odd question.</p>
<p>In <code>Plutus.V1.Ledger.Contexts</code> module I see that <code>TxOut</code> is a transaction output and <code>TxOutRef</code> is a reference to a transaction output.</p>
<p>In code, we use it often to</p>
<ul>
<li>check some statements about txInputs</li>
<li>to describe a transaction's constrains</li>
</ul>
<p>But what was the reason behind the introduction of this abstraction? What would be a correct analogy?</p>
<p>Thank you</p>

CC BY-SA 4.0
2021-06-02T20:15:38.770Z
Welcome to the site!
Nike Dattani
<plutus>
Why do we need TxOutRef in addition to TxOut?
# Why do we need TxOutRef in addition to TxOut?

(Asked by: username_0 on 2021-06-02)

I'm sorry if it feels like an odd question.

In `Plutus.V1.Ledger.Contexts` module I see that `TxOut` is a transaction output and `TxOutRef` is a reference to a transaction output.

In code, we use it often to

* check some statements about txInputs
* to describe a transaction's constrains

But what was the reason behind the introduction of this abstraction? What would be a correct analogy?

Thank you

**Tags:** plutus
> **Comments:**
> **username_1**: Welcome to the site!  

---

## 1 answers

### Answer by username_2 on 2021-06-02. Score: 5 | Accepted answer

A `TxOut` cannot be used to uniquely identify an UTxO, as it is just an address and a value.

`TxOutRef` is unique as it is the transaction id and the output index within that transaction.


---

