bitcoinlib


Namebitcoinlib JSON
Version 0.7.0 PyPI version JSON
download
home_pagehttp://github.com/1200wd/bitcoinlib
SummaryBitcoin cryptocurrency Library
upload_time2024-11-02 19:35:52
maintainerNone
docs_urlNone
author1200wd
requires_pythonNone
licenseGNU3
keywords bitcoin library cryptocurrency wallet crypto keys segwit transactions blocks
VCS
bugtrack_url
requirements requests fastecdsa scrypt pycryptodome SQLAlchemy numpy sphinx coveralls psycopg mysql-connector-python mysqlclient sphinx_rtd_theme Cython win-unicode-console
Travis-CI No Travis.
coveralls test coverage
            Python Bitcoin Library
======================

Bitcoin cryptocurrency Library writen in Python.

Allows you to create a fully functional Bitcoin wallet with a single line of code.
Use this library to create and manage transactions, addresses/keys, wallets, mnemonic password phrases
and blocks with simple and straightforward Python code.

You can use this library at a high level and create and manage wallets from the command line or at a low level
and create your own custom made transactions, scripts, keys or wallets.

The BitcoinLib connects to various service providers automatically to update wallets, transaction and
blockchain information. You can also connect to a local
`Bitcoin <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bitcoind-connection.html>`_ or
`Bcoin node <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bcoin.html>`_.


.. image:: https://github.com/1200wd/bitcoinlib/actions/workflows/unittests.yaml/badge.svg
    :target: https://github.com/1200wd/bitcoinlib/actions/workflows/unittests.yaml
    :alt: Unittests
.. image:: https://img.shields.io/pypi/v/bitcoinlib.svg
    :target: https://pypi.org/pypi/bitcoinlib/
    :alt: PyPi
.. image:: https://readthedocs.org/projects/bitcoinlib/badge/?version=latest
    :target: http://bitcoinlib.readthedocs.io/en/latest/?badge=latest
    :alt: RTD
.. image:: https://coveralls.io/repos/github/1200wd/bitcoinlib/badge.svg?branch=installation-documentation-update
    :target: https://coveralls.io/github/1200wd/bitcoinlib?branch=master
    :alt: Coveralls


Install
-------

Install required packages on Ubuntu or related Linux systems:

.. code-block:: bash

    $ sudo apt install build-essential python3-dev libgmp3-dev

Then install using pip

.. code-block:: bash

    $ pip install bitcoinlib

Check out the `more detailed installation instructions <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.install.html>`_ to read how to install on other systems or for
troubleshooting.

If you are using docker you can check some Dockerfiles to create images in the
`docker <https://github.com/1200wd/bitcoinlib/tree/master/docker>`_ directory.

Documentation
-------------

Read the full documentation at: http://bitcoinlib.readthedocs.io/


Example
-------

The bitcoin library contains a wallet implementation using SQLAlchemy and SQLite3 to import, create and manage
keys in a Hierarchical Deterministic way.

Example: Create wallet and generate new address (key) to receive bitcoins

.. code-block:: pycon

   >>> from bitcoinlib.wallets import Wallet
   >>> w = Wallet.create('Wallet1')
   >>> w.get_key().address
   'bc1qk25wwkvz3am9smmm3372xct5s7cwf0hmnq8szj'

Now send a small transaction to your wallet and use the scan() method to update transactions and UTXO's

.. code-block:: pycon

    >>> w.scan()
    >>> w.info()  # Shows wallet information, keys, transactions and UTXO's

When your wallet received a payment and has unspent transaction outputs, you can send bitcoins easily.
If successful a transaction ID is returned

.. code-block:: pycon

    >>> t = w.send_to('bc1qemtr8ywkzg483g8m34ukz2l4pl3730776vzq54', '0.001 BTC', offline=False)
    'b7feea5e7c79d4f6f343b5ca28fa2a1fcacfe9a2b7f44f3d2fd8d6c2d82c4078'
    >>> t.info  # Shows transaction information and send results


More examples
-------------

You can find many more examples in the `documentation <https://bitcoinlib.readthedocs.io/en/latest/>`_
for instance about the `Wallet.create() <https://bitcoinlib.readthedocs.io/en/latest/source/bitcoinlib.wallets.html#bitcoinlib.wallets.Wallet.create>`_ method.

There are many working examples on how to create wallets, specific transactions, encrypted databases, parse the
blockchain, connect to specific service providers in the `examples directory <https://github.com/1200wd/bitcoinlib/tree/master/examples>`_ in the source code of this library.

Some more specific examples can be found on the `Coineva website <https://coineva.com/category/bitcoinlib.html>`_.

Contact
-------

If you have any questions, encounter a problem or want to share an idea, please use `Github Discussions
<https://github.com/1200wd/bitcoinlib/discussions>`_


Implements the following Bitcoin Improvement Proposals
------------------------------------------------------
- Hierarchical Deterministic Wallets (BIP0032)
- Passphrase-protected private key (BIP0038)
- Mnemonic code for generating deterministic keys (BIP0039)
- Purpose Field for Deterministic Wallets (BIP0043)
- Multi-Account Hierarchy for Deterministic Wallets (BIP0044)
- Structure for Deterministic P2SH Multisignature Wallets (BIP0045)
- Bech32/base32 address format for native v0-16 witness outputs (BIP0173)
- Native and P2SH nested Segregated Witness transactions (BIP0141 and BIP0143)
- Bech32m format for v1+ witness addresses (BIP0350)
- and many more...


Future / Roadmap
----------------

- Fully support timelocks
- Support Taproot and Schnorr signatures
- Support advanced scripts
- Support for Trezor wallet or other hardware wallets
- Allow to scan full blockchain
- Integrate simple SPV client


Disclaimer
----------

This library is still in development, please use at your own risk and test sufficiently before using it in a
production environment.

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/1200wd/bitcoinlib",
    "name": "bitcoinlib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "bitcoin library cryptocurrency wallet crypto keys segwit transactions blocks",
    "author": "1200wd",
    "author_email": "info@1200wd.com",
    "download_url": "https://files.pythonhosted.org/packages/9b/77/32764418700630cfd6d599e088e442b2d0db866709b2cc0c0dbbacb7dd26/bitcoinlib-0.7.0.tar.gz",
    "platform": null,
    "description": "Python Bitcoin Library\n======================\n\nBitcoin cryptocurrency Library writen in Python.\n\nAllows you to create a fully functional Bitcoin wallet with a single line of code.\nUse this library to create and manage transactions, addresses/keys, wallets, mnemonic password phrases\nand blocks with simple and straightforward Python code.\n\nYou can use this library at a high level and create and manage wallets from the command line or at a low level\nand create your own custom made transactions, scripts, keys or wallets.\n\nThe BitcoinLib connects to various service providers automatically to update wallets, transaction and\nblockchain information. You can also connect to a local\n`Bitcoin <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bitcoind-connection.html>`_ or\n`Bcoin node <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bcoin.html>`_.\n\n\n.. image:: https://github.com/1200wd/bitcoinlib/actions/workflows/unittests.yaml/badge.svg\n    :target: https://github.com/1200wd/bitcoinlib/actions/workflows/unittests.yaml\n    :alt: Unittests\n.. image:: https://img.shields.io/pypi/v/bitcoinlib.svg\n    :target: https://pypi.org/pypi/bitcoinlib/\n    :alt: PyPi\n.. image:: https://readthedocs.org/projects/bitcoinlib/badge/?version=latest\n    :target: http://bitcoinlib.readthedocs.io/en/latest/?badge=latest\n    :alt: RTD\n.. image:: https://coveralls.io/repos/github/1200wd/bitcoinlib/badge.svg?branch=installation-documentation-update\n    :target: https://coveralls.io/github/1200wd/bitcoinlib?branch=master\n    :alt: Coveralls\n\n\nInstall\n-------\n\nInstall required packages on Ubuntu or related Linux systems:\n\n.. code-block:: bash\n\n    $ sudo apt install build-essential python3-dev libgmp3-dev\n\nThen install using pip\n\n.. code-block:: bash\n\n    $ pip install bitcoinlib\n\nCheck out the `more detailed installation instructions <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.install.html>`_ to read how to install on other systems or for\ntroubleshooting.\n\nIf you are using docker you can check some Dockerfiles to create images in the\n`docker <https://github.com/1200wd/bitcoinlib/tree/master/docker>`_ directory.\n\nDocumentation\n-------------\n\nRead the full documentation at: http://bitcoinlib.readthedocs.io/\n\n\nExample\n-------\n\nThe bitcoin library contains a wallet implementation using SQLAlchemy and SQLite3 to import, create and manage\nkeys in a Hierarchical Deterministic way.\n\nExample: Create wallet and generate new address (key) to receive bitcoins\n\n.. code-block:: pycon\n\n   >>> from bitcoinlib.wallets import Wallet\n   >>> w = Wallet.create('Wallet1')\n   >>> w.get_key().address\n   'bc1qk25wwkvz3am9smmm3372xct5s7cwf0hmnq8szj'\n\nNow send a small transaction to your wallet and use the scan() method to update transactions and UTXO's\n\n.. code-block:: pycon\n\n    >>> w.scan()\n    >>> w.info()  # Shows wallet information, keys, transactions and UTXO's\n\nWhen your wallet received a payment and has unspent transaction outputs, you can send bitcoins easily.\nIf successful a transaction ID is returned\n\n.. code-block:: pycon\n\n    >>> t = w.send_to('bc1qemtr8ywkzg483g8m34ukz2l4pl3730776vzq54', '0.001 BTC', offline=False)\n    'b7feea5e7c79d4f6f343b5ca28fa2a1fcacfe9a2b7f44f3d2fd8d6c2d82c4078'\n    >>> t.info  # Shows transaction information and send results\n\n\nMore examples\n-------------\n\nYou can find many more examples in the `documentation <https://bitcoinlib.readthedocs.io/en/latest/>`_\nfor instance about the `Wallet.create() <https://bitcoinlib.readthedocs.io/en/latest/source/bitcoinlib.wallets.html#bitcoinlib.wallets.Wallet.create>`_ method.\n\nThere are many working examples on how to create wallets, specific transactions, encrypted databases, parse the\nblockchain, connect to specific service providers in the `examples directory <https://github.com/1200wd/bitcoinlib/tree/master/examples>`_ in the source code of this library.\n\nSome more specific examples can be found on the `Coineva website <https://coineva.com/category/bitcoinlib.html>`_.\n\nContact\n-------\n\nIf you have any questions, encounter a problem or want to share an idea, please use `Github Discussions\n<https://github.com/1200wd/bitcoinlib/discussions>`_\n\n\nImplements the following Bitcoin Improvement Proposals\n------------------------------------------------------\n- Hierarchical Deterministic Wallets (BIP0032)\n- Passphrase-protected private key (BIP0038)\n- Mnemonic code for generating deterministic keys (BIP0039)\n- Purpose Field for Deterministic Wallets (BIP0043)\n- Multi-Account Hierarchy for Deterministic Wallets (BIP0044)\n- Structure for Deterministic P2SH Multisignature Wallets (BIP0045)\n- Bech32/base32 address format for native v0-16 witness outputs (BIP0173)\n- Native and P2SH nested Segregated Witness transactions (BIP0141 and BIP0143)\n- Bech32m format for v1+ witness addresses (BIP0350)\n- and many more...\n\n\nFuture / Roadmap\n----------------\n\n- Fully support timelocks\n- Support Taproot and Schnorr signatures\n- Support advanced scripts\n- Support for Trezor wallet or other hardware wallets\n- Allow to scan full blockchain\n- Integrate simple SPV client\n\n\nDisclaimer\n----------\n\nThis library is still in development, please use at your own risk and test sufficiently before using it in a\nproduction environment.\n",
    "bugtrack_url": null,
    "license": "GNU3",
    "summary": "Bitcoin cryptocurrency Library",
    "version": "0.7.0",
    "project_urls": {
        "Homepage": "http://github.com/1200wd/bitcoinlib"
    },
    "split_keywords": [
        "bitcoin",
        "library",
        "cryptocurrency",
        "wallet",
        "crypto",
        "keys",
        "segwit",
        "transactions",
        "blocks"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48eab906ee64f0b17b327f1586b814c267e8f053acfaacb06fbeb9aaedd5ca0b",
                "md5": "cea6ee97143bd2bb9f1b504eb99cfd51",
                "sha256": "ec826633018bd080f526b98d80494da1beeb42cc87faf64c0041d86a054afc94"
            },
            "downloads": -1,
            "filename": "bitcoinlib-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cea6ee97143bd2bb9f1b504eb99cfd51",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4245180,
            "upload_time": "2024-11-02T19:35:46",
            "upload_time_iso_8601": "2024-11-02T19:35:46.950469Z",
            "url": "https://files.pythonhosted.org/packages/48/ea/b906ee64f0b17b327f1586b814c267e8f053acfaacb06fbeb9aaedd5ca0b/bitcoinlib-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b7732764418700630cfd6d599e088e442b2d0db866709b2cc0c0dbbacb7dd26",
                "md5": "9ea0035e530844fac32cba2a5971a920",
                "sha256": "a2b0092223a31e54b46efe6fab5128484921632d7d24aea0f00d1653485ff68e"
            },
            "downloads": -1,
            "filename": "bitcoinlib-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9ea0035e530844fac32cba2a5971a920",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4189840,
            "upload_time": "2024-11-02T19:35:52",
            "upload_time_iso_8601": "2024-11-02T19:35:52.335809Z",
            "url": "https://files.pythonhosted.org/packages/9b/77/32764418700630cfd6d599e088e442b2d0db866709b2cc0c0dbbacb7dd26/bitcoinlib-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-02 19:35:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "1200wd",
    "github_project": "bitcoinlib",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.25.0"
                ]
            ]
        },
        {
            "name": "fastecdsa",
            "specs": [
                [
                    ">=",
                    "2.3.0"
                ]
            ]
        },
        {
            "name": "scrypt",
            "specs": [
                [
                    ">=",
                    "0.8.20"
                ]
            ]
        },
        {
            "name": "pycryptodome",
            "specs": [
                [
                    ">=",
                    "3.19.0"
                ]
            ]
        },
        {
            "name": "SQLAlchemy",
            "specs": [
                [
                    ">=",
                    "2.0.20"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.26.0"
                ]
            ]
        },
        {
            "name": "sphinx",
            "specs": [
                [
                    ">=",
                    "7.2.0"
                ]
            ]
        },
        {
            "name": "coveralls",
            "specs": [
                [
                    ">=",
                    "4.0.1"
                ]
            ]
        },
        {
            "name": "psycopg",
            "specs": [
                [
                    ">=",
                    "3.1.16"
                ]
            ]
        },
        {
            "name": "mysql-connector-python",
            "specs": [
                [
                    ">=",
                    "8.4.0"
                ]
            ]
        },
        {
            "name": "mysqlclient",
            "specs": [
                [
                    ">=",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "sphinx_rtd_theme",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "Cython",
            "specs": [
                [
                    ">=",
                    "3.0.8"
                ]
            ]
        },
        {
            "name": "win-unicode-console",
            "specs": []
        }
    ],
    "lcname": "bitcoinlib"
}
        
Elapsed time: 0.73874s