Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A small daemon for processing bitcoin payments compatible with modern HD wallets

Project Description


Pypayd is a minimalistic daemon for accepting bitcoin payments, originally written by Alexander Maznev. This is meant to be a good alternative if you do not want setup an account with a third-party payment processor. Pypayd provides an API for creating orders and automatically records order fulfillment (payment received) as well as invalid payments.

Pypayd-NG is a rewritten version of pypayd, which automatically creates receiving addresses for provided HD wallet, a wrapper around the pycoin implementation of BIP32. It generates addresses compatible with modern HD wallets from a public master-key only (note that there is no need to store the private key on the server, it’s much safer to use the public key only!).


The recommended installation is to use pip3 install pypayd-ng.

If you prefer to use a developement version: git clone

following that cd into the pypayd-ng directory and execute: pip3 install -r requirements.txt.


You are able to configure pypayd via creating pypayd.conf file. Consult pypayd_ng/pypayd/ for configuration values.

currency exchange rates

Currently there are three sources of live currency exchange rates available:

Example usage

Get a wallet. Pypayd supports the following wallets out of the box:

  • Copay: copay (supports Live and Test BTC networks)
  • Electrum: electrum (supports Live BTC network only, Electrum versions >=2.0)
  • Mycelium: mycelium (supports Live and Test BTC networks)
Obtain a publickey from your wallet. It should look like:
tpubD8z6BcZQGXU6AVeqgkqmhDKAtfMPoX2sNyYaSzoiZYHRdJjG75f5CTbzmQ9sWCWsijwnwW9MEvVbQuckbKQoZktBjJyxL1ui4rSoAyQDnwF (please do not use that public key, as it is an example only)

Insert the publickey into a file payment_wallet.txt on your online server. Then run pypayd, specifying type of the wallet you are using (for example Copay): --server wallet --wallet-type="copay" --from-file="payment_wallet.txt"

Then from your webserver (i.e. to create an order for a payment of 20 USD):

import requests
import json
url = ""
headers = {'content-type': 'application/json'}
payload = {
    "method": "create_order",
    "params": {"amount": 20.0, "qr_code": True},
    "jsonrpc": "2.0",
    "id": 0,
response = url, data=json.dumps(payload), headers=headers).json()

This will return an automatically created order_id, a price converted to Bitcoin from the DEFAULT_CURRENCY by the DEFAULT_TICKER, a receiving address, as well as a time left on the transaction (note that the timeleft on the transaction is the time-lapse after which a payment received for the order will not be considered valid; it may be preferable to set a longer TX_LIFE then the one displayed to the customer). The full argument list for create_order as follows:

* amount          order amount in native currency
* currency        takes a string such as 'USD', config.DEFAULT_CURRENCY if none
* item_number     specify an item-number to associate  with the order in the database
* order_id        specify an order-id, if one is not given an order-id will be created by hashing other order attributes
* gen_new         generate a new address for the order if True, otherwise uses config settings
* qr_code         generate a qr_code for the corresponding receiving address if True


  • Python3
  • See requirements.txt
  • zbarimg binary is required for tests only, you can find it in zbar-tools package in debian/ubuntu

to do

See the list.


Pypayd-NG supports insight-api (run locally or hosted: and blockr ( I’ll probably add support for jmcorgan’s fork of bitcoin-core with address indexing in the near future. To configure set BLOCKCHAIN_SERVICE to the interface Pypayd should load (“insight” or “blockr”) and BLOCKCHAIN_CONNECT to the complete url in the pypayd.conf file.

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(58.1 kB) Copy SHA256 Hash SHA256
Wheel 3.5 Jan 19, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting