Quickstart

Install


pip install bitpilot

With agent framework support:


pip install bitpilot[agent]

With Lightning / L402 support:


pip install bitpilot[lightning]
pip install bitpilot[l402]

Create a Wallet


from bitpilot import Wallet

wallet, mnemonic = Wallet.create(network="testnet")
print("Save this mnemonic:", mnemonic)

The mnemonic is shown once. Store it securely — it is the only recovery mechanism.

Check Balance


balance = wallet.get_balance()
print(f"Confirmed: {balance.confirmed_sats} sats")
print(f"Total:     {balance.total_sats} sats")

To refresh UTXOs from the network:


import asyncio
asyncio.run(wallet.sync())

Attach a Spend Policy


from bitpilot import Policy

policy = Policy(
    max_per_tx_sats=100_000,
    require_approval_above_sats=50_000,
)
wallet.set_policy(policy)

Propose a Payment


proposal = wallet.propose_payment(
    to_address="tb1qtest...",
    amount_sats=25_000,
    fee_rate_sat_vb=5.0,
    memo="coffee",
)
print(f"Status: {proposal.status.value}")
print(f"Proposal ID: {proposal.id}")

Proposals under the approval threshold are auto-approved by the policy engine. Proposals above it enter pending status and require explicit human approval:


txid = wallet.approve_proposal(proposal.id)

Estimate Fees


import asyncio
from bitpilot import FeeEstimator

estimator = FeeEstimator(network="mainnet")
fee = asyncio.run(estimator.estimate_fee())
print(f"Fast: {fee.fast_sat_vb} sat/vB, Medium: {fee.medium_sat_vb}, Slow: {fee.slow_sat_vb}")

CLI


bitpilot init-wallet
bitpilot balance
bitpilot fees
bitpilot propose --to tb1q... --amount-sats 25000
bitpilot approve --proposal-id <id>

Next Steps