What is Blockchain? The Technology Powering Cryptocurrency

Yousuf Ahmad
4 min readNov 19, 2021

Recently, mainstream popularity around cryptocurrencies such as Bitcoin, Ethereum, and Dogecoin have skyrocketed. According to Google Trends, the search rates for Cryptocurrency recently hit an all-time high. But, what makes these currencies so special? The answer to that is the technology behind these tokens: Blockchain

A good video to understand blockchain

Despite its recent discussions, blockchain was actually invented in 1991 by two mathematicians who were intrigued with the idea of building a solution to a large problem at the time: transactions between two or more parties were being tampered with. Their proposition was a major success as seen through Bitcoin, the largest cryptocurrency which implements blockchain technology.

To understand blockchain technology, we can break it apart into four subsections: Hash, Blocks, Blockchain, and Distributed Blockchain.

A hash is called a digital signature or fingerprint of data. This means that any data that is put through a hashing algorithm, will result in a new string value that will always be the same for that data. We can understand this with an example. SHA256 is one of the most popular hashing algorithms and is also used in Bitcoin. This hash takes the data input and converts it into a new string that has 256 bits which is 64 characters. This algorithm will result in the hash of the data always being 256 bits so even if I hash the entire English dictionary, the resulting hash will remain the same length. If we use this hashing algorithm for the word “hello”, the resulting hash is “2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824". If I add a single character and change the input to “helloo”, we see that the resulting hash is completely different: “e0cb05d98fc5f38266f3ea8376d84c61a8c16050240e439e7ae96f12e2cb30a4”. You can play with hashing data using this tool. We can apply the concepts of hashes to blocks.

Blocks use three values to create a hash: block number, nonce, and literal data. The block number is the numeric value of the block. Nonce stands for “Number ONCE”. I’ll explain what this is in a moment. The data component is where data in the form of transactions are shown and kept track of. All three values are put together as one input that gets hashed. The resulting hash is a 64 character string. If you alter any of these three components, the hash is changed. This block can also be mined. This is an interesting concept that utilizes these three components to alter the hash. Essentially, the mining function changes the nonce value until it finds a correct value that results in a hash that has a certain number of leading zeroes. So to make it easy to understand, we can go through an example - If the number of leading zeroes required by the blockchain system is 4 zeroes, our block number is “1”, our nonce value is “1”, and our data is “transaction 1 transaction 2”, our hash does not have the required four zeroes in its beginning. So what does the mining function do? It changes the nonce value to “2” and checks if the resulting hash has the four zeroes in the beginning. In this case, it does not so it checks the next value; “3”, which also doesn’t work. It will continue to try different nonce values until the number of zeroes in the front of the hash is four. The required nonce value for our example is 150341. The resulting hash is “00001d3dc9631dc88a18a804d7947b94929aa6b1d3ac64da4e64efbba54eef4c”. The number of leading zeroes is known as the difficulty level and is set by the blockchain system.

Blockchain incorporates these blocks; however, now there is more than one block. There are often thousands of blocks in a blockchain that are all linked together. They are linked due to the implementation of one block’s hash into the next one. The hash of one block is used with the input of the next block to create the hash. In a blockchain, if one block is altered, all of the following blocks that come after it will also end up broken and in an invalid state. This is because the changed block’s hash changes which changes the hash of the next block. This pattern continues until the last block. However, this can be fixed if we mine each of the broken blocks which do not have the correct number of leading zeroes. Once we mine these blocks, the correct nonce values are found which results in the correct hashes for these blocks. So how can we tell if a blockchain has been altered if we are able to mine each block and make it look like no changes occurred? That is where distributed blockchains come into play.

Distributed blockchain means that the copy of the blockchain is distributed amongst everyone who uses that blockchain. These individuals are called “peers”. This allows any altered chains to be removed from the blockchain system and not taken into account. There are often hundreds or thousands of peers in the system. If one copy of the blockchain is altered by editing one of the transactions in one of the blocks, we will notice that the last hash of the last block will be different for that copy of the chain compared to the copies that every other peer has. The rest of the peers can then implement a majority rule to remove that individual and their copy from the blockchain.

--

--