Skip to content

Instantly share code, notes, and snippets.

View fjahr's full-sized avatar
🏠
Working from home

Fabian Jahr fjahr

🏠
Working from home
View GitHub Profile
@fjahr
fjahr / rolling_utxo_set_hash.md
Last active April 30, 2021 17:00
Rolling UTXO Set Hash proposal

Rolling UTXO Set Hash proposal

TL;DR

I have picked up Pieter Wuille's proposal from 2017 to use a rolling hash for the UTXO set hash. It deals with the problem of a long computation time of the UTXO set hash which results in a slow RPC call gettxoutsetinfo (can take several minutes depending on hardware). I investigated three hash functions: MuHash, ECMH and LtHash and started implementing them in Bitcoin Core for comparison. However only MuHash has a rolling hash implementation

@fjahr
fjahr / bitcoin_debugging.md
Last active March 6, 2024 11:43
Debugging Bitcoin Core

Moved to https://github.com/fjahr/debugging_bitcoin to allow for better collaboration.

This document is currently optimized for MacOS. If you would like to help me add Linux equivalent commands, please let me know.

Debugging Bitcoin Core

This guide is designed to give beginners of C++ development and/or people new to the bitcoin core code base an overview of the tools available for debugging issues as well as giving hints where issues may trip you up.

@fjahr
fjahr / bfgminer.md
Last active June 10, 2023 17:08
Solo CPU Mining on MacOS using BFG Miner
@fjahr
fjahr / lightning_mw_messages.md
Last active February 11, 2019 17:28
List of all Lightning Network MW Message Types

Lightning Network MW Message Types

List of all Lightning Network Message Types for easy & quick overview.

Messages with strikethrough style exist in the original RFCs but are currently removed in Lightning MW.

Setup & Control (0 - 31)

Messages related to connection setup, control, supported features, and error reporting.

@fjahr
fjahr / lightning_messages.md
Last active February 2, 2019 20:22
List of all Lightning Network Message Types

Lightning Network Message Types

List of all Lightning Network Message Types for easy & quick overview.

Setup & Control (0 - 31)

Messages related to connection setup, control, supported features, and error reporting.

@fjahr
fjahr / lightning_resources.md
Last active November 14, 2018 23:37
Technical Lightning Network Resources
@fjahr
fjahr / debug.ex
Created April 24, 2018 23:07
Debugging Plug as a last resort for debugging nasty production issue in Elixir/Phoenix/AWS ECS Fargate
defmodule MyApp.Plugs.Debug do
@behaviour Plug
require Logger
def init(default), do: default
def call(conn, _) do
case conn.request_path do
"/path/to/error" ->
@fjahr
fjahr / pb.py
Last active April 20, 2018 15:48
Minimize Change Output for Bitcoin transactions, naive implementation
"""
Suppose you are given a list of possible Bitcoin that you control (inputs). You
need to pay someone exactly 0.71 BTC. How would you select exactly 2 inputs in
such a way as to minimize the change output if you could ignore fees? Write a
python function that selects the two inputs.
"""
from itertools import permutations
TEST_INPUTS = [0.21, 0.59, 1.34, 3.45, 0.3, 0.84, 0.53, 0.62, 0.70, 0.21, 0.44,
0.28, 0.39, 200.9, 4.34]
Verifying my Blockstack ID is secured with the address 1DMWKLoHuFQU5QHAa2KyQwEqsyLP5sxXLN https://explorer.blockstack.org/address/1DMWKLoHuFQU5QHAa2KyQwEqsyLP5sxXLN