Bitcoin Graffiti

a museum of data stored in the blockchain work in progress
← timeline
text-software ✓ verified on-chain

CryptoGraffiti Python tool (source)

#!/usr/bin/env python3
#
# This file is placed in the public domain.
#
# CryptoGraffiti tool
#
# Requires python-bitcoinlib-v0.2.1
#
# https://github.com/petertodd/python-bitcoinlib
#
# pip install python-bitcoinlib

# Usage:
#
# ./cryptograffiti.py <textfile>

import collections
import sys

from bitcoin.rpc import Proxy
from bitcoin.wallet import *

DUST = 0.000055

addrs = collections.OrderedDict()
with open(sys.argv[1], 'rb') as fd:
    while True:
        b = fd.read(20)

        if not b:
            break

        addr = P2PKHBitcoinAddress.from_bytes(b.ljust(20))
        addrs[str(addr)] = DUST

addrs['1MVpQJA7FtcDrwKC6zATkZvZcxqma4JixS'] = 0.0009

print('%d outputs with total cost: %f mBTC + fees' % (len(addrs), sum(addrs.values())*1000))

r = input('Send? y/n\n')

if r == 'y':
    proxy = Proxy()
    r = proxy.sendmany('', addrs)
    print('Sent: %s' % r)

else:
    print('Canceled!')

#!/usr/bin/env python3 ... CryptoGraffiti tool