paint-brush
Blockchain In Bullet Pointsby@cryptoshegz
417 reads
417 reads

Blockchain In Bullet Points

by Olusegun AdedokunSeptember 6th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

A blockchain is a chain that is made up of blocks linked together and linked together. Every block has a head and a body. A block's head or block header or head of the block is an 80-byte long string and is divided into six parts: The Bitcoin version number (4-byte) The hash of the preceding block (32-byte) The root hash of the Merkle tree (32-byte) The time in seconds from 1970–01–01 T00: 00 UTC (4-byte) The difficulty target of the block (4-byte) The nonce used by miners (4-byte) Every node in the blockchain network has a copy of the every transaction. Transactions recorded on the blockchain are a permanent and cannot be changed. The consensus algorithm is a set of instructions for decision-making on the bitcoin network

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Blockchain In Bullet Points
Olusegun Adedokun HackerNoon profile picture



NO!


The headline is not an outrageous claim to get your attention.


Read on to find out for yourself.


What’s The Blockchain?

A blockchain is a chain that is made up of blocks linked together!


These blocks contain data.


The blockchain is a chain of blocks that contain data.


Let's pause here for now.


Picture a ledger in your mind.


A ledger is a book that is used to record transactions.


Ledgers have pages.


Each page is where the transactions are written or recorded.


Great!!


Imagine again that this ledger lets everyone involved in a transaction know with confidence what happened, when it happened, and confirm everyone is seeing the same thing.


And it does this without any middleman to guarantee trust, and with no need to reconcile data later.


Now, let's get back to the blockchain.


Characteristics of Blockchains


  1. Blockchains are Immutable


Immutability means that transactions recorded on the blockchain is a permanent and cannot be changed.


Every computer or node in the blockchain has a copy of the digital ledger.


If majority of the nodes agree a transaction is valid, it is added to the blockchain.


Every transaction validated on the blockchain are irreversible and unchangeable.



  1. Blockchains Use Distributed Ledger Technology


Every node in the blockchain has a copy of the every transaction.


There is total transparency.


Public ledgers show all data about every participants on the network and transactions.


Distributed ledger technology makes tracking new transactions easy as it gets updated fast on the blockchain in seconds or minutes.


No node gets special treatment from the network.



  1. Blockchains are Decentralized


There is no central authority in charge of anything.


No central point of failure that can be targeted.


Attacking a blockchain is so expensive that hackers realize it is not even worth the try.



  1. Blockchain Transactions are Traceable


Every change made on a blockchain can be traced.


As a user, you now have control over your assets without relying on a third party



  1. Blockchains are Secure

Every record in the blockchain are hashed (using cryptography)


This gives the blockchain another layer of security.


All data have unique identity on the network.


Every block has a unique hash of its own includes the hash of the block before it.


So, any attempt to edit data is impossible as it means editing every hash or transaction ID.



  1. Blockchains Have a Consensus Algorithm


Blockchains have a consensus algorithm used to make fast, unbiased decisions.


**A consensus algorithm is a set of instructions for decision-making on the blockchain.



  1. Blockchain Transactions are Trustless


No need to trust who you are transacting with.


The consensus algorithm that runs and makes decisions at the core of the blockchain makes trust unnecessary.


Without it, blockchains will lose their value.



  1. Blockchains Transactions are Unanimous


When a node wants to add a block to the blockchain, majority of the "votes" from the network must agree.


Or else the block cannot be added to the blockchain.


A node cannot add, update, or erase any data on the blockchain.


** A code is a computer terminal in the blockchain network



  1. Blockchains offer Faster Settlement


Traditional banks take days to process transactions.


After they finalize all settlements, they can still be easily corrupted.


Blockchain offers faster settlement and makes life easier.

Anatomy of a Blockchain

Here are the parts that make up any blockchain.


Each block in the blockchain is has two main parts that make it up. The HEAD and the BODY.


A Block's Head

A block's head or block header or head of the block is an 80-byte long string and is divided into six parts:


  1. The Bitcoin version number (4-byte)

  2. The hash of the preceding block (32-byte)

  3. The root hash of the Merkle tree (32-byte)

  4. The time in seconds from 1970–01–01 T00: 00 UTC (4-byte)

  5. The difficulty target of the block (4-byte)

  6. The nonce used by miners (4-byte)


Don't worry about these parts because I'll break them down in simple way.


The Bitcoin Software Version Number

Every software has a version number.


This version number does not really matter most of the time.


BUT, a miner (someone that confirms that a transaction happened) with a particular version number can indicate which set of block validation rules followed.


The Hash of the Previous Block

Remember, a blockchain is a chain of blocks that contain transaction data.


Each block is connected to the next block by a chain.


The hash of the previous block is the chain connecting the blocks together in a blockchain.


How is this so?


Simple.


The hash of the new block contains the hash (or transaction ID) of the previous block.


The unique thing about the blockchain is that all the blocks are built on each other.


Without this hash or connector, there will not be a connection and chronology between each block.


By the way, chronology is the arrangement of dates of a transaction in the order that they occurred.


The Root Hash of the Merkle Tree

Every transactions stored in a block can be grouped together and displayed in a hash.


This is called the root hash of the Merkle tree.



The Time in Seconds Since 1970–01–01 T00: 00 UTC

Every time a transaction occurs, the exact time of the transaction is captured or stamped in the block the transaction is in.


This is called a timestamp. It is in the block itself.


The time is captured in and displayed in seconds since 1.1.1970.


The Current Difficulty Target of the Block: The goal of the current difficulty shows how small the new hash must be to claim validity.


This means every hash has a size measured in bits.


The smaller the goal is (in bits), the more difficult it is find a matching hash.


Any hash that has a lot of zeros at the beginning is smaller than a hash with less zeros or no zeros.


The Nonce

A NONCE is a word derived from "Number Only used oNCE."


It is a number added to a block that is hashed in a blockchain so that when it is rehashed, it meets the difficulty level restrictions.


It is the number blockchain miners are competing to solving to get the block reward.


The nonce is the variable increased by the proof of work.


Proof of work is the "evidence" crypto miners must show, and it is the fastest miner to show it that wins the right to mine a block of crypto.


Once the block is mined, the miner gets rewarded.


The “work” is to solve a highly complex math problems.


The “proof” is the solution to the complex math problems.


Computers with high computing power within the network anywhere in world compete to solve complex math problems.


It's like a 100m dash between computers.


The fastest to solve the problem earns the right to verify the next block of crypto transactions.


The winning miner who verifies the block and gets rewarded in cryptocurrency.


The miner must guess a valid hash that is smaller than the target.


The six components form the block header.


The block header plays a critical role in Bitcoin as it connects all blocks together.


So, if we think of the block as a petrol tanker, the block header is the cockpit of the tanker.


The 6 parts of the block header are like the documents in the cockpit.


The Body of the Block


If the block header is the cockpit of the tanker, the body of the block or block body is the loading space of the truck.


The block body is the container of every transaction confirmed with the block.


To create or mine a new block, miners must solve a math problem.


When finding a valid solution for the network, it can be assumed that a new block will be added to the blockchain by consensus.


"Consensus" is a set of rules computers in the network all agree on to ensure that only one single valid copy of record shared by all the computers or nodes exists.


The miner who finds the solution first, receives a reward for the new block.


When a miner creates a block, he validates a transaction, it is like checking if there is enough money to spend in a transaction.


The miner checks previous blocks to see if the sender has 2 bitcoin if he wants to send 2 bitcoin.


This information is read from the blockchain.


Transactions in a block are not merely in a list, but in something called a Merkle Tree.


So, What is a Merkle Tree?

The Merkle Tree is named after mathematician Ralph Merkle.


What Merkle discovered was that a lot of data can be represented in a single hash.


The way this works is that the data itself is first hashed.


Then the hash is hashed again and merged.


Lastly, the Merkle Tree is merged into a single hash.


The last hash is the root hash or the root of the Merkle tree.


The root hash represents all the data of the Merkle tree's “leaves” (each transaction) and “branches” (hashes of the leaves) in a relatively short string.


**A string is a hexadecimal combination of several numbers and letters.

***Hexadecimal means using a numerical system that is base 16 rather than base 10.


It is quick and easy to create the root hash if you know all the branches and leaves.


The function of a hash function works fast and clearly in one direction and is impossible to break down in the other direction.


If anyone knows the root hash of a Merkle Tree, but doesn't know the transactions, it is not possible to guess the transactions.


Therefore, a root hash alone is insufficient. The remainder of the block needs to be saved.


The miner can validate the root hash any time by hashing the data contained in the block again.


So long as the hash function is the same, the miners will get the same hash for a given input of data every time.


This is useful because they can only check if they are on the same level as the hash.


What is a Hash? And Other Things You Should Know

In layman's terms, hashing means taking an input string of any length and giving out an output string of a fixed length.


Hashing is a way to secure a message that is to be seen by a particular recipient only. Let's put this in context of bitcoin.


Transactions are taken as input and run through a hashing algorithm (bitcoin uses SHA-256) to get an output of a fixed length.


An algorithm is a set of instructions or a set of rules to be followed in problem-solving operations, usually by a computer.


Hashing is a unidirectional or one-way process.


This means you will never be able to work backwards to get back the original data.


So, a hash is a hexadecimal string of several characters generated using a complex mathematical function.


Hashing is a way to secure a message that is to be seen by a particular recipient only.


A formula generates the hash and the hash helps to secure the transmission against tampering.


A good hash algorithm should be complex enough that it cannot not generate the same hash value from two different inputs.


Mining: the Search for a Special Hash

Here's another way to understand the mining of the proof of work.


During mining, the head of the block or block header is increased to get a special hash.


Remember, that the header is made up of five constants and one variable.


The constants are:


  1. The Bitcoin version number (4-byte)

  2. The hash of the preceding block (32-byte)

  3. The root hash of the Merkle tree (32-byte)

  4. The time in seconds from 1970–01–01 T00: 00 UTC (4-byte)

  5. The difficulty target of the block (4-byte)


The variable is the nonce used by miners (4-byte)


A nonce is a number increased by one.


Miners hash the data and check if the data results in a hash with a smaller value than the searched target value.


If it is not, the miner repeats the process, This means increasing the nonce by one, and hashing again.


This is repeated until it a hash below the target is found.


Or, it gets another block from competing miner whose hash is below the target.


This new block is then used as the basis for the next block (using the new hash as “hash of the earlier block”).


Mining is a process that is super-repetitive. The goal of which is to find a special hash.


Once this is found, it is back to square on and the process is repeated again.


The chance of finding a special hash depends on how difficult the problem to solve is.


Bitcoin averagely finds a new block every ten minutes.


As the difficulty keeps adapting, this average of ten minutes remains the same.


One unique feature of this process is that the special hash can only be found by guessing!


The faster the rate of doing this, the more the computing power needed and therefore, the more the energy.


Ultimately, it costs money!


Below is a fictional example of a hash from the Bitcoin blockchain:


000000000000000000054bfa1edb1245c347e42452e6518e9fe5a2e24d335b16


It is special because it begins with many zeros as mentioned many above!


I hope this helps you.


Share and follow me for more!