Blockchain and cryptocurrencies under the hood

Amir Hachaichi
4 min readMay 12, 2021

--

Bitcoin has gained a lot of popularity these last years, one decade after its creation, the total capitalization has recently reached 1 Trillion USD, meaning that a lot of people are actually investing in it, turning their physical money into just data basically. The level of trust we have here is just insane, and what made this success possible is the blockchain technology. Bitcoin is one of many other cryptocurrencies, and cryptocurrencies are one of an even growing number of other applications of this technology, which is probably going to shape our future, so it’s a good idea to get, at least, a basic understanding of it.

What is a blockchain?

A simple description of it would be: Blocks of data that are continuously being created, each new block carrying a mathematical fingerprint (a hash) of the previously created one, the process happening simultaneously on multiple computers. The blockchain is a transparent and trustable way of storing data, once you store something using this technology, it can’t be modified, deleted, or hidden. Here is how it works:

The first aspect is that storage is decentralized, using a network of computers (the nodes): Each node holds a complete copy of all blocks (the ledger), and runs a piece of software that is specific to each blockchain technology, which has to be open source. Nodes constantly communicate between each other to add the new blocks, and makes the necessary checks to ensure that they all hold the exact same data.

It’s the approach to data protection that makes the blockchain stands out from other data storage technologies: Instead of restricting access to data to keep it from unauthorized modifications, the blockchain makes data accessible to any member of the network, while making it impossible to make any changes to anything that has already been written, thanks to a mathematical function called hash.

Power comes from hash

A hash is a fixed length string that can be calculated from any data.

For example, the hash obtained from the word blockchain using MD5 function is: 5510a843bc1b7acb9507a5f71de51b98

If we capitalize the first letter and use Blockchain instead, the MD5 hash is 3cc377f79bda308c750459a2caf7fc38

If you hash a text composed of a million characters, even if you change only a single character and you hash again, the two hashes will be completely different, but if the data is exactly the same, using the same hash function will generate the same hash. Comparing hashes is much easier than comparing data, that’s why it’s so powerful.

MD5 hash function has been very popular for a long time, and it’s still used today, despite being deprecated, as it’s no more considered secure enough, and it’s never used in blockchains. Bitcoin uses SHA-256 function, which is cryptographically secure.

How cryptocurrencies work?

Cryptocurrencies use the power of the blockchain to record every single transaction made since the beginning of a particular crypto.

Public-key cryptography is used to identify owners and to authorize transactions.

You may have heard about crypto miners, who invest in very powerful computers and pay huge electricity bills to earn cryptos, but why is this needed?

In order for the blockchain to maintain its integrity, blocks must be added one at a time, and because the network is decentralized and there is no third party to control and decide, each time all members of the network must agree to select the single node who is gonna write it. In addition, to allow propagation of new blocks to all nodes, there has to be a limit on how many blocks can be created in a defined unit of time.

The Bitcoin blockchain uses a mechanism called Proof of Work (PoW): Nodes compete against each other to find the solution to a problem involving hashing. The difficulty of the problem is adjusted to allow one solution to be found every 10 minutes, and the successful problem solver gets rewarded in freshly created coins. The more competitors there are, the more difficult the problem will be, and vice versa.

Will cryptocurrencies replace national currencies?

Cryptocurrencies are often seen as a potential replacement to fiat money, allowing people to get rid of banks and government control, but there are a number of reasons why they won’t become a mass payment solution.

The first problem with paying with cryptocurrencies is their volatility: Price tags are still in fiat money, and the value of a crypto can vary widely within a very short period of time, so unless you get paid in cryptos, it is not very convenient.

The transaction cost is also a limitation: The more a cryptocurrency is exchanged, the highest will be the cost of a single transaction.

Money laundering and illegal trade: Being decentralized and anonymous means almost no barriers for criminal activities.

No customer service: If you put your money in a traditional bank, and it happens that you loose your credit card, you can still recover your money by providing your ID documents to the bank, but if you store all your coins under a single key, and you loose your private key, you can’t access your money anymore, and nobody can help you.

These are the problems that we would face if traditional money is replaced by major cryptos like Bitcoin and its derivatives, but how about changing how the whole economy works?

The real advantage of cryptocurrencies is that unlike fiat money, which can only be created by banks, anyone can create its own cryptocurrency. Ethereum and Cardano are two open source platforms that allows pretty much anyone to do that pretty easily.

The future of cryptos

Boosting innovation: What if every new project had its own cryptocurrency? Everyone who contributes to the project would receive an amount of coins, and if the project gets successful, their value will go up.

The possible end of general purpose money: We could have a crypto to buy food, another one for medications, one for real estate, another one for transportation, and so on, you get the idea.

--

--

Amir Hachaichi

I am passionate about web technologies and I build web applications using javascript. Also learning Data Science and LLMs enthusiast. https://synlaunch.com