MultiversX Tracker is Live!

What is a blockchain? - A noob explanation

All Cryptocurrencies

by COINS NEWS 41 Views

Seasoned crypto enthusiasts can skip this post.

For everyone else, I'm going to try to explain what a blockchain is in very simple terms to help those who are new to the concept.

I often talk about cryptocurrencies to my friends and family, so this should be an easy task, right? Well, it turned out to be not that straightforward.

If you can't explain it simply, you don't understand it well enough.

- Albert Einstein

Let's start with a "block."

  • A block is nothing more than a collection of data. It can contain various types of data, but for simplicity, let's focus on transactions.

For this explanation, I'll use the example of the Bitcoin blockchain. In a block, the data consists of a list of transactions. For instance:

X pays Y 0.01BTC A pays B 0.24BTC Y pays H 1.12BTC 

Other blockchains like Ethereum, Binance Smart Chain, Cardano, Solana, etc., may include more than just transactions, such as smart contracts. However, I won't delve into that now; it could be a topic for another post or further research?!

Blocks have limits, meaning they can only hold a certain number of transactions. When a block is full, we need to do something with it.

  • We add the full block to the network, a process called mining

Since Bitcoin uses a proof of work model, we have to prove that we mined the block. This leads us to something called hashing. So, the next big question is:

What is hashing?

  • Hashing is an encryption system where you input something, and it gives you a hash as the output.

There's a lot of math and magic involved, but essentially, you input something, and you get something different back as the output.

In the case of Bitcoin, it uses the SHA-256 hashing function. A SHA-256 hash always consists of a fixed, unique (hexadecimal) output of 64 characters. Whether you input your name or the entire dictionary, a SHA-256 hash will always give you 64 characters as the result.

Three important things to know about hashing!

  • **A hash works in one direction.**You can't reverse-engineer the input of a hash; you have to guess and check by brute-forcing it. It's a one-way function and cannot be reversed.

You have to keep giving different inputs until you guess the correct output, which is an immensely intensive task. At times, miners are calculating/guessing at a rate of 447.29 exahashes per second (EH/s) in the Bitcoin network. That's 447.29 * 10^18 hashes per second, or four hundred forty-seven quintillion two hundred ninety quadrillion per second!

  • A small change in the input creates a significant change in the output.
    Examples of SHA-256 outputs for the following text:

"reddit" gives: 2e183f2a7a70de1c10044f4e370a221a792736cb074835afcde6a9df457d413b "Reddit" (with a capital 'R') gives: eb0050f72303bcdbbdc071e2a3bf810c903be8d05cdf09f7c3106f2b6f9878bf 

They are completely different results, even though only one letter has changed!

The phrase "The quick brown fox jumps over the lazy dog" gives: d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 

So, the number of words does not affect the length of the output. Even if you encode a whole Wikipedia page in SHA-256, the output will still be 64 characters.

You can try it yourself:

https://emn178.github.io/online-tools/sha256.html

  • Calculating a hash takes time!
    It may take just a few milliseconds for a small text, but if you try to hash an entire book or check millions of variations of it, it starts to take time and computational power.

This is exactly what Bitcoin does when we're mining.By adding leading zeros to the SHA-256 output of a block, it tries to find a special outcome.

For example, let's say we are trying to mine:

"X pays Y 0.01 BTC, A pays B 0.24 BTC, Y pays H 1.12 BTC" The SHA-256 output is: b95bd7790dd1b91164219a07fa24ade136f994484cb6e32d2c4bdf7f9b8113c4 

Bitcoin changes the leading characters of this SHA-256 output to make it more difficult.(look at the zero's at the beginning)

The input hash was: b95bd7790dd1b91164219a07fa24ade136f994484cb6e32d2c4bdf7f9b8113c4 Bitcoin expects: 000000000dd1b91164219a07fa24ade136f994484cb6e32d2c4bdf7f9b8113c4 

The difficulty of mining Bitcoin lies in the number of leading zeros that need to be added to the beginning of the original hash. The rest of the hash should remain unchanged.

As you saw in the SHA-256 examples for "reddit" and "Reddit," a small change has a significant effect. This makes it computationally intensive to calculate the expected hash.

Computers all around the world work hard to find the right addition, and when they do, we say that the block is solved and verified. The one who provided the solution is rewarded with BTC.

Over time, more zeros are added to the hash, and the reward for solving (or guessing) a hash is halved. Mining Bitcoin becomes more challenging and costly, but at the same time, computers become more powerful.

  • We know that a block is a collection of data, usually a list of transactions in the case of cryptocurrencies. After we have a block, we need to find the hash of that block.
  • Miners do this by guessing and checking until they find the solution. After they find the solution for that block, they ensure that it is linked to the hash of the previous block. Each block refers to the previous one, and that's the magic of a blockchain.
  • If you try to go back and edit an old block, all the newer blocks change because you altered the hash that points to them. This way, we ensure that someone cannot go back and add more money to their account in an old block.

In a sense, everything added to the blockchain is recorded in history forever because it cannot be changed, which is beneficial for things like financial transactions.

To summarize:

  1. Blocks are collections of data, and in the case of cryptocurrency, they usually contain a list of transactions.
  2. After we have filled a block, we need to find the hash of that block.
  3. Miners do this by guessing and checking until they find the hash.
  4. After they find the solution for that block, they ensure that it is linked to the hash of the previous block.
  5. Since each block refers to the previous one, they are connected, forming a chain.
submitted by /u/bvandepol
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments