Source repository: https://github.com/UTEXO-Protocol/rgb-lightning-nodeFull OpenAPI / Swagger reference: https://utexo-protocol.github.io/rgb-lightning-node
One node, two execution paths
The
--network option selects the Bitcoin network for the entire node. It does not change Utexo’s support policy: use a mainnet deployment for on-chain RGB operations only. On testnet, you can exercise both the on-chain and Lightning paths through the same integration.
Prerequisites
Before starting, make sure you have the following available:Chain-backend credentials are supplied in the
/unlock request, not on the command line. See Unlocking the node.Installation
Build from Source
Clone the repository with its submodules:rgb-lightning-node binary:
Docker Image
Build the Docker image locally:Running the Node
Each RLN daemon is started withrgb-lightning-node and requires the following arguments:
Unlocking the node
AfterPOST /init, every start requires POST /unlock. The body selects how LDK syncs with the chain through ldk_chain_sync, and sets the RGB wallet’s indexer and transport:
Chain sync modes
indexer_url (the RGB wallet’s indexer) is independent of the sync mode, so any indexer can be paired with either mode. indexer_url and proxy_endpoint can be omitted from the body when they are set in the [chain] section of the config file; if no indexer URL is set anywhere, unlock fails with MissingIndexerUrl.
Regtest (Local Development)
Start the required Docker services (bitcoind, electrs, proxy):BlockSync config, indexer_url, proxy_endpoint):
Regtest Helper Commands
Regtest with Docker
To run a node inside Docker while using the shared regtest network:RLNdata1 volume. To start fresh:
Testnet3
No local Docker services needed — the node uses public infrastructure:BlockSync config and indexer_url; proxy_endpoint only when using proxy transport):
Testnet4
Same as testnet3, with the following differences:On-chain RGB operations
The on-chain path uses the same RLN process and authentication model as the Lightning path. Use the following REST endpoints instead of integrating a separate on-chain service:
RLN does not use xPub request headers or a client-side
*begin/*end PSBT flow. Authenticate to RLN with Biscuit tokens as described below. If your custody model requires keys outside the node, run RLN in external-signer mode; see Remote Signer.
For complete request and response schemas, see the RGB Lightning Node API.
Authentication
RLN uses Biscuit tokens for API authentication. For production deployments never use--disable-authentication.
One-Time Setup
Install the Biscuit CLI and generate a root keypair:Minting Tokens
Three built-in roles are available: Admin (full access):date -u -d '+30 days' +%Y-%m-%dT%H:%M:%SZ with GNU coreutils, or date -u -v+30d +%Y-%m-%dT%H:%M:%SZ on macOS.
Using Tokens
Pass the token in theAuthorization header:
Revoking Tokens
To revoke a token before its expiry:Using the REST API
Once a daemon is running, interact with it via its REST API. Example — issue an RGB asset:Key Endpoints
The complete list of endpoints with request/response schemas is available in the interactive Swagger UI at https://utexo-protocol.github.io/rgb-lightning-node.
Running a Local Swagger UI
You can also expose the OpenAPI spec locally:http://localhost:8246 in your browser. If a daemon is running on one of the example ports you can call the APIs directly from the UI.
Running Tests
Integration tests use the same regtest services asregtest.sh (they cannot run simultaneously):
Production Checklist
1
Secure your private key
Store the Biscuit issuer private key in a dedicated secret manager. Never commit it to version control.
2
Enable authentication
Remove
--disable-authentication and pass --root-public-key when starting the daemon.3
Restrict network access
Expose only the daemon REST port (default
3001) to trusted clients. Firewall the LN peer port (9735) as appropriate.4
Persist data
Mount the node data directory on durable storage (e.g. a named Docker volume or a cloud disk) to survive container restarts.
5
Monitor the daemon
Poll
GET /nodeinfo and GET /networkinfo periodically to verify the node is reachable and in sync.6
Backup regularly
Call
POST /backup on a schedule and store the encrypted backup off-node.7
Rotate tokens
Issue short-lived tokens with expiry dates and rotate them regularly. Revoke compromised tokens immediately via
POST /revoketoken.