<p>You don't. To know if an output was spent you must check the blockchain, the information is not encoded in the transaction itself.</p>

<p>In Bitoin, you don't need to scan the <em>entire</em> blockchain, though. There's a database maintained by nodes, wallets and other software called <strong>unspent transaction output</strong>, or UTXO. Other coins may be different.</p>

CC BY-SA 3.0
2018-03-20T00:21:33.857Z
Exactly, wouldn't it be great if transaction had "I am valid!" flag, then you wouldn't need to validate anything! </sarcasm>
Pieter Wuille
CC BY-SA 4.0
2018-05-29T11:03:15.017Z
@PieterWuille that is impossible because chained block cannot be modified. The flag "I am valid" will never updated for the output.
Frank Kong
CC BY-SA 3.0
2018-03-20T00:18:50.537Z
2018-03-20T00:18:50.537Z
Osias Jota
<p>When looking through the data represented in JSON, how do I know if a particular output has been spent as input in another transaction?</p>

<bitcoin-core>
How do I know if an output is unspent when looking through the raw transaction data of a transaction?
Skyvell
# How do I know if an output is unspent when looking through the raw transaction data of a transaction?

(Asked by: username_0 on 2018-03-19)

When looking through the data represented in JSON, how do I know if a particular output has been spent as input in another transaction?

**Tags:** bitcoin-core


---

## 1 answers

### Answer by username_1 on 2018-03-20. Score: 1

You don't. To know if an output was spent you must check the blockchain, the information is not encoded in the transaction itself.

In Bitoin, you don't need to scan the *entire* blockchain, though. There's a database maintained by nodes, wallets and other software called **unspent transaction output**, or UTXO. Other coins may be different.

> **Comments:**
> **username_2**: Exactly, wouldn't it be great if transaction had "I am valid!" flag, then you wouldn't need to validate anything! </sarcasm>  
> **username_3**: @username_2 that is impossible because chained block cannot be modified. The flag "I am valid" will never updated for the output.  

---

