The protocol behind cryptocurrencies has first been developed by a mysterious figure: Satoshi Nakamoto who developed the Bitcoin system.
The idea is that instead of being a delimited file or object that could possibly be duplicated, the Bitcoin system simply gives access to a ledger that records every transaction. To use a simple comparison, it is as if you tried to play poker without money or chips. You would need to record the bets, who won and who lost and eventually how much money has changed hands and whose are the hands involved. The players only have a limited trust of one another, so each would keep their own ledger from fear of being cheated.
How then is each person identified so that no one can make transactions in their name ? The identification system works with a pair of keys, a public and a private one. Each transaction is accompanied by a string of bits that is generated as a function of both the nature of the message and the private key, the other agents on the network can then check, with the public key, that this identifying string has been generated with the associated public key. This system of double identification is safe by design as people are identified through a mixture of publicly available information and a uncrackable code. However safety is negated if access to the ledger is made through a web service that uses a standard ID/password combination.
But how can one be sure that each individual version of the ledger is the same ? Basically, the solution put forward by bitcoin and other cryptocurrencies is that the version of the ledger that is gonna be kept eventually is the one that has the most computational work put into it. The idea behind this “proof-of-work”mechanism is to make fraudulent or conflicting versions of the blockchain require an infeasible amount of computations.
This system was first designed by Cynthia Dwork and Moni Naor to fight spam. It relies on an object called a hash function, most commonly SHA-256 (first developed by the NSA), that generates from an input a seemingly random output made of a fixed number of bits (256 if our example hence the name), the hash function is made so that by altering the input only so slightly, of even one character, we get an output that looks nothing alike. In the case of cryptocurrencies this cryptographic hash functions is used to generate blocks, the elements of the larger ledger, itself called the blockchain. A block contains a list of transactions whose size is limited differently from one system to the other (roughly 2400 in the case of bitcoin) and a hash function input that is such that the ensemble of the transaction plus the hash input gives an output of a certain form (usually starting with some number of zeros). This special number will then be added as the header to the next block so that the input that solves the same problem for the next block will depend on this header. If someone wanted to alter a block retroactively, the new recorded transaction would change the proof of work solution in the current block but also in the following block thus making it exponentially harder to find a new solution for every block in the chain as the chain grows longer.
This process of generating hash-inputs to sign the blocks and make them accepted in the blockchain is called mining, the first new block to get accepted in the chain is the one produced by the miner who solved the hash problem the fastest, if it includes a transaction that other miners have not received, because for instance it is fraudulent, a new chain not including this transaction will be generated and since the chances of generating a large number of consecutive blocks are increasingly small the fork containing this transaction will be discarded in favor of the longer one that doesn’t include it. In a few words, the true ledger is the one that has the larger number of blocks, the one with the most work put into it.
Why then this term of mining ? The answer lies with incentives, when a new block is generated some units of currency are added to the wallet of the person who generated it, the system could not be decentralized otherwise because no one would have a reason to keep the ledger updated. Furthermore as the number of transactions increase but the size of a block doesn’t, miners have to chose which transactions to include in the blockchain and this choice is easier made when they can charge a transaction fee. Most cryptocurrencies are also a finite resource, there will never be more than 21M of bitcoins, the mining is getting increasingly harder and is driving cryptocurrencies “producers” to invest in more more computers and more and more energy .
From this base many cryptocurrencies have developed improvements or alternate design. For instance Iota forgoes the mining process completely and uses scalable blocks. Ripple is simply a contract intermediary to trade any kind of currency or tokens and is closely linked to the finance industry. Ethereum offers additional services to its users like participating in ICOs etc…
by Joel Brehin