Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
View raw-privkey-dangers.txt
behave un-intuatively
'giving' a key to someone still means you have it
change addresses / paper wallets
chris-belcher /
Last active Feb 27, 2020
View from
#copyright # Copyright (C) 2013,2015 by Daniel Kraft <> and phelix /
import base64
import httplib
import json
class JsonRpcError(Exception):
def __init__(self, obj):
self.code = obj["code"]
View relaybot.config
#Can override these defaults per-section.
#Twisted's default is 30 seconds.
#A single channel to join, or a list of channels: #a-bridged-channel,#some-other-channel
#Can change to allow more specialized behavior.
chris-belcher /
Last active May 26, 2020
How Wasabi Wallet and Samourai Wallet slightly degrade the divisibility of bitcoin

How Wasabi Wallet and Samourai-Wallet-Whirlpool slightly degrade the divisibility of bitcoin

December 2018

I made this claim on twitter recently and many people wanted me to go into more detail.

Lots of privacy tech in bitcoin like coinjoin, coinswap, tumblebit and Lightning Network require many entities to come together to agree to make certain kinds of transactions. This creates a requirement that the right resources (coins) have to be in the right place,

chris-belcher /
Last active May 26, 2020
JoinMarket with off-chain fees

JoinMarket with off-chain fees


Problem: Single JoinMarket coinjoins aren't private enough

A single JoinMarket coinjoin often doesn't hide which inputs belong to the maker(s) and which belong to the taker. This is because the coinjoin fee is included on-chain.

To tell apart takers' inputs from makers' inputs, subset matching can be used. The taker's subset is

chris-belcher /
Last active May 26, 2020
Plan to improve the privacy of JoinMarket's tumbler script

Plan to improve the privacy of JoinMarket's tumbler script


JoinMarket has a tumbler application which aims to send bitcoins in a way that delinks the origin and destination.

I have some thoughts on how and why to improve the tumbler algorithm.

Feel free to bikeshed some of these parameters (averages, counts, etc), as my important points are about other stuff.

chris-belcher /
Last active May 26, 2020
DSPV Security - Miner-resistant design of lightweight bitcoin wallets

edit: this scheme has serious problems, see the comments

DSPV security - Miner-Resistant Design of Lightweight Bitcoin Wallets


What are lightweight wallets

Lightweight wallets are ones which are not full nodes. Lots of people use them because full nodes are costly: they cost time to setup/synchronize, education, disk space, bandwidth, RAM and a few other resources.

chris-belcher /
Last active May 27, 2020
Financial mathematics of joinmarket fidelity bonds

Financial mathematics of JoinMarket fidelity bonds


To read the context see the main document Design for improving joinmarket's resistance to sybil attacks using fidelity bonds.

Valuing fidelity bonds

We want to come up with a mathematical formula which gives the value of a fidelity bond. We want this function to be in the best interests of takers who use it. We aim for them to get the best possible sybil resistance.

chris-belcher /
Created Jul 13, 2019
Sybil attack success probability
#! /usr/bin/python3
##this file calculates the success probability of a sybil attack on the
# orderbook with fidelity bonds used in joinmarket
# see
from scipy.optimize import brentq
from time import time
from datetime import timedelta
You can’t perform that action at this time.