There’s no denying the hype around blockchain technology. But for anyone who wants to get ahead of the game, here’s what they need to know about blockchain in order to capitalize on this groundbreaking new trend.

Blockchain is the technology behind Bitcoin taking into consideration as an example. It’s a decentralized digital ledger of all transactions that happen across the internet. It’s the backbone of the cryptocurrency industry, and it’s been hailed as a potential game-changer for how people and businesses interact with each other. It’s the latest buzzword to enter the technology realm, and here’s everything you need to know about blockchain and why you should be paying attention.

But what exactly is blockchain? Here are 7 things you need to know.

How does it work?

Essentially, a blockchain encrypts information in such a way that it cannot be altered, hacked, or cheated. The blockchain serves as a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems. It is a secure, open-source, distributed database used to keep track of who owns what, and who owes whom. Databases and lists of records are referred to as blocks, and they are cryptographically linked together.

Fig-1 – BlockChain

The first block in the chain is called Genesis Block, whose previous block hash is zero.

http://www.anf.es/pdf/Haber_Stornetta.pdf

The work of Stuart Haber and W. Scott Stornetta from 1991 on How to Time-Stamp a Digital Document and their follow-up paper Improving the Efficiency and Reliability of Digital Time-Stamping introduced the idea of a chain of hashes to create a total order of commitments to a dynamically growing set of documents. 

Cryptography – How SHA256 Hash Works

Our fingerprints are unique to each individual, as we all know. It is highly unlikely that two individuals will have identical fingerprints. It cannot be denied, however, that 1 in 60 million people have a similar fingerprint. In this respect, a fingerprint is considered to be the unique identifier of a person. As a matter of fact, it is used by forensic personnel to identify criminals.

Is there any possibility of attaching some type of unique identification to digital assets to make them identifiable?

One idea for using a digital fingerprint is SHA256, developed by the NSA. SHA-256 is a cryptographic hash function that produces a value of 256 bits.  SHA – Secure Hash Algorithm and 256 stands for 256 bits taken in the hash. Hash is always 64 characters long. 64 characters are hexadecimal (numbers from 0 to 9 and letters A to F).

What is a cryptographic hash function?  Any function that maps arbitrary data (text, video, audio, any kind of digital assets of any length or you can put whole operating system) to a fixed-size value can be called a hash function – a fingerprint. This is the core principle used in the Blockchain.

The following linked video and a demo is a very basic visual explanation of the principles behind a blockchain: https://andersbrownworth.com/blockchain/hash  

There are 5 requirements of the SHA256 hash algorithm and these are:

1. One-way: The conversion from digital asset to hash must be one-way.

Fig-2 Hash

This means that the original copy cannot be recreated or restored or reverse Engineer using the hash function. As with fingerprints, no one can recreate a person using its fingerprint.

2. Deterministic: Every time it generates a hash for the same digital asset, it should be the same.

3. It must have fast computation.

4. The Avalanche Effect: It means that, even if a small change is made to the document, the hash will change completely. It is implemented in this manner in the algorithm. A small change may have a significant impact on the algorithm’s output.

5. It must withstand collision: Similar to the case of fingerprint, that 1 in 60 million may have the same fingerprint. There may be a chance that two arbitrary documents may have the same hash function. It is because 64-character combinations are still limited while the creation of digital assets is limitless. Therefore, it is likely at some point that a collision will occur. This is called the pigeon hole principle.  

Fig-3 – pigeonhole  

“In mathematics, the pigeonhole principle states that if {\displaystyle n}n items are put into {\displaystyle m}m containers, with {\displaystyle n>m}n>m, then at least one container must contain more than one item.” Wikipedia. It must be possible for the algorithm to handle it even though it is very rare.   

Refer to chapter 1 of the below-linked book for more details on the SHA256 Hash Algorithm.

https://webspace.science.uu.nl/~tel00101/liter/Books/CrypCont.pdf

Immutable Ledger

Immutable means “impervious to change.” Ledger is a fancy term for the record, which refers to something recorded. In other words, an immutable ledger is a record that cannot be altered.

We can trust digital data in the digital age if the data is secure and hasn’t been altered.

When tracking money transactions, trust and proof of trust are very significant. Let’s say you sent me an e-funds transfer of $100 without any proof that you did so and without any way to verify that you did so. When the money showed up, I would believe you, and if it did not show up–what then?

Banks and credit card companies use ledgers to keep track of transactions. Can we trust them? If we do not wish to hand over our money to a large corporation, bank, or government, what can we do?

Blockchain technology introduced the concept of the Immutable Ledger. Mathematics underlies this concept. Knowing it can’t be altered or changed, you put your trust in that math. 

What does the blockchain do to ensure its immutability? The hash is its foundation. Hashes are like digital signatures, and if a hacker tampers with the ledger, its hash will change. 

The blockchain will reject the hash if it no longer matches the previous hash in the ledger, making it null and void like a bad check.

Fig-4 – BlockChain-hack

It means that the hacker would have to change the next block, the one after that, and the entire blockchain itself. 

Distributed P2P Network

A distributed peer-to-peer network is one where every participating node is equal and independent. This means no single entity can control the network or the resources of the network. In addition, it enables participating users to make money by sharing the processing power and storage capacity of their systems with other users in need. The user with excess processing power can rent it out to users who have a specific job he or she cannot accomplish alone. 

Decentralization of network able to lends itself to different applications and services such as distributed storage and bandwidth, digital content distribution, cryptocurrencies, prediction markets, and much more.

Blockchain is distributed network technology where everyone has a copy of all the transactions blocks, which is stored in every node. The data on these blocks is encrypted and shared among all of the participating peers. In fact, everyone has access to a copy of the entire network and is able to see who owns what. The transactional records cannot be changed retrospectively without altering all subsequent blocks and collusion of the network. All of the transaction data is stored in a decentralized fashion, without a single point of failure. Such Peer-to-peer sharing of information directly between peers without the involvement of a central third party makes a P2P network. 

It is important to understand the difference between “distributed” and “decentralized”.

“distributed” means that not all transactions are processed in the same place, while “decentralized” means that no single entity controls the entire process.

Fig 5 – (a) centralized (b) decentralized (c) distributed

[source: https://medium.com/@VitalikButerin/the-meaning-of-decentralization-a0c92b76a274]

How Mining Works

Here is the simple analogy of Blockchain Mining:

I tell my friends that I am considering a number between one and 100, and on a paper, I write the number and seal it inside an envelope.
 
There’s no need for my friends to guess the exact number; just that they must be the first to guess any number lower than or equal to the one I am thinking of. It does not matter how many guesses they get.
Let me say that I am thinking of the number 19. If Frіеnd A guеѕѕеѕ 21, they lоѕе bесаuѕе оf 21 is greater than 19. If Frіеnd B guesses 16 and Friend C guеѕѕеѕ 12, then they have both thеоrеtісаllу аrrіvеd аt vіаblе аnѕwеrѕ, because of 16<19 and 12<19. Thеrе is no “еxtrа сrеdіt” for Frіеnd B; even thоugh B’ѕ аnѕwеr was closer to thе target аnѕwеr оf 19. 

Nоw imagine that I роѕе the guess whаt number I am thinking? But this time I am nоt asking just three frіеndѕ, аnd I am nоt thіnkіng оf a number bеtwееn 1 аnd 100. Rаthеr, I am asking millions оf wоuld bе mіnеrѕ, and I am thinking оf a 64-dіgіt hexadecimal numbеr. Do you believe that іt iѕ gоіng tо bе extremely hаrd tо guеѕѕ?

Comparing to above аnаlоgу, where thе number 19 оn a ріесе of рареr іn a sealed envelope, in bitcoin mining tеrmѕ, thаt metaphorical undisclosed numbеr іn the envelope іѕ called thе tаrgеt hаѕh – 64 Digit Hexadecimal Number.

Whаt Iѕ a “64-Digit Hеxаdесіmаl Numbеr?
The following Hexadecimal number is any example оf such a numbеr:
0000000000000000057fсс708сf0130d95е27с5819203е9f967ас56е4df598ее
The numbеr above hаѕ 64 dіgіtѕ.

Mіnеrѕ are dоіng wіth those massive computers аnd dоzеnѕ оf сооlіng fаnѕ is guеѕѕіng аt thе tаrgеt hаѕh. Mіnеrѕ makes these guеѕѕеѕ by randomly gеnеrаtіng as many “nоnсеѕ” аѕ “роѕѕіblе, as fаѕt аѕ possible. 

A nоnсе іѕ short fоr “numbеr оnlу used оnсе,” and thе nоnсе is the kеу tо gеnеrаtіng thеѕе 64-bit hеxаdесіmаl numbеrѕ. 
In Bitcoin mіnіng, a nonce іѕ 32 bіtѕ іn ѕіzе—muсh smaller thаn thе hash, which іѕ 256 bits. Thе fіrѕt mіnеr whоѕе nonce gеnеrаtеѕ a hаѕh thаt іѕ lеѕѕ thаn оr еԛuаl tо thе target hаѕh іѕ аwаrdеd сrеdіt fоr соmрlеtіng thаt block and is аwаrdеd.

Byzantine Fault Tolerance

To illustrate how a group of Byzantine generals could have communication problems when trying to decide on their next move, the Byzantine Generals’ Problem was devised in 1982.

The generals have their own armies, and each army is positioned at different locations around the city they plan to capture. They must decide whether to attack or retreat. If all generals reach a consensus, i.e., agree on a common decision that will be executed in coordination, it does not matter if they attack or retreat.

Now there are the following requirements:

  • Decisions must be made by generals regarding attacking or retreating (yes or no);
  • Once a decision is made, it cannot be changed;
  • All generals must agree upon a synchronized decision.

Generals are only able to communicate with each other through messages sent through couriers, which creates communication problems. Byzantine Generals’ Problems are characterized by the fact that the messages can get delayed, lost or destroyed.

A message may also be delivered successfully, but a general may decide (for whatever reason) to send a fraudulent message to confuse other generals, leading to a total failure.

With blockchains, each general represents a node in the network, and the nodes must agree on the current state of the system is before the general can move forward. As another way of putting it, when a distributed network operates, the majority of the participants must agree on the same action and execute it.

Therefore, the only way to achieve consensus in a distributed system is by having at least ⅔ or more reliable and honest network nodes. This means that if most of the network decides to act maliciously, the system is prone to failures and attacks (such as the 51% attack).

Consensus Protocol

Blockchain consensus protocols are the rules that govern what constitutes valid transactions on a distributed ledger. In other words, they define what the “consensus” is around any given set of transactions. They are a critical component of blockchain technology because they determine whether or not a transaction is valid. Blockchains operate based on consensus rather than a central authority.
This means that any participating node can create a block and contribute it to the chain. Instead of having a central authority that authenticates transactions, blockchains use consensus algorithms to determine which transactions are allowed to enter into the ledger.
The miners secure consensus algorithms, and the miners are compensated by earning transaction fees or new coins. The two main consensus algorithms are Proof of Work and Proof of Stake. 
The create of the original blockchain, Bitcoin, invented the “Proof of Work” consensus algorithm.
Ethereum is currently a PoW blockchain.

Conclusion

In conclusion, blockchain technology is already being used by more than 1,000 organizations across various industries. It is predicted to disrupt almost every industry in the next few years. However, many people still don’t understand what blockchain is, how it works, and why it is such a game-changer.