In 2017, when the Bitcoin spirit burst out of the bottle after years of dormancy, its pricesuddenly jumped sharply from 1,000 to nearly 20,000 dollars. Many people have rediscovered themselves as “professional crypto traders.”
Yes, you could make a lot of money in a short period of time. But let's face it — this "party" is over.
Even though people's blood was pumping with adrenaline, mostly because of money, it was actually technology that pushed things forward in the first place. And this technologyblockchaincan still contain a hugepotential. Perhaps now is the time for business developers, entrepreneurs and just interested people to join inspired blockchain followers and share their enthusiasm. But for such inspiration, first of all, you need a better understanding of how this technology works. Unfortunately, most of the explanations that exist today are either satiated with complex technical jargon, or are largely superficial and do not contain comprehensive information. None of them provide us with a clear and clear understanding of blockchain technology. So where do you start? Let me suggest you start right with this article. It will take ten to fifteen minutes of your time, but in return it will open the question of what is considered so revolutionary and fundamental in blockchain technology. Believe me, it will be worth the time spent. Enjoy reading!
What kind of thing is this blockchain?
First of all, blockchain (eng. “blockchain”, “block” - block, “chain” - chain) is a concept from the world of information technology, which is a method of storingdata. This data goes to the blockchain in the form of blocks,therefore, imagine blocks of digital data. Blocks communicate with each other like chain links, thereby making the data in them protected from changes. When a block is connected to other blocks, the data in it can never be changed again. This block will be publicly available in the same form in which it was originally added to the blockchain, if suddenly someone wants to see it again someday. This is very revolutionary, because it allows you to keep track of almost everything you can think of (here are a few examples: ownership, identity cards, cash balances, medical records), without the risk that someone could falsify these records. Suppose if I buy a house right now and add a photo of the property rights to it on the blockchain, I can now, at any time in the future, prove that at some point in time I owned the property rights to this property. No one can change this information after it has been added to the blockchain (well, let's be honest, in fact, this method exists, but this is quite advanced material, so I suggest that you read it later, for example, here and here). So, blockchain is one way to store data and protect it by making it immutable. Sounds great, doesn't it? But the main question, of course, is the following - how does it all work?
Step 1 — Transaction data
Ok let's start with that for exampleconsider the Bitcoin blockchain. It is the oldest existing blockchain. Each block in it consists of approximately 1 megabyte (MB) of data. At the time of this writing, the Bitcoin blockchain totaled about 525 thousand blocks, or in other words, that it contained approximately 525,000 MB of data. The data blocks in the Bitcoin blockchain consist exclusively of transactional data from operations with bitcoins. This is a huge recorded history of all transactions ever made with bicomines, right up to the very first transaction. In this article, we will assume that transaction data is stored in the blockchain, similar to the Bitcoin blockchain.
Step 2 — Attaching blocks to a chain (with hash)
Imagine a bunch of blocks with transaction data.
</p>In this figure, we see three blocks containingsome data of various transactions. So far, it seems, nothing special. These blocks can be compared with individual text documents, which simply describe which transactions took place and how this was reflected in the balances of specific accounts. “Document 1” will describe the very first completed transactions with a total data volume of up to 1 MB in chronological order, while subsequent transactions with a volume of 1 MB to 2 MB will be recorded in “Document 2”, and so on. These documents are precisely the same data blocks. Then the blocks are connected to each other (in other words - are connected in a chain). In order for such a connection to occur, each block receives a unique (digital) signature that exactly matches the data line in this block. If any changes occur inside a block, even if only one character changes, this block will receive a new digital signature. How it works? This is achieved by the method of data hashing, which we will consider in detail later in step 3.
Suppose that in block 1 twotransactions, transaction 1 and transaction 2. Imagine that the data of these transactions occupy 1 MB of disk space (in reality, of course, much more transactions can be recorded in 1 MB). This block now receives a digital signature for this particular data row. Let such a signature be, for example, “X32”. And this is how it will look:
</p>Remember that changing even one character inblock 1 will cause the assignment of a completely different signature to this block! The data from block 1 is then attached to block 2 by adding a digital signature of block 1 to the data of block 2. Now the signature of block 2 partially consists of the signature of block 1, since it is included in the data line in block 2. Here is what it looks like:
</p>Signatures bind blocks to each other, forming a chain of blocks from them. Let's imagine the picture of adding a new block - block 3 - to an existing block chain. It looks like this:
</p>Now imagine that the data in block 1 is changed. Assume that the transaction between Damien and George is forged, and now Damien allegedly sent George 500 bitcoins instead of 100. The data line in block 1 is now different, which means that this block will also receive a new signature. The digital signature “X32” no longer corresponds to the changed data in block 1. For example, let “W10” become a new signature. And here is what we have as a result:
</p>Signature "W10" no longer matches thatsignatures that were previously added to block 2. Blocks 1 and 2 are now considered unrelated to each other. For other users of the blockchain, this event is a signal that some data in block 1 has been changed. And since the blockchain should be unchanged, they reject this change by returning to the previous state of the blockchain, in which all the blocks were still connected to each other in a chain (the record where Damien sent 100 bitcoins to George). The only option in which a change in the blockchain can go unnoticed by anyone will be one in which all the blocks remain connected to each other. This means that in order for the change not to be detected, the new signature of block 1 must replace the old one in the data of block 2. But, if the data in block 2 changes, this will also entail a change in the signature of block 2. Suppose that the new signature of block 2 will be "PP4" instead of "9BZ". And what do we get in the end? And we get the following situation - blocks 2 and 3 will no longer be connected with each other!
</p>Anyone can read the contentsblocks in the blockchain. Thus, if it is assumed that a change in the blockchain should go unnoticed by all, all blocks must remain correctly connected to each other in a chain (otherwise people will be able to understand that something is wrong and some blocks are not properly connected ) This means that changes to one block will require the creation of a new signature for each block following it, and so on until the very end of the chain. In practice, this is almost impossible. In order to understand why this is almost impossible, you need to find out how signatures are created.
Step 3 — How a digital signature (hash) is created
So, let's imagine a block again -block 1. Only one single transaction is recorded in this block. Thomas sends 100 bitcoins to David. This particular data row now requires a digital signature. In the blockchain, such a signature is created using a cryptographic hash function. It is based on a very complex formula that takes any input line and converts it into a unique 64-bit output line. For example, you can insert the word “Jinglebells” into this online hash generator (there are other options for hashing algorithms, but we will use this for this specific example), and you will see that the result of the output conversion for this particular data string is the hash amount will be the following line:
761A7DD9CAFE34C7Cde6C1270E17F773025A61E511A56F700D415F0D3E199868
If you enter at least one character when entering,for example, adding a space, or changing the capital letter or adding a period, the result will be completely different. If you add a period at the end of this word and write “Jinglebells.”, You will get the following hash sum for the output of this particular line:
B9B324E2F987CDE8819C051327966DD4071ED72D998E0019981040958FEC291B
If you remove the point again, then we get exactly the same line as before:
761A7DD9CAFE34C7Cde6C1270E17F773025A61E511A56F700D415F0D3E199868
Cryptographic Hashing Algorithmthe hash function will always produce the same result until the input data changes. Therefore, when the input data changes, the result of the data processing will be different. The cryptographic hash function is used by the Bitcoin blockchain to create digital block signatures. In this case, the contents of the block are used as input data, and the corresponding digital signature is just the output. Let's take another look at block 1. Thomas sends 100 bitcoins to David.
</p>Suppose the data row of this block is as follows:
Block 1 Thomas -100 David +100
If you enter this data line into the hashing algorithm, then the output hash (signature) will look like this:
Bab5924FC47BBA57F4615230DDBC5675A81Ab29E2E0Ff85D0C0AD1C1ACA05Bff
This signature is then added to the data of block 2. Suppose now that David is transferring 100 Jimi bitcoins. The blockchain now looks like this:
</p>Block 2 data line looks like:
Block 2 David -100 Jimi +100 BAB5924FC47BBA57F4615230DDBC5675A81AB29E2E0FF85D0C0AD1C1ACA05BFF
If we enter this data into the hash generator, then the output will receive the following signature:
25D8BE2650D7BC095D3712B14136608E096F060E32CEC7322D22E82EA526A3E5
So we got a signature for block 2. A cryptographic hash function is used to create digital signatures for each unique block. There is a wide variety of hash functions, but the SHA-256 hash algorithm is used as a hash function in the Bitcoin blockchain. And how can these digital signatures prevent anyone from simply adding a new signature to each subsequent block after changing one of them (such a change will not be detected by anyone, but on the condition that all the blocks remain properly connected, and people just will not notice)? The answer lies in the fact that only hashes (signatures) are accepted by the blockchain that satisfy certain requirements of the blockchain itself. This is controlled by the mining process, the explanation of which is given in step 4.
Step 4 — When does a signature satisfy the requirements, and who signs blocks?
The fact is that the signature does not always matchrequirements. A block will be added to the blockchain only if its signature begins, for example, with a certain number of consecutive zeros. To illustrate this example, let's assume that only blocks whose signatures begin with at least ten zeros are eligible to be added to the blockchain. However, as explained in step 3, each row of data only has one unique hash associated with it. What if the block signature (hash) does not start with ten zeros? Well, in order to give a block a signature that satisfies the requirements of the blockchain, the block's data string must be changed repeatedly until the hash function produces a signature starting with ten zeros. Since the transaction data and its metadata (block number, timestamp, etc.) must remain unchanged, a small special piece of data is added to each block for the sole purpose of finding a suitable signature by changing it many times. This piece of block data is called a nonce, or one-time code. Nonce is a completely random string fromnumbers(note:Other symbols are also shown in the pictures, but the one-time code can only consist of numbers). To summarize the explanation just given, the block now contains the following information: 1) transaction data, 2) the signature of the previous block, and 3) a nonce. The process of repeatedly changing the one-time code and hashing the block data to select a signature that meets the appropriate criteria is calledmining, and those involved in mining –miners. Miners consume electricity in the form ofprocessing power, constantly changing the composition of the block (nonce) and hashing it until they find the appropriate output (signature). The more computing power they have at their disposal, the faster they will be able to hash different block compositions, and the more likely they will find a suitable signature faster than others. This is a peculiar trial and error method or “scientific poking method”. The above process can be illustrated as follows:
Any user on the blockchain network can participate in this process by downloading and running the appropriate mining software in this particular blockchain.
Upon completion of all necessary preparations,the user simply uses his computing power to try to solve nonce for the block. Here is an example of a transaction block that has recently been added to the Bitcoin blockchain - block 521477:
As you can see, the hash (signature) of this blockand the hash of the previous block both start with a few zeros. It is not easy to find such a hash; for this it will take a lot of computational power and time or a ton of luck. Yes, sometimes it happens that the miner is incredibly lucky, and he finds a suitable signature using very small computing power and in a matter of minutes. An extremely rare example of such an event occurred recently with block 523034. Some small miner with weak capacities found the required signature in a very short time, while all the other miners in aggregate had computing power of 7 trillion times more. For comparison, the odds of winning the Powerball jackpot are one in 292 million. This means that winning the Powerball lottery jackpot is 24,000 times easier than it was for this miner to win the hash competition against all other network members. And you are talking about the number of some zeros. In any case, it is important to learn from this chapter that it is very difficult to find a suitable signature for a block.
Step 5 — How does this contribute to the integrity of the blockchain?
As described above in step 3, changing the blockwill disconnect it from the rest of the blocks in the chain. In order for a modified block to be accepted by the rest of the network, it must be reattached to subsequent blocks. Do you understand where this leads? As explained earlier, this will require that each block following the changed one receive a new signature. And this signature must comply with the requirements of the blockchain! Providing all subsequent blocks with new signatures is a very expensive and time-consuming process, although it does not seem impossible. In any case, this is still considered impossible, and here's why:
Let's assume that one dishonest minerchanged some block of transactions and is now trying to find new signatures for subsequent blocks so that the rest of the network accepts the change he made. For him, the problem is that the rest of the blockchain network participants are also calculating new signatures for new blocks at the same time. A rogue miner will also be forced to guess new hashes for these blocks as they are added to the end of the chain. After all, he will have to prevent the chain from breaking and maintainall blocksconnected with each other, including constantlynew blocks being added. If the miner does not have computing power that exceeds that of the rest of the network combined, he will never catch up with the rest of the network in searching for signatures.
</p>Millions of users are engaged in mining inBitcoin blockchain, as a result of which it can be assumed that no single attacker or certain organization in the network will ever have more computing power than the combined power of all other participants in the network. In other words, the network will never accept any changes to the blockchain while making the blockchainunshakable. After the data has been added toblockchain, they can never be changed. However, there is one exception. But what if an attacker has more computing power than the rest of the network combined? Yes, theoretically this is possible. This is called a “51% attack” (more details about this vulnerability can be found in this article and here), and in the past it took place on various blockchains. In reality, an attack of 51% on the Bitcoin blockchain will be much more expensive than the expected profit from such an attack. Such an operation will require not only a huge amount of hardware, cooling equipment and space to accommodate all this computing power, but also be fraught with the risk of prosecution, and, more importantly, it can radically harm the ecosystem of the blockchain itself, which will significantly reduce the potential profits due to a sharp drop in Bitcoin prices. An attempt to conduct a 51% attack is comparable in practice to a battle against all other users of this blockchain alone. This is also the reason that the more users participate in the mining process, the more secure the blockchain becomes.
Congratulations on being here! I hope you now understand why the (large) blockchain is considered unshakable. However, one important question is now brewing - how is it prevented miners from adding damaged blocks to the blockchain (for example, falsified transaction data)? This is blocked at a technical level; more about transactions in the blockchain can be found in this article.
Step 6 — How is blockchain regulated? Who makes the rules?
Bitcoin blockchain follows a democratic modelmanagement and therefore updates its transaction history record (and therefore bitcoin balances) in accordance with what most of its users consider to be true. The blockchain protocol does this automatically, always following the records of the longest chain of blocks available, as it assumes that this chain is represented by the majority. In the end, the computing power of the majority is required to create the longest version of the blockchain. By the same principle, the changed block is automatically rejected by the majority of network participants. Most of the network automatically rejects the changed block because it is no longer associated with the longest chain in the blockchain.
On Bitcoin blockchain, the entire transaction history andwallet balances are publicly available information (blockchain.info). Anyone can view any wallet or transaction that has ever occurred up to the very first transaction completed (January 3, 2009). Although wallet balances can be verified by anyone in the public domain, the owners of these wallets remain largely anonymous. Here is an example of a wallet still containing 69,000 bitcoins, which amounted to about $ 500 million at the time of writing. The last time it was used in April 2015, but since then no activity has been observed with it.
Final step, step 7 — What about cryptocurrencies?
Cryptocurrencies are essentially a modified form ofBitcoin. Most cryptocurrencies are built on their own blockchain protocols, which may have different rules than the Bitcoin blockchain. Bitcoin was intended to becurrencythat is, it must explicitly functionin the role of money. Monero is a cryptocurrency with the same function, but some additional rules are implemented in its blockchain protocol that make it a more confidential currency (transactions in the Monero blockchain are much more difficult to track). Cryptocurrencies, however, can be assigned any form of value, depending on their issuer. They can also be called "tokens." Such tokens can provide their owners with the right to “something”, starting from a game license or access to social networks and ending with access to resources such as electricity or water, in general, there is nothing to list. A cryptocurrency token can be assigned a value of absolutely any kind. All transactions with cryptocurrencies are recorded on various blockchains and they can be exchanged online through cryptocurrency exchanges and p2p exchange sites, such as, for example, HodlHodl. This is new internet money. A good example of a sector of the economy that they have a significant impact on is stock markets. There is a high probability that in the future, shares of companies and other property rights will be taken into account in the form of tokens in the blockchain. But the use of blockchains is not limited to registering material values in the form of tokens. Blockchains also have the ability to keep records securely, such as medical records, ID cards, historical information, tax records, and much, much more. That's why the technology is so voluminous, and I have not even mentioned decentralization (another of the most significant aspects of the blockchain).
</p>