General overview
A block is a data structure within the blockchain database where transaction information has been permanently recorded. It records some or all of recent transactions not yet validated by network participants, once these are verified then it becomes closed and creates another one for new ones to enter into the validation process.
Functionality of Blocks
The blockchain is a digital recording of transactions that occupies very little space and includes many different pieces. The blocks that make up each transaction are like pages in a ledger, with the head (block header) and body acting as two different parts.
Header Components
- Version number of software
- Hash of the previous block
- Root hash of Merkle Tree
- Timestamp
- Goal of current difficulty
- The Nonce (variable incremented by proof of work)
Body Components
Every transaction that’s confirmed with a block is stored in the body. When you verify and validate input, this includes checking its sender has enough money to spend as well—it can easily be read from blockchain data because each miner always looks at past blocks before deciding which transactions go into their own little chunks of code called “blocks.”
Merkle Tree
The transactions in a block are not just listed, but they’re also organized into what’s called Merkle trees.
The Merkle Tree is a way to represent information in its most compact form. It takes the data itself and hashes it, then merges these hashed versions together into one single tree-like structure called “the root hash”. This represents all leaves (individual transactions) with their branches which are combinations of lower-level leaf nodes created by pairing off individual children’s transactions with parents’ corresponding grandchildrens’, etc. until they reach up through every generation possible – including grandparents!
The root hash is quick and easy to create, as long as all branches are known. We remember that a function works clearly in one direction but cannot be broken down into other directions or outputs anything on an input data stream without knowing its contents beforehand. If you have knowledge of only the Root Hash value, it’s impossible for anyone else who doesn’t know what transactions may occur after this point because there would always be uncertainty when trying to figure out which ones these could potentially come from based on their respective inputs.
The root hash is not enough on its own, and the rest of a block must be saved. This means that miners can validate any time by hashing information in again with the same function as before- they always get identical results for given input data thus providing an easy way to check if both parties are working at similar speeds or not (and there’s no need do extra work).
Blocks and Mining
Bitcoins are created through Bitcoin mining. The term mining is used in this context as an analogy for the mining of gold. Bitcoins already exist and only need to be found, just like gold. Mining is a complex matter and is primarily there to control the monetary growth of Bitcoin and is necessary for the common accounting and its verification. As the network participants jointly manage the accounting in parallel and reconcile it with each other, decentralized accounting is ensured. All Bitcoin transactions are added there in the form of blocks. The blocks build on each other and, in addition to the transaction, also contain a hash value of the preceding block. The resulting concatenation results in the blockchain.
A hash is the result of a complex mathematical task. This is easily reproducible but not reversible. A miner calculates this task and whenever such a number is found, a block is created. This block is then sent to all other network participants. With each calculated block, not only the transactions of the last 10 minutes but also all previously calculated blocks, i.e. all transactions ever made, are reconfirmed (in the case of Bitcoin, all Bitcoin transactions).
The so-called difficulty regulates the creation time of the blocks, which should always be 10 minutes, regardless of the number of miners and the available computing capacity. If there were no adjustable difficulty, there would be fluctuations in the calculation time of a block depending on the number of participating computers. An adjustment of the Difficulty happens every 2016 blocks.
However, mining is not only used for posting transactions and confirming them, but also for the problem of Byzantine generals, which is well known in science. This is solved by the miners through the proof of work procedure. But more about this in dedicated articles. Mining is much more complex and can be described in more detail and will only be mentioned in this article to the extent that the connection can be recognized (more details in article mining). Blocks and mining are in strong context to each other and can not be considered completely separately.
The reward for the work of a miner is credited for each found (calculated) block in the form of bitcoins. The number is defined in the Bitcoin protocol and is halved after 210 000 blocks see also the entry Bitcoin Halving.The block reward is not only a reward for the work but also a regulator of the money supply and its growth.In addition, the miner also receives transaction fees for each block found. These are flexible, but affect the speed with which the transaction is confirmed by the network. The transaction fees are defined by the Bitcoin sender. However, they can also be omitted.