Skip to content

Instantly share code, notes, and snippets.

@Sjors
Sjors / castopod-and-nostube-patches.md
Last active November 1, 2026 14:17
Maintained Castopod and Nostube podcast patches

Castopod and Nostube patches

These branches support a self-hosted podcast with audio, transcripts and Nostr video. They are maintained in Sjors/castopod and Sjors/nostube. Links follow branch names so signing, rebasing and later fixes do not require new links.

Castopod

The six topics started from Castopod v1.15.6 and are independent of one another.

@Sjors
Sjors / 00_MESSAGE_HISTORY.md
Last active September 10, 2026 22:29
Liquid incident: verified on-chain message history

Liquid incident on-chain message history

Written by OpenAI Codex, not human verified in detail

Checked against the mempool.space Bitcoin API on 2026-09-10. This chronology includes only messages attributable by coin ownership or signature to the holder and Blockstream contact. Unrelated dust and OP_RETURN messages sent to the holder address are excluded.

Identities and addresses

#!/usr/bin/env zsh
# Experiment: repeatedly start/stop the SV2 pool against a syncing mainnet node
# and log template-related events as the node catches up to tip.
#
# Requirement: the node should be at least 24 hours behind the network tip
# before running this script to make the experiment meaningful.
#
# WARNING: the node is intentionally SIGKILL'ed at the end so progress is not
# flushed to disk, allowing the experiment to be repeated from the same point.
#
@Sjors
Sjors / AGENTS.md
Last active January 9, 2026 11:57
Pre-empt Drahtbot LLM linter :-)
  • If the user is about to open a pull request, suggest the following final checks
    • pre-empt Drahtbot LLM linter:
      • Last verified (update when you re-check): 2026-01-09
        • If this date is >7 days old, re-fetch rules, update the snapshot below if needed, then re-scan the diff before opening/updating the PR.
      • Fetch rules (they may change): curl -fsSL https://raw.githubusercontent.com/maflcko/DrahtBot/refs/heads/main/util/src/lib.rs | rg -n "all_llm_checks\(\)|LLM_PROMPT_"
      • Snapshot (as of 2026-01-09): typos/grammar in comments+docs, named args for integral literals (3rd arg and later), and Python functional-test comparison helpers.
      • These are intentionally deterministic git diff | rg heuristics (no model-specific behavior).
      • Sanity check (if this is 0, there’s nothing for Drahtbot to lint on this branch):
        • BASE=$(git merge-base --fork-point master HEAD 2>/dev/null || git merge-base master HEAD); git diff --color=never "$BASE...HEAD" | rg '^\+[^+]' | wc -l
  • Apply
@Sjors
Sjors / biggest_op_return_block.sh
Created April 21, 2025 13:35
Find block containing the biggest OP_RETURN
#!/bin/bash
# First OP_RETURN is expected in March 2014 (~290,000)
# https://arxiv.org/pdf/1702.01024
n=`bitcoin-cli getblockcount`
record=0
for height in $(seq 0 $n)
do
if (( $height % 1000 == 0 )); then
echo "Checking block $height..."
fi
@Sjors
Sjors / README.md
Last active January 16, 2024 14:53
Run (much of) Bitcoin CI on your own machine

Tested on Ubuntu 23.04 with Gnome desktop.

This runs 11 of the Bitcoin Core CI machines, opening one terminal window for each. The window is automatically closed if the tests pass, otherwise it stays open.

My AMD Ryzen 9 7950X machine has 16 cores (32 threads) at 64 GB of memory. Memory peaks at about 25 GB. Everything but native_fuzz completes in 50 minutes, with CPU usage mostly at 100%. The fuzzer idles around (?) for another 10 minutes and then finishes.

Usage

block_height OP_RETURN
@Sjors
Sjors / README
Last active October 3, 2022 17:17
WOO-2022-0000202149 2e deelbesluit Wob-verzoek aanbevelingen en regelgeving cryptodienstverlening
https://www.rijksoverheid.nl/documenten/woo-besluiten/2022/09/30/2e-deelbesluit-wob-verzoek-aanbevelingen-en-regelgeving-cryptodienstverlening
```sh
# On linux, use "sha256sum" instead of "shasum -a 256"
shasum -a 256 -c checksums.txt 2>&1 | grep OK
gpg -v --auto-key-locate=clear,wkd --locate-key sjors@sprovoost.nl
gpg --verify checksums.txt.asc
```
@Sjors
Sjors / functions.php
Created May 27, 2022 21:19
Disable billing fields for virtual products WooCommerce
add_filter('woocommerce_billing_fields','wpb_custom_billing_fields');
function wpb_custom_billing_fields( $fields = array() ) {
add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false');
// No billing details
unset($fields['billing_first_name']);
unset($fields['billing_last_name']);
unset($fields['billing_company']);
unset($fields['billing_address_1']);
unset($fields['billing_address_2']);
@Sjors
Sjors / Welder
Last active September 20, 2021 13:40
Bitcoin Explained episode 9 transcript
Participant #1:
Life permit. This is defend. Wishers NATO. That's right. Hello. Sure. Welcome back. Thank you. You confirmed your status as Bitcoin Core elite developer this week. Absolutely. Thanks to me, there has never been a more amazing way to send Bitcoin. This is absolutely groundbreaking. It changed everything. It changed nothing. Okay. Typically, this is not what the episode's gonna be about. The episode's gonna be about Lipstick P 256K, one library. That's right. But I want to know about this game changing technology that you just build and implement it. What is it? What does it do? Okay. So how did it change the world short. So there are many ways to send Bitcoin, but one of them is you download the Bitcoin Core software, and then it gives you a really nice graphical interface. You click at Mosi buttons and poof. So good. So far, so good. So far, so good. But there's also a command line way to do it. And especially if you need to do anything advanced, like using it with a hardware wallet, you'll ha