Blockchain in 5 mins

Blockchain technology is considered by many to be the greatest innovation since the birth of the Internet, and is the underlying skeletal structure that makes cryptocurrencies possible.
What is it?
A distributed consensus model, which can be thought of as a digital ledger that keeps a record of every transaction that occurs in a sequential fashion from the inception of a cryptocurrency up until the most recent transaction block. It should be noted that once a cryptocurrency transaction has been submitted to the blockchain, it can never be reversed or removed.
Mining
A cryptocurrency transaction is recorded to the blockchain through a process of being confirmed and validated by a majority number of the network. These network confirmers are known as “miners” and they are responsible for confirming that a transaction is validated and therefore, authentic. Each one of these “miners” operates a full node which is essentially a computer connected to the Bitcoin network and has a duplicate version of the entire up-to-date Bitcoin blockchain stored on it.
The Double Spend Problem
The main innovation behind the Bitcoin blockchain was that it solved the Double Spend problem by establishing an order of priority between transactions.
To simplify, the following analogy will be utilized:
- Alice only has 1 BTC in her digital wallet.
- Alice then proceeds to send 1 BTC to Jack — we can call this “Transaction A” and it moves into an unconfirmed transaction pool.
- Alice then sends 1 BTC to Bob — we can call this “Transaction B” and it too moves into an unconfirmed transaction pool.
Which transaction is valid?
Both can be viewed as being syntactically valid however only one is historically valid. This is where the innovation of blockchain technology came in and solved this problem, because it made the order of priority between these transactions mathematically sound.

Blockchain Operations
The blockchain is exactly what it states, a chain of blocks. Each “block” contains the following four main elements:
- A set of transactions
- A hash from the previous block: This will guarantee that the next block will be generated in a sequential manner, because the current block knows where it originated from (i.e. contains the hash of the previous block). Therefore, the next block will occur in chronological order.
- A block header: This is where the block keeps its hash value.
- A Merkle hash tree.
Proof-of-work
The Bitcoin blockchain uses a “proof-of-work” system. This means that the miners of the network need to solve a mathematical puzzle or “proof of work” by hashing the set of transactions in the block. As a result, this generates new blocks to the Bitcoin blockchain. It is important to note that Bitcoin uses a cryptographic hash function called SHA256 (Secure Hash Algorithm 256-bit) to do this.
Now that it has been established that each transaction has a hash counterpart associated with it, the next key element is a Merkle hash tree or binary hash tree. Once the set of transactions has been hashed, they are placed into a tree data structure.
Merkle Tree
The purpose of a Merkle tree is to structure these unverified transactions so that they can be verified, and to ensure the integrity of the cryptocurrency transactions. In order to explain this concept further, we will utilize our aforementioned analogy.

“Transaction A” is a normal transaction. It is placed through a hash function and gains the corresponding “Hash A” value.
Once an individual transaction has been hashed, it is combined with other hashed transactions in order to be hashed once again. An example will be placing “Hash A” from “Transaction A” with “Hash B” from “Transaction B” into a hash function to produce “Hash AB”.
If there is an even amount of transactions then each will have an adjacent partner however, should there be an odd number of transactions then one of the transactions will pair with itself. Transaction A can be utilized as an example here as it would produce “Hash AA” when paired with itself.
The process of combining hashed transactions and re-hashing the results is repeated until only one hashed value remains. This is known as the Merkle root.
Merkle Root
The Merkle root is placed in the block header along with the hash of the previous block and a nonce.
Nonce
Nonce stands for “number used only once”; it is a 32-bit random number generated and incremented until a valid hash is created.
Once a block has been hashed miners can begin to perform “proof-of-work”. This process entails producing a value of x, which after hashing is a value lower than the “hash target value”. The “hash target value” is a 256-bit number and is the standard for mining set by the Bitcoin protocol.
H(x) > target value
H(x) represents the block itself and a unique value chosen by the miners.
The unique value chosen acts as a sort of lottery ticket. A miner will continuously test this unique value against a different set of unique values (a nonce as mentioned above).
This is incremented until a valid hash is located. Once a valid hash is found by a miner, a proof-of-work is added to the block concluding it and every miner moves onto the next block.
It is also important to note that the lower the target value is, the harder the proof-of-work process and therefore, the harder it is to create a new block. It is for this reason that every few weeks the “hash target value” is adjusted accordingly in order to make sure it is difficult enough to mine new blocks.
Mining can be viewed as a race as there are miners from all over the globe competing to confirm a block first. Miners are rewarded in Bitcoin for their service.

If this interests you and you would like to know more about Blockchain Technology, Cryptocurrency and Bitcoin, please do consider reading this:





