pyspv

WARNING: This is experimental software. Use at your own risk

pyspv is a no-bullshit, easy-to-use Python module implementing the full Bitcoin SPV client protocol. Connecting to the Bitcoin network is as easy as:

import pyspv
spv = pyspv.pyspv("my-application-name")
...

... but just connecting to the Bitcoin network would be boring. The real goal of this project is to make embedding Bitcoin into your project so simple that everybody does it. pyspv handles the details like Blockchain syncing, the peer-to-peer network, payment management, wallets, etc., and allows you to get started prototyping your Bitcoin application quickly.

I intend to make this SPV client as extensible as possible with a goal of supporting alt-coins using simple coin definitions. Because pyspv is modular, it is now easy to connect to several different alt-coin networks within the same application -- simply initialize two pyspv classes with different coin definitions.

You can develop a pretty UI wallet or just a simple utility to send you an E-mail you when an address receives a payment. The possibilities are really endless.

requirements

pyspv only relies on a small handful of dependencies:

features

examples

simple-wallet.py

This example runs a basic wallet. Running it with no arguments starts an RPC server. With arguments, an RPC call is made. The program behaves similarly to bitcoind, with several noticeable differences.

Available commands:

test-stealth-keys.py

This example runs through the math and demonstrates how stealth addresses work in theory.

anyonecanpay-new.py

Create a new transaction with specified outputs and zero inputs. The transaction displayed can be used as input to anyonecanpay-add.py.

anyonecanpay-add.py

Given a transaction and a spend id, add those inputs and sign them using ANYONECANPAY. This program, combined with anyonecanpay-new.py effectly allows easy creation of assurance contracts.

documentation

TODO

Documentation will soon be available at http://docs.pyspv.org/