HomeHow ToHow Blockchain Technology Works. A Beginner's Guide

How Blockchain Technology Works. A Beginner's Guide

Everyone has heard of Bitcoin and Blockchain but perhaps they don't know exactly what they are and how they work. With this article we will try to enlighten you on the above concepts.

Blockchain

First of all, let's make something understandable from the beginning, which may confuse many. Bitcoin is not Blockchain , nor is it the other way around. They are two different things. Bitcoin is a digital currency based on Blockchain technology.

So you guessed it right, Blockchain is a technology, a digital method, a way of recording data, an entire philosophy if you will, which when it appeared almost changed the way of thinking in many human activities. And as you may have already heard, Bitcoin may disappear, but Blockchain never will. It came and will stay for a very long time. Let's see.

What is Blockchain?

Blockchain is literally a digital ledger that is almost impossible to hack. Although it can be applied to many human activities, today we will look at it as an example in financial transactions, since it first appeared in the digital currency Bitcoin.

About History
It first appeared in January 2009 by someone or a group called Satoshi Nakamoto. It is still unknown today who or what group is behind this name.

What exactly does it do?

Let's imagine that you are in Athens and you want to send money to your friend George, who is in Crete. To understand our example, let's go back in time a little and imagine that we are in 2008. There was no Bitcoin and neither were digital transactions. So you walk to your bank and tell the teller to take money from my passbook and send George in Crete 100 euros.

The cashier checks if you have 100 euros in your possession and if he finds them, he sends an order to have them removed from you and transferred to George's bank account. Then you call George and he happily walks to his bank to collect 99.50 euros. Of course, the bank also charges a 0.50 euro fee for its effort. But don't be fooled. The 0.50 euro is not the bank's real profit. This is probably the least.

The bank benefits from having a logbook that records the entire transaction. That on February 31st, so-and-so sent so-and-so 100 euros. It did not physically send the 100 euros to George, but simply recorded the transaction and instructed its branch or another bank in Crete to pay the money to George. This means that our entire financial system is based on 5-10 banks, which we trust to manage and keep a logbook of transactions.

And if you are wondering what the problem is, we tell you that banks act as intermediaries in a transaction and with the logic that they are very limited in number, it makes us deeply dependent on them. Wouldn't it be better if we could carry out our transactions without intermediaries, like banks? So here is what Satoshi Nakamoto thought when he discovered Blockchain.

First of all, Blockchain needs more than 3 people to work. Let's do an example with 5 people. These 5 decide to make a separate currency and some transactions with it. They realize that for the new currency to stand on its own feet they will have to monitor the flow of funds and one person – let's call him George – decided to keep a list of all actions in a diary. The diary is empty at the beginning but on the 1st day the following transactions were recorded:

  • a. Costas gives Manolis 100 coins
  • b. Manolis gives George 150 coins
  • c. George gives Dimitri 50 coins
  • d. Dimitris gives Maria 20 coins

One of the five, let's say Dimitris, thinking cunningly, decides to steal and secretly goes to George's diary and makes some change:

  • a. Costas gives Manolis 100 coins
  • b. The Manolis  Dimitris gives George 150 coins
  • c. George gives Dimitri 50 coins
  • d. Dimitris gives Maria 20 coins

Hash function

George noticed that someone had tampered with his diary and decided to stop it. He found a program called Hash that converts text into a set of numbers and letters like in the table below.

How Blockchain Technology Works. A Beginner's Guide

A hash is a series of numbers and letters generated by a function. A hash function is a mathematical function that takes a variable and random number of characters and converts it into a string with a fixed number of characters. Even a small change in the original string creates a completely new hash. In short, the hash function accepts a number or a word or mixed letters with numbers or a sentence or an entire text and as a result produces a fixed-length set of numbers and characters. The reverse mathematical solution is not possible. That is, if someone knows the hash, they cannot find, or know the original text. The hash function is one-way, from the text to the hash.

Happy to have found a solution to his problem, George entered a hash after each entry that represented that entry. The new calendar now looked like this:

  • a. Costas gives Manolis 100 coins
    29f3e7d933dfa9aa6f28b56e2676197d
  • b. Manolis gives George 150 coins
    e20a38184188d3cde4b31ba136ab7f9a
  • c. George gives Dimitri 50 coins
    d1ce2082961d697493faef24ee227a23
  • d. Dimitris gives Maria 20 coins
    160830a92d8bf4634d24201092946d2e

Dimitris decided to change the entries again. At night he went to the log, changed the file, saw that next to the transaction there was also a hash, and created a new hash based on the altered transaction.

  • a. Costas gives Manolis 100 coins
    29f3e7d933dfa9aa6f28b56e2676197d
  • b. Manolis gives George 150 coins
    e20a38184188d3cde4b31ba136ab7f9a
  • c. George gives to Dimitri 50 5 coins
    d1ce2082961d697493faef24ee227a23
    2e9252e9b7ac9183cc32af4ee373acc4
  • d. Dimitris gives Maria 20 coins
    160830a92d8bf4634d24201092946d2e

George, the next day, noticed that someone had tampered with the log again. He decided to complicate the recording of each transaction. After each entry, he inserted a hash created from the transaction record + the last hash. So that each entry depends on the previous one.

  • a. Costas gives Manolis 100 coins
    29f3e7d933dfa9aa6f28b56e2676197d
  • b. Manolis gives George 150 coins – 29f3e7d933dfa9aa6f28b56e2676197d
    5c1e8fc1a84af70c4847706f3e5af054
  • c. George gives Dimitri 50 coins – 5c1e8fc1a84af70c4847706f3e5af054
    9960e5687176870d6c32d10758ba8f07
  • d. Dimitris gives Maria 20 coins – 9960e5687176870d6c32d10758ba8f07
    62a154626243b2f41bb79e673a8d6948

If Dimitris now tries to change the entry, he will have to change the hash in all the previous entries. But Dimitris was stubborn and really wanted to make easy money. So he spent the whole night counting all the hashes and making new ones.

Nonce

But George didn’t want to give up. He decided to add a number after each transaction record. This number is called the “Nonce”. The nonce should be chosen so that the generated hash of each transaction ends in two zeros. This is not an easy process, as it requires painstaking and endless trials until the correct nonce is found.

  • a. Costas gives Manolis 100 coins 451
    29f3e7d933dfa9aa6f28b56e26761900
  • b. Manolis gives George 150 coins 13 – 29f3e7d933dfa9aa6f28b56e26761900
    5c1e8fc1a84af70c4847706f3e5af000
  • c. George gives Dimitri 50 coins 467 – 5c1e8fc1a84af70c4847706f3e5af000
    9960e5687176870d6c32d10758ba8f00
  • d. Dimitris gives Maria 20 coins 56 – 9960e5687176870d6c32d10758ba8f00
    62a154626243b2f41bb79e673a8d6900

Now, to create new, corrupted files, Dimitris would have to spend hours and hours choosing the Nonce for each line. The most important thing about this encryption system is that not only humans, but even the fastest computers cannot calculate the nonce that fast.

Nodes

Later, George realized that there were too many records and that he couldn't keep the journal forever because he was just becoming a middleman, a bank. So, when he had written down 2,000 transactions, he converted them into a one-page spreadsheet and gave it to Maria. Maria checked all the transactions and found them correct.

George spread the log to over 5,000 computers, which were all over the world. These computers are called Nodes . Every time a transaction is made, it is sent to all the nodes and must be approved by them. Each node checks the validity of the transaction. Once a node checks a transaction that is created, there is a kind of electronic voting, as some nodes may believe that the transaction is valid and others consider it to be a fraud.

The nodes mentioned above are computers. Each node has a copy of the digital calendar, in other words the Blockchain. Each node checks the validity of each transaction. If the majority of the nodes say that a transaction is valid then it is recorded in a block. So now the matter becomes much more secure but also much freer. If Dimitris, who also owns a Nobe, changes an entry, all the other computers that have the original hash would see the change. They would not allow the change to happen since the majority would say that it is not correct and Dimitris would be excluded from the Nobe network.

Block

This spreadsheet that George created is called a block. Each Block contains 2,000 records. When the records reach 2,000, the block is filled, closed, sealed, and placed immediately after the previous Block. That is, it forms a chain with all the previous Blocks that have existed since the beginning of the birth of the currency. At the same time, a new empty Block is created. The entire family of Blocks is the blockchain (the chain of blocks). Each node has a copy of the Blockchain.

The Blockchain is updated every ten minutes. This is done automatically. No master or central computer instructs the computers to do this. Once the spreadsheet is updated, it can no longer be changed. So, it is impossible to hack it. You can only add new entries to it. And the spreadsheet is updated simultaneously on all computers in the network.

What if there are many people who want to steal? If the insolvent guys in our example, who are all nobe and each owns a copy of the transactions, become three (more than half), then the protocol will collapse. The scenario is known as a “51% Attack”. In the event that the majority of the nodes in the network decide to steal the rest of the network, the protocol will fail by design because it simply relies on the majority. The blockchain will not be the right one, but will be modified in the interests of the malicious. Although this is a low probability scenario, it is also one of the few security gaps (if not the only one) in Blockchain.

Block sealing and proof of work

By filling a block with transactions, nodes must seal it before including it in the blockchain. Thus, the 5 nodes in our example, as soon as they realize that a block is filled, try to find a specific number (nonce) which, when attached to the list of transactions in the block along with the hash of the previous block and all this is given to the input of the hash function, will give a result so that the created hash ends in two zeros.

It is not an easy process and requires computing power and electricity consumption. As soon as one of the 5 finds this number, he announces it to the other 4. They check the number and if they agree, they all place it on their computational gender, seal the Block and adapt it to the Blockchain. The work of finding and verifying it is called “Proof of Work ” or as an acronym PoW. But what happens if someone disagrees? The majority simply wins and the one who disagrees must delete his own incorrect block, download the block from the others and store it to himself.

The one who finds the special number wins a reward for the computing power, which currently amounts to 12.5 BTC, and thus becomes the first miners. That is why all nodes do not wait for the nonce to be ready but try to earn the reward by mining.

How Blockchain Technology Works. A Beginner's Guide

Important points to remember:

  1. A Blockchain is a kind of log or spreadsheet that contains information about transactions.
  2. Each transaction creates a hash.
  3. A hash is a series of numbers and letters.
  4. Transactions are recorded in the order they appear. The order of recording is very important.
  5. The hash depends not only on the transaction but also on the hash of a previous transaction.
  6. Even a small change to a transaction creates a completely new hash.
  7. Nodes check the hash to make sure a transaction has not been changed.
  8. If a transaction is approved by a majority of nodes then it is written into a block.
  9. Each block refers to the previous block and together they make up the blockchain.
  10. A Blockchain is efficient as it is spread across many computers, each of which has a copy of the Blockchain.
  11. These computers are called Nodes.
  12. The Blockchain is updated every 10 minutes.

Now imagine this whole transaction process, which eliminates intermediaries, not limited to currency but as a technique spreading to all human activities. Imagine seeing it in many traditional sectors, such as: banking, insurance, entertainment, government and others. Although still in its early stages of development, blockchain technology is already being used in real life for cryptocurrencies, storing government data and so on, and many in both the private and public sectors are exploring potential use cases.

If we take it a step further, on a political-philosophical level, consider many activities escaping the state control of each country and relying on a blockchain distributed in nodes scattered across the globe. For example, a recording and issuance of identities of all the inhabitants of the Earth, which no state would have the data for, or a recording and issuance of car license plates.

Wallets, digital signatures

George gathered the remaining 4 and they made a team of 5 people. He had to explain the new currency to them. George, being truly honest (not like Dimitri who tried to steal), confessed to the team the initial mistakes he had made and apologized profusely. To prove his honesty, he gave Maria and Manolis their coins back.

George explained why this could never happen again. He decided to implement something called a digital signature to confirm every transaction. But first, he gave everyone a wallet.

What is a wallet?
A wallet is a string of numbers and letters, such as 18c177926650e5550973303c300e136f22673b74. This is an address that will appear in various blocks within the Blockchain as transactions are made. There are no visible records of who did what transaction with whom, only a wallet number. The address of each specific wallet is also a public key.

A wallet is essentially a document that contains a public address that can be used to receive Bitcoins and a private key, which allows you to spend or transfer Bitcoins stored at that address. A wallet can be created using services such as BitAddress or  Bitcoinpaperwallet which allow users to generate a completely random Bitcoin address and a private key to it.

Digital Signature
To make a transaction you need two things: a wallet, which is basically an address, and a private key. The private key is a series of random numbers, but unlike the address, the private key must remain secret.

When someone decides to send coins to anyone else, they must sign the message containing the transaction with their private key. The two-key system is at the heart of cryptography and its use predates the existence of Blockchain. It was first proposed in the 1970s.

Once the message is sent, it is broadcast to the Blockchain network. The network of nodes then checks the message to make sure that the transaction it contains is valid. If it confirms validity, the transaction is placed in a block and no information about it can be changed thereafter.

Blockchain Principles

Distributed database
Blockchain is essentially a database and every node of the Blockchain has access to the entire Blockchain. No single node or computer regulates the information it contains. Every node is able to validate the records of the Blockchain. All of this is done without one or more intermediaries controlling everything.

It is architecturally decentralized, and there is no possibility of one or more points of failure that would destroy the Blockchain.

Peer-to-peer (P2P) Transmission
According to the first principle, communication between nodes always occurs directly between themselves and not through a central node. Information about what is happening in the Blockchain is stored on each node and then transmitted to neighboring nodes. Using the P2P transmission system, information is propagated through the entire network.

Transparency but pseudonymity
Anyone with access to the Blockchain is able to see every transaction and its hash value. Someone using the Blockchain can be anonymous if they wish, or they can give their identity to others. All you see on the Blockchain is a record of transactions between wallet addresses.

Records
Once a transaction is recorded on the Blockchain and the Blockchain is updated, then the modification of that record is impossible. This is due to the fact that the specific transaction record is linked to the history of each previous one. Blockchain records are permanent, chronologically ordered, and available to all other nodes.

Why is it impossible to disable Blockchain?
Since there are nodes all over the world, it is almost impossible to take over the entire network.

 

📧
Subscribe to the SecNews Newsletter

The most important Security & Technology news in your Inbox.

SecNews
SecNewshttps://www.secnews.gr
In a world without fences and walls, who needs Gates and Windows

SEARCH

FOLLOW US

📧
Newsletter SecNews
The most important Security & Technology news in your inbox.

LIVE NEWS