MAPPING CONTROVERSIES: THE BLOCKCHAIN AND CRYPTOCOINS
About the project
Index
Actors
Chronology
The Blockchain is actually a ledger in the form of an account book series.

Users of the Blockchain use the Ledger to register transactions. For each transaction, three information are registered:
• The sender
• The recipient
• The amount of the transaction

All users have a free unlimited access to the Ledger in order to check any transaction since the very first one. Therefore, there is actually no wallet robbery (or even falsifying) simply because there is no wallet at all: every user knows how much a user has by doing the math between all he ever received/spent.

This book series has a particularity: it is a chain in which no book can ever be deleted nor modified once it has been added to the chain. So to add a book to the chain, users have to be certain that transactions in the new book are valid, after it will never be editable.

Therefore, to add a book to the chain, at least the majority of users has to approve/validate transactions written in it. Books are added to the chain by consensus to the never-ever-editable Ledger: the Blockchain.

HOW IT WORKS: UNDER THE HOOD OF BLOCKCHAIN
THE LEDGER:
Block N with nonce 1 --> aogri0rC6 --> don’t fit
Block N with nonce 2 --> zap012vFrz --> don’t fit

Block N with nonce 19,035,357 --> g0rna0zocJ --> FIT! --> we have two "0" and one "a"
Doing the math in the current Ledger (= the validated account book series = the Blockchain), you know that currently Adam, Bob, and Charles and Diana have:





Assume the following account book is waiting to be forever added to the Ledger (Blockchain).










• Users want to be sure Adam, Bob, Charles and Diana actually can make such transactions.
• So a bunch of users (which needs to represent at least 51% of all) will check step-by-step transactions.













Adam can’t make such a transaction, most of users reject this transaction and the book cannot be added to the chain as it is considered corrupted.

The chain of books which constitutes the Ledger is not an image at all, the Blockchain is really a ledger constituted of blocks. These blocks are added by consensus: to be added to the chain, a block is validated by at least 51% of all users.

We just saw that people are making transactions of Bitcoins (it can be any other cryptocurrency). But how exist these bitcoins? Adam, Bob etc., where did they find these coins? They probably received it from someone against common money or a good. But this someone also received somewhere etc.… At some point bitcoins had to be created. But nobody can be responsible for emitting coins as it works with no central authority.
We also saw above that for a block to be added, it needs to be verified by 51% of the users, it needs time. Moreover, million users could try to send their transaction through a block with only their transaction registered in it. This results in a flood of millions blocks to be validated at the same time all over the world.

EXAMPLE:
HASH:
However Blockchain updates take time to be propagated to all users (a few time but nothing is instantaneous) so we would have lot of blocks to be added at the same time all over the world resulting in a huge mess. It would be impossible to have a clear and unique update of the Blockchain for all users.

So there is the need of two things:
• a way to create coins under the control of no one, so it has to be part of the system;
• to limit in time the addition of blocks, at least some sec/min between two blocks, the time for the blockchain to propagate the update.
The solution to both these problem is actually the key innovation of Bitcoin invented by the unknown Satoshi Nakamoto: the proof of work. He limited the addition of blocks to every 10 minutes (it is a long time, but bitcoins were invented a long time ago when internet was still quite slow, new cryptocurrencies allow 10 sec) using Hash function.
A hash function is a one-way function. The output is easy to find with the input, but with an output you cannot find what was the input. From any input the output is alphanumeric and has a fixed length.

Examples with 10 characters’ hash key:








--> No matter the input length of form, the output always has 10 characters;

--> Just a ‘y’ transformed in ‘u’ totally change the hash key. Therefore, hash key foremost is used as signature of a numeric object. For instance when copying: at the end of the transfer the copy is passed through a hash function, the hash key is compared with the hash key from the source; if it is the same then the copy must be the same, because only one difference would have led to a totally different hash key.



A scale (balance ?) for instance is a good example of a one-way/hash function in the real life: you put something on the scale and the output is the weight, but with only a weight you cannot know what has been weighed. And in fact, at the automatic checkout of a supermarket, you have to flash the barcode (which also is a kind of hash key of a product) and put the object in the basket to the right where it is weighed. The weight is used as the signature of the product. To be sure that you really put in the basket the stuff you flashed the machine knows the weight of all the products. You cannot flash a chewing-gum and put a wine in the basket.

If you are punctilious, you could say that two different object could have the same weight while two different numeric object cannot have the same hash. This is wrong: two different object do have a difference in weight, the scale only has to be accurate enough to be able to see it, it cannot be exactly the same weight until the last molecule. So a scale is a kind of hash function and the weight is the equivalent of a hash key, it helps to understand how it works.
A block full of transaction is the input of a hash function, the output of it is its hash key.

The block is composed of 3 things:
• The hash key of the previous block
• Transactions (sender, recipient, amount)
• A nonce which is alphanumeric and random for iterative hash,
we will see…


Change anything in block --> change hash key --> change the first
information of block N+1 --> change hash key N+1 …


This is why it is an unbreakable chain of block:
every block is linked with the previous.


A change in any block change all blocks after it:
the whole chain after the corrupted block will be corrupted.
HOW IS IT WITH BLOCKS?
• You cannot know the hash key of “Hello how are you today?” or “01010010100011” without passing it through the hash function.

• The idea of the creator was to impose conditions on the hash key of a block (passed through a hash function).

• For example the system can impose automatically “the hash key of the next block has to have a ‘a’, and two ‘0’ in it”, like 0atrba02f: there are two ‘a’ (and we needed at least one), and two ‘0’.

• Here is where users will use the nonce, it is just a chain of characters. They try to pass a block with a first nonce, and see if the hash key of the block fit with the characteristics needed (the output of a hash function is unpredictable and random without trying with the input). If it doesn’t fit, they try with another nonce, and another, and another etc. until they find a fitting hash key.







• Users working on this block N had to try 19,035,357 times before finding a hash key which fitted with the characteristics: it took time the difficulty is made for blocks to be find in ten minutes on average;

• If people several times find blocks in less than 10 minutes (simply because with time the computing power increase), the system automatically increase the difficulty, like “the hash key of the next block has to have a ‘a’, two ‘0’ in that order in it”.

• The difficulty being higher, computers will take more time to find the next block

• Again if computer power increase until finding in less than 10 minutes, the difficulty will be increased.
PROOF OF WORK:
So now we have a solution to impose blocks to be accepted only every ten minutes. But as we saw, it takes computer power and time, which means electricity and therefore money. Why bother? Because there is an incentive: finding a fitting block lead to the creation of bitcoins which are given to who found it. So people are actually competing to find before the others a fitting block, it really worth it. This is why they always put more computer power on mining blocks: to have more computer power and then more chances than the others to mine a block. In fact, people seeking blocks are actually called miners, because as real miners dig randomly to find gold, block miners hash randomly to find bitcoins! Mining blocks is the only way to create bitcoins, and as it takes time the system created a programmed scarcity: only some bitcoins are created every ten minutes.

Satoshi Nakamoto solved both the problem of creating numeric scarcity and to limit in time adding blocks to the Blockchain.
The proof of work can be anything, some altcoins use: electricity, DdOS, proof of space and so on. The biggest problem of Bitcoin's proof of work is its high electric consumption, which is comparable to Ireland's power.
FORK:
Just one more detail: it happens that two blocks are mined (hash key fitting with the characteristics imposed) at two points of the web merely at the same time:
It takes time for the web to be updated so there are two theoretically valid blocks: the result is the creation of a fork in the Blockchain.







When it happens the miners of each branch of the fork don’t get paid for the moment because only one branch of the fork will be followed and the other abandoned.
• Some miners will decide to work on the next block using the hash key of 1
• Some other miners will decide to work on the next block using the hash key of 2

If a block is find after 2 before after 1, all the web will switch to the branch 2:







In that case, the miners who found 2 gets paid for it, 1 is an orphan block and the miners of it never get paid for it. 1 will be abandoned:
ARCHITECTURAL SECURITY
The architecture itself is safe:

You can’t just invent bitcoins because as we saw, there is no wallet but just a sum of what you received and spent. If Adam tries to spend more than he can (which is called double spending), he will need the approval of 51% of all users;
Actually mining is hard work, it would make no sense to spend 10min with heavy computational power (which consume an electric power comparable with Irish total electricity power) to mine a block with wrong transaction in it. Your block would be accepted by the system because it fit with the characteristics but then you would need the approval of at least 51% of users. They will check all the transactions of the block and easily see something is wrong: ten expensive minutes would have been spent for nothing. So before mining, miners first verify that there are mining true transactions.

Decentralization is also a key security: if cyberpirates ever try to falsify a block, they would need:
o first to be able to mine a corrupted block. It is extremely hard to mine alone. Miners usually work together on a block to mine it in ten minutes, alone it would take centuries…
o second, if you successfully succeeded in mining a corrupted block, then you will have to attack the computer of all the users on earth (because they all have a copy of the blockchain) to add this block to the Blockchain: this is impossible. The blockchain is based on peer-to-peer. As peer-to-peer download, once a document/music/video is put online by someone, people download and share it again and the document is propagated exponentially all over the world in some seconds. If someone want to stop the propagation it would need to delete it on all computers all over the world which is impossible or stop internet itself.
o Finally, even if it is impossible, once a block is corrupted, people will easily see it. Everything would stop because nobody would trust Bitcoin anymore and they would worth nothing after that.

Users trust bitcoins because as gold they are scarce and scarcity it the base of any currency. For instance, if a state emits too much liquidity people will not trust the currency anymore because scarcity is not guaranteed. In bitcoins only a fixed amount defined by the system can be created every 10 minutes: no more, the architecture of the system creates the scarcity.

Finally, it is impossible to spend the money of someone else. For example Charles could register “Diana send 5 $BTC to Bob” in the block. Once the block is mined it would be validated because Diana has 6 $BTC so she could spend 5. But transactions are actually ensured by asymmetric cryptography. Asymmetric cryptography is explained in the page “Security”, “Asymmetric cryptography explained with dictionaries”. Basically it ensures that only Charles only can register transaction with his own bitcoins. To make a transaction Charles must sign it with his own private key, and he send it like a message using the public key of the recipient. Asymmetric cryptography used in the Blockchain is unbreakable follows the latest patterns which are currently unbreable in a reasonable term.
CONSENSUS & THE 51%
The blockchain has only one failure: consensus. To be added a block needs consensus of all users. If a miner (or a bunch of cooperating miners) ever reach the majority of 51% of the total computational power, he (or they) will be able to take control of the Blockchain. However it would be almost impossible as it would cost billion dollars to do so because the current total power is too high and miners have to incentive to create a majority (see 25% attack in the security page).

And their power will still be limited:
• They will not be able to change the past transactions: as all blocks are linked to the previous, they would need to recalculate all the blocks after the corrupted one, which is still a hard work.
• This only would result in a fork, the 49% would keep the Blockchain before 51% attack, and kick out from this chain the 51% computers by kicking out their signatures.
• The attackers would not be able to spend the money of someone else because transactions are signed with an unbreakable asymmetric cryptography.

So basically, a 51% attack only would be able to double spend money but not the money of others and block other transactions. Having 51% of the power is impossible because too expensive and the system has no incentive to make mining pools always bigger (a mining pool is a group of miners working on a same block) because the bigger is a mining pool the more miners have to share the reward. So miners don’t care to be 100, 10000: if they are 10000 they will mine a block 100 times faster but they will have to split the reward a 100 times more. And even if it was to happen, the attacker will soon be kicked out of the system.
CONCLUSION
The Blockchain:

• It is a ledger constituted of all transaction ever made;

• It takes the form of a chain of blocks where are registered transactions;

• A block has to be mined looking for hash keys to be added, this guarantee the proof of work: that you actually had to work hard to mine it, so there is no incentive to mine corrupted blocks;

• Actually you cannot add a corrupted block because 51% of all users at least will verify it;

• The proof of work also creates a numeric scarcity with no central authority;

• Mining cost money but there is an incentive: mining a block lead to the creation of bitcoins;
The blockchain is safe because it is decentralized and protected by cryptography
CREDITS:

Nicolas Fernandes


SOURCES:

Sveinn Valfells, “Minting Money With Megawatts”, 2016

Satoshi Nakamoto, “Bitcoin: A Peer-to-Peer Electronic Cash System”, 2009
REFERENCES