🔥 Join in Trading Popular Crypto Futures and Win an $8,888 Airdrop Reward!
How to Participate:
1️⃣ Click to register and select "Join Now."
2️⃣ Trade specified coins, accumulate 1,000 USDT to earn a $2-$10 reward!
🎯 Specified Coins: SOL, XRP, KOMA, SOON, SUI, LPT, etc.
🎈 Total prize pool of $8,888, first come, first served!
🎁 Join Now: https://www.gate.io/campaigns/299
Bitlayer Research: OP-DLC 2大道至简
Original Title: "Bitlayer Core Technology: DLC and Its Optimization Considerations"
Original authors: mutourend & lynndell, Bitlayer Research Group
1. Introduction
Discreet Log Contract (DLC) is a contract execution framework based on oracle machines proposed by Tadge Dryja at MIT in 2018. DLC allows two parties to make conditional payments based on predefined conditions. The possible outcomes are agreed upon and pre-signed by both parties, and these pre-signed agreements are used to execute payments when the oracle signs the result. Therefore, DLC enables new applications for decentralized finance while ensuring the security of Bitcoin deposits.
The previous article "DLC Principle Analysis and Its Optimization Thinking" summarized the advantages of DLC in privacy protection, complex contracts, and low asset risk, and also analyzed the problems of Secret Key risk, Decentralization Trust Risk, and collusion risk in DLC, and introduced decentralized oracles, threshold signatures, and optimistic challenge mechanisms into DLC to solve various problems it should face. Because the DLC involves three participants, Oracle Machine, Alice, and Bob, the conspiracy between different participants is relatively complex, resulting in relatively complex prevention strategies. Complex defense strategies are not perfect, do not conform to simplicity, and lack the beauty of simplicity.
In Bitcoin, any behavior of any participant needs to be implemented through a UTXO. Therefore, using the Consensus Mechanism to ensure that the UTXO is correct is resistant to arbitrary attacks. Similarly, in DLC, any behavior of any party needs to be implemented through a CET (Contract ution Transaction). Therefore, if you use the optimistic challenge mechanism to ensure that the CET is correct, you will be able to resist arbitrary attacks. Specifically, after Oracle Machine stake the 2B TC, you will be able to sign the CET. Add an optimistic challenge mechanic to CET. If the CET is not challenged, or if the challenge is successfully tackled, the CET is correct, the Settlement can be completed, Oracle Machine the stake is released, and the fee is paid; If Oracle attempts to do evil, anyone can successfully challenge, the CET will not Settlement, the Oracle Machine will lose its stake, and the Oracle Machine will no longer be able to sign the same CET. In line with the simplicity of the avenue, with simple beauty.
2. DLC Principle
Alice and Bob sign a bet agreement: bet on whether the hash value of the ξth block is odd or even. If it is odd, Alice wins the game and can withdraw the assets; if it is even, Bob wins the game and can withdraw the assets. Use DLC to pass the information of the ξth block through an oracle machine to construct a conditional signature so that the correct winner can win all the assets.
The elliptic curve generator is G, and the order is q. The Oracle Machine, Alice, and Bob have their respective key pairs (z, Z), (x, X), (y, Y).
Funding Transaction (on-chain): Alice and Bob create a funding transaction together, each locking 10 BTC in a 2-of-2 multisig output (one public key X belongs to Alice, and one public key Y belongs to Bob).
Building CET (off-chain): Alice and Bob create CET 1 and CET 2 for spending investment transactions.
Oracle Machine calculates the commitment R = k · G, and then calculates S and S'
S := R - hash(OddNumber, R) · Z
S' := R - hash(EvenNumber, R) · Z
The new public keys corresponding to Alice and Bob are as follows:
PK^{Alice} := X + S
PK^{Bob} := Y + S'.
Settlement (off-chain->on-chain): When the first Block is successfully generated, the corresponding CET 1 or CET 2 is signed Oracle Machine according to the hash value of the Block.
If the hash is odd, the Oracle Machine signs as follows s
s := k - hash(OddNumber, R) z
Broadcast CET 1.
If the hash is even, the Oracle Machine signs s'
s' := k - hash(EvenNumber, R) z
Broadcast CET 2.
Withdrawal (on-chain): If the oracle broadcasts CET 1, Alice can calculate a new private key and spend the locked 20 BTC.
sk^{Alice} = x + s
If the oracle broadcasts CET 2, then Bob can calculate a new private key and spend the locked 20 BTC
sk^{Bob} = y + s'
Bitlayer research team found that: in the above process, any action needs to be implemented through CET. Therefore, only need to use the optimistic challenge mechanism to ensure the correct CET, it can resist any attack. Incorrect CET will be challenged, not executed, while the correct CET will be executed. In addition, the Oracle Machine needs to pay the price for malicious behavior.
If the program to be challenged is f(t), CET should be constructed as follows.
s = k - hash(f(t), R) z.
Assuming the actual situation is that the hash value of the ξ block is an odd number, i.e. f(ξ) = OddNumber, the oracle machine should sign CET 1
s := k - hash(OddNumber, R) z.
However, the Oracle Machine maliciously modifies the function value to Even and signs CET 2:
s' := k - hash(EvenNumber, R) z.
Therefore, any user can thwart this malicious behavior based on f(ξ) ≠ OddNumber.
3.OP-DLC 2
OP-DLC includes the following 5 provisions:
If Oracle_sign is honest, Disprove-CET 1 transaction cannot be initiated, and CET settlement will be executed after 1 week. In addition, the Oracle Machine stake will be unlocked and receive fees;
If Oracle_sign is dishonest, i.e., anyone successfully initiates a Disprove-CET 1 transaction and successfully spends connector A output, the signature of the oracle is invalid, resulting in a loss of 2B TC staked, and the oracle will no longer be able to initiate the same result signature for the DLC contract in the future. Because the Settle-CET 1 that relies on the connector A output will be permanently invalidated.
Advantages:
Disadvantages:
4. Conclusion
OP-DLC introduces optimistic challenge mechanism into CET, ensuring that incorrect CET is not settled and corresponding malicious oracle machine loses stake; ensuring that correct CET is executed, and oracle machine stake is unlocked and receives fees. This method can resist arbitrary attacks and has simplicity and beauty.
Reference