Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
View 1 script tapscript fund and spend
➜ btcdeb git:(taproot) ✗ ./tap $internal_pubkey 1 $tapscript
tap 0.2.19 -- type `./tap -h` for help
WARNING: This is experimental software. Do not use this with real bitcoin, or you will most likely lose them all. You have been w a r n e d.
LOG: sign segwit taproot
Internal pubkey: efe24af16da45a3e3ce3503b7b7172d64b16b28922011f8df970dd5bf6cc6be7
1 scripts:
- #0: a8206c60f404f8167a38fc70eaf8aa17ac351023bef86bcb9d1086a19afe95bd53338820cc9519ba6fb1cb0cca53743dc90c2418440cf637f8b891ce2f0e2dc5c5b3cf01ac
View gist:89f9386ad31005eb1bae313390598adc
Initial script:
View Signet 2019-06-28


This is a description of how to get started with Signet. This document assumes you are capable of using git, and that you are able to compile Bitcoin. (If you have not yet done so, you should begin by doing that now.)

Fetch and compile signet

$ git clone signet
$ cd signet
$ git checkout 2003-signet-consensus
View gist:420006d18045cffe56ffc541ddbe3984
On Debian Jessie PowerPC (Big endian) system (endianness probably unrelated):
wallet/walletutil.cpp: In function ‘std::vector<boost::filesystem::path> ListWalletDir()’:
wallet/walletutil.cpp:57:78: error: ‘end’ was not declared in this scope
for (auto it = fs::recursive_directory_iterator(wallet_dir); it != end(it); ++it) {
wallet/walletutil.cpp:57:78: note: suggested alternative:
In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
from /usr/include/c++/4.9/string:52,
from ./fs.h:9,
kallewoof /
Created Jul 19, 2018
Compile commits in a range from current head
if [ $# -lt 1 ]; then
echo "syntax: $0 <commit count> [<make args>]"
echo "will attempt to run 'make' on each commit starting with the commit <commit count> commits ago all the way up to the current HEAD"
echo "e.g. compile-commits 10 -j10"
exit 1
if [ ! -d ".git" ]; then
echo ".git not found or not a dir"
kallewoof /
Created Apr 16, 2018
Clang Static Analyzer Setup

Setting up Clang Static Analyzer on macOS

Using it

  • Go to e.g. ~/workspace/myproject
  • Compile it from scratch, including autogen parts, with make clean, but prefix each call with the scan-build in the path above. E.g.
kallewoof /
Last active Jul 2, 2019
Test vectors, Schnorr signatures

Schnorr signature test vectors

Test vector overview

  1. Hash function H(m) = SHA256(m)


  • For a private key x, the public key is xG.
  • A signature on the message m with private key x is (R, s) where R=kG, s=k+H(R,X,m)x.
  • Verifying a signature is testing whether sG = R+H(R,X,m)X.
View test_cleanse_scoped.s
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 12
.globl __Z14memory_cleansePvm
.p2align 4, 0x90
__Z14memory_cleansePvm: ## @_Z14memory_cleansePvm
## BB#0:
pushq %rbp
.cfi_def_cfa_offset 16
View ubu1704.test_cleanse_noasm.s
.file "test_cleanse.cpp"
.p2align 4,,15
.globl _Z14memory_cleansePvm
.type _Z14memory_cleansePvm, @function
movq %rsi, %rdx
xorl %esi, %esi
View ubu1704.test_cleanse.s
.file "test_cleanse.cpp"
.p2align 4,,15
.globl _Z14memory_cleansePvm
.type _Z14memory_cleansePvm, @function
pushq %rbx
.cfi_def_cfa_offset 16
You can’t perform that action at this time.