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.

block at 350008 is empty, its timestamp is 25 seconds later than the previous block
block at 350074 is empty, its timestamp is -458 seconds later than the previous block
block at 350096 is empty, its timestamp is 15 seconds later than the previous block
block at 350113 is empty, its timestamp is 49 seconds later than the previous block
block at 350147 is empty, its timestamp is 11 seconds later than the previous block
block at 350290 is empty, its timestamp is -177 seconds later than the previous block
block at 350418 is empty, its timestamp is 21 seconds later than the previous block
block at 350422 is empty, its timestamp is -48 seconds later than the previous block
block at 350621 is empty, its timestamp is 28 seconds later than the previous block
block at 350720 is empty, its timestamp is 34 seconds later than the previous block
@darosior
darosior / 2015-01-bitcoin-dev.log
Last active March 27, 2026 18:43
January 2015 IRC logs for bitcoin-dev
2015-01-03 21:34:02 0|michagogo|Hmm
2015-01-03 21:34:16 0|michagogo|My syncing seems to be stalled
2015-01-03 21:34:21 0|sipa|:(
2015-01-03 21:34:38 0|michagogo|It's been at 337077 for a very long time now
2015-01-03 21:34:44 0|michagogo|(this is on v0.10.0rc1)
2015-01-03 21:34:52 0|sipa|;;blocks
2015-01-03 21:34:53 0|gribble|337339
2015-01-03 21:35:20 0|michagogo|getblockchaininfo says I have all the headers
2015-01-03 21:35:38 0|sipa|what does getchaintips say?
2015-01-03 21:35:58 0|michagogo|https://www.irccloud.com/pastebin/MjcFrbB7