paint-brush

This story draft by @escholar has not been reviewed by an editor, YET.

How Cross-Chain Transfer Protocols Ensure Safe and Smooth Transactions

featured image - How Cross-Chain Transfer Protocols Ensure Safe and Smooth Transactions
EScholar: Electronic Academic Papers for Scholars HackerNoon profile picture
0-item

Table of Links

  1. Abstract and Introduction

  2. Preliminaries

  3. Overview

  4. Protocol

    4.1 Efficient Option Transfer Protocol

    4.2 Holder Collateral-Free Cross-Chain Options

  5. Security Analysis

    5.1 Option Transfer Properties

    5.2 Option Properties

  6. Implementation

  7. Related Work

  8. Conclusion and Discussion, and References


A. Codes

B. Proofs

B.1 Transfer Protocol Proofs

Lemma 9. The holder transfer procedure of Protocol 4.2.1 does not require Bob’s participation.


Proof. It is evident that, Alice does not own the exercise secret, holder’s transfer is required to replace the holder address and transfer public key, and the inconsistency of two chains will not harm the interest of Bob. According to the Protocol 4.1, Bob cannot use the transfer private key of Alice, i.e. π‘ π‘˜π΄ to claim assets. Therefore, during the reveal phase and consistency phase, Bob is not required to participate and not allowed to make any change on πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ and πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅.


Lemma 10. If Bob and Dave are conforming, then the writer transfer procedure of Protocol 4.2.1 does not require Alice’s participation.


Proof. Obviously, honest Bob will not leak two signatures or π‘ π‘˜π΅ and honest Dave will submit signature πœŽπ‘š on both πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ and πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅, Alice only needs to make operations when there is any dishonest party.


Theorem 2. Protocol 4.2.1 satisfies liveness: If Alice, Bob, and Carol/Dave are conforming, then Alice/Bob will obtain Carol/Dave’s collateral, Carol/Dave will obtain Alice/Bob’s position, and Bob/Alice will retain their original position.


Proof. By Lemma 9, Bob’s participation is not required during the holder transfer. If Alice and Carol are conforming, Carol will create πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ contract and lock her collateral using signature of Alice before 𝑇𝐻 βˆ’ 3Ξ”. Alice will then reveal signature by π‘ π‘˜π΄ and callπ‘Ÿπ‘’π‘£π‘’π‘Žπ‘™() onπΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ at𝑇𝐻 βˆ’2Ξ”. An honest Carol will forward the signature, setting the holder to Carol. Alice can then wait for 3Ξ” withdrawl delayed period to obtain the collateral, while the writers ofπΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ andπΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅ are still Bob, Bob maintains the writer’s position. During the process where Bob transfers his position to Dave, if both parties are conforming, Bob will not expose two different signatures. After π‘‡π‘Š + Ξ”, Bob will not be obstructed and will surely obtain Dave’s collateral. Meanwhile, Dave can submit πœŽπ‘š betweenπ‘‡π‘Š βˆ’Ξ” andπ‘‡π‘Š to πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ and πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅ to change the writer, Alice retaining the holder position.


Theorem 3. Protocol 4.2.1 satisfies unobstructibility: Alice/Bob can transfer the position to another party even if Bob/Alice is adversarial.


Proof. By Lemma 9, Bob’s participation is not required, it is evident that Bob cannot block the process of transferring a holder’s position. During Bob’s transfer to Dave, Alice can only obtain Bob’s collateral by two different messages signed with π‘ π‘˜π΅ or the exercise secret. If Bob is honest, he will neither leak 𝑠𝐡, sign multiple messages nor leak exercise secret. Consequently, Alice cannot interrupt the transfer process.



Proof. After 𝐴𝑙𝑖𝑐𝑒𝑖 transfers to 𝐴𝑙𝑖𝑐𝑒𝑖+1, the holder in the current option’s πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ and πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅ is updated to Alice𝑖+1, and the transfer key is known only to 𝐴𝑙𝑖𝑐𝑒𝑖+1. Therefore, after a holder transfer, 𝐴𝑙𝑖𝑐𝑒𝑖+1 can transfer the position to 𝐴𝑙𝑖𝑐𝑒𝑖+2 by re-performing Protocol 4.2.1 with the transfer key of 𝐴𝑙𝑖𝑐𝑒𝑖+2. Similarly, after π΅π‘œπ‘π‘— transfers to π΅π‘œπ‘π‘—+1 (holder Alice does not contest within Ξ”), the writer in the current option’s πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ and πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅ is updated to Bob𝑗+1. At this point, only π‘ π‘˜ 𝑗+1 𝐡 or its signatures can be used for the next transfer. π΅π‘œπ‘π‘—+1 can also transfer the position by re-performing Protocol 4.2.1 with the new transfer key.


Lemma 11. Protocols 4.2.1 satisfy atomicity: If conforming Alice/Bob loses their position, she/he will be able to obtain Carol/Dave’s collateral.


Proof. Following Theorem 2, in transferring the holder position, after Carol correctly escrows the collateral, Alice temporarily locks the holder position in both contracts using 𝐻(𝐢). If Carol uses 𝐢 to obtain the position before 𝑇𝐻 , then Alice will obtain Carol’s collateral at 𝑇𝐻 + Ξ”. If Carol does not reveal 𝐢 before 𝑇𝐻 , Alice will not receive Carol’s collateral. Similarly, in transferring the writer position, if Bob does not reveal his signature honestly, then Bob will lose the position and Dave can retrieve and will not lose the collateral. If honest Bob signs for a buyer Dave, the honest Dave will use the signature to obtain Bob’s position at π‘‡π‘Š . Bob will then obtain Dave’s collateral at π‘‡π‘Š + Ξ”.


B.1.1 Safety.


Proof. In the πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄, the following elements are defined:


β€’ 𝑇𝐸: The expiration time of this option.


β€’ exercise_hashlock: The hash lock of this option, which is the hash of a secret value known only to the writer.


β€’ old_exercise_hashlock: The hash lock of this option, which is the hash of a secret value known only to the writer.


β€’ holder: The holder can call 𝑒π‘₯π‘’π‘Ÿπ‘π‘–π‘ π‘’ () to exercise the option before 𝑇𝐸.


β€’ guarantee: The writer’s asset, i.e. 𝐴𝑠𝑠𝑒𝑑𝐺 , which can be any asset mutually agreed upon by the holder and writer as guarantee. This can include tokens, NFTs, or any other type of asset.


β€’ writer: The writer can use the secret value to call π‘Ÿπ‘’ 𝑓 𝑒𝑛𝑑 () to retrieve the guarantee or retrieve it directly after 𝑇𝐸 + 2Ξ”.


β€’ collateral: The collateral that Alice must deposit if she decides to exercise the option to purchase Bob’s asset.


β€’ holder_transfer_public_key: the transfer key of Alice, π‘π‘˜π΄, used for verify the transfer signature of Alice to Carol.


β€’ writer_transfer_public_key: New transfer key of Dave, π‘π‘˜π· , used for verify the transfer signature of Dave to others.


β€’ old_writer_transfer_public_key: Old transfer key of Bob, π‘π‘˜π΅, used for verify the transfer signature of Bob to Dave, Within the period of one Ξ”, during which the transfer signature must be submitted to this contract, we still need to record the old transfer public key in case of Bob’s misbehavior.


β€’ writer_transfer_time: The writer transfer time, used for Alice to claim assets if there exits misbehavior of Bob.


In the πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅, there are other additional items:


β€’ collateral: The writer’s collateral, i.e.𝐴𝑠𝑠𝑒𝑑𝐡, it can be claimed by holder with preimage of hashlock.


β€’ holder: The holder can call 𝑒π‘₯π‘’π‘Ÿπ‘π‘–π‘ π‘’ () to exercise the option before 𝑇𝐸.


β€’ writer: The writer can callπ‘Ÿπ‘’ 𝑓 𝑒𝑛𝑑 () to retrieve the guarantee or retrieve it directly after 𝑇𝐸 + 2Ξ”.


In the πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π· , the following elements are defined:


β€’ T_W: The deadline for seller to reveal signature.


β€’ buyer: writer position buyer, i.e. Dave.


β€’ seller: writer position seller, i.e. Bob.


β€’ old_exercise_hashlock: The hashlock of exercise, if Bob reveals during the transfer, Dave is able to reclaim with preimage.


β€’ exercise_hashlock: The new hashlock of exercise, generated by Dave.


β€’ old_writer_transfer_public_key: Bob’s transfer public key, used for verify the signature of Bob.


β€’ writer_transfer_public_key: New transfer public key generated by Dave, used for replacing Bob’s key.


β€’ transfer_time: Used for record the time of transfer (the time reveal signature) and calculate the withdrawal delayed period.


Take Bob transferring his position to Dave as an example, since Bob deposit 𝐴𝑠𝑠𝑒𝑑𝐺 and 𝐴𝑠𝑠𝑒𝑑𝐡 into the contracts, which is more complex. Transferring Alice’s position to Carol is more simple.


By Lemma 11, if compliant Bob loses his position, he will at least obtain Dave’s collateral during the writer transfer process.


If Dave is conforming, then if Bob acts maliciously on his own, Bob provides two different signatures to different buyers, Dave can reclaim the transfer fee with extracted π‘ π‘˜π΅ since 𝐷 records old_writer_transfer_public_key i.e. π‘π‘˜π΅. If Bob reveals 𝐡 at the same time during transfer process, then Dave can use 𝐡 to reclaim π‘Š π‘Ÿπ‘–π‘‘π‘’π‘ŸπΉπ‘’π‘’ since πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ records old_exercise_hashlock i.e. 𝐻(𝐡). If Alice and Bob collude, they can use π‘ π‘˜π΅ or 𝐡 to withdraw 𝐴𝑠𝑠𝑒𝑑𝐺 and 𝐴𝑠𝑠𝑒𝑑𝐡. Then, Dave can observe π‘ π‘˜π΅ or 𝐡 and withdraw π‘Š π‘Ÿπ‘–π‘‘π‘’π‘ŸπΉπ‘’π‘’ during withdrawal delay period since πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π· records transfer_time.


If Alice is conforming, then If Bob provides two different signatures to different buyers, Alice can extract π‘ π‘˜π΅ and submit it to obtain 𝐴𝑠𝑠𝑒𝑑𝐺 and 𝐴𝑠𝑠𝑒𝑑𝐡. If Bob or Dave publishes one signature exclusively on either πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ or πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅, Alice can forward this signature to another chain to make sure the exercise secret hashlocks are consistent on two chains. If Bob and Dave collude, they use two signatures to change the hashlock. During the withdrawal delay period, Alice can obtain 𝐴𝑠𝑠𝑒𝑑𝐺 and 𝐴𝑠𝑠𝑒𝑑𝐡 using the extracted π‘ π‘˜π΅.


Transferring Alice’s position to Carol is simpler, as Alice does not deposit assets into the option contracts and cannot modify the exercise secret hashlock. Carol only needs to ensure consistency between the holders on the two chains. Otherwise, she can extract π‘ π‘˜π΄ and refund the π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ during the withdrawal delay period.


Theorem 5. Protocol 4.2.2 satisfies isolation: Alice and Bob can simultaneously and separately transfer their positions to Carol and Dave, respectively. This means that transferring holder and the transferring writer can proceed concurrently.


Proof. Suppose both Carol and Dave are interested in Alice’s and Bob’s positions, respectively. According to Lemma 9, Alice transferring to Carol does not require Bob’s involvement, hence Alice and Carol will not be interfered with. Similarly, it is known that during Bob’s transfer to Dave, by Lemma 10, if Bob and Dave are both compliant, Alice does not need to participate. Considering the case when Bob reveals two different signatures: (i) If Carol has already revealed the secret value 𝐢 of the transfer hash lock, then Carol becomes the new holder and can use two different signatures by 𝑠𝐡 to obtain 𝐴𝑠𝑠𝑒𝑑𝐡 and 𝐴𝑠𝑠𝑒𝑑𝐺 . (ii) If Carol has not revealed 𝐢 and will reveal it after Ξ”, Carol can simultaneously reveal𝐢 and call π‘Ÿπ‘’π‘π‘™π‘Žπ‘–π‘š() on both chains after Ξ” to obtain 𝐴𝑠𝑠𝑒𝑑𝐡 and 𝐴𝑠𝑠𝑒𝑑𝐺 . If Dave or Bob publishes πœŽπ‘š on one single chain, Carol must forward πœŽπ‘š to the other chain while revealing 𝐢.


Authors:

(1) Zifan Peng, The Hong Kong University of Science and Technology (Guangzhou) Guangzhou, Guangdong, China ([email protected]);

(2) Yingjie Xue, The Hong Kong University of Science and Technology (Guangzhou) Guangzhou, Guangdong, China ([email protected]);

(3) Jingyu Liu, The Hong Kong University of Science and Technology (Guangzhou) Guangzhou, Guangdong, China ([email protected]).


This paper is available on arxiv under CC BY 4.0 license.