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:
reverse.py- Lightning to Bitcoinsubmarine.py- Bitcoin to Lightningchain.py- Bitcoin to Liquid (and vice versa)
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(5.4 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boltz_client-0.4.1.tar.gz.
File metadata
- Download URL: boltz_client-0.4.1.tar.gz
- Upload date:
- Size: 5.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ebba5ef6faadd1deced94d7652eed39fd15bc8ba84565f473ad46118ef52b42
|
|
| MD5 |
0256de4854325b9d7eeb082f8263e32d
|
|
| BLAKE2b-256 |
d82f00b031fdfdaaf2ec09373935ca24bce9031d779be913a2f4cd16da187cea
|
File details
Details for the file boltz_client-0.4.1-py3-none-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: boltz_client-0.4.1-py3-none-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: Python 3, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cbd21d8dcbca16bb6814ce25bacc0b6c333d7eed9ca6c9508d48a4f23ebd1e4
|
|
| MD5 |
d90d514a74a5415aae78cc9def206a99
|
|
| BLAKE2b-256 |
3dcf2e207d784ae3efcfe89b226d5437f1567d426f1fcb38a39941d5a469f3cf
|