decrypt bitcoin

Posted by fierce at 2020-03-22

Bitcoin has been hyped in recent years. There is no consensus on whether it is good or bad. Let's read about bitcoin's technology. After understanding the principle, what problems bitcoin can solve and what defects remain will be clear. The remaining question is to discuss what opportunities there will be as bitcoin develops.

We can divide the bitcoin system into four questions: 1. Transaction, 2. Payment, 3. Audit, 4. Mintage.

【1】 Transaction

The basic demand of the transaction is that the payer remits money to the payee. The technical challenge is encryption, which aims to prevent the third party from intercepting or even tampering with the remittance amount.

Bitcoin adopts the existing asymmetric encryption system based on public key and private key. There is no innovation here.

[1] In the legend of the second section, the leftmost box explains the transaction mechanism of the remittance from owner0 to owner1. The screenshot is as follows.

1. Owner0 first finds the public key of owner1. Encrypt the remittance details with the public key of owner1. In this way, only owner1 uses its own private key to open the encrypted remittance details. In the legend, no remittance details are drawn. But the negligence of this little account is of no consequence.

2. For the convenience of owner1 to verify that the remittance does come from owner0 rather than others, in addition to the encrypted remittance details, there is also the digital signature of owner0 in the remittance form sent by owner0. When owner1 receives the remittance, in order to verify that the remittance indeed comes from owner0, he can use the public key of owner0 to verify the digital signature of owner0 in the remittance order.

3. When owner0 sends out the money order, the money order is not only delivered to owner1, but also advertised. Anyone who wants to participate in bitcoin audit can receive all the money orders sent by all the people in the world.

4. Following the principle of 1, 2 and 3, owner1 remits money to owner2, and then owner2 remits money to owner3. Bitcoin, through hash mechanism, links all the remittance transactions involving the same bitcoin in order to trace the fraud of double hanging.

【2】 Payment

When the payer sends the transaction to the payee, the payment process is not completed. The payment process is not officially completed until the payee signs in the remittance.

Before the payee accepts the remittance, he must confirm that the remitter has no double pending payment. This is similar to that before we accept paper money, it's better to verify whether it's counterfeit.

Bitcoin's method of verifying duplicate payments is to rely on public prosecution. When the payee receives the remittance, he informs him of the money order. When the audit site receives the advertised remittance order, it will check whether bitcoin involved in the remittance order appears in other remittance orders and whether it is repeatedly paid. In case of such duplicate payment, the audit site will report and notify the payee to refuse to sign for the remittance.

Bitcoin guarantees that the repeated payment can be reported, but it cannot guarantee that it can be caught on the spot. [2] Suppose a scenario,

1. The swindler opened two accounts, a and B. He first remitted a bitcoin from account a to account B, and account B signed immediately. Before account B signed the remittance, he didn't give the remittance slip a wide notice.

2. Then the swindler goes to C's online shop to buy things. He remittes the same bitcoin from account a to account C. C after receiving the remittance form, wait for a few seconds. If the audit websites do not report, C will sign for a's remittance and deliver the goods at the same time.

3. But while C was waiting, the swindler told him the money order from a to B, and this was a money order that B had signed for. Because the money order from a to B is legal, this money order is accepted by each audit site.

4. When C signs in the remittance form sent by a and advertises, each audit website will report that the remittance form from a to C is a duplicate payment and is invalid. Although the swindler was reported, but C has delivered the goods, C was cheated.

In order to prevent duplicate payment, there are many improvements in bitcoin's current payment method. For example, when a payer can be forced to send a remittance note to the payee, the remittance note must be widely informed, and at this time, the remittance note has not been signed. Then, when the payee signs the remittance, he must advertise it again. However, unlike the first time, the second time advertises the remittance bill that has been signed.

However, it seems that up to now, no mathematically rigorous method has been found that can completely eliminate the occurrence of duplicate payment.

【3】 Audit

In order to eliminate duplication of payment fraud, a simple way is to submit the remittance note to an authority, such as Alipay, when the people around the world remit money. Alipay receives the BitCoin from the payer and sends another BitCoin to the actual payee. This ensures that the BitCoin received by the payee will not be fraudulent, but it can not guarantee that Alipay, BitCoin received from the remittances, has not been paid repeatedly.

For example, if the authority except Alipay, there are Paypal and so on, the payer remittances to two payers with the same BitCoin, and remittances are passed by Alipay and Paypal respectively. If the repeat payment is successful, the two payee will not lose, but there must be an institution fraudulent in Alipay and Paypal.

In addition to the technical loopholes, this fraud prevention mechanism relies on the practice of authoritative institutions, which is contrary to bitcoin's design concept of mass line.

Bitcoin's approach is to record every transaction from the birth to the present, and connect them in chronological order. It's like antiques. They usually have historical records. From the beginning of production and sale, every time they change hands, they are recorded, which helps to prevent being replaced by counterfeits.

Bitcoin's records are advertised, recorded, and strung together. In this way, every bitcoin transaction involves not only the payer and the payee, but also the third-party auditor. The auditor can be a full-time organization or any computer. Audit can not only discover illegal operations in time, such as repeated payment, but also backtrack even if the network is missed at that time.

[1] In the legend of section 8, the serial data structure of bitcoin transaction is explained, and the screenshot is as follows.

There are two points to note,

1. In order to improve audit efficiency, bitcoin combines multiple transactions into one block, and uses merkletree (also known as hash tree) [3] to organize these transaction details.

If you want to check whether a block contains a transaction, the easiest way is to find the appropriate private key, decrypt and open the block and the transactions contained in it, and then check one by one. Obviously, such an approach is not only a waste of time, but also very unsafe.

The advantage of using Merkle tree is that you don't need to decrypt the package, you just need to hash the transaction, and then compare the hash result with the hash value of each intermediate node in Merkle tree in turn, you can easily determine whether the specified transaction is included in Merkle tree, and which leaf node it is if any.

2. If each transaction contains only one bitcoin, the history of each bitcoin is a single line. But in fact, each transaction can involve more than one BitCoins, so the transaction history, not only has a single line, but also has multiple single lines combined into a single line.

There are not only mergers, but also bifurcations. This happens when a sends multiple bitcoins to B, and B signs in the remittance transaction, and then transfers multiple bitcoins to multiple payees.

Not only bitcoin's history has multiple lines merged into a single line, but also a single line split into multiple lines. And a bitcoin can be divided into several small coins.

【4】 Mintage

In the bitcoin system, anyone who participates in the audit automatically participates in the production of currency. The production of money, the process of mintage, is called gold mining in the bitcoin system.

Technically speaking, auditing and coinage are totally two things that can be separated. It is the setting of the rules of the game to bind the right of coinage with the participation in audit. The purpose is to mobilize the masses and jointly safeguard bitcoin's integrity system.

In addition, bitcoin's total reserves are pre-set. The purpose of this is to curb inflation by limiting the amount of money in circulation.

From a technical point of view, bitcoin system can be used as a toolbox to configure different rules and create another monetary system.

For example,

1. It can be set that only the government is qualified to dig gold, so as to take the right of coinage back to the government.

2. It is not necessary to set the upper limit of currency circulation, but to increase currency issuance according to new wealth.

3. Credit value can be set for each payer through authentication to speed up payment and sign in.

4. The payee of each remittance transaction can also sign for the remittance immediately through insurance. In case of repeated payment, the insurance company will compensate.

5. Although in theory everyone (actually every computer) is qualified to be an auditor, in fact, there are bound to be large-scale institutions, which will become professional audit institutions with strong computing and storage capabilities.


[1] Bitcoin: A Peer-to-Peer Electronic Cash System

[2] Best Practice for Fast Transaction Acceptance - How highis the risk?

[3] Introduction to Merkle Tree