Lesson 11: "Mathematical Rationale" Let's try to tamper with the blockchain

¿Por qué necesito esta lección?

In this lesson, you will learn how to mathematically prove the probability of successfully tampering with the blockchain, if you were to try to do so. By learning this lesson, you will see how difficult it is to tamper with a blockchain.

Lo que aprenderá en esta lección

  • The Difficulty of Tampering with Blockchains
  • Gambler Bankruptcy Problem
  • Finality of Bitcoin Transactions

The tamperability of the blockchain

Each good node in a blockchain will naturally not try to capture fraudulent transactions in its blocks.

Therefore, there are two types of fraudulent activities that a malicious node can perform

  • Falsifying the past history to get back the amount that has been paid so far
  • Monopolize new coins to be issued in the future.

Since the blockchain considers the longest chain to be the correct chain, the competition between the correct chain and the incorrect chain for length can be thought of as a random walk.

If the correct chain extends by one block, the group of good nodes will be one step ahead, and conversely, if the incorrect chain extends by one block, the group of bad nodes will be one step ahead.


The probability that the length of the rogue chain catches up with and overtakes the length of the correct chain is analogous to the gambler bankruptcy problem.

The gambler's bankruptcy problem is the theory that the probability of going bankrupt increases if you keep betting the same amount in gambling.

This theory proves that a gambler with little money cannot win against an operating organization with enormous financial power.


The Bitcoin thesis proves that the probability that the length of an illegal chain can catch up with the length of a correct chain even once becomes exponentially smaller as the length of the correct chain grows (as the number of blocks increases).

If P > q (where the group of good nodes outnumbers the group of rogue nodes), then qz becomes exponentially lower as the number of blocks in the correct chain increases.

Therefore, the rogue nodes have to close the gap with the correct chain as soon as possible.


Compruebe el progreso de su lección

Una vez que hayas averiguado de qué trata la lección,
haz clic en el botón "Comprobar".

Transaction Finality

From now on, we will learn how much time is needed to reduce the possibility of a transaction being tampered with to almost zero percent.

This state, where the possibility of a transaction being tampered with is almost zero, is called finality.


As an example, let's assume that the sender of a transaction is a rogue node and the receiver is a good node.

The rogue node sends a fake bitcoin transaction to the good node, and by the time the good node notices it after a certain period of time, it is already too late.

The rogue node will start forming blocks of the rogue chain at the same time it sends the fake bitcoin transaction.

The correct node has no way of knowing how far the rogue node has extended the rogue chain.

At this point, if the correct chain was forming blocks as usual due to the adjustment of the difficulty, the length of the block that the rogue node can extend would follow the expectation of the Poisson distribution below.


The probability that the rogue chain will catch up with the correct chain is obtained by multiplying the probability that the rogue node has completed forming k blocks at the time when each node starts generating chains by the probability of catching up from the z-k difference (number of blocks connected to the correct chain - number of blocks connected to the rogue chain), and summing the result over all k.


Converting the above formula into C code, we get the following


Let's try to apply some numbers to this formula.


As you can see above, the probability of a rogue chain catching up with a correct chain becomes exponentially smaller as z increases.


So, how many blocks does it actually take to reach the finality state?

If we assume that the probability of a rogue chain catching up with a correct chain is less than 0.1%, then the required number of blocks is as follows


In other words, if there are more than six blocks connected to the correct chain, the probability of a rogue chain catching up with the correct chain can be kept below 0.1%.

In other words, if six blocks are subsequently formed after a new block is formed, it is considered to be in a state of finality.

In the case of Bitcoin, the time it takes for a block to form is regulated by the Difficulty to be about once every 10 minutes, which means that the state of finality is established when 10 minutes x 6 blocks = 60 minutes have passed since the formation of a new block.


Compruebe el progreso de su lección

Una vez que hayas averiguado de qué trata la lección,
haz clic en el botón "Comprobar".

Lesson 11: "Mathematical Rationale" Let's try to tamper with the blockchain

0%

0%

No has completado todas las lecciones. ¡Vamos a completarlos todos antes de hacer la prueba!

Haga clic en el botón siguiente para iniciar la prueba.