Core Components
RGB Protocol
Client-validated smart contracts on Bitcoin enabling scalable and private asset issuance
Lightning Network
Second-layer payment protocol providing instant, low-cost transactions
LSP Integration
Lightning Service Providers offering liquidity and channel management services
Desktop Client
Secure, user-friendly interface with full key control
System Architecture

RGB Protocol
What is RGB?
RGB is a scalable and confidential smart contract system for Bitcoin. It uses client-side validation and single-use seals to enable complex smart contract functionality while maintaining Bitcoin’s security guarantees. Key Features:- Client-Side Validation: Contract state is validated by the recipient, not globally
- Scalability: No blockchain bloat - contracts are off-chain
- Privacy: Transaction details are only known to involved parties
- Bitcoin Security: Anchored to Bitcoin blockchain for security
RGB Asset Types
- RGB20 - Fungible Assets
- RGB21 - NFTs
- RGB25 - Unique Digital Assets
RGB20 tokens are fungible assets similar to ERC-20 on Ethereum.Use Cases:
- Stablecoins (USDT, USDC)
- Tokenized commodities
- Loyalty points
- Currency tokens
- Divisible
- Interchangeable
- Fixed or variable supply
Lightning Network Integration
Why Lightning?
The Lightning Network provides the scalability layer for instant, low-cost RGB asset transfers. Benefits:- ⚡ Instant Settlement: Transactions complete in milliseconds
- 💰 Low Fees: Fraction of on-chain costs
- 🔒 Security: Backed by Bitcoin’s security model
- 📈 Scalability: Millions of transactions per second
How It Works
- Payment Channels: Users open bidirectional payment channels
- Off-Chain Transactions: Multiple transfers happen off-chain
- Channel State: Only final state is settled on Bitcoin blockchain
- Routing: Payments route through network of channels
RGB on Lightning
KaleidoSwap extends the Lightning Network to support RGB assets alongside native BTC:- Transfer USDT instantly through Lightning channels
- Trade assets atomically via HTLC-based atomic swaps
- Multi-asset channels supporting BTC + RGB20 tokens simultaneously
Lightning Service Providers (LSPs)
What are LSPs?
LSPs provide essential services to Lightning Network users:Channel Liquidity
Channel Liquidity
LSPs open channels with users, providing inbound liquidity for receiving payments
Channel Management
Channel Management
Automatic channel rebalancing, backup services, and monitoring
Routing Services
Routing Services
Optimal payment routing through the Lightning Network
RGB Asset Support
RGB Asset Support
Specialized support for RGB asset transfers and atomic swaps
RGB LSPS1 Specification
KaleidoSwap implements the RGB Lightning Service Provider Specification (RGB-LSPS1):- Standardized Interface: Common API for LSP interactions
- Asset Allocation: Specify RGB assets when opening channels
- Swap Support: Built-in atomic swap functionality
- Fee Transparency: Clear fee structure for all operations
Desktop Client Architecture
Non-Custodial Design
Everything runs on your device. The desktop application communicates directly with your RGB Lightning Node, which manages keys locally, controls channels, and validates contracts. No third party ever has access to your funds. Security Principles:- 🔐 Your Keys, Your Coins: Private keys never leave your device
- 🔒 Encrypted Storage: All sensitive data encrypted locally
- 🛡️ No Custody: No third party can access your funds
- ✅ Client Validation: You validate all RGB contracts
Component Layers
- UI Layer: React-based desktop interface
- Business Logic: State management and workflow orchestration
- Node Interface: Communication with RGB Lightning node
- Network Layer: P2P connections and LSP integration
Data Flow
Atomic Swap Process

- Request Quote — Taker requests a price for the asset pair
- Init Swap — Taker initiates the swap, creating an HTLC
- Lock Assets — Both sides lock their assets (BTC and RGB) in HTLCs
- Reveal & Claim — The secret is revealed, allowing both parties to claim
- Complete — Both parties receive their swapped assets atomically
Security Model
Multi-Layer Security
Trustless Trading
- No Counterparty Risk: Atomic swaps execute atomically or fail completely
- No Custodians: Users maintain control of their keys and assets
- No Trust Required: Cryptographic guarantees, not trust in intermediaries
Scalability
Transaction Throughput
| Layer | Throughput | Finality | Cost |
|---|---|---|---|
| Bitcoin On-Chain | ~7 TPS | 10-60 min | High |
| Lightning Network | Millions TPS | Instant | Very Low |
| RGB Contracts | Unlimited | Client-side | Minimal |
Why This Matters
- Mass Adoption: Can scale to billions of users
- Micro-Transactions: Economically viable even for tiny amounts
- Real-Time Trading: No waiting for blockchain confirmations