<p>The notion of accounts is for human convenience. The system doesn't care that you think of all the coins accessible by the same private key as a single account.</p>

<p>Instead, miners keep an efficiently organized database of all UTXOs (unspent transaction outputs). When a miner validates a transaction, it checks that each input corresponds to a valid UTXO.</p>

<p>There's no need to keep the UTXO database in memory. Storing it on disk is fine as long as it is efficiently indexed. Since it's kept for precisely for this purpose, it is efficiently indexed for this purpose.</p>

CC BY-SA 3.0
2018-01-29T00:37:02.003Z
So the UTXO is updated after every new block, is that correct?
Greg
CC BY-SA 3.0
2018-01-29T00:48:56.073Z
The UTXO set is updated any time a new block is accepted or the blockchain is reorganized.
David Schwartz
CC BY-SA 3.0
2018-01-29T00:21:46.773Z
2018-01-29T00:21:46.773Z
David Schwartz
<p>I am trying to understand how double spending can be prevented if mining nodes do not keep a current "balance" of BTC associated with an account?</p>

<p>If they do keep the current balance isn't this a problem as the number of potential accounts is very, very large? That is, if each account balance takes up space in memory, and more accounts are created then the only way nodes can keep up is when the rate of growth of accounts is less than the rate of growth of available memory per node?</p>

<p>Am I missing something?</p>

<mining-theory><balance>
Do miners keep a "balance" of how much each public key has?
Greg
# Do miners keep a "balance" of how much each public key has?

(Asked by: username_0 on 2018-01-28)

I am trying to understand how double spending can be prevented if mining nodes do not keep a current "balance" of BTC associated with an account?

If they do keep the current balance isn't this a problem as the number of potential accounts is very, very large? That is, if each account balance takes up space in memory, and more accounts are created then the only way nodes can keep up is when the rate of growth of accounts is less than the rate of growth of available memory per node?

Am I missing something?

**Tags:** mining-theory, balance


---

## 1 answers

### Answer by username_1 on 2018-01-29. Score: 2 | Accepted answer

The notion of accounts is for human convenience. The system doesn't care that you think of all the coins accessible by the same private key as a single account.

Instead, miners keep an efficiently organized database of all UTXOs (unspent transaction outputs). When a miner validates a transaction, it checks that each input corresponds to a valid UTXO.

There's no need to keep the UTXO database in memory. Storing it on disk is fine as long as it is efficiently indexed. Since it's kept for precisely for this purpose, it is efficiently indexed for this purpose.

> **Comments:**
> **username_0**: So the UTXO is updated after every new block, is that correct?  
> **username_1**: The UTXO set is updated any time a new block is accepted or the blockchain is reorganized.  

---

