There are several methods in which records are maintained in networks. One of the basic methods is the Account/Balance model that you saw previously wherein balance related to every account is maintained. Bitcoin uses a different mechanism for record keeping. Let’s learn about that as part of the next video.
Bitcoin uses the concept of unspent transaction output (UTXO) for record keeping. Every transaction in a bitcoin is based upon an unspent transaction output (UTXO). Whenever a transaction is performed in bitcoin, it primarily consumes existing UTXOs called as inputs and creates new UTXOs called outputs. The outputs generated from a transaction can be utilized further in the network by the node.
There are two ways to get the UTXO in a bitcoin network: Either from another node in the network or as a network reward. Let’s analyze a sample transaction in the network and see how the UTXO model works.
Important:
Each UTXO corresponds to a particular addreess i.e a particular public key. The corresponding private key is used to unlock and spend that UTXO. This private key corresponds to the owner of the UTXO which is required to unlock and spend that UTXO. Once spent, that UTXO is again locked with the public key of the new owner. Now since it is locked with the public key of the new owner, it requires the private key of the new owner to be unlocked and spent again.
Let's learn about something new called Transaction fee. Jeevan explains it in the video below.
So transaction fee is the fee paid to the miner over and above the reward the miner gets for mining the block.