Close Menu
  • Coins
    • Bitcoin
    • Ethereum
    • Altcoins
    • NFT
  • Blockchain
  • DeFi
  • Metaverse
  • Regulation
  • Other
    • Exchanges
    • ICO
    • GameFi
    • Mining
    • Legal
  • MarketCap
What's Hot

After Gold Futures, GCEX Adds Paxos and Tether Tokenized Gold for On-Chain Trading

11/03/2026

Ethereum price prediction as ETH teeters below $2,000

11/03/2026

SEC gives WisdomTree the green light for instant, around-the-clock trading

11/03/2026
Facebook X (Twitter) Instagram
  • Back to NBTC homepage
  • Privacy Policy
  • Contact
X (Twitter) Telegram Facebook LinkedIn RSS
NBTC News
  • Coins
    1. Bitcoin
    2. Ethereum
    3. Altcoins
    4. NFT
    5. View All

    Price Breaks All-Time High Record Again – Here’s What We Know

    04/08/2025

    Bitcoin Switzerland? El Salvador to Host First Fully Native Bitcoin Capital Markets

    04/08/2025

    Bitcoin Breaks $119K, but XLM and HBAR Aren’t Impressed by Its Meager Percentage Gain

    04/08/2025

    High-Stakes Consolidation Could Define Q3 Trend

    04/08/2025

    Ethereum price prediction as ETH teeters below $2,000

    11/03/2026

    Here’s What to Expect as ETH Tests $2,000 While Channel Support Holds

    11/03/2026

    Will Ethereum price fall under $1,900 as a bearish crossover forms?

    11/03/2026

    Ethereum Price Extends Pullback, $1,920 Support Now Under Threat

    11/03/2026

    The Sui Ecosystem’s Top 3 Altcoin Performers

    29/07/2025

    Floki Launches $69000 Guerrilla Marketing Challenge With FlokiUltras3

    28/07/2025

    Crypto Beast denies role in Altcoin (ALT) crash rug pull, blames snipers

    28/07/2025

    $1.6 Billion XRP Surge: Here’s What’s Unfolding

    28/07/2025

    SpoonOS distributes first NFT rewards to Skill Capture Campaign participants

    11/03/2026

    Top NFT Sales of the Week, Flying Tulip Takes Top Spot

    09/03/2026

    McLaren F1 Debuts Hedera-Powered MCL/COLLECT Digital Collectibles for 2026 Race Weekends

    08/03/2026

    SuperRare Unveils Liquid Editions

    07/03/2026

    After Gold Futures, GCEX Adds Paxos and Tether Tokenized Gold for On-Chain Trading

    11/03/2026

    Ethereum price prediction as ETH teeters below $2,000

    11/03/2026

    SEC gives WisdomTree the green light for instant, around-the-clock trading

    11/03/2026

    Sana Ebrahimi: Iran’s regime prioritizes Islamic doctrine over citizen welfare, the reality of gender apartheid, and the propaganda tactics suppressing dissent

    11/03/2026
  • Blockchain

    R3E Network launches N3Index API, .matrix domain system for Neo N3

    11/03/2026

    Royaltiz Brings Athlete Tokenization to Solana With Eduardo Camavinga Launch

    11/03/2026

    Chainlink Expands Cross-Chain Adoption With 11 New Integrations Across Web3 Ecosystems

    10/03/2026

    Corastone and Zcash’s ZODL show blockchains growing up for real finance

    10/03/2026

    Real-time settlement is the missing infrastructure layer in distributed energy

    10/03/2026
  • DeFi

    Babylon-Ledger tie-up expands access to Bitcoin Vaults for collateral use

    11/03/2026

    Mantle and Aave cross $1b as DeFi TVL jumps 66% in a week, where do they go from here?

    11/03/2026

    Jito Foundation acquires SolanaFloor days after platform shutdown

    11/03/2026

    DeFi lending platform Aave sees a rare $27 million liquidations after a price glitch

    11/03/2026

    Pieverse Taps Bitget Wallet to Advance Agentic DeFi Market

    10/03/2026
  • Metaverse

    Meta expands AI agent push with Moltbook acquisition

    10/03/2026

    ‘The Sandbox’ Adds Web-Based Games in Season 7 Accessibility Push

    24/02/2026

    AMD jumps as Meta signs multiyear AI infrastructure partnership

    24/02/2026

    Corning shares surge over 16% after Meta signs $6B data center deal

    27/01/2026

    Mark Zuckerberg’s Meta signs $6B fiber deal with Corning to expand US data centers

    27/01/2026
  • Regulation

    SEC gives WisdomTree the green light for instant, around-the-clock trading

    11/03/2026

    Kraken rolls out crypto-style, 24/7 perpetuals trading for tokenized U.S. stocks

    11/03/2026

    Dow Jones forms an alarming pattern ahead of Salesforce, NVIDIA earnings

    11/03/2026

    Hut 8 stock price forms cup-and-handle ahead of earnings

    11/03/2026

    Bitcoin retakes $64,000, crypto miners rally, as AI-related software rout eases

    11/03/2026
  • Other
    1. Exchanges
    2. ICO
    3. GameFi
    4. Mining
    5. Legal
    6. View All

    After Gold Futures, GCEX Adds Paxos and Tether Tokenized Gold for On-Chain Trading

    11/03/2026

    Hyperliquid’s next upgrade to let seasoned traders take bigger bets with less capital

    11/03/2026

    Belgian giant KBC taps Taurus to support country’s first regulated Bitcoin, Ether trading

    11/03/2026

    Bitcoin Exchange Bithumb Announces It Will Delist This Altcoin from Its Spot Trading Platform! Here Are the Details

    11/03/2026

    South Korea Poised to Lift Ban on Domestic ICOs After 7 Years

    19/12/2025

    Why 2025’s Token Boom Looks Both Familiar and Dangerous

    31/10/2025

    ICO for bitcoin yield farming chain Corn screams we’re so back

    22/01/2025

    Why 2025 Will See the Comeback of the ICO

    26/12/2024

    Pudgy Penguins launches its ‘Club Penguin’ moment, and the game doesn’t feel like crypto at all

    10/03/2026

    WORLD3 Partners PlaysOut to Bring AI Agents into Web3 Gaming

    10/03/2026

    Pudgy Penguins Launches ‘Pudgy World’ Browser Game

    10/03/2026

    METYA Partners With Kult Games to Expand Web3 Gaming Ecosystem

    05/03/2026

    Canaan stacks Bitcoin, bucking rival miners’ rush to sell

    11/03/2026

    Public Bitcoin Miners are Dumping Bitcoin for AI, a Historic Mistake

    10/03/2026

    Trump-Linked American Bitcoin Adds 11,298 ASICs, Boosts Hashrate

    09/03/2026

    New model proves miners need Bitcoin above $74k to break even on power

    09/03/2026

    Sana Ebrahimi: Iran’s regime prioritizes Islamic doctrine over citizen welfare, the reality of gender apartheid, and the propaganda tactics suppressing dissent

    11/03/2026

    Sarah B. Rogers: Europe’s Online Safety Act threatens US free speech, 12,000 arrests for speech acts in the UK, and the chilling effects of vague regulations

    11/03/2026

    Sana Ebrahimi: Iran prioritizes Islamic doctrine over citizen welfare, the regime’s dependency on Russia and China undermines its revolutionary ideals, and systemic gender apartheid persists

    11/03/2026

    JPMorgan concedes it debanked Trump after Capitol attack

    10/03/2026

    After Gold Futures, GCEX Adds Paxos and Tether Tokenized Gold for On-Chain Trading

    11/03/2026

    Ethereum price prediction as ETH teeters below $2,000

    11/03/2026

    SEC gives WisdomTree the green light for instant, around-the-clock trading

    11/03/2026

    Sana Ebrahimi: Iran’s regime prioritizes Islamic doctrine over citizen welfare, the reality of gender apartheid, and the propaganda tactics suppressing dissent

    11/03/2026
  • MarketCap
NBTC News
Home»Blockchain»Mercury Layer’s Lightning Latch Swap Protocol
Blockchain

Mercury Layer’s Lightning Latch Swap Protocol

NBTCBy NBTC20/03/2024No Comments7 Mins Read
Share
Facebook Twitter LinkedIn Pinterest Email


Commerceblock has released a new atomic swap protocol for use with statechains on their Mercury Layer protocol. The HSM server has introduced functionality to support atomically swapping two statechains, as well as enforcing an atomic exchange of a statechain for a Lightning payment. This is the first example of concretely defined and built interactions between statechains and the Lightning Network. Synergy between both protocols has been postulated since the concept of a statechain was originally proposed by Ruben Somsen, specifically as a way to solve the limitation of having to transfer a whole statechain UTXO at once.

Basic Statechain Swaps

In order to support the new swap protocols, the HSM server needs to add some new fields to its database entries tracking each statechain it is facilitating. To facilitate the statechain to statechain swap, the server needs to track:

  • Batch_id: a value to associate statechains being swapped in a group.
  • Batch-time: a time that starts a counter after which the statechains can be “reclaimed” if the swap fails.
  • Locked: a value indicating whether or not the statechain is locked and restricted from regular transfers.

This allows the HSM server to track and enforce all the variables necessary to ensure a safe atomic swap. When initiating a swap, users have to communicate with each other directly in order to establish a shared batch_id between them. From this point they trade all the necessary information required to facilitate a normal statechain transfer, and send that information plus the batch_id and batch-time to the server. They essentially start the regular transfer process, but also attach the variables to connect the individual statechains as participating in a swap together and how long the timeout period is for that.

The server at this point will apply a lock to every statechain using the same batch_id in the transfer process. Until the timeout expires, or all of the statechains in its database using the same batch_id have been unlocked by the current owners, the server will not approve any transfers. A neat thing about the way the HSM enforces the swap logic is that it doesn’t matter who contacts the server first. When the server gets a message using a batch_id, it checks every statechain in its database and if there is a pre-existing batch-time for that batch_id it sets it as the same. This ensures that no matter who registers the swap first they all use the same time value for the timeout function.

Each client involved in the swap at this point checks for and downloads the messages that initiated the transfer protocol, and upon verifying they’re correct sends a message to the server to unlock their statechain, removing the transfer restrictions. Whenever anyone attempts to finalize a transfer on the receiver side of any of the statechains involved in the swap, the server checks to make sure all of the statechains with the same batch_id are unlocked. If even a single one with the related batch_id is still locked the server will finalize a transfer for none of them. If a swap doesn’t succeed before the timeout, the server will continue restricting the finalization of the swap transfer, but will let the current owners initialize a new transfer to themselves to effectively cancel the swap.

Lightning Latch

The Lightning Latch functionality, swapping a statechain for a Lightning payment, works very similarly to the statechain to statechain swap. Here are the new fields the server must track for the Lightning swap:

  • Batch_id: a value to associate statechains being swapped in a group.
  • Batch-time: a time that starts a counter after which the statechains can be “reclaimed” if the swap fails.
  • Pre-image: the preimage of the Lightning payment, which is generated by the HSM server.
  • Locked_1 and locked_2: there are two lock fields for the Lightning swap, one authorized by each user involved.

Just like with the statechain to statechain swap, the users establish and share a random batch_id. The current statechain owner then messages the server with the batch_id and statechain involved and requests it generates a hashlock preimage for a Lightning payment. This user then generates a Lightning invoice using this preimage, and the second user contacts the server to confirm it generated the preimage. The current statechain owner then begins the statechain transfer process and uploads the transfer message to the server.

After confirmation of that, the second user trying to swap for the statechain initiates the Lightning payment. At this time the server is the only one with the preimage, so the statechain owner cannot finalize the payment yet. The current owner after verifying the pending Lighting payment sends the server an unlock message to remove the first lock on the statechain. The receiver finally verifies the transfer message, and if valid messages the server to remove their lock as well.

Now with both locks removed, the HSM server will release the preimage to the current statechain owner to finalize the Lightning payment, and will finalize the statechain transfer to the receiver.

This scheme does require trusting the statechain operator to function honestly, but that is fundamentally not a change to the pre-existing trust model of using a statechain in general. At no time does the operator have control over users’ funds, nor do they learn anything about the Lightning payment details.

What Is This Good For?

This scheme is a far cry from the originally posited interaction between statechains and Lightning channels, stacking one on top of the other, but even as a simple starting point this presents functional utility for existing Lightning users. Rebalancing channels is a necessary thing for many nodes, if the capacity is entirely pushed to one side or the other the utility of that channel is limited for routing payments. Many businesses and users have started experimenting with using Liquid as a mechanism for this due to on-chain fees rising and making swaps into and out of the Lightning Network more expensive.

Statechains offer an alternative mechanism to a federated sidechain to alleviate some of the fee expenses associated with channel balance management. Instead of having to swap out to the mainchain directly, or use a sidechain, funds can be swapped to a statechain and held there until they are needed for swapping funds back into a channel. Similar savings in fees can be had while still maintaining the ability to unilaterally claim your funds on the mainchain.

Another potential use case (TRIGGER WARNING) would be the possibility of more efficient marketplaces for trading ordinals. Since ordinals are simply an index scheme tracking paths backwards in the transaction history to specific satoshis, they can easily be lifted off-chain onto a statechain. That dynamic in combination with Lightning Latch could allow cheaper and faster off-chain purchases of ordinals. Someone could build a marketplace where they can be sold instantly off-chain over the Lightning Network.

It’s even possible one day if Lightning clients could become aware somehow of which statechain operators specific Lightning nodes trust that Latch could be used to help route payments by passing statechains around between different nodes instead of using conventional Lightning channels.

On the front of pure statechain to statechain transfers, this offers the potential for a message passing layer to recreate coinjoin like system mixing coins off-chain, similar to the original mixing functionality in Commerceblock’s first statechain implementation.

While it is a very simple starting point, Lightning Latch and the statechain swap functionality crack open the first door of statechains integrating into the existing Lightning Network – and other similar layers to come in the future – in a way that lets them all integrate seamlessly and function as a singular network in terms of payment routing and liquidity management. Even while we debate the need for and usefulness of covenants, there is still quite a lot of room to continue building with what we already have.

You can listen to the Commerceblock team explain the logic beyond the protocol here:

Chatting with the Dr @TTrevethan about why to build lightning latch on @mercurylayer #bitcoin #layer2 pic.twitter.com/CKVG9aHTQ6

— Nicholas Gregory (@gregory_nico) March 15, 2024

And for a more technical explanation, here:

Going through the technicals of how lightning latch will work with @TTrevethan on @mercurylayer #bitcoin #layer2 pic.twitter.com/aQIcjh2ukq

— Nicholas Gregory (@gregory_nico) March 16, 2024


Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
NBTC

Related Posts

R3E Network launches N3Index API, .matrix domain system for Neo N3

11/03/2026

Royaltiz Brings Athlete Tokenization to Solana With Eduardo Camavinga Launch

11/03/2026

Chainlink Expands Cross-Chain Adoption With 11 New Integrations Across Web3 Ecosystems

10/03/2026

Corastone and Zcash’s ZODL show blockchains growing up for real finance

10/03/2026
Add A Comment

Comments are closed.

Top Posts
Get Informed

Subscribe to Updates

Get the latest news from NBTC regarding crypto, blockchains and web3 related topics.

Your source for the serious news. This website is crafted specifically to for crazy and hot cryptonews. Visit our main page for more tons of news.

We're social. Connect with us:

Facebook X (Twitter) LinkedIn RSS
Top Insights

After Gold Futures, GCEX Adds Paxos and Tether Tokenized Gold for On-Chain Trading

11/03/2026

Ethereum price prediction as ETH teeters below $2,000

11/03/2026

SEC gives WisdomTree the green light for instant, around-the-clock trading

11/03/2026
Get Informed

Subscribe to Updates

Get the latest news from NBTC regarding crypto, blockchains and web3 related topics.

Type above and press Enter to search. Press Esc to cancel.