<p>Bitcoin doesn't really care about balances, accounts, people or ownership. It doesn't need to know about any of those things.</p>
<p>Read the above sentence again. It is true. It has many important implications.</p>
<p>Bitcoin is <em>cash</em>, not an account. There's no system that tells a pizza storekeeper how many $10 bills (banknotes) you have under your mattress. The pizza storekeeper doesn't care. They only care that the $10 bill you hand them is not fake.</p>
<p>They don't need your ID. They don't need your name. They don't care whether you don't have a bank account. They don't ask you who owns that $10 bill, because they don't care <em>who</em> paid for the pizza - only <em>that</em> it gets paid for at all.</p>
<p>Don't let the terminology confuse you. The bitcoin blockchain isn't a ledger that keeps track of balances. It is a transaction journal that records only half of a real-life transaction - the half where A gives B some Bitcoin money, not the half where B gives A a pizza.</p>
<p>The transaction has inputs and outputs. The inputs are &quot;coins&quot; that A is giving up and the outputs are typically a new &quot;coin&quot; that B is getting and a new &quot;coin&quot; that A gets back as change (since Pizzas rarely cost exactly $10).</p>
<p>A Bitcoin &quot;coin&quot; is really just an output amount from an earlier transaction that has not yet been spent in a subsequent transaction. It is an Unspent Transaction Output (a UTXO).</p>
<p>Bitcoin nodes just keep track of UTXOs. When a UTXO is spent, the U in its name no longer applies. Every node observing the spend removes that TXO from its list of UTXOs. So every node seeing a second spend of a TXO would know that TXO is now not a UTXO and reject that second spend as invalid.</p>
<p>If a wallet reports a false balance to its owner, no one is harmed but the owner. A fake balance does not enable you to spend money you don't have. Its like a leather wallet that has &quot;$30&quot; written on the outside but which only contains two $10 bills.</p>
<p>That's the difference between bank accounts and cash.</p>

CC BY-SA 4.0
2021-05-21T15:39:53.570Z
Thanks, that really cleared things up. I didn't know about UTXOs and TXOs. Thanks for taking your time and helping me.
laust0rm
CC BY-SA 4.0
2021-05-21T13:25:49.257Z
2021-05-21T15:08:42.983Z
2021-05-21T15:08:42.983Z
RedGrittyBrick
<p>I'm making my own blockchain based currency for a school project and kind of hit a roadblock. I have a wallet class which initializes with zero coins. What prevents the user from just sending a transaction, if he doesn't own the spent coins. Bitcoin is anonymous, so it doesn't save the balance of each account, right? So you could just reprogram a wallet to not subtract the spent amount from your balance? How does Bitcoin prevent this? Thanks in advance.</p>

<blockchain><wallet><fraudproofs>
How does Bitcoin verify that a user owns the bitcoins he/she spent?
laust0rm
# How does Bitcoin verify that a user owns the bitcoins he/she spent?

(Asked by: username_0 on 2021-05-21)

I'm making my own blockchain based currency for a school project and kind of hit a roadblock. I have a wallet class which initializes with zero coins. What prevents the user from just sending a transaction, if he doesn't own the spent coins. Bitcoin is anonymous, so it doesn't save the balance of each account, right? So you could just reprogram a wallet to not subtract the spent amount from your balance? How does Bitcoin prevent this? Thanks in advance.

**Tags:** blockchain, wallet, fraudproofs


---

## 1 answers

### Answer by username_1 on 2021-05-21. Score: 2

Bitcoin doesn't really care about balances, accounts, people or ownership. It doesn't need to know about any of those things.

Read the above sentence again. It is true. It has many important implications.

Bitcoin is *cash*, not an account. There's no system that tells a pizza storekeeper how many $10 bills (banknotes) you have under your mattress. The pizza storekeeper doesn't care. They only care that the $10 bill you hand them is not fake.

They don't need your ID. They don't need your name. They don't care whether you don't have a bank account. They don't ask you who owns that $10 bill, because they don't care *who* paid for the pizza - only *that* it gets paid for at all.

Don't let the terminology confuse you. The bitcoin blockchain isn't a ledger that keeps track of balances. It is a transaction journal that records only half of a real-life transaction - the half where A gives B some Bitcoin money, not the half where B gives A a pizza.

The transaction has inputs and outputs. The inputs are "coins" that A is giving up and the outputs are typically a new "coin" that B is getting and a new "coin" that A gets back as change (since Pizzas rarely cost exactly $10).

A Bitcoin "coin" is really just an output amount from an earlier transaction that has not yet been spent in a subsequent transaction. It is an Unspent Transaction Output (a UTXO).

Bitcoin nodes just keep track of UTXOs. When a UTXO is spent, the U in its name no longer applies. Every node observing the spend removes that TXO from its list of UTXOs. So every node seeing a second spend of a TXO would know that TXO is now not a UTXO and reject that second spend as invalid.

If a wallet reports a false balance to its owner, no one is harmed but the owner. A fake balance does not enable you to spend money you don't have. Its like a leather wallet that has "$30" written on the outside but which only contains two $10 bills.

That's the difference between bank accounts and cash.

> **Comments:**
> **username_0**: Thanks, that really cleared things up. I didn't know about UTXOs and TXOs. Thanks for taking your time and helping me.  

---

