Analysis of Cross-chain Atomic Interchange Protocol

Foreword

Each blockchain has its own data assets and data information. Since the creation of Bitcoin, TPS has always been a bottleneck in the blockchain industry, and it is difficult to break through. Various solutions have emerged for this industry to improve consensus, block expansion, and improve data structures. The side chain technology such as plasma enhances the performance of the blockchain from the lateral expansion of the blockchain. That is, the main chain is responsible for handling basic transactions, and the side chain is responsible for handling specific transactions. For example, Bitcoin can generate a pizza chain, a fruit chain, and a drink chain. When people need to use bitcoin to purchase pizza, fruit, and drinks, they can convert bitcoin to Digital assets on the side chain, purchased in the side chain. In this way, each chain can be used to handle different transactions, divide and conquer different transactions, improve the processing capacity of the chain as a whole, and increase the storage capacity of the chain.

Atomic interchange

Atomic exchange of assets across the chain, that is, in different blockchain systems. In other words, the asset transfer swap is successful or fails. Can't appear, Alice transferred the asset successfully on A, but did not receive the corresponding amount of assets on the B chain. The following is an example of the transfer of assets between Alice and Bob in Bitcoin and Ethereum to illustrate the principle of atomic interchange in cross-chain transactions.

Atomic interchange steps :

1) Alice has 1BTC and wants to exchange Bob's 20ETH. Alice and Bob have one account on each of the two chains.

2) First, Alice randomly generates a key K, initiates transaction 1, and transfers 1BTC to the Bob bitcoin account. The transaction can only be completed when Bob's signature and key K are obtained.

3) Before the transaction 1 is initiated, Alice will broadcast a retracement transaction (transaction 2), which indicates that if the transaction 1 is not completed within 48 hours, the asset will be returned to Alice; the retracement transaction will be shared by Alice and Bob. Effective after signing. At the same time, Alice will only initiate transaction 1 if transaction 2 is successful.

4) Bob receives Alice's transaction 2 and adds a signature to transaction 2 if he agrees to cross-chain transfers. At this time, transaction 2 takes effect, and Alice broadcasts transaction 1 to the entire network.

5) Bob initiates transaction 3 on Ethereum, pays 20 ETH to Alice to get the key K, and Alice can get 20 ETH after entering the key K and signature in the transaction. In order to secure Bob's assets in Transaction 3, a retracement transaction (transaction 4) will also be sent before transaction 3.

6) After Alice receives the transaction 4, it will attach its own signature. After the retracement transaction 4 takes effect, Bob will broadcast the transaction 3 on the whole network.

7) Alice obtains her own signature and key K in transaction 3 for obtaining 20 ETH; at this time transaction 3 succeeds, Alice obtains 20 ETH, and Bob obtains key K.

8) In Bitcoin, Bob enters his signature and key K to obtain 1BTC. Atomic interchange summary

Atomic swaps did not transfer Bitcoin assets to Ethereum, but only exchanged ownership of both chain assets. The total assets of the two chains have not changed, so the atomic swap agreement cannot achieve inter-chain asset transfers. Atomic interchange can be used not only in blockchains, but also in centralized systems, as long as the system provides retracement, time lock, and key lock.

Design analysis

In the transfer transaction 1, the key K and the Bob signature are required to be satisfied at the same time:

1. The key K guarantees the security of the sponsor's funds, that is, the recipient K cannot directly obtain the assets without the key K.

2. The recipient's signature guarantees the security of the recipient's assets, that is, without the recipient's private key, even if someone else obtains the key K, the asset cannot be obtained.

The completion of transaction 1 requires confirmation from both the initiator and the receiver.

The role of the retracement transaction:

1. Agreeing on the transfer of assets (48 hours unsuccessful, then cancel transaction 1 and withdraw funds to Alice)

2. Avoid an asset launching multiple cross-chain transactions (similar to “double flower”, locking cross-chain trading assets within 48 hours, the asset cannot be used for other transactions)

Quesstion :

How to guarantee the correctness of the key K in the transaction 3 in the atomic exchange, that is, the correct transaction of the key K is successful, and the wrong transaction fails?

Reference materials:

[Fire Coin Blockchain Industry Special Report] Cross-chain articles (on) https://www.jianshu.com/p/f2d2e83473fc

Author: Cao Haitao

We will continue to update Blocking; if you have any questions or suggestions, please contact us!

Share:

Was this article helpful?

93 out of 132 found this helpful

Discover more

Blockchain

The Digital Renminbi Revolution: Standard Chartered Breaks Ground

China and Standard Chartered Bank have launched a digital RMB platform to modernize cross-border payments.

Blockchain

Altcoin Surge: KLAY, CHZ, and BLUR Defy Bitcoin Downtrend 🚀📈

Despite the current trend, altcoins such as Chiliz, Klaytn, and Blur are bucking the trend and demonstrating strong m...

Market

BLUR’s Upside Surprise: 35% on the Menu

Fashionista, you won't want to miss this news! BLUR rose to its highest level since May, reaching $0.52 and a 35% inc...

Market

DBDX: Deutsche Börse’s Leap into the Digital Asset Market

Deutsche Börse Group's latest development, the Deutsche Börse Digital Exchange (DBDX), marks a major advancement into...

Blockchain

A Breakthrough in the Crypto World: HKMA’s Marvelous E-HKD Experiment with Visa

Visa partners with HKMA in successful trial of e-HKD, a digital version of the Hong Kong dollar.

NFT

Battle of the Crypto Titans: Bitcoin vs. NFTs

Fashion enthusiasts were offered an exclusive chance to obtain physical replicas of their favorite CryptoPunks NFTs f...