Many who heard about Bitcoin, Ethereum, Monero or any other cryptocurrency at the same time get acquainted with the term “Blockchain”. You can often hear that bitcoin is the future of currency, and more and more companies start using this technology in their activities, etc. However, only few can really understand what this magic word “Blockchain” means.
The structure of blockchain
As the name of the technology indicates, a blockchain is a kind of “node” comprised of many blocks. If we read literally, this word reads as the chain of blocks.
Each currency has a slightly different block structure but many characteristics coincide. The block may be characterised by basic information including size in bytes, header, number of transactions per block (integers), and transactions themselves.
The block header
The information consists of the last block hash, which is information of the latest block encrypted using special “one-way” cryptographic function to ensure that nobody can change the previous block, the block transaction hash, time and solving of computational problems (we will talk about it later).
Even if you are not interested in the technical side, you should know about hashes. In computer science, there are formulas that allow conversion of data into hashes, for example MD5 or SHA-256. These formulas are specific in the sense that having a particular value such as block bytes, it is easy to carry out encryption , however, it is extremely difficult to carry out decryption. The aim is to make decryption impossible unless you try all the possible combinations, so called brute-force attack.
Thus, if the block is encrypted, and that block includes the cipher of the pre-existing block (which contains the cipher of the previous block, and so on), it is nearly impossible to change the transactions of the pre-existing block becomes almost impossible (there is such a thing as 51% attack, see further explanations).
Regarding the solving of computational problems – it may seem strange and even mysterious, nevertheless it is one of the most complex tasks, complexity of which is much dependent upon the cryptocurrency. Namely for solving of the computational problems all the computing power of miners is used. For example, in case of Bitcoin – for the “dual” SHA-256 function to be decoded. In order to solve the computational problem as soon as possible, the miners create mining pools thus “sharing” the task.
Block of transactions
Each block contains the main thing – the transactions that occurred during the creation of the block. By the way, it is interesting that the first reward transaction is false in the sense that it comes to the miner “from nowhere” (we describe it in more detail in the “Digging” section). If we try to understand the whole structure of these transactions, it may be compared to the General Ledger.
Blockchain and the General Ledger
To find out how the Blockchain works, it’s important to understand the essence, and for better understanding the example of General Ledger may be used. It provides the structure which allows encompassing all transactions, and ultimately a balance is calculated.
The Blockchain reminds of the General Ledger – in order to find out what is the user’s account balance (more precisely, the cryptocurrency wallet balance), we need to know structure of the entire currency node, also known as the chain, including all the transactions (transfers) that have ever occurred. To make it easier to understand let’s take an example.
Example of the transactions on the blockchain
Let’s imagine two people, the first of whom has 30 units of cryptocurrency, and the second – 10. If the first one has transferred 15 units of virtual currency to the second, the balance of these two people will be 15 and 25 respectively. This is exactly the transaction record that will be encrypted in the block of blockchain.
Occurrence of the transactions
Now that we already have an idea how transactions are secured in this technology, a natural question arises – how they occur.
Everything is quite simple – you need to have a wallet (more precisely – a wallet address) and a “private key”. The wallet address is given entirely randomly, for example, when a Bitcoin wallet is created, and presents just a sequence of numbers/letters. The “private key” is a number made of many different digits (which varies depending on the technology) and is in most cases stored in the wallet itself. This is precisely why the wallet is encrypted – the private key is protected.
So when we have both a wallet and a private key, we can sign the particular transaction and announce it on the network. All this takes place by means of P2P (peer to peer) technology where the transaction is announced to the random computers of the network, and they transfer it further. The same technology works for downloading of torrents. These transactions are selected by miners and included into blocks – see what we wrote about the blocks of transactions in the paragraphs above.
Often we can hear how Blockchain technology keeps data secure, however here we should write “BUT” in capital letters. Although the technology concept itself seems to be flawless, it still has really serious drawbacks.
The most important security element is precisely the information available to each block about the pre-existing blocks (the header of block contains the pre-existing cipher of the block, and the latter includes the cipher of the previous block, etc.). Because of this kind of encryption – again depending on the different implementation of Blockchain – confirmation of a few blocks is required for confirmation of the transaction. For example, the Bitcoin transaction is executed when there are 10 block approvals, and replacement of the old block becomes almost impossible since replacement of the subsequent would be required.
50% + 1 attack
The main problem that all cryptocurrencies can encounter is the 50% + 1 attack. Since Blockchain is fully decentralized, i.e. does not have one true copy of all blocks (it is for all users), if 50% and one more user (most) report that it is different (for example, someone has 500 BTCs), it would be true because there is no real truth.
Actually, the 50% + 1 attack on Bitcoin, Ethereum or other most popular Blockchain technologies would not be a big issue because of the huge number of users and miners. But for the new currencies that are not so popular it may be a huge challenge.
Miners are the main factor for Blockchain to function. After all, if no one verifies transactions – there will be none of them.
The miners using their own calculating devices such as phones, computers or even special equipment approve transactions. In order to retain the miners, they are given a reward, namely the first transaction in the block wherein the miner transfers the currency to himself/herself from nowhere.
In order to control the cryptocurrency inflation, it has been programmed that over time the mining rewards are decreasing and it results in less “new” money. The aim is to reduce the rewards to a minimum or totally withdraw in the future. That is why for each order a transfer fee may be established (in many cases it is not). The miners also receive these fees.
If in less popular currencies it is still possible to make a transfer and without fees, however, in the big ones, you will not succeed. Due to the huge number of transactions (every Blockchain adaptation has its block size limit), not all orders are executed. As a result, an ever-increasing fee is required to execute the order (because the miners confirm the “most valuable” transactions). This is one of the biggest problems as, for example, Bitcoin transactions become quite expensive.
In order to count down (extract/find, and alike) the block, a lot of computing power is needed. The greater the power, the greater is the chance that you will succeed.
To obtain too much resource is very expensive and risky. That is why people join into the groups (digging pools), share calculations and “combine” their computing power. When calculations are made on local machines (e.g. on PCs), the calculated results are sent to the pool (so-called shares are sent) where they are combined and inscribed into the Blockchain network as from the single miner (since all the power is “united”). The received reward is split depending on the deposit.
Of course, pools leave some percentage (for example one) for their own needs since they handle hundreds of inquiries from all users. In most cases, each member of the pool is paid reward under any system. Currently, the two most popular systems are PPLNS and PPS.
Pay Per Last N Shares (PPLNS )
Useful for those who mine for more than 24 hours. They are charged not for each share sent to the pool, but for a deposit, let’s say, within 30 minutes. Most often, when mining by this method, also lower fees are required thus encouraging long-term engagement in mining.
Pay Per share (PPS)
In many cases, it is beneficial only to those who carry-out mining for a very short time. They pay for each share that was sent to the pool, and for this often higher fees are charged.
Adoption of Blockchain technologies
The first and most popular, of course, is Bitcoin, but it should be mentioned that Blockchain technology can be used not only for currencies. Blockchain can be used to store data that are transferred as a property and cannot be changed. Currently, many tests and applications for this technology – from identification cards, aviation records to national money or cryptocurrencies – are taking place.