Close Menu
  • News
    • Bitcoin
    • Altcoins
    • DeFi
    • Market Cap
  • Blockchain
  • Web 3
    • NFT
    • Metaverse
  • Regulation
  • Analysis
  • Learn
  • Blog
  • Contact
    • Tech7685@gmail.com
What's Hot

Bitcoin can go to the impending correction mode for ‘weeks and weeks’, according to analyst Willy Woo – here is why

2025-06-01

Bitcoin is still bullish, only $ 200,000 of the table and $ 137,000 in sight

2025-06-01

VeChain wants to transform the supply chain from Amazon with confidential evidence

2025-06-01
Facebook X (Twitter) Instagram
  • Contact
  • Terms & Conditions
  • Privacy Policy
  • DMCA
  • Advertise
  • Free.cc (Free Crypto)
Facebook X (Twitter) Instagram
Bitcoin Platform – Bitcoin | Altcoins | Blockchain | News Stories Updated Daily
  • News
    • Bitcoin
    • Altcoins
    • DeFi
    • Market Cap
  • Blockchain

    VeChain wants to transform the supply chain from Amazon with confidential evidence

    2025-06-01

    Binance and Pakistan IT ministerie Rollen Blockchain Education Program out for 80,000 students

    2025-06-01

    Omnia -Protocol works together with Flare Networks to unlock more private and interoperable Web3 Future

    2025-06-01

    Hodooi and Ice Open Network are a powerful alliance for Web3 Social Expansion

    2025-05-31

    Transition to an internet supported by people

    2025-05-31
  • Web 3
    • NFT
    • Metaverse
  • Regulation

    Humans leads $ 3,490,000 from the US government, various companies in bank fraud: Doj

    2025-06-01

    American authorities charge six people in connection with alleged $ 66,000,000 Food Stamp -Fraud schedule

    2025-05-31

    American authorities punish the Philippines-based company for alleged computer infrastructure for crypto pig breaking stop

    2025-05-30

    FBI is looking for victims who are connected to FunNull Pig Butching Crypto Investment SCAM

    2025-05-30

    JPMorgan Chase received a fine of $ 566,082 due to alleged not responding to regulator during the energy crisis

    2025-05-30
  • Analysis

    Bitcoin can go to the impending correction mode for ‘weeks and weeks’, according to analyst Willy Woo – here is why

    2025-06-01

    Cronos Tart Crypto Market Downtick on Friday as asset manager Canary Capital Files for CRO ETF

    2025-05-31

    XRP multi-time frame breakdown: here comes what is there

    2025-05-31

    XRP -Price risks crash under $ 2 if the correction holds, here is why

    2025-05-31

    XRP price objectives recovery – signs of strength arise

    2025-05-31
  • Learn

    What Is Asset Tokenization? How It Works and Why It’s Important

    2025-05-30

    What Is DeFi 2.0 and Why It Matters

    2025-05-27

    Crypto Margin Trading: How It Works and How to Manage the Risks

    2025-05-26

    Wat is circulerende levering in cryptocurrency?

    2025-05-23

    What Is a DEX (Decentralized Exchange)?

    2025-05-21
  • Blog
  • Contact
    • Tech7685@gmail.com
Bitcoin Platform – Bitcoin | Altcoins | Blockchain | News Stories Updated Daily
Home»Blockchain»Mercury Layer’s Lightning Latch Swap Protocol
Blockchain

Mercury Layer’s Lightning Latch Swap Protocol

2024-03-19No 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 atomic swapping of two statechains, as well as forcing an atomic swap 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 state chain was originally proposed by Ruben Somsen, specifically as a way to overcome the limitation of transferring an entire state chain of UTXO at once.

Basic state chain swaps

To support the new swap protocols, the HSM server must add some new fields to the database entries that track each statechain it facilitates. To facilitate statechain-to-statechain exchanges, the server must maintain:

  • Batch_id: A value to associate statechains that are 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 state chain is locked and limited to regular transfers.

This allows the HSM server to track and enforce all the variables necessary to ensure a secure atomic swap. When initiating a swap, users must communicate directly with each other to establish a shared batch_id between them. From this point on, they trade all the necessary information needed to enable 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 link the variables to connect the individual state chains as participants in an exchange and how long the timeout period is for that.

The server will apply a lock to each statechain with the same batch_id in the transfer process at this point. Until the timeout expires, or until all statechains in the database using the same batch_id are unlocked by their current owners, the server will not approve any transfers. The nice thing about the way the HSM enforces the swap logic is that it doesn’t matter who contacts the server first. When the server receives a message using a batch_id, it checks each 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.

See also  Tron adds Google Cloud as a super representative candidate

Each client involved in the swap at this point checks and downloads the messages that initiated the transfer protocol, and after verifying that they are correct, sends a message to the server to unlock their statechain, thus removing the transfer restrictions cancelled. Whenever someone tries to complete a transfer on the receiver side of one of the statechains involved in the swap, the server checks to see if all statechains with the same batch_id have been unlocked. If even one with the associated batch_id is still locked, the server will not complete a transfer for any of them. If a swap fails before the timeout, the server continues to limit the completion of the swap transfer, but allows the current owners to initialize a new transfer to itself to effectively cancel the swap.

Lightning bolt

The Lightning Latch functionality, which involves swapping a statechain for a Lightning payment, works much the same as the statechain-to-statechain swap. Here are the new fields the server must maintain for the Lightning swap:

  • Batch_id: A value to associate statechains that are 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 pre-image of the Lightning payment, which is generated by the HSM server.
  • Locked_1 and lock_2: There are two lock fields for the Lightning swap, one authorized by each involved user.

Similar to statechain-to-statechain exchanges, users set and share a random batch_id. The current statechain owner then sends a message to the server with the affected batch_id and statechain and asks it to generate 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 that it generated the preimage. The current statechain owner then begins the statechain transfer process and uploads the transfer message to the server.

See also  The RWA app integrates with almost protocol to fuel the growth of tokenized assets

After confirming this, the second user who attempts to trade for the statechain will initiate the Lightning payment. At this point, the server is the only one with the preimage, so the statechain owner cannot complete the payment yet. The current owner, after verifying the pending Lighting payment, sends an unlock message to the server to remove the first lock from the statechain. The receiver finally verifies the transfer message and if it is valid, it also sends a message to the server to remove the lock.

Now that both locks have been removed, the HSM server will release the preimage to the current statechain owner to complete the Lightning payment, and the statechain transfer to the recipient will be completed.

This plan does require that you can trust the statechain operator to function honestly, but that is not fundamentally a change to the pre-existing trust model of statechain use in general. The operator has no control over users’ funds at any point, nor does it 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, where one is stacked on top of the other, but even as a simple starting point it offers functional usability for existing Lightning users. Channel rebalancing is a necessity for many nodes; if capacity is pushed completely to one side or the other, the usefulness of that channel for routing payments is limited. Many companies and users have begun to experiment with using Liquid as a mechanism for this, as on-chain costs increase and swaps into and out of the Lightning Network become more expensive.

Statechains provide an alternative mechanism to a federated sidechain to alleviate some of the fees associated with managing channel balances. Instead of having to swap directly to the main chain or use a side chain, funds can be swapped to a state chain and held there until they are needed to swap funds back to a channel. Similar cost savings can be achieved while still retaining the ability to unilaterally claim your funds on the main chain.

See also  Ethereum Devconnect to host World Fair in Buenos Aires

Another potential use case (TRIGGER WARNING) would be the possibility of more efficient ordinal trading marketplaces. Because ordinal numbers are simply an index scheme that follows paths back in the transaction history to specific satoshis, they can easily be taken off-chain into a state chain. That dynamic combined with Lightning Latch could enable cheaper and faster off-chain purchases of ordinal numbers. Someone could build a marketplace where they could be sold directly off-chain via the Lightning Network.

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

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

While it’s a very simple premise, Lightning Latch and its statechain swap functionality opens the first door of statechains that integrate into the existing Lightning Network – and other similar layers to come in the future – in a way that lets them all integrate seamlessly. function as a single network in terms of payment routing and liquidity management. Even as we debate the need and usefulness of covenants, there is still a lot of room to build on what we already have.

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

Chat with Dr. @TTrevethan on why you should build a lightning bolt on @mercurylayer #bitcoin #layer2 pic.twitter.com/CKVG9aHTQ6

— Nicholas Gregory (@gregory_nico) March 15, 2024

And for a more technical explanation, here:

Going over the technical details of how lightning bolt will work with @TTrevethan on @mercurylayer #bitcoin #layer2 pic.twitter.com/aQIcjh2ukq

— Nicholas Gregory (@gregory_nico) March 16, 2024



Source link

Latch Layers Lightning Mercury Protocol Swap
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

VeChain wants to transform the supply chain from Amazon with confidential evidence

2025-06-01

Binance and Pakistan IT ministerie Rollen Blockchain Education Program out for 80,000 students

2025-06-01

Omnia -Protocol works together with Flare Networks to unlock more private and interoperable Web3 Future

2025-06-01

Hodooi and Ice Open Network are a powerful alliance for Web3 Social Expansion

2025-05-31
Add A Comment

Comments are closed.

Top Posts

How Avalanche’s DEX volumes can drive AVAX forward

2023-11-21

SEC Commissioners Peirce and Uyeda oppose SEC’s NFT enforcement action

2023-08-28

Analyst Points Out Why Late 2023 Won’t Be Great for XRP Price

2023-09-12
Editors Picks

XRP Ledger Set To Get New NFT Amendments, Here’s More

2023-08-20

Bitcoin price after the prediction of the analysts for Bullish Breakout, here is the target

2025-04-16

AAVE consolidates losses above USD 61

2023-08-04

‘Not Just About XRP’ – Bitnomial Disputes SEC Claim About XRP Futures

2024-10-11

Our mission is to develop a community of people who try to make financially sound decisions. The website strives to educate individuals in making wise choices about Cryptocurrencies, Defi, NFT, Metaverse and more.

We're social. Connect with us:

Facebook X (Twitter) Instagram Pinterest YouTube
Top Insights

Bitcoin can go to the impending correction mode for ‘weeks and weeks’, according to analyst Willy Woo – here is why

Bitcoin is still bullish, only $ 200,000 of the table and $ 137,000 in sight

VeChain wants to transform the supply chain from Amazon with confidential evidence

Get Informed

Subscribe to Updates

Get the latest news and Update from Bitcoin Platform about Crypto, Metaverse, NFT and more.

  • Contact
  • Terms & Conditions
  • Privacy Policy
  • DMCA
  • Advertise
  • Free.cc (Free Crypto)
© 2025 Bitcoinplatform.com - All rights reserved.

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

  • bitcoinBitcoin(BTC)$104,075.650.26%
  • ethereumEthereum(ETH)$2,494.28-1.32%
  • tetherTether USDt(USDT)$1.00-0.01%
  • rippleXRP(XRP)$2.14-0.71%
  • binancecoinBNB(BNB)$649.58-0.91%
  • solanaSolana(SOL)$151.82-1.32%
  • usd-coinUSDC(USDC)$1.000.00%
  • dogecoinDogecoin(DOGE)$0.1888720.19%
  • tronTRON(TRX)$0.268246-0.26%
  • cardanoCardano(ADA)$0.66-0.88%
  • suiSui(SUI)$3.263.23%
  • hyperliquidHyperliquid(HYPE)$31.780.02%
  • chainlinkChainlink(LINK)$13.800.30%
  • avalanche-2Avalanche(AVAX)$20.32-0.05%
  • stellarStellar(XLM)$0.2636800.61%
  • unus-sed-leoUNUS SED LEO(LEO)$8.67-0.96%
  • bitcoin-cashBitcoin Cash(BCH)$400.06-2.03%
  • the-open-networkToncoin(TON)$3.111.30%
  • shiba-inuShiba Inu(SHIB)$0.0000132.68%
  • hedera-hashgraphHedera(HBAR)$0.1657861.86%
  • litecoinLitecoin(LTC)$86.821.31%
  • polkadotPolkadot(DOT)$4.020.32%
  • moneroMonero(XMR)$327.510.61%
  • bitget-tokenBitget Token(BGB)$4.66-1.28%
  • ethena-usdeEthena USDe(USDE)$1.000.07%
  • daiDai(DAI)$1.00-0.01%
  • pepePepe(PEPE)$0.0000111.21%
  • piPi(PI)$0.631.48%
  • uniswapUniswap(UNI)$6.172.11%
  • aaveAave(AAVE)$240.82-2.63%
  • bittensorBittensor(TAO)$415.894.02%
  • okbOKB(OKB)$49.82-0.65%
  • aptosAptos(APT)$4.681.25%
  • nearNEAR Protocol(NEAR)$2.39-0.07%
  • crypto-com-chainCronos(CRO)$0.102059-1.09%
  • internet-computerInternet Computer(ICP)$4.862.47%
  • ondo-financeOndo(ONDO)$0.820.80%
  • ethereum-classicEthereum Classic(ETC)$16.77-0.42%
  • gatechain-tokenGateToken(GT)$19.18-0.13%
  • mantleMantle(MNT)$0.681.41%
  • official-trumpOFFICIAL TRUMP(TRUMP)$11.193.24%
  • polygon-ecosystem-tokenPOL (prev. MATIC)(POL)$0.2119381.53%
  • kaspaKaspa(KAS)$0.084088-1.07%
  • usd1World Liberty Financial USD(USD1)$1.00-0.03%
  • vechainVeChain(VET)$0.0237760.59%
  • render-tokenRender(RENDER)$3.800.93%
  • ethenaEthena(ENA)$0.3059072.29%
  • artificial-superintelligence-allianceArtificial Superintelligence Alliance(FET)$0.742.03%
  • worldcoin-wldWorldcoin(WLD)$1.11-1.83%
  • filecoinFilecoin(FIL)$2.530.56%
  • bitcoinBitcoin(BTC)$104,075.650.26%
  • ethereumEthereum(ETH)$2,494.28-1.32%
  • tetherTether USDt(USDT)$1.00-0.01%
  • rippleXRP(XRP)$2.14-0.71%
  • binancecoinBNB(BNB)$649.58-0.91%
  • solanaSolana(SOL)$151.82-1.32%
  • usd-coinUSDC(USDC)$1.000.00%
  • dogecoinDogecoin(DOGE)$0.1888720.19%
  • tronTRON(TRX)$0.268246-0.26%
  • cardanoCardano(ADA)$0.66-0.88%
  • suiSui(SUI)$3.263.23%
  • hyperliquidHyperliquid(HYPE)$31.780.02%
  • chainlinkChainlink(LINK)$13.800.30%
  • avalanche-2Avalanche(AVAX)$20.32-0.05%
  • stellarStellar(XLM)$0.2636800.61%
  • unus-sed-leoUNUS SED LEO(LEO)$8.67-0.96%
  • bitcoin-cashBitcoin Cash(BCH)$400.06-2.03%
  • the-open-networkToncoin(TON)$3.111.30%
  • shiba-inuShiba Inu(SHIB)$0.0000132.68%
  • hedera-hashgraphHedera(HBAR)$0.1657861.86%
  • litecoinLitecoin(LTC)$86.821.31%
  • polkadotPolkadot(DOT)$4.020.32%
  • moneroMonero(XMR)$327.510.61%
  • bitget-tokenBitget Token(BGB)$4.66-1.28%
  • ethena-usdeEthena USDe(USDE)$1.000.07%
  • daiDai(DAI)$1.00-0.01%
  • pepePepe(PEPE)$0.0000111.21%
  • piPi(PI)$0.631.48%
  • uniswapUniswap(UNI)$6.172.11%
  • aaveAave(AAVE)$240.82-2.63%
  • bittensorBittensor(TAO)$415.894.02%
  • okbOKB(OKB)$49.82-0.65%
  • aptosAptos(APT)$4.681.25%
  • nearNEAR Protocol(NEAR)$2.39-0.07%
  • crypto-com-chainCronos(CRO)$0.102059-1.09%
  • internet-computerInternet Computer(ICP)$4.862.47%
  • ondo-financeOndo(ONDO)$0.820.80%
  • ethereum-classicEthereum Classic(ETC)$16.77-0.42%
  • gatechain-tokenGateToken(GT)$19.18-0.13%
  • mantleMantle(MNT)$0.681.41%
  • official-trumpOFFICIAL TRUMP(TRUMP)$11.193.24%
  • polygon-ecosystem-tokenPOL (prev. MATIC)(POL)$0.2119381.53%
  • kaspaKaspa(KAS)$0.084088-1.07%
  • usd1World Liberty Financial USD(USD1)$1.00-0.03%
  • vechainVeChain(VET)$0.0237760.59%
  • render-tokenRender(RENDER)$3.800.93%
  • ethenaEthena(ENA)$0.3059072.29%
  • artificial-superintelligence-allianceArtificial Superintelligence Alliance(FET)$0.742.03%
  • worldcoin-wldWorldcoin(WLD)$1.11-1.83%
  • filecoinFilecoin(FIL)$2.530.56%