Setup
Install the SDK, Intents client, and the Nostr transport peer dependency:Pay a Lightning Invoice
Lightning send is exact-out:payment.fundAmount is the quote’s from_amount,
and the invoice amount is its to_amount. Recovery is not automatic. If
the solver does not pay the invoice, the wallet must return after
refund_locktime and submit a refund.
@arkade-os/swap/nostr transport uses nostr-tools to send the addressed
RFQ over the relays in the solver card. Addressed RFQs use Nostr kind 24859
during the preview.
requestLightningSend requests a quote, derives the expected contract locally
with the SDK-supplied covenant co-signer, rejects an address mismatch, and
checks invoice expiry and refund headroom. Funding payment.fundAmount accepts
the quote. The solver observes the funded contract through Arkade, pays the
invoice, learns the preimage, and claims the swap. The solver can complete this
sequence without the application remaining online.
The card currently accepts Lightning sends from 500 to 50,000 sats and sets
fee_bps: 30. A 10,000-sat invoice locks 10,031 sats, with the difference
between from_amount and to_amount representing the fee.
Exchange BTC for an Asset
Asset exchange selects a compatible market, calculates a quote from the solver card’s feed and fee, and funds the swap. An unfilled swap has no automatic expiry. Keep cancellation available until the application confirms a fill or cancellation.offer.offerHex and the funding
txid in the SDK asset-swap repository as soon as wallet.send returns.
cancelOffer and restoreAssetSwaps use both values to identify the deposit.
cancelOffer submits the cancellation without a solver signature. Keep that
action available because the deposited funds remain locked until the swap is
filled or cancelled.
Lightning Receive
No solver currently serves Lightning receive. The solver card setsmax_base_amount: "0" for lightning:BTC → arkade:BTC, so it refuses requests
for that route.
requestLightningReceive requests a hold invoice and seals the claim preimage.
The configured claim key determines who can open the packet, publish the
preimage, and complete the claim. Implement the receive and claim
flow when a compatible solver
becomes available.
Preview Availability
Lightning send uses a pinned solver during the preview. The quote, funding,
settlement, and recovery sequence follows the shared protocol lifecycle, while
the APIs and provisional wire details may still change. Build against the
pinned card now and add broader solver selection as compatible implementations
become available.
Lightning Solver Card
The Lightning preview solver is not listed in the registry. Its signed card publishes the connection details and current terms. Pin its relay and solver key innostrRfqTransport.
beta-solver.card.json
beta-solver.card.json
min_quote_amount and max_quote_amount define the Lightning amount accepted
when paying an invoice. The max_base_amount of "0" closes the
lightning:BTC → arkade:BTC receive route on this deployment.The card is signed, and sig covers the connection data it advertises. Pinning
the card makes this solver and its advertised connection data part of the
application’s trust boundary. Load the latest signed card before deployment
because its limits, fee, relay, and key may change.Integrate Lightning
Request, fund, claim, and recover Lightning swaps.
Exchange Assets
Integrate asset discovery, exchange, and cancellation.
Implementation Status
Check solver, client, and route readiness.
Trust and Limitations
Review settlement guarantees, external dependencies, and recovery conditions.