Protocol
Security Analysis
A. Codes
B. Proofs
We want to remove the need for upfront collateral from Alice without using a cross-chain bridge. Allowing Alice direct access to the exercise secret risks Bobโs asset since Alice has no collateral. To address this, we resort to economic incentives and let Bob control the exercise secret while Alice retains the right to penalize Bob. In addition to the usual collateral, Bob locks a valuable asset on ๐ถโ๐๐๐๐ด as a guarantee. If Bob fails to release the exercise secret when Alice exercises her right, she receives Bobโs guarantee as compensation, incentivizing Bob to cooperate.
Suppose Alice and Bob reach an agreement that Alice pays Bob ๐ as a premium on a chain denoted by ๐ถโ๐๐๐๐ . The option takes effective at ๐๐ด meaning that Alice obtains the right to exchange ๐ด๐ ๐ ๐๐ก๐ด for ๐ด๐ ๐ ๐๐ก๐ต before ๐๐ธ. Bobโs guarantee is ๐ด๐ ๐ ๐๐ก๐บ .
The protocol involves two kinds of asset settlement: first for option establishment (or activation, we use them interchangably) and second for option exercise. We therefore introduce two secrets:
(1) Activation secret ๐ด, used for Alice to pay the premium and activate the option; and (2) Exercise secret ๐ต, used for Alice to pay ๐ด๐ ๐ ๐๐ก๐ด to Bob in exchange for ๐ด๐ ๐ ๐๐ก๐ต when the option is exercised. Secret ๐ด is generated by Alice and ๐ต is generated by Bob.
The protocol is divided into two phases. Figure 2 shows the execution process of this protocol if both parties are honest.
(1) Setup phase: Alice and Bob activate an option. Alice obtains option and Bob obtains premium.
(2) Exercise/Abandon phase: Alice can either exercise the option or abandon it.
In the setup phase, Alice and Bob will establish this option similarly to a vanilla HTLC. Alice locks ๐ with a hashlock ๐ป(๐ด) in a contract on any chain. Bob creates two contracts, ๐ถ๐๐๐ก๐๐๐๐ก๐ด on ๐ถโ๐๐๐๐ด and ๐ถ๐๐๐ก๐๐๐๐ก๐ต on ๐ถโ๐๐๐๐ต, which are used in the option. The option remains inactive until Alice reveals the activation secret ๐ด before ๐๐ด, at which point the state updates to active and Bob gets Aliceโs premium. ๐ถ๐๐๐ก๐๐๐๐ก๐ด holds Bobโs guarantee, ๐ด๐ ๐ ๐๐ก๐บ , until the option expires. If Alice exercises the option and Bob fulfills his obligation by revealing the exercise secret ๐ต, ๐ด๐ ๐ ๐๐ก๐บ is refunded to Bob. If Bob fails to fulfills his obligation, ๐ด๐ ๐ ๐๐ก๐บ will be transferred to Alice. ๐ถ๐๐๐ก๐๐๐๐ก๐ต locks Bobโs collateral, ๐ด๐ ๐ ๐๐ก๐ต, using ๐ป(๐ต).
I. Setup Phase.
(1) Alice randomly selects a secret ๐ด as activation secret, and computes its hash value ๐ป(๐ด). Bob generates ๐ต and ๐ป(๐ต), which serve as the exercise secret and hashlock.
(2) Alice locks ๐ with hashlock ๐ป(๐ด) on the agree-upon๐ถโ๐๐๐๐ with timeout ๐๐ด + ฮ.
(3) If Bob observes that Alice has honestly deposited the premium, Bob should, at any time before ๐๐ด โ ฮ:
(a) Create ๐ถ๐๐๐ก๐๐๐๐ก๐ด on ๐ถโ๐๐๐๐ด and ๐ถ๐๐๐ก๐๐๐๐ก๐ต on ๐ถโ๐๐๐๐ต. These contracts are initially in an inactive state, and record the holder and writer, activation time ๐๐ด and option expiration time ๐๐ธ.
(b) Escrow the guarantee ๐ด๐ ๐ ๐๐ก๐บ on ๐ถโ๐๐๐๐ด, and lock principal ๐ด๐ ๐ ๐๐ก๐ต on ๐ถโ๐๐๐๐ต with hashlock ๐ป(๐ต).
(4) If Alice observes that Bob has created contracts and made deposits, Alice reveals ๐ด at ๐๐ด on both chains to activate the option. If not, transaction aborts, Bob calls refund() and retrieves ๐ด๐ ๐ ๐๐ก๐บ and ๐ด๐ ๐ ๐๐ก๐ต. Alice refunds ๐.
II. Exercise/Abandon Phase.
(1) Exercise: If Alice wants to exercise the option at ๐๐ต before expiration, she calls exercise() and deposits ๐ด๐ ๐ ๐๐ก๐ด into ๐ถ๐๐๐ก๐๐๐๐ก๐ด, then within one ฮ:
(a) If Bob reveals ๐ต and calls fulfill() on ๐ถ๐๐๐ก๐๐๐๐ก๐ด, then he obtains both ๐ด๐ ๐ ๐๐ก๐ด and ๐ด๐ ๐ ๐๐ก๐บ . Upon observing ๐ต, Alice obtains ๐ด๐ ๐ ๐๐ก๐ต with ๐ต from ๐ถ๐๐๐ก๐๐๐๐ก๐ต.
(b) If Bob does not reveal ๐ต, Alice calls claim() on๐ถ๐๐๐ก๐๐๐๐ก๐ด after ๐๐ต + ฮ to receive ๐ด๐ ๐ ๐๐ก๐บ as compensation.
(2) Abandon: If Alice does not call exercise() before or at ๐๐ธ, then the option is abandoned and Bob can call refund() on ๐ถ๐๐๐ก๐๐๐๐ก๐ด and ๐ถ๐๐๐ก๐๐๐๐ก๐ต to refund ๐ด๐ ๐ ๐๐ก๐บ and ๐ด๐ ๐ ๐๐ก๐ต.
Timeouts. The latest deadline ๐๐ต is no later than ๐๐ธ. If Bob fails to fulfill his obligations, then Alice receives ๐ด๐ ๐ ๐๐ก๐บ by ๐๐ธ + 2ฮ. Therefore, the lock period for ๐ด๐ ๐ ๐๐ก๐บ in ๐ถ๐๐๐ก๐๐๐๐ก๐ด is ๐๐ธ +ฮ if Alice waives the option, or extends to๐๐ธ +2ฮ if Alice exercises the option. Alice exercises the option and receives ๐ด๐ ๐ ๐๐ก๐ต by๐๐ธ +2ฮ. Therefore, the lock period for ๐ด๐ ๐ ๐๐ก๐ต in ๐ถ๐๐๐ก๐๐๐๐ก๐ต is ๐๐ธ + 2ฮ.
4.2.1 Integration: Efficient Cross-Chain Options without Upfront Holder Collateral. We incorporate the efficient option transfer protocol to enable a collateral-free option transfer process. From the option transfer perspective, the roles of the holder and writer are reversed, as Bob owns the exercise secret. Bob deposits ๐ด๐ ๐ ๐๐ก๐บ and ๐ด๐ ๐ ๐๐ก๐ต in ๐ถ๐๐๐ก๐๐๐๐ก๐ด and ๐ถ๐๐๐ก๐๐๐๐ก๐ต. In the transfer of Bobโs position, hashlock ๐ป(๐ต) must remain consistent.
Take Bob transferring writer to Dave as an example. It is similar to the Protocol 4.1.1 with three notable differences. Suppose Bob reaches an agreement with Dave to transfer the writer position. Dave is able to buy Bobโs risky asset with its obligation at the price of ๐ ๐๐๐ก๐๐๐น๐๐ before or at ๐๐ . First, Dave must choose a new hashlock as the exercise secret, and similarly, Bob needs to use his private key ๐ ๐๐ต to sign Daveโs new hashlock ๐ป(๐ท), which means message ๐ = (๐, (Dave.๐๐๐๐๐๐ ๐ , ๐ป(๐ท), ๐๐๐ท )). Second, Alice can use Bobโs private key ๐ ๐๐ต to reclaim ๐ด๐ ๐ ๐๐ก๐ต and guarantee, ๐ด๐ ๐ ๐๐ก๐บ . Third, if Alice wants to exercise the option and makes the deposit after Bob reveals the signature during the transfer process, the transfer continues, and Dave must forward the signature to obtain the writerโs position. Dave should fulfill his obligation and reveal the exercise secret at ๐๐ โ ฮ on ๐ถ๐๐๐ก๐๐๐๐ก๐ด.
As a result of the support for concurrent bidding, our protocol can effectively defend against phantom bid attack. In phantom bid attack, an adversary creates multiple virtual buyers who offer higher prices but do not finalize the transfer. In the previous protocol [12] which attempts to transfer the option to a buyer sequentially, in face of such an attack, the option holder/writer cannot sell their positions in a reasonable time since the virtual buyers are exhausting the option transfer window.
With our proposed protocol, an adversary option buyer cannot launch this attack. This is due to the use of a signature for option transfer settlement, rather than a hashlock used in the previous protocol. By this signature scheme, once a buyer is chosen by the seller, the option transfer can be finalized. There is no time window for the buyer to choose to finalize the option transfer or abort.
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.