Commerceblock has made a groundbreaking announcement with the release of 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 marks the first concrete example of interactions between statechains and the Lightning Network.
The new swap protocols require the HSM server to track specific fields in its database entries, such as batch_id, batch-time, and locked values, to ensure a safe atomic swap. Users initiate the swap by establishing a shared batch_id and communicating directly with each other. The server applies a lock to every statechain involved in the swap until the timeout expires or all statechains are unlocked.
Similarly, the Lightning Latch functionality works by swapping a statechain for a Lightning payment. Users establish a batch_id, and the server generates a hashlock preimage for the Lightning payment. After both users confirm the preimage, the statechain transfer process begins, and the Lightning payment is initiated. Once both locks are removed, the server releases the preimage to finalize the Lightning payment and the statechain transfer.
This new protocol opens up a world of possibilities for existing Lightning users, offering a more efficient way to manage channel balances and reducing fees associated with on-chain transfers. It also paves the way for potential off-chain marketplaces and enhanced payment routing capabilities within the Lightning Network.
While still in its early stages, the integration of statechains and Lightning Network through the new atomic swap protocol represents a significant step forward in the evolution of payment networks. The Commerceblock team has provided further insights into the protocol’s logic and technical details, showcasing the innovative potential of this development.