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 / calculating-equivalent-interest-rate.txt
Last active March 26, 2016 01:07
calculating-equivalent-interest-rate
JoinMarket yield generators earn money on an unpredictable basis. It's worth calculating
the equivalent interest rate as if joinmarket was a savings account.
We can make a model of a bank account that takes deposits and withdrawals at any time and
where the balance accumulates interest, then the parameters from a JoinMarket yield-generator
wallet can be inputted to obtain the equivalent interest rate.
We know that the present value of a bank account (P) grows to the future value (F) determined
by the interest rate per unit time (r) and time (t)
https://en.wikipedia.org/wiki/Compound_interest#Mathematics_of_interest_rates
@chris-belcher
chris-belcher / no-longer-a-dream.txt
Last active July 29, 2016 21:30
No longer a dream
hey cypherpunks, it's the end of the old regime
cryptographic currency, no longer a dream
oh believers in liberty, feel the new sunrise
trustworthy coinage is right before our eyes
it's time to remember the early pioneers
ten thousand coins for a pizza, they look back in tears
@chris-belcher
chris-belcher / irc-own-pings.py
Created December 14, 2016 15:55
IRC script which sends its own pings without creating any other threads
#irc script which sends its own pings without creating any other threads
import socket, random
from datetime import datetime
nick = 'testbot-' + hex(random.randint(0, 0xffffff))[2:]
hostport = ('irc.snoonet.org', 6667)
ping_interval_seconds = 30
ping_timeout_seconds = 60
@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 / 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 / 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]
@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 / 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 / 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 / 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. :)"