Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions apply_fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e
#!/bin/bash
git checkout -b fix/issue-27
cat << 'EOF' > selfish_mining_solver.py
def calculate_alpha_threshold(gamma):
"""
Returns the alpha threshold for selfish mining profitability.
Formula: alpha > (1 - gamma) / (3 - 2 * gamma)
"""
return (1 - gamma) / (3 - 2 * gamma)

if __name__ == "__main__":
# Parameters for Bitcoin Math Puzzle #004
gammas = [0.0, 0.5, 1.0]
for g in gammas:
threshold = calculate_alpha_threshold(g)
print(f"Gamma: {g}, Alpha Threshold: {threshold:.4f}")
EOF
git add selfish_mining_solver.py
git commit -m "fix: [radar] SN open bounty 2026-05-08T00:10 — Fixes #27"
14 changes: 14 additions & 0 deletions selfish_mining_solver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def calculate_alpha_threshold(gamma):
"""
Returns the alpha threshold for selfish mining profitability.
Formula: alpha > (1 - gamma) / (3 - 2 * gamma)
"""
return (1 - gamma) / (3 - 2 * gamma)


if __name__ == "__main__":
# Parameters for Bitcoin Math Puzzle #004
gammas = [0.0, 0.5, 1.0]
for g in gammas:
threshold = calculate_alpha_threshold(g)
print(f"Gamma: {g}, Alpha Threshold: {threshold:.4f}")