Skip to content

Instantly share code, notes, and snippets.

View chris-belcher's full-sized avatar

chris-belcher

View GitHub Profile
@chris-belcher
chris-belcher / raw-privkey-dangers.txt
Last active February 13, 2017 11:51
raw-privkey-dangers
https://bitcoin.stackexchange.com/questions/29948/why-doc-says-importing-private-keys-is-so-dangerous
https://bitcoin.stackexchange.com/questions/18619/why-so-many-warnings-about-importing-private-keys
behave un-intuatively
'giving' a key to someone still means you have it
change addresses / paper wallets
@chris-belcher
chris-belcher / alectryon.py
Last active November 7, 2021 20:42
bitcoin-blockchain-feed-bot
#jsonrpc.py from https://github.com/JoinMarket-Org/joinmarket/blob/master/joinmarket/jsonrpc.py
#copyright # Copyright (C) 2013,2015 by Daniel Kraft <d@domob.eu> and phelix / blockchained.com
import base64
import httplib
import json
class JsonRpcError(Exception):
def __init__(self, obj):
self.message = obj
@chris-belcher
chris-belcher / relaybot.config
Created December 24, 2017 14:49
relaybot.config
#Can override these defaults per-section.
[DEFAULT]
#Twisted's default is 30 seconds.
timeout=180
port=6697
#A single channel to join, or a list of channels: #a-bridged-channel,#some-other-channel
channels=#joinmarket
nick=JoinMarketRelay
#Can change to allow more specialized behavior.
username=jmrelay
@chris-belcher
chris-belcher / privacy-liquidity-divisibility.md
Last active June 3, 2021 07:13
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
chris-belcher / joinmarket-with-off-chain-fees.md
Last active May 26, 2020 19:15
JoinMarket with off-chain fees

JoinMarket with off-chain fees

17/01/2019

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
chris-belcher / improvement-plan-for-joinmarket-tumbler.md
Last active May 26, 2020 19:15
Plan to improve the privacy of JoinMarket's tumbler script

Plan to improve the privacy of JoinMarket's tumbler script

24/02/2019

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
chris-belcher / miner-resistant-lightweight-wallets.md
Last active April 21, 2021 02:37
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

2019/03/21

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
chris-belcher / financial-mathematics-of-joinmarket-fidelity-bonds.md
Last active November 7, 2023 02:24
Financial mathematics of joinmarket fidelity bonds
@chris-belcher
chris-belcher / sybil-attack-success-prob.py
Created July 13, 2019 15:29
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 https://gist.github.com/chris-belcher/87ebbcbb639686057a389acb9ab3e25b
from scipy.optimize import brentq
from time import time
from datetime import timedelta