Skip to content

Instantly share code, notes, and snippets.

Avatar

chris-belcher

View GitHub Profile
View raw-privkey-dangers.txt
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 Feb 27, 2020
bitcoin-blockchain-feed-bot
View alectryon.py
#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.code = obj["code"]
View 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 May 26, 2020
How Wasabi Wallet and Samourai Wallet slightly degrade the divisibility of bitcoin
View privacy-liquidity-divisibility.md

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
JoinMarket with off-chain fees
View joinmarket-with-off-chain-fees.md

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
Plan to improve the privacy of JoinMarket's tumbler script
View improvement-plan-for-joinmarket-tumbler.md

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 May 26, 2020
DSPV Security - Miner-resistant design of lightweight bitcoin wallets
View miner-resistant-lightweight-wallets.md

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 May 27, 2020
Financial mathematics of joinmarket fidelity bonds
View financial-mathematics-of-joinmarket-fidelity-bonds.md

Financial mathematics of JoinMarket fidelity bonds

13/7/2019

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
chris-belcher / sybil-attack-success-prob.py
Created Jul 13, 2019
Sybil attack success probability
View sybil-attack-success-prob.py
#! /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
You can’t perform that action at this time.