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 / rust-bitcoin-play.rs
Created April 22, 2021 15:56
rust bitcoin play teleport coinswap
// 22/4/2021
// random various unrelated functions coded to help me figure out how to use rust-bitcoin
// should be useful for figuring out why certain things in teleport are coded the way they are
extern crate bitcoincore_rpc;
use bitcoincore_rpc::{Client, Error, RpcApi, Auth};
extern crate bitcoin_wallet;
use bitcoin_wallet::account::{
MasterAccount, Unlocker, Account, AccountAddressType
@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 / 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 / rbtc-censorship.md
Last active May 14, 2020 19:01
censorship on r/btc

r/btc markets itself as a "censorship-free" sub. In reality it attempts to silence the voices of people it disagrees with.

A few screenshot examples of censorship https://imgur.com/a/rHrtC

this article was deleted when posted, which describes how the mods of r/btc are roger ver's employees at bitcoin.com https://medium.com/@WhalePanda/the-curious-relation-between-bitcoin-com-anti-segwit-propaganda-26c877249976#.4mfo9qn3e

"Exploit code for the recent BTU attack - apparently this was posted to /r/btc, and of course, got censored. :)"

@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
@chris-belcher
chris-belcher / block-probability.py
Created May 15, 2016 02:55
block probability
import matplotlib
import numpy.random
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
#https://www.reddit.com/r/Bitcoin/comments/4gp28d/how_to_avoid_getting_ripped_off_in_large_btc/
#https://en.bitcoin.it/wiki/Confirmation
cumulative = True
@chris-belcher
chris-belcher / getpeerinfo-parse.py
Last active April 13, 2019 21:19
getpeerinfo-parse.py
#run with
#/path/to/bitcoin/bin/bitcoin-cli getpeerinfo | python getpeerinfo-parse.py
#output looks like
#zlato@zlato:~/bitcoin-0.17.1/bin$ ./bitcoin-cli getpeerinfo | python getpeerinfo-parse.py
#services L=NODE_NETWORK_LIMITED N=NODE_NETWORK G=NODE_GETUTXO B=NODE_BLOOM R=NODE_REPLACE_BY_FEE W=NODE_WITNESS X=NODE_XTHIN U=UNKNOWN
# id addr user-agent iB se re conn'd ping serv lastr
# # host oO nt cv MMDD-HHMM msec ices HHMMSS
# 414 27.102.130.92 /Satoshi:0.17.1/ oF 20M 28M 0411-2005 358 LNBW 121021
# 417 139.59.34.217 /Satoshi:0.15.1/ oF 17M 46M 0411-2006 163 NBW 121019
@chris-belcher
chris-belcher / forkers-we-re-not-raising-a-single-byte.txt
Last active December 28, 2017 02:00
Forkers, we're not raising a single byte
In cryptoland, cypherpunks get clever
Belief in freedom switches off never
So long as nodes are run, bitcoin stays untorn
Six an hour, new blocks are born
To honest miners, new coins are bestow
Going above 21 million is a no
[chorus x2]