Lightning
The Lightning Network is a payment layer on top of Bitcoin. Payments move off-chain through payment channels, so they settle in seconds and cost a fraction of an on-chain fee. Only channel openings and closings touch the blockchain.
You don't run a Lightning node. The platform operates the nodes, opens and maintains the channels, and manages liquidity for you. You create invoices to get paid and pay invoices that others send you.
There are two ways to use Lightning:
| Go Lightning | Lightning custody wallet | |
|---|---|---|
| Where the funds live | Your existing Go Account. Lightning and on-chain bitcoin share one balance | A separate Lightning wallet with its own balance |
{coin} (prod / sandbox) | ofcbtc / ofctbtc | lnbtc / tlnbtc |
| Setup | None, once Lightning is enabled | Create the wallet (can take up to 24 hours) |
| Get paid | Create an invoice | Create an invoice |
| Pay | sendcoins with the invoice as address | lightning/payment |
| Amount unit | Satoshis only | Millisatoshis or satoshis |
Most integrations should start with Go Lightning: it works from the Go Account you already use for trading and withdrawals, and there is no wallet to create or fund separately.
Neither option works until Lightning is enabled on the enterprise. Contact [email protected] to enable Go Lightning, Lightning custody wallets, or both.
Each Lightning payment, sent or received, is limited to $500 USD or less.
Units
| Unit | Value |
|---|---|
| 1 BTC | 100,000,000 satoshis (sats) |
| 1 satoshi | 1,000 millisatoshis (msats) |
Fields ending in Sat are in satoshis and fields ending in Msat are in millisatoshis. Lightning custody wallets report Lightning balances in millisatoshis; Go Lightning works in satoshis only.
Go Lightning
Go Lightning adds Lightning to your Go Account. Payments you receive are credited to the account's bitcoin balance, and payments you send are debited from it — there is no separate Lightning balance to manage.
Receive: Create an Invoice
POST /api/v2/wallet/{goAccountId}/lightning/invoicevalueSat— the amount to request, in satoshis. Go Lightning does not acceptvalueMsatmemo— optional text shown to the payerexpiry— optional lifetime of the invoice, in seconds- Returns the encoded
invoicestring to share with the payer and apaymentHashto track it
Example payload:
{
"valueSat": 1000,
"memo": "Order 1042",
"expiry": 3600
}
Example response:
{
"valueMsat": "1000000",
"memo": "Order 1042",
"paymentHash": "<paymentHash>",
"invoice": "lnbc10u1p...",
"walletId": "<goAccountId>",
"status": "open",
"expiresAt": "2026-08-01T12:00:00.000Z"
}
The response reports the amount in valueMsat even when you requested it in valueSat.
Track an Invoice
GET /api/v2/wallet/{goAccountId}/lightning/invoice/{paymentHash}— one invoiceGET /api/v2/wallet/{goAccountId}/lightning/invoice— all invoices, filterable bystatus,startDateandendDate
An invoice is open until it is paid (settled) or canceled. An open invoice past its expiresAt can no longer be paid.
Pay an Invoice (sendcoins)
Pay with the same sendcoins endpoint used for crypto withdrawals, passing the invoice string as the destination address.
POST /api/v2/{coin}/wallet/{goAccountId}/sendcoinswith{coin}set toofcbtc(prod) orofctbtc(sandbox)address— the Lightning invoice stringamount— the amount in satoshiswalletPassphrase— the Go Account passphrase- Returns a
transferyou can track like any other withdrawal
Example payload:
{
"address": "lnbc10u1p...",
"amount": "1000",
"walletPassphrase": "<passphrase>"
}
Example response (abridged):
{
"transfer": {
"id": "<transferId>",
"coin": "ofcbtc",
"wallet": "<goAccountId>",
"type": "send",
"valueString": "-1000",
"state": "signed"
},
"status": "signed"
}
Before paying, check the Go Account's withdrawableBalance the same way as before a crypto withdrawal.
If withdrawal fees are configured for your account, the fee is deducted from amount before the payment is sent (see Fees). A Lightning invoice usually asks for an exact amount, so the reduced amount will not match it. Contact [email protected] before paying Lightning invoices from an account with withdrawal fees.
Lightning Custody Wallet
A Lightning custody wallet is a dedicated Lightning wallet, separate from the Go Account. It reports on-chain and Lightning channel balances separately and works in millisatoshis.
1. Create the Wallet
POST /api/v2/{coin}/wallet/generatewith{coin}set tolnbtc(prod) ortlnbtc(sandbox)label— a name for the walletpassphrase— the wallet passphrase. You need it for every payment, so store it securelypasscodeEncryptionCode— a code used to encrypt the passphrase for recoveryenterprise— the enterprise that owns the wallettype: "hot"andsubType: "lightningCustody"
Example payload:
{
"label": "Lightning wallet",
"passphrase": "<passphrase>",
"passcodeEncryptionCode": "<passcodeEncryptionCode>",
"enterprise": "<enterpriseId>",
"type": "hot",
"subType": "lightningCustody"
}
The response returns the wallet (with its id) and three encrypted keychains: userKeychain, userAuthKeychain and nodeAuthKeychain.
Creating the wallet also sets up its Lightning node. This can take up to 24 hours, and the wallet can't send or receive Lightning payments until it finishes.
2. Fund the Wallet
Fund the wallet by sending bitcoin on-chain to one of its deposit addresses.
POST /api/v2/{coin}/wallet/{walletId}/address— create an on-chain deposit address for the walletGET /api/v2/wallet/{walletId}/lightning/transaction— list the wallet's on-chain transactions
3. Receive: Create an Invoice
POST /api/v2/wallet/{walletId}/lightning/invoice- Set the amount with either
valueMsat(millisatoshis) orvalueSat(satoshis) memoandexpirywork the same as for Go Lightning
Track invoices with the same get and list endpoints used for Go Lightning, passing the Lightning wallet ID.
4. Pay an Invoice
POST /api/v2/{coin}/wallet/{walletId}/lightning/paymentwith{coin}set tolnbtc(prod) ortlnbtc(sandbox)invoice— the Lightning invoice to pay (required)passphrase— the wallet passphrase (required)amountMsat— the amount in millisatoshis. Only needed for invoices that don't specify an amountfeeLimitMsatorfeeLimitRatio— optional cap on the routing fee, as an absolute amount in millisatoshis or as a ratio of the payment amountsequenceId— optional identifier of your own, to track the payment and retry safelycomment— optional internal note
Example payload:
{
"invoice": "lnbc10u1p...",
"passphrase": "<passphrase>",
"feeLimitMsat": "5000",
"sequenceId": "<your-unique-id>"
}
Example response (abridged):
{
"txRequestId": "<txRequestId>",
"txRequestState": "delivered",
"paymentStatus": {
"status": "in_flight",
"paymentHash": "<paymentHash>",
"amountMsat": "1000000",
"feeMsat": "0"
},
"transfer": {
"id": "<transferId>",
"coin": "lnbtc",
"wallet": "<walletId>",
"type": "send",
"state": "signed"
}
}
Accounts with withdrawal fees can't use this endpoint: the request is refused with Withdrawals for this account must use sendcoins. Contact [email protected] if you need custody Lightning payments on such an account.
5. Track Payments
GET /api/v2/wallet/{walletId}/lightning/payment— all payments, filterable bystatus,paymentHash,startDateandendDateGET /api/v2/wallet/{walletId}/lightning/payment/{paymentId}— one payment
A payment is in_flight while it routes through the network, then becomes settled or failed. A failed payment carries a failureReason, such as NO_ROUTE, TIMEOUT, INSUFFICIENT_BALANCE or INVOICE_EXPIRED.
Check the Balance
GET /api/v2/{coin}/wallet/{walletId}with{coin}set tolnbtcortlnbtc
A Lightning custody wallet holds bitcoin in two places, reported in different units:
| Field | Unit | Meaning |
|---|---|---|
balanceString | satoshis | On-chain bitcoin in the wallet |
spendableBalanceString | satoshis | On-chain bitcoin available right now |
offchain.outboundBalance | millisatoshis | Lightning funds you own across all channels |
offchain.outboundSpendableBalance | millisatoshis | Lightning funds you can pay out now |
offchain.outboundReservedBalance | millisatoshis | Lightning funds held back by channel reserve requirements |
offchain.inboundBalance | millisatoshis | How much you can receive. This is capacity, not funds you own |
The total you own is balanceString plus offchain.outboundBalance divided by 1,000. Use offchain.outboundSpendableBalance to decide whether a payment can go through, and offchain.inboundBalance to decide whether you can receive an invoice's amount.
Withdrawing from a Lightning custody wallet to an on-chain address is not available through the API. Contact [email protected] if you need it.
Next Steps
- Withdrawals —
sendcoinsand balance checks for Go Accounts - Fees — How withdrawal fees are calculated
- Funding — Deposit funds into a Go Account