<blockquote>
  <p>I felt the absolute necessity to verify that these 'n' transactions actually took place. How would I find the relevant block? </p>
</blockquote>

<p>A transaction consumes inputs, and creates outputs (new 'unspent transaction outputs' or UTXOs). For the transaction to be valid, each input must be a valid UTXO that exists on the network. Full nodes keep a continually updated index of all valid UTXOs, that they can check against incoming transactions.</p>

<p>A transaction input will reference the transaction which created it, via the transaction ID and the output index. So a full node will just look up that entry in the UTXO index, ensuring it exists and is being used validly. </p>

<blockquote>
  <p>Would I decrypt the block to read it? </p>
</blockquote>

<p>Blocks are not encrypted, but you will have to parse through the relevant blocks to obtain the relevant transaction data. </p>

<blockquote>
  <p>Is this ever done in actual practice and is it expensive and time consuming to do it?</p>
</blockquote>

<p>Yes, this is done by each and every node, for each and every transaction / block. Checking a single transaction is not a computationally expensive procedure, but there is consideration for the sum of verifications a full node must compute in order to synchronize with the network. In order to maintain a robust and decentralized network (which is integral to the network's properties), it is important that the total resource requirements to run a node remain relatively low, to ensure that a sufficient number of nodes are able to stay online. </p>

CC BY-SA 4.0
2020-05-05T00:07:57.243Z
You don't need to parse the relevant blocks if you keep all information about UTXOs in a UTXO database (like Bitcoin Core does). In that case, the UTXO set is not an index into the blocks; it is a fully self contained database of all unspent outputs.
Pieter Wuille
CC BY-SA 4.0
2020-05-05T01:30:39.437Z
@PieterWuille so a node contains the blockchain as well as a database called a UTXO database that contains all unspent transaction points of all nodes (people) on the network? Also what happens when a transaction is spent? Is it removed from the UTXO table or a special column in the DB is updated to specify a spent transaction?
Bittu
CC BY-SA 4.0
2020-05-05T01:33:17.060Z
Yes. When a transaction is confirmed in a block its inputs are removed from the UTXO set, and its outputs are added to it.
Pieter Wuille
CC BY-SA 4.0
2020-05-04T23:45:20.900Z
2020-05-04T23:45:20.900Z
chytrik
<p>When transferring BTC between two users, the new transaction will consist of references to previous transactions.</p>

<p>For example, if I user A wishes to transfer 1 BTC to user B, he will need 'n' transactions totaling 1 BTC in order for the transaction to be valid.
If these 'n' transactions occur with large periods of time between them (say 1 year) and for some reason I felt the absolute necessity to verify that these 'n' transactions actually took place. </p>

<p>How would I find the relevant block? </p>

<p>Would I decrypt the block to read it? Is this ever done in actual practice and is it expensive and time consuming to do it?</p>

<transactions><blockchain><validation>
How does the network verify previous transactions when transferring BTC between two users?
Bittu
# How does the network verify previous transactions when transferring BTC between two users?

(Asked by: username_0 on 2020-05-04)

When transferring BTC between two users, the new transaction will consist of references to previous transactions.

For example, if I user A wishes to transfer 1 BTC to user B, he will need 'n' transactions totaling 1 BTC in order for the transaction to be valid.
If these 'n' transactions occur with large periods of time between them (say 1 year) and for some reason I felt the absolute necessity to verify that these 'n' transactions actually took place.

How would I find the relevant block?

Would I decrypt the block to read it? Is this ever done in actual practice and is it expensive and time consuming to do it?

**Tags:** transactions, blockchain, validation


---

## 1 answers

### Answer by username_1 on 2020-05-04. Score: 1 | Accepted answer

> I felt the absolute necessity to verify that these 'n' transactions actually took place. How would I find the relevant block?

A transaction consumes inputs, and creates outputs (new 'unspent transaction outputs' or UTXOs). For the transaction to be valid, each input must be a valid UTXO that exists on the network. Full nodes keep a continually updated index of all valid UTXOs, that they can check against incoming transactions.

A transaction input will reference the transaction which created it, via the transaction ID and the output index. So a full node will just look up that entry in the UTXO index, ensuring it exists and is being used validly.

> Would I decrypt the block to read it?

Blocks are not encrypted, but you will have to parse through the relevant blocks to obtain the relevant transaction data.

> Is this ever done in actual practice and is it expensive and time consuming to do it?

Yes, this is done by each and every node, for each and every transaction / block. Checking a single transaction is not a computationally expensive procedure, but there is consideration for the sum of verifications a full node must compute in order to synchronize with the network. In order to maintain a robust and decentralized network (which is integral to the network's properties), it is important that the total resource requirements to run a node remain relatively low, to ensure that a sufficient number of nodes are able to stay online.

> **Comments:**
> **username_2**: You don't need to parse the relevant blocks if you keep all information about UTXOs in a UTXO database (like Bitcoin Core does). In that case, the UTXO set is not an index into the blocks; it is a fully self contained database of all unspent outputs.  
> **username_0**: @PieterWuille so a node contains the blockchain as well as a database called a UTXO database that contains all unspent transaction points of all nodes (people) on the network? Also what happens when a transaction is spent? Is it removed from the UTXO table or a special column in the DB is updated to specify a spent transaction?  
> **username_2**: Yes. When a transaction is confirmed in a block its inputs are removed from the UTXO set, and its outputs are added to it.  

---

