Skip to content

Instantly share code, notes, and snippets.

View darosior's full-sized avatar

Antoine Poinsot darosior

View GitHub Profile
@darosior
darosior / MiniTapscript.md
Last active February 14, 2023 08:39
Notes on adapting Miniscript for Tapscript

(Contains input from many people, not my own ideas)

Notes

  • Forbid multi, have a new multi_a itself forbidden in other contexts
  • We now need to care about the maximum stack size (1000). With Taproot it's now also checked before executing the Script.
  • We could have a new d: wrapper that is u because the MINIMALIF rule is consensus
  • It doesn't look like there is interesting combinations of the new CHECKSIGADD opcode with existing fragment. Maybe we could have used it for thresh to save an OP_ADD if the sub was a CHECKSIG, but the arguments aren't in the right order for this.
  • No need to check for the Script size anymore
  • I don't think we need to take the sigop budget into account, as we can't create a Script that would duplicate the signatures.
  • When calculating sizes, keep in mind the signature length is now 64
@darosior
darosior / plot_bkpr_report.py
Last active May 14, 2024 11:33
A quick script to plot the balance over time of a C-lightning routing node using the report from `bkpr-listincome`
import json
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
STARTING_BALANCE = 0
with open("bkpr_report.json", "r") as report:
events = json.load(report)["income_events"]
@darosior
darosior / result.md
Created May 17, 2024 09:29
Simulate how long it would take to drop the difficulty to 1 by exploiting timewarp.

End of period 1, reducing the diff by 1.008431712962963.

End of period 2, reducing the diff by 1.9997885879775676.

End of period 3, reducing the diff by 2.4953826200260374.

End of period 4, reducing the diff by 2.6938205846144805.

End of period 5, reducing the diff by 2.767310059006725.