2022/02/16

Blockchain and cryptocurrency mining...

Money has always evolved alongside humanity. Commodity money, where real coins are made from a valuable material such as gold, dates back to around 700 B.C. Representative money may be even older, as a token representing some valuable material is used for trading, rather than the real material. Representative money was used until the last century, as most coins represented bars of gold that were safely stored elsewhere.

Today we all use what is called Fiduciary money, which only has value because the government decides it. Technology is evolving very fast in recent decades, and society is evolving with it. The Internet is now an essential tool, and along with smartphones is causing a profound change in the way we do things. Cash has begun to fall into disuse, and online shopping is now easy and widespread. The way we buy and pay for things has changed dramatically in recent years, but the currency itself has remained the same. Cryptocurrencies are trying to change this. A cryptocurrency is a digital currency that uses cryptography to ensure its security while broadcasting live on the Internet all transactions. The main idea of cryptocurrencies is to avoid centralization and trust in a few organizations that control all monetary transactions.

In other words, the goal of cryptocurrencies is to get rid of traditional banks and Fiat money, in favor of a decentralized and communal system where transactions remain secure and private. In order to achieve this, cryptocurrency networks save all transactions on what is called the blockchain. This is an important concept, so let's explain it in some detail. Since Bitcoin is the most famous cryptocurrency we use as the main example throughout this explanation. Blockchain is, in a few few, the cryptocurrency term for the general ledger. That is, the blockchain is a list of all transactions of a given cryptocurrency.

Individual transactions are grouped into blocks, which are the building pieces of the blockchain. For bitcoin, currently each block has around 2,500 different transactions on it, but this is not a fixed number; new blocks are created every ten minutes.

Everyone has a copy of the blockchain, and to make sure everyone has the same list of block transactions, and in order to prevent people from cheating (more on this later), cryptography algorithms are used to make this blockchain secure. That is, blockchains usually use a proof of work (PoW) system: for a block to be a valid candidate for the chain, it has to carry sufficient proof of its authenticity, and this proof is measured in terms of work.

What is meant by work is computer work: finding a certain unique number for each block that satisfies a certain cryptographic algorithm. The main point is that finding this unique number, called the hash number, is not an easy task, but a task that can be performed by anyone, though. This is where cryptocurrency decentralization starts: Ideally, anyone with a computer can validate the blocks, and therefore instead of having a central bank that controls all transactions, every computer in the world is keeping track of all of them and validating their authenticity. The search for this validation for a block is called mining.

This idea has many setbacks, but like Bitcoin and the other existing cryptocurrencies are showing that there are ways to overcome most of them. First, there could be conflicting blocks popping up on the chain, or someone could create a fake block with fraudulent transactions. The way PoW controls this is by temporarily allowing different versions of the string to exist, and relying on the longest (i.e., the one that got the most work done). This is the consensus algorithm. Since there are many computers around the world miner for this same chain, fake blocks will be quickly discarded, as they will only be mined by their fraudulent creator.

Certainly, if a group of people could control enough computers around the world, they would be able to add fake blocks to the chain and steal money from other users.

This is called a 51 attack, and while it can be a problem for small cryptocurrencies, for large networks like Bitcoin it is not feasible, as it is almost impossible to accumulate that amount of computing power. Now, for this system to work, the blockchain needs people extracting the blocks to validate the transactions.

Why would anyone want to do that? The answer to this question is block rewards: each transaction has an associated reward, which is a reward for the person who manages to mine that block. This ensures that people will try to mine blocks, as they will earn money by doing so. This is a problem for small transactions. In order to validate any transaction we need someone to mine it, and this mining needs to be paid for. Therefore, if I want to give a friend a few cents in bitcoins, I will have to pay a fee to validate the transaction that could be comparable or even higher than the real money I wanted to send.

However, mining fees are not a real problem for large transactions. On the contrary, they can be seen as a force of the system. Since the transaction is done securely through the blockchain there are no intermediaries ever, and in particular there is no central bank. So this is the only fee that needs to be paid, and potentially anyone has a chance to win.

One of the main problems of the system explained above is the lack of scalability. This lack of scalability manifests as a low limit on the number of transactions the blockchain can process. This also causes mining rates to increase considerably in busy periods. Related to all this, the scalability issue is also due to the high power consumption that the blockchain requires.

As we said, the idea of the Bitcoin PoW protocol is to have a lot of computers around the world to get that single number that validates the block. This means that there will constantly be a lot of computers calculating the same thing, and most of this work will not be used in the end.

This, of course, is extremely expensive in terms of computational power or, in other words, in terms of power consumption. The Bitcoin network currently uses about the same amount of electricity as a country like Greece.

Market volatility is currently another issue for cryptocurrencies as it is extremely high. This means that currency price fluctuations are huge and very unpredictable. Typically the price of a cryptocurrency varies by 10 daily, and there have been cases in the past where the change has been much larger than that, as we can see in the figure below.

An important point to note is that cryptocurrencies are quite new and therefore remain a constantly evolving market and a very active area of research. New cryptocurrencies are being created regularly, and existing ones are being updated. Some of them introduce revolutionary new ideas within the cryptocurrency community, as Ethereum did. We discussed more about Ethereum at the end of this post.

Finally, related to the amount of computational power, there is the problem of specialized computers built just to mine a cryptocurrency in a very efficient way. They are called ASICs, and although they also have their own limitations, they are a very powerful tool, which has caused Bitcoin miners to mostly own ASIC. Thus, ASICs can be seen as a centralization of the bitcoin network, which goes against the original cryptocurrency idea. That's why a large part of the cryptocurrency community is putting their efforts into avoiding ASIC dominance of the market. To do this, some ASIC-resistant algorithms are being tested, with varying degrees of success.

There are two main strategies for making a resilient ASIC currency. The first, used for example by Ethereum, is to have a hard-memory hash algorithm. This means that instead of having an algorithm that is entirely solved by trial and error calculations, like bitcoin's SHA-256, it uses an algorithm where memory is the limitation. They are usually extracted via GPU. Check out our ASIC vs GPU Mining Post for a detailed explanation.

The other option to create an ASIC-resistant coin is to use hash algorithm combinations instead of just one. Since an ASIC is optimized for a single algorithm, it is very difficult and expensive to have an ASIC that can solve any combination of hash algorithms. An example of this second case is Ravencoin, with the X16R algorithm. This algorithm uses a number, unique for each block, to choose sixteen hash functions in a row from a set of sixteen, with repetition. So, there are potentially 16! = 20,922,789,888,000 possible combinations of hash functions that can happen.

As we said earlier, some cryptocurrencies have introduced novel concepts into the blockchain community. The Ethereum network was a big step forward for example. This network not only allows crypto-money transactions, but also allows you to run code (computer programs) on it, to create assets that can be linked to the real world, for example. This is done with smart contracts.

Another innovation that Ethereum will implement shortly is a modification of the PoW protocol. As we said, having all of mine the same is very inefficient and energy consumption is very high, so many alternatives are sought. One alternative that some coins are already using and that will be tested soon by Ethereum is the proof of stake (PoS) protocol.

The idea behind this protocol is not to have all the mining blocks on the chain and rely on the chain with more work, but rather to choose random miners from the network, and asking only the mining blocks. This selection is not intended to be completely random; features such as cyber age or currency possession would also be taken into account.

Smart contracts are very exciting as they can be seen as the beginning of a new era in computing. Stay tuned for related posts on our blog on this topic.

Alejandro O. Asharabed Trucido

+54911 5665 60608
Buenos Aires, February 16, 2022

No comments:

Post a Comment