Our Unspent Transaction Output Explained…

BTCBAM Official
4 min readAug 9, 2021

--

BTCBAM’S UTXO

When you think about how your bank does the accounting for your bank account it is pretty intuitive. You hold a certain amount of money in your account which has an account number. If you receive money the amount is added to your balance. If you spend money, then the amount you spend gets subtracted from your balance. With cryptocurrencies, accounting works a little differently.

The blockchain does not create an “account” for you to maintain a balance. There is no final balance stored on the ledger. The blockchain only stores individual transactions and to check your balance, there is an additional step involved. Your wallet does this automatically whenever you open it. What happens in the background is that your wallet scans the ledger for all transactions to your address(es) and adds them up.

What Is a UTXO?

An unspent transaction output (UTXO) is a discrete piece of bitcoin. UTXOs can be combined and split up to make payments in any denomination.

UTXOs can be likened to physical coins, in that they must be spent discretely. If you want to spend 5 cents, you cannot spend half of a dime. Instead, you must spend the entire dime and receive a nickel as change. Unlike physical coins, however, UTXOs do not come in standardized denominations. A UTXO can hold any amount of bitcoin.

As its name suggests, a UTXO is an output of a Bitcoin transaction. An output exists as a UTXO until it is used as an input in a subsequent transaction, at which point it is no longer unspent.

The set of all existing UTXOs at a given point in time is called the UTXO set. Bitcoin nodes keep track of the UTXO set in order to determine exactly which coins exist and who can spend them. This system enables Bitcoin to solve the Double Spend Problem, which had plagued previous attempts at a digital currency.

How a UTXO Works

UTXO transactions sound complicated, but they really are fairly simple. UTXO or unspent transaction outputs are used in cryptocurrency transactions. These are the transactions that are left unspent after someone completes a transaction, similar to the change someone receives after conducting a cash transaction at the store.

Here’s how it works. A UTXO database is used to store change from cryptocurrency transactions. This database or ledger is initially set to empty or zero. As transactions multiply, the database becomes populated with change records from various transactions. When a transaction is completed and there are outputs that aren’t spent, they are deposited back into a database as inputs that can be used at a later date for a new transaction. Cryptocurrency transactions — such as those used for bitcoins — are similar to cashier checks. You cannot exchange them for custom amounts and must spend the entire amount stored in that data byte.

But cryptocurrencies like bitcoin are also unique in that transactions can be conducted using fractions of the cryptocurrency. This means spending does not take place using a single data byte. Instead, multiple fractions of bitcoin are retrieved by the algorithm to fulfill a spending request. For example, a purchase worth 1 bitcoin may retrieve 0.6 BTC from one byte and 0.4 BTC from another. Change from each of these fractions is then sent to the UTXO database to be spent at a later date.

How Are UTXOs Created?

UTXOs are created through the consumption of existing UTXOs. Every Bitcoin transaction is composed of inputs and outputs. Inputs consume an existing UTXO, while outputs create a new UTXO. So, if old UTXOs are destroyed to create new UTXOs, how are UTXOs created in the first place?

Coinbase Transactions

A coinbase transaction is a special type of transaction which creates new bitcoin as a reward for the miner of a block. Since new bitcoin is being created, the coinbase transaction has no inputs and one or more outputs. Like all normal outputs, the output of a coinbase transaction is a new UTXO.

Remember: Every UTXO’s history can be traced back to one or more outputs of coinbase transactions.

UTXO EXAMPLE

For example, a purchase worth 50 BTCBAM may retrieve 0.5 BTCBAM from one byte and 49.5 BTCBAM from another. Change from each of these fractions is then sent to the UTXO database to be spent at a later date.

To sum up everything that has been stated so far; n the UTXO model, the total inputs must equal or exceed the total outputs. This is one of the preliminary checks validators run to verify whether a transaction is valid.

UTXO thrives in a decentralized system because it can check for double-spending in a computationally simple manner.

--

--

BTCBAM Official
BTCBAM Official

Written by BTCBAM Official

BTCBAM: a web3 finance & investment ecosystem for diverse opportunities & financial growth. Trustworthy platform for all investors.

No responses yet