Skip to main content

Boltz Swap library

Project description

Boltz Client Python Bindings

Python bindings for the Boltz Rust library, enabling atomic swaps between Bitcoin, Lightning Network, and Liquid.

Installation

pip install boltz_client

Quick Start

⚠️ WARNING: All examples are only to be used in REGTEST.

import boltz_client
import asyncio

async def main():
    # Initialize for regtest (do NOT use this example in production)
    network = boltz_client.Network.REGTEST
    boltz_api = boltz_client.BoltzApiClientV2.default(network)

    # Example: Create a submarine swap (Lightning → Bitcoin)
    key_pair = boltz_client.KeyPair()
    btc_chain = boltz_client.btc_chain_from_network(network)

    invoice = "lightning-invoice-to-pay"

    request = boltz_client.CreateSubmarineRequest(
        _from=btc_chain,
        to=btc_chain,
        invoice=invoice,
        refund_public_key=key_pair.public(),
    )

    swap = await boltz_api.create_swap(request)
    print(f"Send {swap.expected_amount} sats to {swap.address}")

asyncio.run(main())

Swap Types

  • Submarine swaps - Lightning → On-chain Bitcoin/Liquid
  • Reverse swaps - On-chain Bitcoin/Liquid → Lightning
  • Chain swaps - Bitcoin ↔ Liquid atomic swaps

Examples

Complete working examples are available in the examples/ directory:

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

boltz_client-0.4.0.tar.gz (5.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boltz_client-0.4.0-py3-none-manylinux_2_34_x86_64.whl (5.3 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

File details

Details for the file boltz_client-0.4.0.tar.gz.

File metadata

  • Download URL: boltz_client-0.4.0.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for boltz_client-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a3f5a6b637350267856e3ab680cd92158de720fa2d5805fc075e4583d020cb2a
MD5 276d58717825c4cb09b5087f95ecd1b9
BLAKE2b-256 5197c0d3d0cb5a6f70511fc22549d661406fa41859971b3d8e807c9122525d8c

See more details on using hashes here.

File details

Details for the file boltz_client-0.4.0-py3-none-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: boltz_client-0.4.0-py3-none-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 5.3 MB
  • Tags: Python 3, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for boltz_client-0.4.0-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ed0b520209cf1b05a8523002f5d8f26fa29c04d2faecc9cbde3621b4ddc417e6
MD5 aed08e7f2e75abbdb41ab0fad1144cf2
BLAKE2b-256 be2ac99448f0e9789a6d4b6d25392c0eb17b1dedef7c16bafae9a91b2a92e592

See more details on using hashes here.

Supported by

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