Fund the wallet
The simplest way to get a first balance is the receive flow in section 7: pay a BOLT11 invoice of your own wallet from any
Lightning wallet. The SDK also exposes a Bitcoin deposit address (ReceivePaymentMethod.bitcoinAddress); if you use it,
try a small amount first.
One wallet per user, paid from a central wallet
Each user's app embeds the SDK with its own mnemonic on the device. Your server runs one central wallet that holds the balance you pay from.
- The user's app shows its Spark address (
ReceivePaymentMethod.sparkAddress). - Your server pays that address from the central wallet with the same parse, prepare and send calls used for invoices. Paying a
Spark address is a direct Spark transfer: no Lightning and no routing fee (verified on 2026-11-09 between two wallets: 1,000
sats, status
completed, fee 0). - To withdraw, the user pays any Lightning invoice from their own wallet.
Keep the amount, and the change left in the sending wallet, at 330 sats or more. A smaller piece makes the wallet's funds lock for
a while (a 100 sat transfer failed this way in our test). Keep preferSparkOverLightning: false and pay the Spark address
explicitly. Fund the central wallet by Lightning (see Lightning liquidity).
Lightning liquidity
Lightning payments in and out go through IBIRAPAY's SSP and its Lightning channels. The SSP can pay out only what its channels hold on its side, and that grows when wallets receive Lightning payments. IBIRAPAY watches this balance and reinforces it, with no amount guaranteed. Fund your wallet first, then pay out, and tell IBIRAPAY your largest expected single payment and your monthly volume so the channels can be sized before you launch. A payment larger than the available channel balance fails with a routing error and loses nothing.
The reserve for Enterprise wallets. When the SSP's Lightning capacity falls low, the SSP keeps what is left for the wallets
with priority: those registered to an Enterprise account (section 5.5), until the end of the account's first paid month (section 5.4). A Lightning send from any other wallet is refused before any funds move,
while receiving and Spark-to-Spark transfers keep working. The refusal is an error from prepareSendPayment whose text contains
LIQUIDITY_RESERVED (the full text today is LIQUIDITY_RESERVED: liquidez reservada, tente mais tarde). In your app:
try {
prep = await sdk.prepareSendPayment(request: request);
} catch (e) {
if (e.toString().contains('LIQUIDITY_RESERVED')) {
// Lightning payouts are paused for this wallet for now. Nothing left the wallet.
// Keep the payout queued, tell the user to try again later, retry after a few minutes.
return;
}
rethrow;
}
Match on LIQUIDITY_RESERVED, not on the sentence after it. Do not retry in a tight loop. A wallet with priority is not
refused. If your registered wallet gets this error before the end of the account's first paid month, check that it is registered (a new registration reaches the
SSP in about 30 seconds) and tell IBIRAPAY; after that month, the refusal is the expected behaviour (section 5.4).
Fund your wallet by Lightning, not by an on-chain deposit. A Lightning deposit adds to the SSP's side of the channel, which is what pays your later payouts, so deposits and payouts keep the channel balanced. An on-chain deposit raises your Spark balance without adding to the channel, and every payout then draws the channel down with nothing to replace it. If you must deposit on-chain, tell IBIRAPAY first so the channel can be refilled.