Skip to content

Instantly share code, notes, and snippets.

@XertroV
XertroV / arbitraryBytesAddress.py
Created Mar 6, 2014
Turn any <20 bytes into a bitcoin address
View arbitraryBytesAddress.py
#!/usr/bin/python
from hashlib import sha256
import sys
from pycoin.encoding import b2a_base58
def hashme(m):
return sha256(m).digest()
@XertroV
XertroV / gist:9755361
Created Mar 25, 2014
Geonode styling notes
View gist:9755361
@XertroV
XertroV / gist:12a6b80b5210fe9b9d91
Last active Aug 29, 2015
First transactions with cryptonet (min_coin example)
View gist:12a6b80b5210fe9b9d91

A record of the first few transactions on min_coin

Usage

┌──────────────────────────────( linux )─( X-LittleLap )─( 23:14:29 )─┐
└─( ~/src )─> mctx -h
usage: mctx [-h] secret_exponent to_x amount fee donation

positional arguments:
  secret_exponent  secret exponent to use
View trezor-wipe-and-init.py
""" Trezor wipe-and-load script. Generates fresh keys (or inserts predetermined mnemonic) """
from trezorlib.client import TrezorClient
from trezorlib.transport_hid import HidTransport
import mnemonic
m = mnemonic.Mnemonic('english')
priv = m.generate(256)
View gist:b4d85e5f4d871748064e
Verifying that +xertrov is my Bitcoin username. You can send me #bitcoin here: https://onename.io/xertrov
View 2014-08-27-microchains.md

Originally posted at https://xk.io/2014/08/microchains.html

Microchains

The Ethereum devs have been talking about microchains lately so I figured it was time to write up what my thoughts on this sort of thing have condensed into.

As a note, I didn't coin the term microchain, though I've heard Gavin Wood use it (and Stephan Tual). I didn't have a term and I think this is perfect.

The point of a microchain is to provide a shared scalable PoW 'container' - a chain meant for nothing else but wrapping data in a PoW. Typically this has been done in a roundabout way (see AuxPoW or Mastercoin/Counterparty) that requires a lot of data, and is not efficient for any 'piggy-backing' chains hanging off the main chain. This isn't a huge issue; insofar as - in the case of AuxPoW - proofs just go from 80 bytes to ~500 bytes (unless you're using P2Pool or Eligius then it's a bunch more). This is because the whole chain from block hash to PoW must be included, which is `Hash(Header(MerkleTree(Coinbase(ScriptSig(BlockHash

View gist:3665a80e835aa2c9285a
### Keybase proof
I hereby claim:
* I am XertroV on github.
* I am xertrov (https://keybase.io/xertrov) on keybase.
* I have a public key whose fingerprint is 38E4 5128 27C9 78CF 6C68 AE99 FEF3 5F69 AAAC E7FE
To claim this, I am signing this object:
@XertroV
XertroV / randomize.dg
Created May 23, 2015
Randomly shuffle things with minimal bits (written in pyos/dg)
View randomize.dg
#!/usr/bin/env python3 -m dg
import '/hashlib'
import '/time'
Counter = subclass object where
__init__ = self ->
self.c = 0
None
@XertroV
XertroV / password_trainer.py
Created Dec 15, 2015
Password Trainer - simple script to remember a password and help you practise
View password_trainer.py
#!/usr/bin/env python3
import getpass
import time
print("Please input your password carefully.")
password = getpass.getpass()
print("Thank you, please type it again to confirm")
p2 = getpass.getpass()
View gist:f6495d9fcc82ff96b05a4986c1316b61
# First: from the HTTP debug interface (Which hung with the RPC command...)
## See below for `debug.stacks()`
```
goroutine 156 [running]:
runtime/pprof.writeGoroutineStacks(0x6b42108, 0xc82c353ee0, 0x0, 0x0)
/usr/local/opt/go/libexec/src/runtime/pprof/pprof.go:516 +0x84
runtime/pprof.writeGoroutine(0x6b42108, 0xc82c353ee0, 0x2, 0x0, 0x0)
/usr/local/opt/go/libexec/src/runtime/pprof/pprof.go:505 +0x46
You can’t perform that action at this time.