How Efficient Transfer Protocols Enable Collateral-Free Cross-Chain Options

cover
25 Dec 2024
  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

4 PROTOCOL

Due to the complexity of efficient holder collateral-free options, we elaborate on the protocol gradually. We first introduce the efficient transfer of an option in Section 4.1. Next, we outline how to achieve holder collateral-free cross-chain options in Section 4.2. Finally, we show the efficient, holder collateral-free option protocol.

4.1 Efficient Option Transfer Protocol

Option Initialization. Firstly, we illustrate an efficient option transfer protocol in an HTLC-based option. Assume Alice and Bob initialize an HTLC-based option as the holder and writer respectively. In this option, Alice locks 𝐴𝑠𝑠𝑒𝑑𝐴 on πΆβ„Žπ‘Žπ‘–π‘›π΄, intending to transfer it to Bob if a preimage of 𝐻(𝐴) is presented before 𝑇𝐸 + Ξ”. Bob locks 𝐴𝑠𝑠𝑒𝑑𝐡 on πΆβ„Žπ‘Žπ‘–π‘›π΅, intending to transfer it to Alice if a preimage of 𝐻(𝐴) is presented before𝑇𝐸, where𝑇𝐸 is the expiration time of this option. Alice owns the preimage 𝐴. In addition, Alice performs 𝐾𝑒𝑦𝐺𝑒𝑛(1 πœ† ) β†’ (π‘π‘˜π΄, π‘ π‘˜π΄), which acts as a transfer key pair3 , which are used for DAPS and misbehavior detection. π‘π‘˜π΄ is recorded in both contracts. The transfer key is used by Alice when transferring ownership to another party. A signature generated by π‘ π‘˜π΄ can be used to replace the contract holder, the hashlock, and the new transfer public key. Similarly, Bob creates a transfer key and records it on chains. Alice and Bob agree in advance on a value (e.g., a 256-bit random number) to serve as the message address π‘Ž recorded in the contracts for the DAPS. We take holder position transfer as an example to illustrate this transfer protocol.

4.1.1 Transfer Holder’s Position. Suppose Alice reaches an agreement with Carol to transfer the holder position on or before time 𝑇𝐻 , with a charge of π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ on πΆβ„Žπ‘Žπ‘–π‘›πΆ. Carol performs 𝐾𝑒𝑦𝐺𝑒𝑛(1 πœ† ) β†’ (π‘π‘˜πΆ, π‘ π‘˜πΆ) to generate a new transfer key pair. Carol deposits π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ in πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ. This contract requires a signature of π‘š = (π‘Ž, 𝑝), where message payload 𝑝 = (Carol.π‘Žπ‘‘π‘‘π‘Ÿπ‘’π‘ π‘ , 𝐻(𝐢), π‘π‘˜πΆ), signed by π‘ π‘˜π΄ to unlock and transfer the π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ to Alice. Besides, πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ records 𝐻(𝐴), specifying that π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ is refunded to Carol if Carol can reveal 𝐴 (meaning that Alice has exercised the option). Instead withdraw immediately, after Alice reveals a signature to redeem π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ , she must wait for 3Ξ” to elapse. We refer to this period as the Withdrawal Delay Period. The protocol consists of two phases, Figure 1 illustrates the position transferring process:

(1) Reveal Phase: Carol locks the transfer fee and Alice attempts to withdraw the transfer fee with her signature.

(2) Consistency Phase: Carol forwards the signature to replace the holder and Alice withdraws the transfer fee after the withdrawal delay period.

I. Reveal Phase.

(1) Alice generates signature by 𝑆𝑖𝑔𝑛(π‘ π‘˜π΄,π‘š) β†’ πœŽπ‘š, where π‘š equals to (π‘Ž, (Carol.π‘Žπ‘‘π‘‘π‘Ÿπ‘’π‘ π‘ , 𝐻(𝐢), π‘π‘˜πΆ)).

(2) If Alice wants to transfer her option to Carol, Alice sends πœŽπ‘š in Contract𝐢 by invoking the function reveal() and wait for 3Ξ” (withdrawal delay period). If she does not like to complete the trade between Carol, she does not reveal πœŽπ‘š. The π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ will be refunded to Carol after 𝑇𝐻 .

II. Consistency Phase.

(1) Carol4 forwards πœŽπ‘š to both πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ and πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅ directly, attempting to call the function transferHolder() to replace the holder to Carol, the hashlock to 𝐻(𝐢), and holder’s transfer public key to π‘π‘˜πΆ.

(2) Alice calls withdraw() to obtain the π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ in πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ after the withdrawal delay period.

If all parties perform honestly, Alice is able to receive π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ and holder is changed to Carol. However, there are possible contingent events or dishonest scenarios:

β€’ If Alice exercises the option during the transfer process and reveals the preimage 𝐴 before 𝑇𝐻 , Carol can refund the π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ from πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ using 𝐴 during the withdrawal delay period.

β€’ If different signatures with the same message address πœŽπ‘šβ€² β‰  πœŽπ‘š, are submitted on πΆβ„Žπ‘Žπ‘–π‘›π΄ and πΆβ„Žπ‘Žπ‘–π‘›π΅ (e.g., if Alice submits two different signatures or sells the option to multiple parties), any one can call 𝐸π‘₯π‘‘π‘Ÿπ‘Žπ‘π‘‘(π‘π‘˜,π‘šβ€² , πœŽπ‘šβ€²,π‘š, πœŽπ‘š) β†’ π‘ π‘˜π΄ to get π‘ π‘˜π΄. π‘ π‘˜π΄ is the secret transfer key of Alice. Whoever gets π‘ π‘˜π΄ means that Alice misbehaves. We can use this as an evidence for fair settlement of funds.

– Carol can call reclaim() and obtain the π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ with π‘ π‘˜π΄ during the withdrawal delay period.

– Bob can use π‘ π‘˜π΄ to claim both 𝐴𝑠𝑠𝑒𝑑𝐴 and 𝐴𝑠𝑠𝑒𝑑𝐡. If a signature has not been submitted, Bob can claim it anytime. If a signature has been submitted, Bob needs to send π‘ π‘˜π΄ within one Ξ” after the signature submission.

β€’ If Carol reveals πœŽπ‘š on only πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ or πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅, Bob can forward the signature to the other contract.

Timeouts. The transfer contract must be created no later than 𝑇𝐻 βˆ’ 3Ξ”, and the reveal phase should be completed by 𝑇𝐻 βˆ’ 2Ξ” to ensure that the option can be transferred to Carol at 𝑇𝐻 . In the consistency phase, if any misbehavior occurs, it should be reported to the contract by 𝑇𝐻 + Ξ”. If Bob does not claim assets on πΆβ„Žπ‘Žπ‘–π‘›π΄ and πΆβ„Žπ‘Žπ‘–π‘›π΅ with π‘ π‘˜π΄, then it implies transfer complete. Overall, a total transfer time of 4Ξ” is required. In other words, the transfer protocol must initiate no later than 𝑇𝐸 βˆ’ 4Ξ”. The unlocking condition for πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘πΆ is summarized in Table 2.

Table 2: Unlocking conditions of transferring position from Alice to Carol, where 𝑇 and 𝑇𝑅 are current time and the time that Alice reveals the signature.

4.1.2 How misbehaviors are handled securely in the protocol. Here we show how this protocol handles misbehaviour and protect each party’s interests by ensuring a fair payoff for honest parties. A more rigorous analysis is shown in Appendix B.1. First, we consider each party acting maliciously on their own.

β€’ If Alice provides two different signatures to different buyers, as shown in 1, Bob can extract π‘ π‘˜π΄ and submit it to obtain 𝐴𝑠𝑠𝑒𝑑𝐴 and 𝐴𝑠𝑠𝑒𝑑𝐡, and Carol can reclaim the transfer fee with π‘ π‘˜π΄. In that case, Bob does not lose his 𝐴𝑠𝑠𝑒𝑑𝐡 and Carol does not lose her transfer fee.

β€’ If Alice reveals𝐴 at the same time during the transfer process, as shown in 2, Carol can use 𝐴 to reclaim π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’. She does not lose anything. The option is exercised, and swap happens between Alice and Bob.

β€’ If Alice or Carol publishes one signature exclusively on either πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ or πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅, as shown in 3, Bob can forward this signature to another chain to make sure the hashlocks and option holders are consistent on two chains.

Next, we consider scenarios where collusion exists.

Figure 1: Alice transfers holder position to Carol. The red dashed lines represent malicious activities, illustrated in Section 4.1.2.

β€’ If Alice and Bob collude, they can use π‘ π‘˜π΄ or 𝐴 to withdraw 𝐴𝑠𝑠𝑒𝑑𝐴 and 𝐴𝑠𝑠𝑒𝑑𝐡 as shown in 4. Carol can observe π‘ π‘˜π΄ or 𝐴 and withdraw π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ during the withdrawal delay period.

β€’ If Alice and Carol collude, they use two signatures to change the hashlock. During the withdrawal delay period, Bob can obtain 𝐴𝑠𝑠𝑒𝑑𝐴 and 𝐴𝑠𝑠𝑒𝑑𝐡 using the extracted π‘ π‘˜π΄, which is reduced to 1.

β€’ If Bob and Carol collude, they cannot do anything harm. Since Alice will only reveal one valid signature, Alice will receive π»π‘œπ‘™π‘‘π‘’π‘ŸπΉπ‘’π‘’ from Carol.

4.1.3 Transfer Writer’s Position. Transferring the writer’s position is similar but simpler because Bob does not possess the preimage of the hashlock. Bob, with the transfer key pair (π‘π‘˜π΅, π‘ π‘˜π΅), can sign the message π‘š = (π‘Ž, (Dave.π‘Žπ‘‘π‘‘π‘Ÿπ‘’π‘ π‘ , π‘π‘˜π· )) using π‘ π‘˜π΅ to collect the transfer fee, where π‘π‘˜π· is a new transfer key for Dave. Transferring writer’s position does not update the hashlock used in the option exercise. Thus, Alice’s option is not influenced except the change of new option writer.

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.

[3] Logically, the transfer key is not used for receiving coins as "identities" in blockchains.

[4] Any party can forward this signature, as Alice may transfer ownership to any party.