# An Architecture for Biometric Electronic Identification Document System Based on Blockchain +
## 5 Consensus Algorithms
### Proof of Work (PoW) Algorithm
#### 5.1.1 Security Problems in PoW  
Blockchain is today considered as a technology really secure because of the difficulty to falsify a block or to change the ledger. However, there are some security issues that have been found and this resulted in the development of various proof-based algorithms.  
Imagine for example that we change the contents of an older block. The hash of this block becomes no longer valid because the Nonce value found for the block was appropriate for the older transactions. But like we have seen, if we change a little thing in the input of a hash function, everything changed in the output. Consequently, every other block that follows this invalid block is also invalid. In fact, every block is linked to each other like a chain, thanks to the previous hash block field in the header. The header is used as the input of the hash function so for all the following blocks, the Nonce value is no longer good. That is to say, thanks to this hash function, changing a little part of the Blockchain, makes everything that follows false and you need to find again all the Nonce values of the following blocks. Because of the difficulty of the puzzle and the rule that the longest chain wins, it seems impossible to falsify the Blockchain. But imagine that this person has a really huge resource of modernhardware that allows him to have more computing power than all the network's nodes. In this case, he will be able to falsify all the Blockchain. A famous attack consists of starting mining a fraudulent branch at the end of the Blockchain and trying the best to be longer than the honest fork. This attack is called the Double spending attack or the 51% attack in reference to the minimum computing power of the network required in order to do this work [51].  
Today, it is impossible for a single node to do this but thanks to mining pools, this kind of attack could be possible. To avoid this problem a lot of research has been done [52]. In a mining pool, the reward would be shared by everyone in equal parts. To disturb pool mining, [PERSON] et al. [53] proposed an evolution of the PoW algorithm. They called it the non-out-sourceable puzzles. This consensus algorithm was developed to discourage the mining pool and to do that, they created a mechanism that gives chances to a miner inside a pool to win all the rewards without making any effort.  
Another technique is used in the Ethereum cryptocurrency, it is called greedy heaviest observed subtree (GHOST). This consensus algorithm requires the mining nodes to include, in the header of the block they want to validate, the headers of the recently orphaned blocks known as uncles. Orphaned blocks are blocks that have been added on parallel branches of the main Blockchain. For Bitcoins, an uncle is, therefore, a block that would be considered as an orphan because it is not located on the longest chain. In GHOST strategy the longest chain is not chosen, it is the one with the most PoW contributions that will be selected as the valid chain. Ethereum encourages miners to include a list of uncles when they validate a new block. This technique has two main effects:  
* It reduces the incentive of centralization by always rewarding (minimally) miners who produce obsolete or orphaned blocks because they are not part of a large group and get noticed about other blocks later (due to propagation delays of the network).
* It increases the safety of the chain by increasing the amount of work on the main chain. As a result, less work is wasted on alternative branches in favor of the main branch.