Bitcoin Cash. And was there a fork?

in #bitcoin7 years ago

23c1382f96bfa6925a783a4b58f8cdd1[1].jpg
Today the topic Bitcoin and Blockchain attracts an incredible amount of attention. Unfortunately, the news does not allow us to understand the full scale of what is happening, as the authors get confused in the terminology and in a hurry release unprepared articles. Which again leads the wave of discussion from the technical side of the matter to the issue of speculation on the Bitcoin course.

Let's try to push emotions aside and study together what happens and what are the consequences.

Summary

  1. Bitcoin - society of lovers of mathematics
  2. What is fork? Why is not so terrible attack 51%
  3. Segwit. How it all began
  4. Bitcoin Cash - How to Earn and How to Give Others Earn
  5. Prospects

Bitcoin - society of mathematics lovers.

Many people represent bitcoin as an extremely simplistic system. Sometimes this is convenient, and sometimes it leads to the impossibility of explaining the current problem. For example, Bitcoin is presented as a huge ledger, where the miners every five minutes try to write another page in the ledger, where they will be recorded, from whom and to whom the funds have been transferred. This analogy is convenient and 99% is true, but it's hard to understand how you can get into this ledger, why you can create an address and account offline, without ever having to contact the Internet and other questions.

I suggest another analogy, Bitcoin is a community of math lovers. In the beginning there was a mathematician Satoshi who wrote the first problem and proposed 50 coins (conventional units) for its solution. Satoshi was very cunning, he offered such a task, to which only he knew the answer. But Satoshi was not only clever, but also intelligent, he drew attention and realized that the system would be alive only if there were other "mathematicians" in it. Then, Satoshi announced the rules, anyone who solves the published problem, can publish their tasks and the number of coins from the solved task to distribute between the new tasks. As a confirmation, Satoshi showed the answer to his task and offered 2 more tasks, one very simple for 20 coins, and another again very difficult for 30 coins. Another mathematician immediately picked up this idea and solved a simple problem for 20 coins and again created one very difficult - for 15 coins, and another simple - for 5 coins. In total, 3 unsolved problems (1 from Satoshi, and 2 from another mathematician) and 2 solved problems were obtained in the system. Many mathematicians rushed to solve simple and complex problems and within a week there were 100-1000 open tasks. At that time, the complexity of the task was completely independent of the number of coins, but even then the mathematicians collected intuitively more coins for their tasks.
The system showed a significant flaw, it needed to be maintained online, so that mathematicians could at any time calmly exchange decisions and lay out new tasks. Naturally, mathematicians decided to involve other "mathematicians" (programmers) in order to solve simpler problems, and for this, who would decide sooner, they received 50 coins and the opportunity to publish their task. For computers (programmers to program simple tasks) did not solve tasks too quickly and did not receive many coins, the complexity of tasks varies dynamically, through every N blocks. Since then, everyone has begun to live together, or almost unanimously.

Let's translate this story into the understandable Blockchain language:

  1. Each published task is a part of the transaction that contains a response to the previously assigned task (the previous transaction and scriptSig / signature) and new tasks (rough approximation of the output list), as well as the distribution of input coins to output coins.
  2. Each simple task is the task of the mining block, namely, finding the key for the hash with the specified properties. It adapts to make the solution approximately every 10 minutes.
  3. Each block includes a solution to the mining task and a list of transactions that the miner has turned on (important!)
    • How similar is the analogy to the real state of affairs in Bitcoin?
    • Quite close, here are some judgments:
  • Really. In Bitcoin input, the output (task description language) is a special Bitcoin script . In which there are up to 80 op-code, including multiplication, addition, hashing, encryption, but no cycles!
  • A typical transaction output looks like "OP_DUP OP_HASH160 a4b4c5245e00d758c4364085d60375b8e22cf482 OP_EQUALVERIFY OP_CHECKSIG" , Which simply speaking means, try to pick up such a number that OP_HASH160 will be equal to a4b4c5245e00d758c4364085d60375b8e22cf482. Of course, this is a question with a podkovyrkoy, a person who publishes such a task knows the answer in advance, but he does not want to tell him to others, let them, as they say, suffer, and he, when he wants new tasks, will do so.
  • Bitcoin does not have address concepts at the bottom level! Roughly speaking, you can write an absolutely cosmic (in terms of UX) application, which will specifically ask you to solve a mathematical problem and absolutely normally interact with bitcoin blockchain. In practice, the address is Base56 from the number a4b4c5245e00d758c4364085d60375b8e22cf482, but this is only true for transactions of the form "OP_DUP OP_HASH160 a4b4c5245e00d758c4364085d60375b8e22cf482 OP_EQUALVERIFY OP_CHECKSIG "
  • In the output, you can write OP_RETURN. Which will mean that your task is very easy to solve. And with a probability of 99% in the next, and maybe in the current block, your coin will be taken away (to a new task) and this will be done by the blocker.
  • One of the simplest ways to burn bitcoin is to put the problem x ^ 3 = y ^ 3 + z ^ 3. Naturally, the problem does not have a solution in positive integers and it will never be solved.
  • A transaction can specify multiple input tasks, but in a transaction all input coins must be spent (the positive remainder is considered a fee and gets to the miner).
  • Transaction (TX1) Input refers to the Transaction Id (TX0), which is already published, and represents the input parameters in TX0 output, when substituting the output of the previous transaction (TX0) is evaluated to TRUE.
  • Input parameters, too, can be a script, but this is a rare phenomenon
  • In the output, you can write any string. Do some people write "marry me" ?

Here are some more judgments for which you can conduct a detailed analysis (but not now):

  • If the output is simple (unencrypted), then it is most likely that the unit miner will take it, even if you run your transaction and it will be absolutely valid.
  • In order for the miner not to steal all transactions, the input input is encrypted in such a way that it can be applied, only to a specific output. Thus, the miner can invalidate the transaction, but it can not change the output, otherwise the transaction will become invalid.
  • Important! The miner can drop a "valid" block and include invalid transactions. Since all clients connected to the bitcoin override the transactions, they will not consider the block to be valid. Other miners can steal the block and include already correct transactions and they will already receive a reward for the block. Roughly speaking, different miners (clients) will have different block history, this is hard fork

Perhaps it is now clear why the ledger is a simplistic analogy, because blockchain does not even have a concept of addresses.

What is fork? Why it is not so terrible to suffer an attack of 51%.

Even today there was an article that the attack is 51% scary and more than 80% of the mining capacity is in China and it's time for us to be afraid. Again, if we present an analogy that there is a book of records and someone has 51% or more and he starts writing in it what he wants. Then, yes, the 51% attack is already simply irresistible. In practice, everything is not so.

Let's return to the analogy of the community with mathematicians, suppose the miners captured 100% of the capacities and publish problems with incorrect answers in various scientific journals at frenzied speed. Naturally, the community of mathematicians will become discouraged, but they will never admit wrong answers and will not write to their personal journal. In the blockchain, each (!) Stores its log. How would an adequate scientific community behave? It would compile a list of good scientific journals or establish a different communication channel and start with the last "valid" transaction. Yes, it would take some strength and time, but this attack would not affect the "truth" of the magazine. This phenomenon is called hard fork . There were 2 chains and each with its own right.
Between miners and mathematicians (users), unique relationships have developed, some do not exist without the others and vice versa. And this balance is observed. Like any system, bitcoin requires improvements. Bitcoin Core is a group of people who used and developed bitcoin practically from the very beginning. And from the very beginning, they were faced with the first difficulty of development. How to release updates? If you even run an attack of 100% and update all the miners, you can get a broken blockchain and a hard fork probability (if the clients do not update), which is absolutely undesirable. Therefore, the concept of soft fork was developed: all the miners are updated, but customers continue to receive backward compatibility blocks and transactions. Clients are updated as needed. Some changes were simple enough to implement. For example, Bitcoin had NO_OP1-10 operations, which meant nothing, they were used for new validation.

Any upgrade process is a complicated procedure and after a while was allocated
Formal process of updating through soft fork (using the following agreements):

  1. All the miners who have blown the block include the information in the block that they are ready to update and include some functions.

  2. After a certain period of time, when the blocks become 95% in a row (agreed on this number, although not necessarily), the miners begin to carry out the attack of the majority. Those. They refuse to accept blocks that do not support the new function (BIP - bitcoin internal proposal). This is a signal that it's time to update all miners, otherwise they will not see their mining fee.

  3. Activation of a feature can occur with a delay, i.e. NO_OP1 -> DIG_SIG_OP can start working through 100 blocks, which gives time to update to clients who already know when the feature will be enabled by markers in blocks.

PS All this should work in a backwards compatible mode, i.e. Those who have not updated will continue to receive updates and work correctly.

The update algorithm is an arrangement, not a formal algorithm! Agreements fail. The most well-known case occurred with the update block_version = 3, when a 95% signal about the inclusion of the majority attack passed, but AntPool continued to drop blocks with version (3) and unfortunately between them still included blocks from other miners with version 2. This was the most A real hard fork, because AntPool with other miners had a lot of power and was able to build the longest chain (by default, bitcoin clients take the longest chain). The problem was with other miners who could not defeat this chain (since there were blocks 2 and 3) and refused to accept it. After 6 hours of fork with AntPool administrators contacted and they abandoned their blocks. Note that hard fork occurred on the same transactions, i.e. Transactions came immediately into 2 fork, though in different blocks.

As you can see, the mechanism of updating was invented not by mathematicians, but programmers-politicians, so sometimes it fails (joke).

Segwit. How it all began

Segwit is an extremely interesting update for Bitcoin, which allows you to make Transaction ID stable for changes on the part of the miners. Today there are techniques when the miner, or the owner can change the inside of the transaction, that the essence remains the same, but the id will change. About Segwit should be told separately and in detail, but the main difference between Segwit and other updates is that it is extremely voluminous.

For Segwit updates, the updated systems should already have two blockchain (!), One which they will show to all nodes before SegWit, and other nodes after SegWit. The essence of transactions and output, of course, will coincide, but the input is slightly different. The thing is that the transactionId has been changed, and this is the necessary parameter for input. Changing the segwit of the block is irreversible, since the new blocks can not mix with the old ones and must go strictly according to the arrangements, which just caused a great delay and a lot of negotiations.

On August 1, there was a locked-in for Segwit, i.e. Blocks that do not declare support for segwit are not included in the block system. August 22 will be the final activation of Segwit and it will be possible to store witness data in transactions.

1 byte Witness data is counted as 0.25 bytes, and 1 byte of the remaining data remains one byte. The block size without witness data has not increased and still is 1 MB, but with segwit it can be 4 MB! Segwit is a soft fork and can not increase the block size otherwise previous versions will not be able to outlaw new blocks. The irony is that the miners adapt the new blocks to the old customers so that they can be disposed of. The new transaction format is also different and also requires adaptation between versions.

Perhaps there is still some way to increase the size of the block, keeping backward compatibility. For example, reduce the complexity of mining tasks and generate blocks more often

Bitcoin Cash - How to Earn and How to Give Others Earn
What did they expect on August 1? What happens is hard fork and we will see the dissenters. And what happened?
Something strange happened ... Since in all plans hard fork was expected on August 1, all sites wrote on August 2 that bitcoin was divided and this idea was picked up by all the commentators and the situation became confusing.

Consider + and - whether Bitcoin Cash is fork or not:

  • Bitcoin Cash really took the whole Bitcoin story until August 1 as it is (+ hard fork)
  • Bitcoin Cash immediately stopped processing valid transactions distributed over the Bitcoin network (- not fork)
  • Did Bitcoin Cash disconnect from the Bitcoin network? (-the typical fork)
  • Bitcoin Cash began to reject new Bitcoin blocks (+ hard fork, the new blocks are not compatible with validation)
  • Bitcoin Cash conducted an incompatible change with Bitcoin - increased the block to 8 MB (+ hard fork)
  • Bitcoin Cash refused to include SegWit (+ hard fork)

In principle, you can say with reservations that Bitcoin Cash is fork. But 2 factors still say that this is bitcoin history fork, not bitcoin fork.

  • stopped processing valid transactions (requires verification)
  • looked like an extremely planned action on the part of the BCH organizers, and not an attack or protection of their interests in Bitcoin (a new wallet, new mining tula, a new blockchain explorer ..)

To whom is it profitable?

  • In principle, all those who had bitcoins, now they are 20-30% more.
  • We have a new, already popular block structure with 8MB per transaction, which is 8 times more, and therefore cheaper.
  • Those who bought a lot of Bitcoin before the split, and sold them immediately after the split. Fee from sales was 0.2-0.5% of X, and revenue for 10 minutes is 30% of X. If you put X = 10 000 000, then calculate yourself.

Prospects and what's next

The most interesting thing is that bitcoin spent only soft fork and only prepares for hard fork on November 20. Already in November there will be a real hard fork and it will be inevitable (probably). The miners decided to increase the block to 2MB, this will automatically make old versions of Bitcoin wallet incompatible, which will lead to people either updating and accepting 2MB or continue to litter the network with an alternative version of blockchain, and maybe someone will continue to block blocks of 1MB . I really hope that this will not happen.

After segwit2x, the bitcoin core group may again meet and return to the development of the new BIP, and will also update the official bitcoin core client to support the 2MB block. At least all existing BIPs were developed with its support.

PS I admit a large number of technical inaccuracies, please comment - we will correct.

Sort:  

Congratulations @btursynb! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published your First Post
You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!