Homework on Bitcoin Transactions and UTXO - Questions
Describe what Unspent Transaction Outputs (UTXO) are.
Money you receive goes from being someone else’s output (a spent transaction) to being your input, which is an unspent transaction until you pass the funds on to someone else again.
Your wallet calculates your balance based on the total of UTXOs associated with your bitcoin address (and all of the bitcoin addresses associated with your private key) - there is no balance on the blockchain itself, though.
This constant re-contextualisation of the funds from one wallet address to another, from input to output, creates a traceable flowchart of transactions, which can be observed on the blockchain via a block explorer application.
What would happen if you don’t have any single UTXO that is large enough to cover for your transaction?
Your wallet chooses a combination of smaller UTXOs that add up to the required amount, whilst also factoring in the fee for the transaction - this goes to the miner who adds your transaction to the blockchain, as a reward for processing that particular block.
If you don’t have sufficient funds in your wallet to cover the output in combination with the transaction fee, or the receipt of funds to your address has not yet been verified with enough confirmations by nodes on the blockchain network, the transaction will fail.
How would a bitcoin wallet specify the transaction fee when creating a transaction?
The mining process consumes a significant amount of electricity to solve the cryptographic puzzle that completes a block of transactions, so the miner needs to at least breakeven to cover the running cost of their rig, otherwise, they will be operating at a loss.
The transaction fee is paid to the miner to at least compensate (but ideally reward) them for processing that transaction. The reason that paying a higher fee for a transaction speeds up the process, is because there is greater incentive due to the higher reward associated with mining that particular transaction.
Without profiting from the mining process, miners will be dis-incentivised, and may shut down their rigs to avoid substantial financial losses - if this were to happen on a large scale, the integrity and efficiency of the blockchain network would be compromised, and even become vulnerable to security breaches.
How could you use the notion of transaction inputs and outputs to increase privacy in your transaction?
Despite public blockchains being open ledgers, wherein you can track and trace funds along a clear path of connected inputs and outputs, it is impossible to know whether any two addresses involved in a transaction are owned by the same individual - someone could be transferring funds to another account of theirs, perhaps to a different wallet, or from their wallet to a decentralised exchange, and in most cases, the only information available is the bitcoin address.
Without KYC (know your customer), and also in the case of owning your private keys (as opposed to interacting with them via a third party), there is no identity information intrinsically associated with a bitcoin address, so you can transact anonymously, as long as the process is peer-to-peer.