Blockchain Education: How Transactions Work On The Bitcoin Network
Whenever the word “blockchain” is mentioned, most people base their thinking on its rudimentary functions. Aside from being a channel for data distribution, the blockchain can function as an entity for building global structures.
Note, data in the above context refers to “information in its raw form” however, data as “value” is not often discussed when it comes to blockchain.
Data as value - Explained
Data is pieces of information that when coming together they can either make or break, it all depends on if the output qualifies as “value” or as a “void and useless”.
For example, when one attempts to make a transaction on the blockchain, there are two possible occurrences; one is the transaction being successful, and the other is failing. In order for the blockchain to even attempt running the checks to bring an associated output, a command has to be made.
These commands are pieces of information that instruct a pre-written program to run and execute. When people discuss blockchain, narrow thinking is observed as they do not precisely factor in all that happens on the backend, to an extent, it is understood that not everybody should care about this, but how else do you understand what a system is capable of if not learning the backend operations?
Using Bitcoin as a case study, it’s safe to say that this network is like a cult, there are rules that have to be strictly followed for transactions to be recorded on the chain.
UTXO - AUTHORISATION - EXECUTION
Although not many people understand why bitcoin is highly praised, the thing is, bitcoin solves “double spending” problems, it solves account security flaws and it solves value distribution flaws by integrating a fair model of execution(consensus).
These are the things that make Bitcoin great and as you expect, it is the building blocks of blockchain technology, upon which new technologies enhance to meet specific audiences and offer specific functionalities like smart contracts.
In detail, UTXO is an acronym for “unspent transaction output” and it’s something many do not seem to know about, thus they fail to understand why blockchain is truly powerful.
UTXO is a way of identifying the availability of assets in an account, when you look at the banking system, there is a poor way of determining who owns what at what point as the contents of an account do not really translate to value but numbers on screens. But with the bitcoin blockchain, you can tell who owns what because the blockchain handles the flow of data across the network differently.
Let’s say I mined 50 BTC, typically this value has no prior location other than the block it was created in, it’s freshly minted and what actually links it to other assets on the network is the block it was created.
Related: A comprehensive guide to bitcoin mining
That said, if I decide to send 25 BTC to John for example, what people believe happens is that 25 BTC just leaves my address and goes to John, but no, there are different layers to how value moves.
First of all, 25 BTC is not the amount that leaves my address, what leaves my address is actually the entire piece, 50 BTC, surprised? every transaction has an input and output, the input references the amount I have and want to spend from my address while the output points at two things, the first is the recipient and the second is the “change”.
To understand how this is all unique coming together, you must know that an address on a bitcoin network isn’t like a bank account, if an address has received a total of 500 BTC from 5 people in 5 different transactions, the blockchain does not see it as 500 in one piece, but it sees 100 UTXO of BTC in 5 places, so the network is in theory populated with UTXOs associated with different addresses.
So when I send 25 BTC to John, I am actually unlocking the entire sum I have in my address which is 50 BTC that I mined, in one transaction, take note! The only reason the whole sum is leaving is that the other half is up to the amount I’m about to spend, thus it covers the charges and is able to create an output. Assuming I had 100 BTC in my address received in two different transactions, in an attempt to spend 25, only 50 BTC would be unlocked likewise because it adds up to create a UTXO for me and the recipient without breaking.
What do I mean? First, you need to understand that a UTXO cannot be broken, meaning that if a previously recorded UTXO was 50 BTC, in any transaction made in the future, all 50 BTC must move to create a new UTXO. In a situation where I have 100 BTC, received in two transactions ( 50-50), if I decide to send 55 BTC to someone, all 100 BTC must move to create a new UTXO, it cannot be broken in let's say 60 BTC just to cover the amount am spending and return a change minus the transaction fee.
Much like how I can’t cut a 5-dollar bill into $4.5 to pay for a $4.4 item, I have to give out the whole sum($5) and get my change.
So in essence, the blockchain does this in other to perfectly keep track of all amounts owned by an address, because each time I spend and receive change(UTXO), two forms of data are recorded on-chain; the fact that I spent a specific amount and the amount I have left.
This ensures that I can’t spend the same bitcoin twice, given that the previously recorded UTXO(which in this context is the output locking 50 BTC to my addresses from mining) has been scattered into more UTXOs, meaning I can’t try to spend 50 BTC again as I have less.
What of situations where you’re spending the entire piece?
The blockchain typically records a new owner of the UTXO being 50 BTC while recording your address to have 0 UTXO. Your address is referenced in the block this transaction was made, so it’s easy to trace the origins of assets given the technology.
Next Up, we’ll discuss “Authorisation and How it prevents miners from stealing your bitcoin”.
Thanks for reading, feel free to ask questions below.