Skip to content

Instantly share code, notes, and snippets.

View Sjors's full-sized avatar

Sjors Provoost Sjors

View GitHub Profile
@Sjors
Sjors / bitcoin-pay.rb
Last active April 9, 2024 16:50
This script demonstrates how a bitcoin transaction is created and signed. Just pass in your own address and private key and it will prepare a transaction for you. You can then copy & paste that transaction into a webservice like Blockchain to send it. I wrote this mostly to understand better how it works. I sometimes had to "cheat" and look at t…
#!/usr/bin/env ruby
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'pry'
require 'bigdecimal'
require 'bitcoin' # Because I need to cheat every now and then
# Usage:
# gem install pry json ffi ruby-bitcoin
@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 / overview.md
Last active December 1, 2023 02:37
Hardware Wallet Support in GUI and RPC, using HWI

Project: https://github.com/bitcoin/bitcoin/projects/15

Final User Experience

A user plugs in their hardware wallet and creates a new wallet. It automatigically detects the device and imports the keys:

The user can verify a receive address on their device with just a click:

@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 / .gitignore
Last active September 8, 2022 03:15
node_modules
*.pdf

EC2 settings

  • Instance type: t2.xlarge
  • vCPUs: 4
  • Memory (GiB): 16
  • General Purpose SSD (GP2): 200 GB
  • Ubuntu
  • Running in eu-central-1b (Frankfurt)

Hint: to make your life easier and allow login with a simple ssh btc-0.14, edit ~/.ssh/config:

@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 / Gemfile.lock
Created April 14, 2012 12:35
Gemfile on April 14
GIT
remote: git://github.com/flying-sphinx/flying-sphinx.git
revision: 49bfed5d91b0afb06390fd50f4e058662f342907
specs:
flying-sphinx (0.6.4)
faraday_middleware (~> 0.7.0)
multi_json (>= 1.0.1)
net-ssh (>= 2.0.23)
rash (~> 0.3.0)
riddle (>= 1.5.0)
find output/ -type f -print0 | sort -z | xargs -r0 sha256sum
41c3b48d14163975f4fd27548a904b77fd3c8c816877f699add061871a1cae89 output/bitcoin-0.18.99-aarch64-linux-gnu-debug.tar.gz
f0ebbc072f5c1b5786e4468690396d7cf4522afef11b639e944f7b6d37760eec output/bitcoin-0.18.99-aarch64-linux-gnu.tar.gz
2c7358a14f8ffb25b5f3678e33d9ed94a17b0f8ed2523fc9d319aac3d7ccd025 output/bitcoin-0.18.99-arm-linux-gnueabihf-debug.tar.gz
34d7e7bc97f274d526042bc16a6bfdb9eccb96c9cf0b5eff269e07db27d2f1bd output/bitcoin-0.18.99-arm-linux-gnueabihf.tar.gz
912764cb7f740185d44658eadc817990b2cd08ae5c3db6135cacefa99244a5b6 output/bitcoin-0.18.99-i686-linux-gnu-debug.tar.gz
13a42d9dafa7a223c2c2d30b3fbf0d92ad2050480ae60d8f683f7142149779bd output/bitcoin-0.18.99-i686-linux-gnu.tar.gz
a1be0c8a543320237903c8b6f2848dc6112524a5f2979faf678aaf1cc9c79ad7 output/bitcoin-0.18.99-riscv64-linux-gnu-debug.tar.gz
62c5cae9eda45884be34ee25e2dc446ed1792a78f73f30d326f4e698bec6fa3e output/bitcoin-0.18.99-riscv64-linux-gnu.tar.gz
831ea3ccdb21f3be8483dd52c2ec7