Skip to content

Instantly share code, notes, and snippets.

View martindale's full-sized avatar
🚀
relentless maker.

Eric Martindale martindale

🚀
relentless maker.
View GitHub Profile
@martindale
martindale / bitcoin-micropayment-protocol.md
Created February 27, 2014 18:34
General flow for micropayment channels in Bitcoin.
  1. Create a public key (K1). Request a public key from the server (K2).
  2. Create and sign but do not broadcast a transaction (T1) that sets up a payment of (for example) 10 BTC to an output requiring both the server's public key and one of your own to be used. A good way to do this is use OP_CHECKMULTISIG. The value to be used is chosen as an efficiency tradeoff.
  3. Create a refund transaction (T2) that is connected to the output of T1 which sends all the money back to yourself. It has a time lock set for some time in the future, for instance a few hours. Don't sign it, and provide the unsigned transaction to the server. By convention, the output script is "2 K1 K2 2 CHECKMULTISIG"
  4. The server signs T2 using its public key K2 and returns the signature to the client. Note that it has not seen T1 at this point, just the hash (which is in the unsigned T2).
  5. The client verifies the servers signature is correct and aborts if not.
  6. The client signs T1 and passes the signature to the server, which now broadca

Extensible Scalable Coopetitive High Availability Trade Optimization Network: ESCHATON

I am the Eschaton; I am not your God.

I am descended from you, and exist in your future.

Thou shalt not violate causality within my historic light cone. Or else.

Singularity Sky by Charles Stross

@holman
holman / tmobile.sh
Created June 29, 2015 21:32
Will someone destroy Comcast already
# Manually download each month's call history from t-mobile.com and toss them in
# a directory. Or do it automatically using computers, who cares.
#
# Install spark: https://github.com/holman/spark
cat * | grep 266-2278 | sort | cut -d, -f5 | spark
# ▂█▁▃▅
echo "fuck comcastttttttttttttttttttttttttttttttttttttttttt"
# ⒻⓊⒸⓀ ⒸⓄⓂⒸⒶⓈⓉ
@thefinn93
thefinn93 / hypedns.py
Created February 15, 2012 03:17
Update nodeinfo.hype from a text based interface
#!/usr/bin/env python
import httplib2
import sys
import json
from urllib import urlencode
h = httplib2.Http(".cache")
print "Please hold while we retrive your IP address..."
r,ip = h.request("http://[fc72:6c3b:8c74:68a7:d8c3:b4e0:6cbd:9588]/ip/","GET")
url = "http://[fc5d:baa5:61fc:6ffd:9554:67f0:e290:7535]/node/details/" + ip + "/save"
print "Looks like your IP is " + ip
@oleganza
oleganza / impulse_review.md
Last active January 23, 2016 06:24
Impulse Review

(That's my attempt to understand what problem Impulse solves and how. I am not a designer/developer of this scheme.)

Problem

Regular Bitcoin transactions are not guaranteed until mined sufficiently deep in the blockchain. Unconfirmed transactions can be observed nearly instantly, but they cannot be trusted (could drop out because of insufficient fees, or double-spent).

Impulse Overview

@trevnorris
trevnorris / proper_code_column_length.txt
Last active August 9, 2016 20:38
Quick notes on why constraining cpl is an advantage when writing source
While the standard 80 character limit for source code can be traced back to the
IBM punch card[1] it can still be seen as a good upper bound for how long lines
of text should be on modern high definition displays.
First thing we must acknowledge is that source code is not read in the
traditional sense. Instead developers scan the source using non-linear eye
movements[2] or stay fixated in a small area of code while working out the
logical details of code being written. The fixation on a single location, even
for more than a few seconds, leads to a loss of visual accuity. Which occurs
when the eyes do not perform frequent saccadic eye movements.[3] Further
@maraoz
maraoz / Original version
Last active October 5, 2016 13:25
Hashed Timelock Contract (HTLC) as proposed in lightning.network paper
OP_DEPTH 3 OP_EQUAL
OP_IF
OP_HASH160 <hash160(R)> OP_EQUALVERIFY
OP_0 2 <AlicePubkey1> <BobPubkey1> 2 OP_CHECKMULTISIG
OP_ELSE
OP_0 2 <AlicePubkey2> <BobPubkey2> 2 OP_CHECKMULTISIG
OP_END
@ksylor
ksylor / style.css
Created November 28, 2016 20:57
Screen reader only class
.screen-reader-only {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
shopt -s expand_aliases
rm -r ~/elementsdir1
rm -r ~/elementsdir2
rm -r ~/bitcoindir
mkdir ~/elementsdir1
mkdir ~/elementsdir2
mkdir ~/bitcoindir
import random
import pprint
from .magic import Spell
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'