Transaction. 1. Types Of Transactions And Their Main Components
Blockchain technology is based on several fundamental principles. The first one is the blockchain structure itself with all its components and their interconnections. As it goes from the name, blockchain is a sequence of blocks. All blocks are composed of numerous transactions. Each of them is considered to be a minimal action blockchain users can perform with their assets. Here, we will describe the very basic concepts of Bitcoin transactions.
As for a miner, there are two types of transactions: coinbase and common. A coinbase transaction is always present in the block and is placed in the very beginning. Such transaction has a single purpose by default, which is to reward a miner for closing a new block. However, in some cases miners can add other functions to this transaction.
It is a way more simple for a transaction receiver. Each simple transaction on a blockchain shows “where from”, “where to” and “how many” assets should be transferred. Such a format is supported by the majority of money protocols implementations on blockchains. On the other hand, even ancestral protocols on similar blockchains might be different.
As a rule, this difference involves additional parameters of assets transfering. In the Bitcoin blockchain, such parameters are scripts (keys) that are present inside of each transaction.
A Bitcoin script is a small instruction that defines the process of transaction parameters verification. Basically, it checks whether a proposed open key corresponds with a secret key to avoid assets transfer by mistake. The language used in a script allows implementing the verification of other parameters. This language does not permit any cycles and repeatings but available commands are enough to write relatively complex conditions. Such a correctly formulated script can be considered as a predecessor of smart contracts.
Each transaction starts with the number of a version key. Then goes the transactions input number, followed by inputs themselves. Each input is a reference to the previously approved transaction that brings some assets to the wallet address. Each input corresponds to a single output of a previously performed transaction that has associated a certain amount of a cryptocurrency with the wallet. The entire set of inputs is confirmed using a hash code and an open key at the time the transaction is distributed over the network.
Once all inputs are listed, outputs enter the stage. First of all, their quantity is specified. After that follows a set of addresses to which funds must be sent. Each output gets a certain amount of money to be transferred. The sum of all funds on inputs must be higher or equal to the sum on all outputs. If there is a difference between these values, a miner will receive it once the next block is closed. The difference plays a role of a transaction fee.
The timestamp of a transaction, also known as a block height, is specified as the last one in the list. This field defines the moment when the transaction can be placed in the block. This option allows delaying the time of transaction approval.
Even though the structure of a blockchain transaction seems complex, this is the only way the network participants can transfer funds to each other. Fortunately, users do not have to go into the details of the concept of inputs and their connection with outputs. Present-day crypto wallets can perform all the technical calculations instead of a person. Still, any interested network member can master the assets accounting method and understand it thoroughly.