Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: BlackHatCoiner on March 31, 2024, 12:48:15 PM



Title: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: BlackHatCoiner on March 31, 2024, 12:48:15 PM
[← Previous Question (https://bitcointalk.org/index.php?topic=5489635.0)]

Bitcoin quizzes are technical questions of educational character that improve the average user's knowledge on Bitcoin, and help him rank up. You can read more about it in here (https://bitcointalk.org/index.php?topic=5489188.0).

As of today, we acknowledge the probability of a malicious pool turning evil, attempting to reverse your transaction with 10 confirmations. We are also aware that the probability of finding a certain number of blocks within a certain time frame follows the Poisson point process, which is a random mathematical object consisting of points distributed independently of each other within a space.



Question: At the time of writing this (http://web.archive.org/web/20240331120711/https://mempool.space/mining), a rich billionaire decides to purchase lots of unused, available ASICs manufactured by Bitmain, with the intention to attack the network. He has acquired so much computational power, that he, alone, can generate 300 EH/s (exahashes per second). Once his setup is done, he turns his ASICs on and attempts to reorg the chain. Assuming that the rest of the hashrate remains constant, how many confirmations do you need to be 99% certain that your transaction will not be reversed by the attacker, and why?


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: AmaGold70 on March 31, 2024, 01:11:21 PM
While reading the question "reorg" got me confused as I don't know the meaning. Is reorg an abbreviation or a slang used in the forum?

Edit: reorg means reorganize, got it.


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: BlackHatCoiner on March 31, 2024, 01:15:10 PM
While reading the question "reorg" got me confused as I don't know the meaning. Is reorg an abbreviation or a slang used in the forum?
https://learnmeabitcoin.com/technical/blockchain/chain-reorganisation/


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: GxSTxV on March 31, 2024, 01:43:47 PM
It’s a new thing to me and these quizzes are giving me some motivation to learn and improve my knowledge also to understand that the security of transactions on the blockchain relies on the number of confirmations receiveid.

Using this guide : https://bitcoin.org/bitcoin.pdf
And taking at this time of my reply hashpower of the rest of the network is 560.35 EH/s

So in this scenario if someone could control a massive part of network hashrate: 300 EH/s, and tries to reorganize the chain the risk of a successful attack increases should be calculated in this way using formulas given in that guide and with the help of an AI to simplify my calculations :

We first calculate the probability of the attacker finding the next block (q):

https://talkimg.com/images/2024/03/31/VRqyZ.jpeg

[300  / (560.35+300)]=0.3487
In this case q = 0.3487

Then, we need to find the number of confirmations (z) needed for 99% certainty using the provided formula:

https://talkimg.com/images/2024/03/31/VR0K8.jpeg

And we going to find approximately 2141 confirmation number.



I might be completely wrong here, and I apologize if I relied much on some tools to solve these equations, but im really interested to learn more through these quizzes.


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: hosseinimr93 on March 31, 2024, 02:13:23 PM
This is like quiz number 1 (https://bitcointalk.org/index.php?topic=5489188.msg63816706#msg63816706) and we again use the formula mentioned on page 7 of bitcoin whitepaper (https://bitcoin.org/bitcoin.pdf).

This time, q would be 300/(300+564.9) = 0.3469

The following chart shows how the probability of the transaction being removed from the blockchain decreases with more confirmations. 

https://www.talkimg.com/images/2024/03/31/VTuLo.png


Code:
confirmations    probability 

0 100
1 72.43575878
2 57.97100299
3 47.38109469
4 39.11081073
5 32.47345203
6 27.06746477
7 22.62412667
8 18.9496105
9 15.89762035
10 13.35446183
11 11.23001478
12 9.451846572
13 7.961150496
14 6.709821413
15 5.658280815
16 4.773818575
17 4.029304111
18 3.402169509
19 2.873597716
20 2.427868307
21 2.05182626
22 1.734447962
23 1.466484873
24 1.240169733
25 1.048973513
26 0.887403752
27 0.750836835
28 0.635378198
29 0.537745613
30 0.455171586

If my transaction receives 26 confirmations, the dishonest miner would have less than 1% chance to remove my transaction from the blockchain and I can be 99% certain that my transaction will surely remain in the blockchain.


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: Amphenomenon on March 31, 2024, 02:19:56 PM
https://www.talkimg.com/images/2024/03/31/VTwqT.jpeg

https://www.talkimg.com/images/2024/03/31/VTHGl.jpeg

There are things I have to correct..


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: Mia Chloe on March 31, 2024, 05:32:11 PM
https://www.talkimg.com/images/2024/03/31/VTBmT.jpeg

Had a proper analysis and I think I am settling for this.


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: EluguHcman on March 31, 2024, 05:44:56 PM
Honestly I do not have Bitcoin technical knowledge and has this allergy feeling of it because the failure to make it right feels depressing after cracking whole lot of brains just to make it right but all usually to no avail. So I just skip it whenever I comes about Bitcoins technicalities.

But right in this Bitcoin discussion board and right in this thread, I am begining to posseses different vibes towards it so I am likely to say that... While I am going through the reply sections of this thread, I am developing some interests about it already and I am having this exploring agility towards acquiring Bitcoin technical knowledges.


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: BlackHatCoiner on April 03, 2024, 10:45:44 AM
hosseinimr93 is correct. The third quiz was just like the first one, with different unknown (confirmations instead of chance of reversal) and another variable, the computational power that is outside the network. In the previous quiz, we were calculating probability of successfully reversing a transaction when a mining pool turns evil. Now that there is no honest hashrate turning evil, you'd have to consider the sum of the honest hashrate and the attacker's hashrate.

[...]
This is incorrect, because the attacker's hashrate is not 30% of 595.05 EH/s. I'm not sure how you worked out 595.05, the total honest hashrate was 564.9. But, either way, the attacker's hashrate is not 182.92, and that's why everything following is incorrect.

[...]
This is also incorrect, because the probability of the attacker succeeding is not 300 / 564.9. You have to get the sum of those two, which is the new hashrate, and use the formula used in the first quiz (https://bitcointalk.org/index.php?topic=5489188.msg63816706#msg63816706) to work it out.

[...]
You were right in the first half, but in the second half ChatGPT didn't use the correct formula to calculate this probability. You can check it out in the first quiz. Could you share with us the prompt you used as input?


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: Mia Chloe on April 03, 2024, 10:54:13 AM
hosseinimr93 is correct. The third quiz was just like the first one, with different unknown (confirmations instead of chance of reversal) and another variable, the computational power that is outside the network. In the previous quiz, we were calculating probability of successfully reversing a transaction when a mining pool turns evil. Now that there is no honest hashrate turning evil, you'd have to consider the sum of the honest hashrate and the attacker's hashrate.

[...]
This is incorrect, because the attacker's hashrate is not 30% of 595.05 EH/s. I'm not sure how you worked out 595.05, the total honest hashrate was 564.9. But, either way, the attacker's hashrate is not 182.92, and that's why everything following is incorrect.
I made 2 mistakes. And they were;
I got the question wrongly thinking the rich billionaire was the  good guy and assuming the bad guys were the ones in the previous question with 30.74% of total hash.

Plus I used a total hash rate of 595.05 EH/s as the latest Bitcoin hash rate.  Instead of 564.9Eh/S.
Anyways I look forward to another math quiz  ;D ;D solving was fun anyways.


Title: Re: [Quiz] Answer the Bitcoin question and earn merits! #3
Post by: GxSTxV on April 04, 2024, 09:55:08 PM
. Could you share with us the prompt you used as input?
Apologies for my late response because I needed some time to address this properly. Thank you for the clarification and the correction of my first mistakes. After reviewing the first quiz results, I have indeed learned something new. Regarding the prompt I have used, what I did was provide ChatGPT with the C code from the Bitcoin: A Peer-to-Peer Electronic Cash System  (https://bitcoin.org/bitcoin.pdf)

Code:
  #include <math.h>
   double AttackerSuccessProbability(double q, int z)
   {
       double p = 1.0 - q;
       double lambda = z * (q / p);
       double sum = 1.0;
       int i, k;
       for (k = 0; k <= z; k++)
       {
           double poisson = exp(-lambda);
           for (i = 1; i <= k; i++)
               poisson *= lambda / i;
           sum -= poisson * (1 - pow(q / p, z - k));
}
return sum; }

Then sending its the total hash rate at that moment, it gave me the formulas beside the results I shared with you in my previous post.