Developers Test Cross-Blockchain Protocol for One-Way ERC20-Bitcoin LN Atomic Swaps

An R&D lab at crypto startup TenX has tested the use of its cross-blockchain interoperability protocol to transfer ERC20 tokens for Bitcoin (BTC) using the Lightning Network (LN). The news was reported on R&D lab CoBlox’s blog today, Dec. 12, in reference to the demo on Dec. 7.

As the blog post outlines, the technical challenge was to exchange ERC-20 tokens — which run on the Ethereum (ETH) platform but are not strictly “native” since they rely on invoking a smart contract to transfer ownership — for Bitcoin’s smallest transactable unit, known as “Satoshi,” using the second-layer scalability LN protocol.

Lightning Network is a second-layer solution to Bitcoin’s scalability issue, which uses Hashed Timelock Contracts (HTLCs) to open payment channels between users that keep the majority of transactions off-chain, turning to the underlying blockchain only to record the net results.

CoBlox’s previous Ethereum HTLC, as today’s post explains, was significantly simpler as it involved native assets. CoBlox has outlined their approach to find a solution for an ERC20 case, stating that the developers decided to “split the HTLC setup into two transactions” — “contract deployment” and “ERC20 transfer call” — but that they could not combine the two steps.

The post writes:

“The ERC20 transfer function uses msg.sender for authentication. However, calling transfer from a contract deployment sets msg.sender to the address of the yet to be deployed contract which obviously has no tokens!”

The post goes on to note that using “the Lightning Network for an atomic swap also has its quirks,” given that the solution relies on users creating invoices and paying them without necessarily “knowing about the underlying HTLCs.” However:

“An atomic swap cannot always be expressed through this model of invoices and payments. In LND, which is what we used for our PoC, receiving a payment requires an invoice which requires knowledge of the secret. As a result, we were only able to do ERC20 to Lightning and not the other way around. The invoice used in the swap can be found below.”

CoBlox states it is still “looking at ways” to resolve the limited directionality issue, and has therefore not included the results of its proof-of-concept (PoC) for ERC20 tokens as part of the open-source release of its COMIT network.

This summer, a study conducted by weekly crypto outlet Diar suggested that the Lightning Network may not be as effective at routing payments as believed, in particular when it comes to larger amounts. The report was rebuffed by the LN development team as being “poorly-researched and written,” with the full details of their criticisms outlined in a Cointelegraph analysis piece.