RGB talks

Conference talks and technical presentations on RGB Protocol on Bitcoin from Bitcoin and Lightning conferences.


KaleidoSwap: Building a Non-Custodial DEX for RGB Assets on Lightning


KaleidoSwap is a non-custodial decentralized exchange (DEX) for RGB Protocol assets, built on the Bitcoin Lightning Network. It allows users to swap RGB assets on an all-or-nothing basis (either the swap completes in full or nothing happens) without using sidechains, trusted intermediaries, or custodial bridges.


Decentralized exchanges on Bitcoin have always faced a fundamental constraint: Bitcoin’s base layer is not designed for on-chain order matching; that is, for executing buy and sell order logic directly on the blockchain. On Ethereum, DEXs like Uniswap run their pricing logic inside smart contracts, so every swap is written on-chain. Bitcoin does not support this model.


RGB Protocol on Bitcoin changes the equation by moving asset transfers off-chain to the Lightning Network. From this foundation, Kaleidoswap is building the first non-custodial DEX on top of it.

What Is KaleidoSwap?


KaleidoSwap is an open-source desktop application that provides a graphical interface for an RGB node. Users connect to a local node or a remote one to issue RGB assets, open Lightning channels for those assets, and execute atomic swaps peer-to-peer.


The core design principle is non-custodial: KaleidoSwap never holds user funds. No trusted third party controls your assets at any point in the swap lifecycle.



How Do RGB Lightning Swaps Work?


RGB Lightning swaps work through an atomic HTLC mechanism across two Lightning channels: one carrying the RGB asset being sold, one carrying the asset being received. KaleidoSwap implements this with a two-role model:


Maker: initiates the swap conditions:, meaning which asset to sell, which to receive, and how long the conditions remain valid. The maker also decides whether to execute the swap after the taker has listed it.


Taker: receives the swap string, activates the swap listing on their node, and signals readiness to the maker.


The swap string encodes all conditions of the trade. When the taker’s node receives an HTLC passing the specified RGB asset through one channel and delivering bitcoin (or another asset) through another, it lets it pass, completing the atomic exchange.


The mechanism relies on HTLCs, so swaps are atomic by construction: either both legs settle or neither does. There is no way for a maker to receive funds without delivering the other asset.


What Is the RFQ Model in KaleidoSwap?


KaleidoSwap uses a Request for Quotation (RFQ) model to make swaps accessible without manual swap string negotiation. A market maker, which also acts as an RGB Lightning Service Provider (LSP), streams real-time prices and executes trades on behalf of users.


The flow looks like the following:

  1. A user requests a new RGB Lightning channel from the LSP (for example, a channel funded with a demo USDT or demo gold asset).
  2. The market maker streams asset prices in real time via WebSocket. In general, quotes update every few seconds, each with a validity window.



When the user selects a quote and confirms, the app sends an RFQ to the market maker, receives a swap string, and automatically instructs the node to execute.


The market maker decides which assets and trading pairs it supports, as well as minimum and maximum trade sizes. The current maximum per trade is constrained to approximately 10% of the channel capacity: a Lightning-level limit that may be relaxed in future protocol updates.


What Is the Free-Option Problem in Atomic Swaps?


The free-option problem occurs when the maker can choose not to execute a swap after the taker has already committed. If market conditions shift in that window, the maker holds an asymmetric advantage, which is effectively a free option at the taker’s expense.

This problem is not unique to RGB, since it is a fundamental challenge for any decentralized swap design. Walter acknowledges it is not fully solvable, but only mitigable.


KaleidoSwap’s current approach is mitigation through reputation. With the RFQ model, the market maker’s behavior is observable over time: users who experience failed executions can rate the maker badly, and future counterparties can factor this into their trust decisions.


How Will KaleidoSwap Achieve Decentralized Price Discovery?


KaleidoSwap is building a peer-to-peer order book using Nostr as the transport layer. It’s similar in spirit to protocols like Bisq, but adapted for RGB asset trading. This system is designed to enable price discovery for new RGB assets with no established market.


The reasoning behind Nostr:


Nostr is a low-latency protocol, compatible with the fast-moving price feeds a trading platform requires. It’s is also an identity layer: makers build a public track record, and users can review them, helping mitigate the free-option problem in a decentralized setting.


Relays can implement anti-spam measures (such as small fees per order) to filter out fake or manipulative listings and improve order book quality. Multiple order books can coexist across different relays; users can choose relays with better liquidity and more reliable makers.


The plan is to start with a centralized API to prototype the order book mechanics, then progressively decentralize via Nostr relays.


What Is the Current Status of KaleidoSwap?


At the time of this community call (April 2025), KaleidoSwap was in alpha on testnet (regtest). On September 30, 2025, the team executed the first RGB asset swap on Lightning mainnet — a trustless exchange of tUSDT (an RGB asset bridged from USD₮ via UTEXO) for sats, settled instantly with no mempool trace. Both nodes ran on a Raspberry Pi 4. A public launch followed shortly after.


To try KaleidoSwap today, you need:


A running RGB node (local or remote): documentation for self-hosting is available.
Sufficient Lightning liquidity, including an RGB-enabled channel for the asset pair you want to trade.


The application is fully open source. You can explore the code, open issues, and contribute features.


Why Does KaleidoSwap Matter for Bitcoin?


KaleidoSwap demonstrates that non-custodial asset trading on Bitcoin is technically achievable today. By combining client-side validation with Lightning’s HTLC mechanism, it is possible to build a DEX that:

  • Requires no sidechain or trusted bridge.
  • Settles atomically with Bitcoin-level security guarantees.
  • Keeps all asset data private and off-chain, thanks to RGB’s use of single-use seals.


As the RGB ecosystem matures and more assets are issued on mainnet, infrastructure like KaleidoSwap will be essential for enabling real liquidity between them.


Kaleidoswap is supported by the RGB Protocol Association. Learn more at rgbprotocol.org and learn about RGB Protocon at docs.rgb.info.

Similar Posts

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *