Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: Add reorg calclator #2161

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrakibi
Copy link

@jrakibi jrakibi commented Feb 6, 2025

This PR adds a new tool that shows the probability that an attacker with a given percentage of the total network hashrate could successfully execute a block reorganization of a given depth.

The current implementation matches the mathematical model presented in the Bitcoin whitepaper (Chapter 11) and is similar to Greg Maxwell's online calculator

The tool also:

  • Uses pure JS (no-dependencies)
  • Follows similar approach/styling to the existing Transaction Size Calculator

Note: the PR is marked as draft because it currently implements the original whitepaper formula.
This will be updated to match the calcultion described in Double Spend Races paper that takes into account the time deviation factor

Closes #2156

@jrakibi jrakibi marked this pull request as draft February 6, 2025 23:25
Add JS calculator that shows the probability that an attacker with a given percentage of the total network hashrate could successfully execute a block reorganization of a given depth. The calculation is based on the mathematical model presented in the Bitcoin whitepaper (Chapter 11)

Signed-off-by: jrakibi <[email protected]>
@jrakibi jrakibi force-pushed the 07-02-reorg-calculator branch from 95113f0 to 604640a Compare February 6, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature suggestion: reorg calculator
1 participant