Skip to main content

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 LightningLightning custody wallet
Where the funds liveYour existing Go Account. Lightning and on-chain bitcoin share one balanceA separate Lightning wallet with its own balance
{coin} (prod / sandbox)ofcbtc / ofctbtclnbtc / tlnbtc
SetupNone, once Lightning is enabledCreate the wallet (can take up to 24 hours)
Get paidCreate an invoiceCreate an invoice
Paysendcoins with the invoice as addresslightning/payment
Amount unitSatoshis onlyMillisatoshis 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.

Lightning must be enabled for your enterprise

Neither option works until Lightning is enabled on the enterprise. Contact [email protected] to enable Go Lightning, Lightning custody wallets, or both.

$500 limit per payment

Each Lightning payment, sent or received, is limited to $500 USD or less.

Units​

UnitValue
1 BTC100,000,000 satoshis (sats)
1 satoshi1,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/invoice
  • valueSat — the amount to request, in satoshis. Go Lightning does not accept valueMsat
  • memo — optional text shown to the payer
  • expiry — optional lifetime of the invoice, in seconds
  • Returns the encoded invoice string to share with the payer and a paymentHash to 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​

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}/sendcoins with {coin} set to ofcbtc (prod) or ofctbtc (sandbox)
  • address — the Lightning invoice string
  • amount — the amount in satoshis
  • walletPassphrase — the Go Account passphrase
  • Returns a transfer you 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.

Accounts with withdrawal fees

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/generate with {coin} set to lnbtc (prod) or tlnbtc (sandbox)
  • label — a name for the wallet
  • passphrase — the wallet passphrase. You need it for every payment, so store it securely
  • passcodeEncryptionCode — a code used to encrypt the passphrase for recovery
  • enterprise — the enterprise that owns the wallet
  • type: "hot" and subType: "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.

A new wallet can take up to 24 hours to be ready

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.

3. Receive: Create an Invoice​

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/payment with {coin} set to lnbtc (prod) or tlnbtc (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 amount
  • feeLimitMsat or feeLimitRatio — optional cap on the routing fee, as an absolute amount in millisatoshis or as a ratio of the payment amount
  • sequenceId — optional identifier of your own, to track the payment and retry safely
  • comment — 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

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​

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​

A Lightning custody wallet holds bitcoin in two places, reported in different units:

FieldUnitMeaning
balanceStringsatoshisOn-chain bitcoin in the wallet
spendableBalanceStringsatoshisOn-chain bitcoin available right now
offchain.outboundBalancemillisatoshisLightning funds you own across all channels
offchain.outboundSpendableBalancemillisatoshisLightning funds you can pay out now
offchain.outboundReservedBalancemillisatoshisLightning funds held back by channel reserve requirements
offchain.inboundBalancemillisatoshisHow 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.

Moving funds back on-chain

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 — sendcoins and balance checks for Go Accounts
  • Fees — How withdrawal fees are calculated
  • Funding — Deposit funds into a Go Account