<p><a href="https://bitcoin.stackexchange.com/questions/49853/utxo-model-vs-account-balance-model">The Bitcoin Network does not keep track of 'account balances', instead it uses an 'unspent transaction output' model.</a> Each node will keep an updated list of all unspent transaction outputs (UTXOs), so that when it hears about a new transaction, it can verify that the transaction is only spending valid UTXOs. This check is done quite simply: the UTXOs used in the transaction must be present in the node's UTXO set. If the transaction attempts to spend a UTXO that does not exist (ie, 'insufficient balance'), then the transaction will be rejected as invalid.</p>

<p>See these questions for more information:</p>

<p><a href="https://bitcoin.stackexchange.com/questions/22997/how-is-a-wallets-balance-computed/23034#23034">How is a wallet&#39;s balance computed?</a></p>

<p><a href="https://bitcoin.stackexchange.com/questions/37397/where-is-the-utxo-data-stored/50071#50071">Where is the UTXO data stored?</a></p>

<p><a href="https://bitcoin.stackexchange.com/questions/35980/how-big-is-the-utxo-database/35987#35987">How big is the UTXO database?</a></p>

<p><a href="https://bitcoin.stackexchange.com/questions/52310/how-can-a-miner-verify-that-a-utxos-is-not-spent-elsewhere">How can a miner verify that a UTXOs is not spent elsewhere?</a></p>

<p><a href="https://bitcoin.stackexchange.com/questions/29780/why-does-bitcoin-store-all-transaction-inputs-and-outputs-instead-of-just-an-a/29782#29782">Why does Bitcoin store all transaction inputs and outputs, instead of just an &quot;account/balance&quot; ledger?</a></p>

CC BY-SA 4.0
2019-09-17T19:24:38.933Z
TIL the [the UTXO set includes unconfirmed transactions in the mempool](https://bitcoin.stackexchange.com/a/71046/13440). This explains how unconfirmed outputs can be spent before being mined.  Thanks!
Jonathan Cross
CC BY-SA 4.0
2019-09-17T00:32:19.543Z
2019-09-17T00:32:19.543Z
chytrik
<p>When a node receives a new transaction, that node will check if the one broadcasting the transaction has enough coins to initiate it. Bitcoin follows a UTXO model, therefore the node has to check in the past if the sender has enough coins. </p>

<p>Is this check linear in time? Where can I read to know more about it?</p>

<transaction-verification>
Bitcoin check if the transaction is valid
Fadi
# Bitcoin check if the transaction is valid

(Asked by: username_0 on 2019-09-16)

When a node receives a new transaction, that node will check if the one broadcasting the transaction has enough coins to initiate it. Bitcoin follows a UTXO model, therefore the node has to check in the past if the sender has enough coins.

Is this check linear in time? Where can I read to know more about it?

**Tags:** transaction-verification


---

## 1 answers

### Answer by username_1 on 2019-09-17. Score: 1 | Accepted answer

[The Bitcoin Network does not keep track of 'account balances', instead it uses an 'unspent transaction output' model.](https://bitcoin.stackexchange.com/questions/49853/utxo-model-vs-account-balance-model) Each node will keep an updated list of all unspent transaction outputs (UTXOs), so that when it hears about a new transaction, it can verify that the transaction is only spending valid UTXOs. This check is done quite simply: the UTXOs used in the transaction must be present in the node's UTXO set. If the transaction attempts to spend a UTXO that does not exist (ie, 'insufficient balance'), then the transaction will be rejected as invalid.

See these questions for more information:

[How is a wallet's balance computed?](https://bitcoin.stackexchange.com/questions/22997/how-is-a-wallets-balance-computed/23034#23034)

[Where is the UTXO data stored?](https://bitcoin.stackexchange.com/questions/37397/where-is-the-utxo-data-stored/50071#50071)

[How big is the UTXO database?](https://bitcoin.stackexchange.com/questions/35980/how-big-is-the-utxo-database/35987#35987)

[How can a miner verify that a UTXOs is not spent elsewhere?](https://bitcoin.stackexchange.com/questions/52310/how-can-a-miner-verify-that-a-utxos-is-not-spent-elsewhere)

[Why does Bitcoin store all transaction inputs and outputs, instead of just an "account/balance" ledger?](https://bitcoin.stackexchange.com/questions/29780/why-does-bitcoin-store-all-transaction-inputs-and-outputs-instead-of-just-an-a/29782#29782)

> **Comments:**
> **username_2**: TIL the [the UTXO set includes unconfirmed transactions in the mempool](https://bitcoin.stackexchange.com/a/71046/13440). This explains how unconfirmed outputs can be spent before being mined.  Thanks!  

---

