Introducing the Lightning Service Provider
Reading note: This article is intended for technically-minded readers and covers RGB protocol design, Kubernetes container orchestration, and Lightning Network channel management. It is structured in two layers: the product layer (what LSP is, what problem it solves, and how it works in our products) comes first, followed by the technical layer (infrastructure requirements, Kubernetes deployment architecture, and validation results).
We want to share with the community and ecosystem partners the progress we've made over the past month on LSP (Lightning Service Provider) infrastructure. We completed the core research and infrastructure development for the LSP architecture — not only deploying the rgbldkd node developed by Bitlight Labs on Kubernetes, but also completing fully automated lifecycle management end-to-end. The Kubernetes infrastructure is now ready to support an open testnet.
What is a Lightning Service Provider?
LSP (Lightning Service Provider) is the liquidity provider role in the RGB protocol's Lightning Network ecosystem.
Understanding LSP requires first understanding RGB's core design: the RGB protocol uses a client-side validation model, where asset states are not globally broadcast on-chain but are instead maintained and verified locally by the holder. This means RGB assets are fundamentally unsuitable for deposit into any centralized contract pool — because there is no globally trusted contract that could custody bilateral reserves.
LSP is the natural answer that emerges under this constraint: liquidity is not hosted by a platform, but provided by independent node operators through their own Lightning channels.
Traditional LP model:
User deposits Token + BTC → Platform contract pool → Platform controls funds
LSP model:
LSP runs its own node → Opens RGB Lightning channels → Funds stay in LSP's channels
Platform only matches traders with LSPs, never touches fundsAnyone can become an LSP by running a rgbldkd node and registering with the platform. Each LSP holds its own assets and settles peer-to-peer atomically with traders through RGB Lightning channels. No assets are ever in platform custody.
The complete path of a trade
Take Alice buying an RGB token on RGB Dex as an example, showing the role LSP plays:
① Alice places an order
Alice's rgbldkd node → Submits buy order to the platform
② Platform matching
Matching engine → Finds an LSP holding the token (Bob's node)
→ Verifies Bob's channel balance is sufficient and rates are optimal
③ Atomic swap execution (off-chain, near real-time)
Alice's node <── HTLC ──> Bob (LSP) node
Alice pays BTC sats Bob delivers RGB tokens
Both transfers are atomically bound: either both succeed or both roll back
④ Settlement complete
Alice's local state file updated (holds the token)
Bob's local state file updated (received BTC)
Only channel commitments remain on-chain; no asset details are exposedThroughout this process, the platform neither custodies Alice's BTC nor Bob's RGB tokens. Bob's assets remain in his own rgbldkd node channels at all times; the platform's role is limited to matching and routing.
Why is LSP needed?
The client-side validation philosophy of the RGB protocol
RGB does not publish all state on-chain for full nodes to verify, unlike Ethereum. Every transfer and every channel state is validated only locally between the parties involved — only unforgeable cryptographic commitments are left on-chain.
This provides strong privacy and scalability, at the cost of: no third party can "custody" your asset state on your behalf. Your assets exist only on your node.
The direct implication of this design philosophy is: a "centralized liquidity pool" cannot exist in the RGB ecosystem. To provide liquidity for RGB assets, you must build a decentralized service provider network composed of many independent nodes.
What does deploying rgbldkd on Kubernetes mean for RGB Dex and Flash Dex?
The readiness of the Kubernetes infrastructure is a prerequisite for transforming RGB Dex and Flash Dex from concept to reality. Both products depend on the LSP network, and the LSP network requires large-scale, reliable rgbldkd cloud node capability.
RGB Dex
RGB Dex is a full lifecycle trading platform for RGB tokens, covering the complete lifecycle from token issuance to secondary market trading.
The barrier to becoming an LSP on RGB Dex is extremely low: a dedicated user node is already registered in Stash Wallet (essentially a container instance on Kubernetes). After the user logs in with the wallet, RGB Dex calls that node and does not provision another one. No self-operated infrastructure is required — users simply register as an LSP through the UI, and their node is automatically converted to an LSP node.

Thanks to Kubernetes' large-scale containerization capabilities (a single cluster can run over 150,000 independent rgbldkd nodes; multi-cluster architectures can theoretically support over a million online nodes simultaneously) and our operations team's years of cost-control experience, we can provide every registered user with a dedicated rgbldkd node free of charge. Users only pay the transaction fees and channel management fees defined by the LSP — rates are entirely determined by free competition among LSPs, with no platform interference. The platform automatically matches users with the LSP offering the best rates.
Flash Dex
Flash Dex is a more advanced product: its goal is to build spot and perpetual contract trading on RGB + Lightning Network, aiming for a Hyperliquid-like experience, with LSP-driven free quoting and support for limit orders and perpetual contracts.
In Flash Dex, LSPs are required to operate as professional market makers:
- Pricing: Order book driven. LSPs actively post Bid and Ask orders, earning profit through spread; market prices emerge from genuine supply-and-demand competition
- Settlement: After contract matching, peer-to-peer instant settlement via RGB Lightning channels — no on-chain confirmation needed, ultimately anchored to Bitcoin L1
- Privacy: RGB client-side validation ensures order contents, positions, and fund sizes are visible only to the parties involved, eliminating MEV at the structural level
Core design differences between the two products
| Dimension | RGB Dex | Flash Dex |
|---|---|---|
| Product category | Fair Mint / auction issuance + AMM Swap | Limit orders + perpetual contracts |
| Pricing mechanism | AMM automated market making | Order book, buyer-seller competition |
| LSP role | Provides liquidity | Professional market maker, actively maintains bid-ask spread |
| LSP influences pricing | No — AMM formula and liquidity determine price | Yes — LSP quotes are the market price |
| LSP skill requirement | Low — one-click registration, platform-provided cloud node | High — requires market-making strategy and risk management |
| Target users | Long-tail RGB token market, general liquidity providers | Professional market makers, institutional-level liquidity |
Both products share the same rgbldkd node infrastructure; the difference lies in the matching logic and pricing mechanisms at the platform layer. This is why the Kubernetes infrastructure being operational is so critical for the entire product line.
Technical Deep Dive: What Infrastructure Does LSP Require?
The LSP model is theoretically elegant, but the engineering implementation faces immense complexity. Every LSP and every trader user needs to run an independent rgbldkd node instance. These nodes cannot be ephemeral containers — if a node's channel state files are lost, it means permanent asset loss.
This imposes four categories of hard infrastructure requirements:
① Elastic node scheduling: Nodes start on-demand when users log in and consume zero resources when idle; LSP nodes remain alive long-term; Hub nodes are uninterruptible 24/7. Different lifecycle policies must be managed uniformly within a single system.
② Permanent data persistence: Each node's storage must be independently mounted and independently retained, never lost when a node is rebuilt. Real-time backups and daily snapshots serve as dual safeguards.
③ Security isolation: Hub nodes, LSP nodes, and regular user nodes must be strictly isolated in terms of network and permissions — invisible to one another, preventing any node from unauthorized access to another's data.
④ Observability and self-healing: Node crashes must be detected in real-time and automatically recovered; health checks must cover both the node itself and channel state; anomaly alerts must trigger before asset-at-risk events occur.
These four requirements all point to one answer: Kubernetes.
Cloud-Native Deployment of Kubernetes and rgbldkd
What is Kubernetes?
Kubernetes is the industry-standard container orchestration system, originally open-sourced by Google and now the de facto standard for cloud infrastructure. The core problem it solves is: how to uniformly manage the lifecycle, resource scheduling, networking, and storage of tens of thousands of containerized service instances across hundreds of servers.
Its value manifests in two key areas:
- StatefulSet: Natively supports the pattern of "each instance has its own dedicated persistent disk," perfectly matching
rgbldkdnodes' requirement for storage exclusivity - Elastic scaling (Scale to Zero): Supports adjusting StatefulSet replicas to 0 (hibernate) or 1 (activate); disk data is retained during hibernation and immediately restored upon wake-up
rgbldkd Deployment Architecture on Kubernetes
rgbldkd is the RGB Lightning Network node daemon developed by Bitlight Labs and is the core execution layer of the entire LSP system.
We designed a three-namespace model for it on Kubernetes:
rgbldk-hub ← Platform Hub node (always-on, 24/7)
└─ Hub StatefulSet + persistent volume
rgbldk-nodes ← User nodes + LSP nodes (dynamically created/hibernated)
└─ One StatefulSet per user + dedicated persistent volume
└─ One StatefulSet per LSP + dedicated persistent volume
service ← Trade matching serviceThe storage strategy is also designed around "data must not be lost": each node mounts a dedicated Enterprise SSD (Retain policy — disk is retained after node deletion); a backup sidecar container uses inotify to monitor key file changes in real-time and syncs them to IPFS and Arweave via Stash Cloud (our in-house data backup and storage product); daily VolumeSnapshot snapshots are automatically created, ensuring data is permanently preserved.
Kubernetes Validation Completed by Stash Labs
Over the past month, we completed the following validations on Kubernetes, formally migrating from a Docker Compose single-machine environment to a production-grade multi-cluster architecture.
Three-namespace isolation and boundaries: The rgbldk-hub (Hub always-on), rgbldk-nodes (dynamic user/LSP nodes), and service namespaces have been deployed, with permissions precisely scoped.
Full node lifecycle pipeline: Hub node StatefulSet runs stably and permanently; full pipeline validation passed for user node and LSP node creation, scale 0→1 (wake-up), scale 1→0 (hibernate), PVC retention, and recovery from VolumeSnapshot. Disk data is retained after node deletion; channel state is fully restored.
Enterprise SSD feature validation: Confirmed Enterprise SSD PVC supports online expansion (without pod restarts); VolumeSnapshot creation and data consistency upon restoration from snapshot verified; inotify works correctly in the ECI cloud disk mount environment — the technical prerequisite for the backup sidecar to capture state changes in real-time — implementation confirmed feasible.
Security group network isolation: Via VPC security group rules, verified that user/LSP nodes in rgbldk-nodes cannot directly connect to Hub's control ports; only Pods in the backend service namespace can access it. Data plane and control plane network separation confirmed.
Node Manager: The bridge layer between the platform backend and the Kubernetes API Server, natively using Watch/Informer mechanisms to uniformly handle all node lifecycle operations, real-time event monitoring, and health checks.
Multi-node concurrent isolation: Simulated multiple user nodes and LSP nodes running concurrently, each independently mounting Enterprise SSD disks. Confirmed no shared storage, no unauthorized access; new nodes are correctly rejected when ResourceQuota is exceeded.
These validations advanced architectural feasibility from paper to an actually runnable, production-grade platform foundation.
Known Risks and Mitigation Strategies
Any early-stage infrastructure has unresolved risks. We choose to list them explicitly rather than avoid them.
rgbldkd maturity dependency: The core execution layer of the entire LSP system relies on rgbldkd, which is under active development by Bitlight Labs. The node is still in active development; interfaces and behaviors may change across versions. Mitigation: We have version adaptation isolation in the Node Manager layer and maintain ongoing communication with the Bitlight Labs team. We will continuously track node versions during the testnet phase. We again extend our sincere gratitude to Bitlight Labs for their long-term technical support and patient communication with Stash Labs.
Counterparty offline risk: If a counterparty (LSP or user node) goes offline during a swap, the HTLC will time out and roll back — funds are safe but the trade fails. Mitigation: The matching engine prioritizes LSPs with stable uptime, and the official team will run LSP nodes during the testnet phase as fallback liquidity.
Eventual consistency in data backups: The inotify + Stash Cloud backup pipeline has a brief delay window. If a node crashes after a write completes but before backup sync, the latest state may be lost. Mitigation: The PVC itself (Enterprise SSD) is the first line of defense, daily VolumeSnapshot is the second, and Stash Cloud off-site backup is the third. Three layers of redundancy cover the vast majority of failure scenarios.
Testnet ≠ Mainnet: All current validations were completed in a testnet environment. Large-scale stress testing and security audits are required before mainnet launch.
What's Next
No more demos and videos
The infrastructure is ready. The remaining work is feature polish and end-to-end system integration testing:
- Complete pipeline for LSP registration, automatic node provisioning, and channel opening
- LSP matching engine: selecting the optimal LSP by fee rate, score, and available balance
- Atomic swap orchestration and channel lifecycle management
- Native LSP trading UI
- Complete alerting, failover, and data recovery drills
- Continuous upgrades and alignment with new versions of
rgbldkddeveloped by Bitlight Labs
When the testnet opens, it won't be a controlled demo with pre-configured nodes — it will be something anyone can truly do: issue an RGB token, register as an LSP, and complete a trade on Bitcoin testnet through a Lightning channel.