Skip to main content

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:

Metadata

Release files for boltz_client 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boltz_client 0.4.1
File Size Uploaded
boltz_client-0.4.1.tar.gz 5.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for boltz_client 0.4.1
File Interpreter ABI Platform
boltz_client-0.4.1-py3-none-manylinux_2_38_x86_64.whl Python 3 none Linux glibc 2.38+ x86-64 Details

Total release size: 10.7 MB

Release files / boltz_client-0.4.1.tar.gz

Download URL boltz_client-0.4.1.tar.gz
Size 5.4 MB
Tags Source
SHA-256 checksum
How to use checksums
3ebba5ef6faadd1deced94d7652eed39fd15bc8ba84565f473ad46118ef52b42
BLAKE2b-256 checksum
How to use checksums
d82f00b031fdfdaaf2ec09373935ca24bce9031d779be913a2f4cd16da187cea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release files / boltz_client-0.4.1-py3-none-manylinux_2_38_x86_64.whl

Download URL boltz_client-0.4.1-py3-none-manylinux_2_38_x86_64.whl
Size 5.4 MB
Tags Linux glibc 2.38+ x86-64 Python 3
SHA-256 checksum
How to use checksums
0cbd21d8dcbca16bb6814ce25bacc0b6c333d7eed9ca6c9508d48a4f23ebd1e4
BLAKE2b-256 checksum
How to use checksums
3dcf2e207d784ae3efcfe89b226d5437f1567d426f1fcb38a39941d5a469f3cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page