Skip to content

Instantly share code, notes, and snippets.

Avatar

kallewoof

View GitHub Profile
View 1 script tapscript fund and spend
internal_pubkey=efe24af16da45a3e3ce3503b7b7172d64b16b28922011f8df970dd5bf6cc6be7
tapscript=a8206c60f404f8167a38fc70eaf8aa17ac351023bef86bcb9d1086a19afe95bd53338820cc9519ba6fb1cb0cca53743dc90c2418440cf637f8b891ce2f0e2dc5c5b3cf01ac
➜ 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:
OP_IF
144
OP_CHECKSEQUENCEVERIFY
<pubkey_alice>
OP_ELSE
OP_SHA256
preimage_hash
OP_EQUALVERIFY
View Signet 2019-06-28 Network.md

Signet

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 https://github.com/kallewoof/bitcoin.git 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
kallewoof / compile-commits.sh
Created Jul 19, 2018
Compile commits in a range from current head
View compile-commits.sh
#!/bin/bash
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
fi
if [ ! -d ".git" ]; then
echo ".git not found or not a dir"
@kallewoof
kallewoof / setup.md
Created Apr 16, 2018
Clang Static Analyzer Setup
View setup.md

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
kallewoof / test_vectors.md
Last active Jul 2, 2019
Test vectors, Schnorr signatures
View test_vectors.md

Schnorr signature test vectors

Test vector overview

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

Basics

  • 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
.cfi_startproc
## BB#0:
pushq %rbp
Ltmp0:
.cfi_def_cfa_offset 16
View ubu1704.test_cleanse_noasm.s
.file "test_cleanse.cpp"
.text
.p2align 4,,15
.globl _Z14memory_cleansePvm
.type _Z14memory_cleansePvm, @function
_Z14memory_cleansePvm:
.LFB77:
.cfi_startproc
movq %rsi, %rdx
xorl %esi, %esi
View ubu1704.test_cleanse.s
.file "test_cleanse.cpp"
.text
.p2align 4,,15
.globl _Z14memory_cleansePvm
.type _Z14memory_cleansePvm, @function
_Z14memory_cleansePvm:
.LFB77:
.cfi_startproc
pushq %rbx
.cfi_def_cfa_offset 16
You can’t perform that action at this time.