Skip to content

Instantly share code, notes, and snippets.

@btcdrak
btcdrak / openpgp-card-guide.md
Created September 1, 2016 21:31 — forked from ageis/openpgp-card-guide.md
Quick GPG Smartcard Guide

Quick GPG Smartcard Guide

We will generate a master key with only the Certify capability and three subkeys with each of the Sign, Encrypt and Authenticate capabilities. These latter three keys are meant for daily use and will be transferred to an OpenPGP smartcard, which has three corresponding slots. The master private key can then be moved to offline cold storage, or stored on a second smartcard.

We are generating keys on a secure computer instead of on the card, because it allows more flexibility. Ideally this means a machine running Tails or one that is air-gapped and not connected to the internet.

This guide assumes that if you want to sign other peoples keys, then you will require the aforementioned secondary smartcard with your master key stored in its Signature slot, or if you only have one smartcard, then you'll have to fetch the master key out of cold storage. By default, GPG generates a master key with the Certify and

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
This is a list of unspendable addresses with which to burn coins to. When you send a coin to any of these addresses, they are permanently gone and can never be redeemed.
You can prove this by sending a small test amount to the address and then checking a block explorer or using `getrawtransaction txid 1`. You should see the coins output to somehting like `"raw_scriptPubKey": "76a914000000000000000000000000000000000000000088ac"` Some block explorers are also smart enough to indicate in their user interface that the coins were destroyed.
You can find the version number matching to the desired altcoin by checking two places in the code:
chainparams.cpp for bitcoin 0.9 and later based coins:
@btcdrak
btcdrak / bitcoin-addrindex-0.10.1.txt
Created April 27, 2015 15:18
Bitcoin Core 0.10.1 + addrindex patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Tagged from e09e1f45ac092229374c03aa72718614972cc9b0 as addrindex-0.10.1
88b3497eff5472bf5c9b0266c7ac4e5af53c964d1f96e5160923015a564ca216 bitcoin-addrindex-0.10.1-win32-setup.exe
256ca06d42284b6513405e04da0013aaa6bfeddc45fce7e093f30c2e29720c90 bitcoin-addrindex-0.10.1-win32.zip
56dd02f0569b6f6f6e0b4efebeccf8adf69a99a7f2b6dc0eb73ff75f2ffa99e8 bitcoin-addrindex-0.10.1-win64-setup.exe
becbb4f74030d64a7c9ffa85e549bd70d1d1485f2ca37a549e0c421042dead20 bitcoin-addrindex-0.10.1-win64.zip
1f64944dbad33ffdbf1d4aca676bf40262eeadd725f523d5f97c5f58e1b86b7a bitcoin-addrindex-0.10.1-osx-unsigned.dmg
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFfJ8J8BEADFqS5Xda1L51ntH2NAyQuvdt/kIib0dnt/e06wuoFjBXV1MRG+
WOCaX4fMqN8LPry9GM+0CbqHYTkWjqD58MzgqgcmnZwwliHI7DHxw3+76eYxoF+J
S5ln1C6XnBJd6LNp4crfKwCd6SAzt5m94YIutABkQbnEZlOpSdc6H7A+4boToZus
hrrHc1PMfzwGHIdU3Hcge9gWiB2wWI4lbN0Qqyb3FXD1U6a5LOBsiw2+aiuivHHo
it+HcoewLHd2F0BBLMygAOCsjJhnuX2T3Yf0cHJIKyOF2U/KrEPNYH02AMe26BaW
/3x9uX14BkIgXSvUXYeX+utsiRp8ozuKqvn5BumjBG6Br7wFspJnZSbRxxiXOlAa
FxqwjB/Z6v8wKazS7hhAI/hSCbEi8VwPvccbTnIG8FG9vADMbt+FRp6uZSnPIgDh
test/txvalidationcache_tests.cpp(64): error in "tx_mempool_block_doublespend": check ToMemPool(spends[0]) failed
test/txvalidationcache_tests.cpp(70): error in "tx_mempool_block_doublespend": check ToMemPool(spends[1]) failed
test/txvalidationcache_tests.cpp(78): error in "tx_mempool_block_doublespend": check ToMemPool(spends[1]) failed
@btcdrak
btcdrak / yubitouch.sh
Created September 1, 2016 13:08 — forked from a-dma/yubitouch.sh
Bash script for setting or clearing touch requirements for cryptographic operations in the OpenPGP application on a YubiKey 4.
#!/bin/bash
# Bash script for setting or clearing touch requirements for
# cryptographic operations the OpenPGP application on a YubiKey 4.
#
# Author: Alessio Di Mauro <alessio@yubico.com>
GCA=$(which gpg-connect-agent)
DO=0
UIF=0
@btcdrak
btcdrak / gpg-offline-master.md
Created August 31, 2016 20:06 — forked from abeluck/gpg-offline-master.md
GPG Offline Master Key w/ smartcard
@btcdrak
btcdrak / sign.sh
Created May 3, 2016 18:21 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py
index 19ee472..3b08cd1 100755
--- a/qa/rpc-tests/test_framework/test_framework.py
+++ b/qa/rpc-tests/test_framework/test_framework.py
@@ -142,6 +142,9 @@ class BitcoinTestFramework(object):
except AssertionError as e:
print("Assertion failed: "+ str(e))
traceback.print_tb(sys.exc_info()[2])
+ except KeyError as e:
+ print("key not found: "+ str(e))