The TenX Summit witnessed an industry first on December 7, 2018, when a group of developers from CoBloX, a TenX research and development lab, showcased an atomic swap between a non-native asset, TenX’s PAY token, and a native asset, bitcoin.
For the uninformed, non-native token is referred to a coin that is not the base currency for the network. For Instance, ether is the native asset of Ethereum and any other token developed on the network is considered a non-native asset. Witnessed only by a tightly packed audience of summit goers, the demonstration was performed by using the Lightning Network and COMIT, the proprietary software of the company. 10 Pay was swapped for 71,240 satoshis.
To confirm their achievements, the team published a blog post on December 12, 2018. The post further elaborates about the process, stating that this swap wasn’t as simple as the first-ever “https://medium.com/coblox/connect-all-the-blockchains-atomic-swap-78b38fff42e” target=”_blank” rel=”nofollow noopener external noreferrer”>ether and bitcoin atomic swap they tested nearly six months ago. Whereas this swap’s hashed time lock contract (HTLC) only required a single use smart contract, the PAY to bitcoin swap took an extra step.
Since PAY token itself used an additional smart contract known as the transfer ownership function, the extra step was required. Subsequently, the HTLC has to be separated into two transactions: one to deploy the swap contract and another as a transfer call for the PAY tokens. The blog post describes:
“Unfortunately, we couldn’t figure out how to combine these two steps. 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.”
Explaining the process further, the blog post explains that the swap is one-sided only. The swap could only be executed by starting with the ERC-20 token and going through the Lightning Network Daemon (LND) implementation and not the other way round.
“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.”
CoBloX has been aiming to achieve a technical milestone after another. Just six months ago the team managed the world’s first ether and bitcoin swap. The software used in the ERC-20 swap, COMIT, is also open-source. Aimed at blockchain interoperability, the software acts as a bridge between networks to facilitate cross-chain asset swaps. In addition to their ongoing work over Ethereum and its ERC-20 tokens, the team plan to expand, incorporating additional features and currencies down the road.