paint-brush

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

Making Cross-Chain Options More Efficient

featured image - Making Cross-Chain Options More Efficient
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

6 IMPLEMENTATION

Implementation. We implemented, tested, and evaluated our proposed protocol, Efficient Cross-Chain Options without Upfront Holder Collateral, in Section 4.2.1. This was conducted within a simulated environment using the Ethereum Virtual Machine (EVM) (Remix VM Cancun) and the Solidity Compiler version 0.8.22. We employ the same signature algorithm as Ethereum, utilizing the secp256k1 curve and the Elliptic Curve Digital Signature Algorithm (ECDSA) [17]. Since EVM does not support direct on-chain verification of a public-private key pair, we implement the proof of the private key π‘ π‘˜ by signing a specific message with it. The corresponding codes are provided in Appendix A.


Expected Transfer Time Evaluation. We compared our work with that of Engel and Xue [12]. Assuming that the probability of an option being transferred and ultimately finalized within the current network is 𝑝, the total number of transfers is 𝑋. Then, in their protocol, 𝑋 follows a geometric distribution, i.e. 𝑋 ∼ 𝐺(𝑝). The relationship between the expected successful transfer time and the successful transfer probability of each phase is illustrated in Figure 3, where mutate lock phase in Engel and Xue’s protocol to corresponds to the reveal phase in our protocol. When a large number of malicious nodes exist in the current network, say, the finalization probability is 10%, the duration of the mutate lock phase and the consistency phase in their protocol becomes significantly prolonged, reaching 45Ξ”, which is approximately equivalent to 2 days in Bitcoin. By initiating the replace phase earlier and consolidating the mutate and consistency phases, we significantly reduce the duration of these phases.


Gas Consumption Evaluation. Figure 4 lists the gas consumption for contract deployment, option operations, and gas consumption in different phases, where gas price is 4.131 Gwei and ETH price is $2274.87 (Sep 7, 2024). We calculate the maximum gas used for each operation. In the transfer failure case, we only calculate the gas consumption of conforming parties.


Notably, as shown in Figure 4a, compared to Engel and Xue’s protocol, the gas consumption for the holder transfer process has significantly decreased from 714,867 to 510,857 gas (a reduction of approximately 28.5% for successful transfers). For failed transfers, the gas consumption decreases from 330,350 gas to 248,388 gas (a reduction of approximately 3.4%). The gas consumption of the transferring writer also decreases to a similar level. The gas consumption for exercising an option increases from 96,916 to 145,337, while the gas consumption for abandonment decreased. This is because, during an exercise, Alice needs to deposit funds and Bob must fulfill the request by revealing the exercise secret. In contrast, for an abandonment, Bob only needs to perform a refund operation.


Figure 4b illustrates the gas consumption of a successful transfer across different phases. In our protocol, the reveal phase only requires the seller to reveal a signature in one contract, significantly reducing gas consumption compared to the mutate and replace/revert phases, lowering the gas for the holder and the writer to 123,158 and 123,435 gas, respectively. However, gas usage in the consistency phase is higher than that of their protocol, as we verify signatures in both contracts to ensure consistency.


The gas consumption for contract deployment in our protocol is generally higher compared to Engel and Xue’s protocol due to additional security measures and DAPS support. For instance, the deployment costs for πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΄ and πΆπ‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘‘π΅ in our protocol are 2,549,610 and 2,220,156 gas, respectively. Nonetheless, this is acceptable, as deploying a transferable HTLC contract in Engle and Xue’s protocol consumes around 2.0M gas, while our protocol adds more secure operations and reduces the cost of option transfer.


Figure 3: Expected transfer time and successful probability.


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.