Skip to main content

Bitcoin utility functions

Project description

This is a bitcoin library that provides tools/utilities to interact with the Bitcoin network. One of the primary goals of the library is to be educational. The code is easy to read and properly documented explaining in detail all the thorny aspects of the implementation.

Currently, only a module that provides access to private/public keys and addresses is available.


$ pip install python-bitcoin-utils

Example usage

>>> from bitcoinutils.keys import PrivateKey, PublicKey
>>> from bitcoinutils.setup import setup, get_network
>>> setup('mainnet')
>>> p = PrivateKey()
>>> p.to_wif()
>>> pubkey = p.get_public_key()
>>> pubkey.to_hex()
>>> pubkey.to_hex(False)
>>> a = pubkey.get_address()
>>> a.to_hash160()
>>> a.to_address()
>>> s = p.sign_message('test')
>>> s
>>> PublicKey.verify_message(a.to_address(), s, 'test')

Project details

Download files

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

Source Distribution

bitcoin-utils-0.0.1.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

bitcoin_utils-0.0.1-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page