All about Concurrency Mining, Web Mining and WASM

Cryptocurrency Mining

Cryptocurrency synonymous with bitcoin. But this is not the case anymore. Due to its increasing popularity, many cryptocurrencies has evolved eventually. Bitcoin is just a type of cryptocurrency among many. There are many cryptocurrencies other than bitcoin like Monero, Dogecoin, Tether, Ripple etc.

Then what is cryptocurrency? And what is its relation to blockchain?

Hmm… It’s very confusing to understand what cryptocurrency is. Let me make it simple. First, let’s see the definition on Wikipedia

A cryptocurrency is a digital asset designed to work as a medium of exchange that uses strong cryptography to secure financial transactions, control the creation of additional units, and verify the transfer of assets. Cryptocurrencies are a kind of alternative currency and digital currency.

So cryptocurrencies are the type of digital currencies. But who takes care of transactions? Which bank? The answer is no one.

The blockchain is the technology beneath the cryptocurrency. The blockchain is the decentralized database of transaction that included values. It differs from the traditional approach for instance bank. When you transfer money online, the bank is the middleman who does the work of verification. It verifies the sender, receiver, the amount or in short, it takes care of all transaction. But in the case of cryptocurrency, there is no bank. Blockchain technology takes care of all this. Explaining more about blockchain is out of the scope of this post. The blockchain is explained well by a video by World Economic Forum.

For now, just understand blockchain is the technology which fuels cryptocurrency and verifies the transaction. 

The transaction is approved or verified by solving the mathematical problem called a crypto puzzle. Miners solve a crypto puzzle as a proof of work (PoW) whose difficulty is dynamically adjusted to produce new blocks at a constant block rate guaranteeing predictability and tamper resistance. Miners compete with each other to solve the problem. Miners use their computational resources to meet the difficulty. When the PoW reaches the difficulty, the new block is linked to the previous one (i.e transaction becomes successful) and also miners are rewarded with cryptocurrency. So basically miners do the job of verification and in return, they get a little share in form of cryptocurrency. 

Due to the recent increase in popularity in mining, more and more people have started it, thus increasing the difficulty of solving the problem and need for extra computation power. There is a direct rule of proportionality between miners and difficulty. So if miners increase the difficulty increases and thus the need of power to solve the puzzle increases. Thatswhy people use high-end GPUs for mining. Web Mining is an alternate solution which drops the need of CPU or GPU.

Web Mining

In Web or In-Browser mining, the computational power of the website visitors is used for mining. The website publisher embeds the script (typically JavaScript) on their website. This script pulls the website visitor (knowingly or unknowingly) to mining pool and uses their computational resources to mine cryptocurrency. On successful mining, the website owner gets rewarded(i.e get cryptocurrency). The use of new technology Wasm for mining is on the high rise. 

WebAssembly (Wasm)

According to Wasm website,

WebAssembly (abbreviated Wasm) is a binary instruction format used in website to execute code at native system speed.

Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications.

In simple terms, Wasm allows using C/C++ languages for web applications. This language has the advantage of speed and ease of execution on the system.

The wasm bytecode can be processed by V8 JavaScript engine. The V8 JavaScript engine is the engine responsible for the execution of JavaScript on top browsers like Google Chrome, FireFox etc.  Wasm is supported by almost all top browsers. You can check if Wasm is supported by your browser by playing this game

Wasm has the advantage of the speed of execution, as it can get executed nearly to the time required by native code to get executed on the machine. Due to this advantage and its open nature that allows free interaction with JavaScript libraries, it has been used by most of the cryptocurrency miners. I will write more about Wasm in an upcoming blog post. 

Thank you for reading!


Edited by: Abhilash Dorle

Leave a Comment