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

Policy

Sam “SBF” Bankman-Fried Faces the Fury of the Court (with a Twist of Humor)

Sam Bankman-Fried, the ex-CEO of FTX, took the stand in a New York court and testified about communication and custom...

Blockchain

Viewpoint | Exchange is the public chain platform

If 2019 is almost a stand-alone platform currency, let me think about " What is value capture? " and "...

News

Policy reshuffle is intensified: the crisis and new life of virtual currency exchanges

The virtual currency exchange industry may have to "change the sky", which seems to be the consensus of the...

Finance

The Block Editor-in-Chief 5 Innovative Projects Worth Paying Attention to

Promising emerging projects include derivatives protocols, governance platforms, and infrastructure, among others. Au...

Blockchain

Three major domestic virtual currency exchanges focus on compliance business and actively engage with local governments and state-owned enterprises

China Times (www.chinatimes.net.cn) reporter Ran Xuedong trainee reporter An Lingfei Beijing reports The currency cir...

Market

Why SEC Chairman Gary Gensler is Cracking Down on the Crypto Market: Latest Speech

SEC Chairman Gary Gensler gave a speech on June 8 at the Piper Sandler Global Exchange and Financial Technology Confe...