113 sats \ 2 replies \ @Murch 1 Oct 2023 \ parent \ on: Explain UTXOs in bitcoin to someone who doesn't understand bitcoin at all. bitcoin
It's a lot more like cash than it's like an IOU
I certainly defer to your knowledge. I hope I haven't spread misinformation.
If you have the time, can you help me understand? I'm a novice at bitcoin but experienced with ethereum.
In ethereum, accounts are stored on-chain with some associated data, including "balance". So they are like regular cash, all accounts have a balance.
And I thought that for bitcoin, this is not true, there is no place where the ledger contains: "owner of pubkey A has balance 1 btc", all that is recorded is transactions of the form "Transaction from owner of pubkey P: Whoever is the owner of pubkey Q is now delegated the ability to spend 1 BTC of what pubkey P was allowed".
So to check "how many BTC do I have?" you need to find all transactions that delegate spending to you, and sum it up.
I'm really interested and if you want to help me understand I appreciate it, I'll give you 5k sats for any attempt. (i learn by bribing people :))
reply
I’d say that Ethereum’s system behaves more like a bank account: you have a single account, any amount received or sent is added or deducted from that balance. When other network participants learn your address they can track your account balance. Transactions from an account are processed in a fixed order to ensure that an account cannot be overdrawn.
Bitcoin instead uses a UTXO-based model. Every transaction output is individually tracked by every full node. Unspent Transaction Outputs (UTXOs) can only be spent in full for exactly the amount assigned to them. Whoever can fulfill the conditions encoded in the output script can spent the funds. Bitcoin users generally use a new address for every payment they receive, which makes it impossible for other users to remotely assess a wallet balance. When you create a transaction, you specify exactly which UTXOs you are spending. This allows transactions to be processed in any order and makes transaction outcomes immutable. Bitcoin UTXOs are more like cash, you designate specific UTXOs that are used similar to how you may hand over a specific $20-bill and a specific $10-bill at the baker’s to pay $21. Since you have to spend UTXOs completely, in your Bitcoin transaction you’d add a change output to yourself to return the $9 change that you’d get from the baker. That’s where the analogy breaks down, though: in Bitcoin that would be a single UTXO, whereas the baker would probably hand you a $5-bill and four $1-bills.
Either way, when you get paid in Bitcoin, the entire network has a record of the funds that you own in the UTXO set. While the transaction is recorded in the blockchain, once the UTXO exists, it no longer matters how that UTXO came to be (except for how you identify the UTXO). As the holder of the corresponding private key, you are the only one that can fulfill the conditions of the output script encoded in your UTXO. You own that UTXO’s amount, just like you’d own a bill in your wallet. It’s not some sort of IOU. You can spend your coin as evidenced by its existence and the appropriate sign-off of the corresponding private key. And just like with bills in your wallet, nobody else can tell which ones are yours unless they get to see the content of the wallet.
reply