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:
reverse.py- Lightning to Bitcoinsubmarine.py- Bitcoin to Lightningchain.py- Bitcoin to Liquid (and vice versa)
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)
| File | Size | Uploaded | |
|---|---|---|---|
| boltz_client-0.4.1.tar.gz | 5.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|