1. What is a hard fork and a soft fork?
01 hard fork
A permanent divergence in the block chain, commonly occurring when non-upgraded nodes can’t validate blocks created by upgraded nodes that follow newer consensus rules.
Blockchains have permanent differences. After the new consensus rules are released, some nodes that have not been upgraded cannot verify the blocks produced by the nodes that have been upgraded. Usually hard forks will occur.
02 soft fork
A temporary fork in the block chain which commonly occurs when miners using non-upgraded nodes violate a new consensus rule their nodes don’t know about.
When the new consensus rule is released, nodes that have not been upgraded will produce temporary forks because they do not know the new consensus rules and produce illegal blocks.
Among them, hard forks, such as ETH hard forks produce ETC, BTC hard forks produce BCH. In particular, BTC has BTG, B2X, BCD, SBTC, ABTC, etc. after hard fork bifurcation, and may be more and more in the future.
So why does a coin have to produce more than one coin? This is like a team starting a business, and each has its own opinions on key issues, splitting out different camps, and finally splitting up and doing what you think is right. And this "all-in-one" is the so-called consensus, and they do not recognize each other, so there is a hard fork.
The soft fork is the node that adopts the new consensus, and the node that maintains the old consensus. The nodes of the old and new consensus always work on the same chain, but the blocks excavated by the old nodes have no chance to be recognized. The block generated by the node will eventually be considered as a short chain and will be discarded. For example, the mobile app upgrade, although the new features, but the app is still the app, will not produce two apps.
2. What is a consensus algorithm?
Bitcoin has a Byzantine general problem, and the consensus algorithm is to solve this problem.
So what is the problem of General Byzantine? Here is a story. Byzantine is the capital of the Eastern Roman Empire. In order to defend against the invasion of foreign enemies, the army is stationed nearby, and each army is separated far and independent. The generals and the generals can only rely on the messenger to transmit news. In the war, all the generals in the Byzantine army must reach a consensus (offensive or retreat) before they have a chance to win. However, there may be traitors inside the army, and the decision of the generals. At this time, in the case where members were known to be rebellious, how the remaining loyal generals reached an agreement, the Byzantine issue formed. Simply speaking, the problem of Byzantine generals is the question of trust and the problem of information transmission.
Here, various consensus algorithms have been developed to solve this problem, including but not limited to POW, POS, DPOS, and so on.
3. What is 51% of computing power?
Because virtual currency is decentralized, that is, there is no authority center to manage transaction information, but based on miners scattered around the world to store this information, and the correctness of a transaction information, "most miners think this The pen transaction is correct and the deal will be executed "idea.
If a miner masters more than 50% of the computing power, just as a company shareholder holds more than 50% of the company's shares, what the shareholder says, others have to listen, he said the deal is correct, that is correct. At this time, the major shareholder miner can initiate a transaction to transfer the bitcoin of the A account to the bitcoin address of the miner of the major shareholder. Therefore, since he is a major shareholder, the transaction is correct, and the Bitcoin of the A account is correct. Will be transferred out.
Although this is theoretically feasible, based on the current level of development of Bitcoin, it is impossible for a miner to master more than 50% of the computing power.
4. What is a replay attack?
Here is an example. When Ethereum hard forks, the Ethereum hard forks appear two chains of ETH and ETC. The transaction data structure on the two chains is exactly the same, so a transaction is valid on ETH. , then it will be accepted on ETC, and vice versa. No one realized that the two chains would cause mutual playback problems before the fork. Later, many miners continued to maintain the ETC chain. It was found that transactions on the ETH chain were still effective in getting the ETC chain to continue playback (broadcasting).
At this time, as long as someone extracts ETH coins from the exchange, it is possible to get the same amount of ETC coins. Many people use this vulnerability to constantly charge and withdraw coins (ETH) on the exchange to obtain additional ETC. This is the exchange of cloud coins, BTC-e and other exchanges that said they were replayed and were defrauded of almost all ETCs. The "replay attack" is also known in the currency circle.