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
RGB Protocol Overview
RGB enables scalable and confidential smart contracts on Bitcoin using client-side validation. For a detailed explanation of how RGB works, see How RGB Works. Key Architectural 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. See Concepts: Lightning Network for more details. Integration 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)
LSP Integration
Lightning Service Providers (LSPs) are critical for onboarding users to the Lightning Network without requiring them to manage complex channel operations manually. LSP Functions in Architecture:- Liquidity Provision: Opening channels with users to provide inbound capacity
- Routing: Finding optimal paths for payments
- Swap Facilitation: Enabling atomic swaps between assets
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
Next Steps
Key Features
Explore core features and capabilities
Desktop App
Atomic swaps with full node control
Web App
Order-based trading from your browser
Rate Extension
Bitcoin Layer 2 wallet extension
SDK
Build with our TypeScript or Python SDKs
API Reference
REST API and swap protocol details