On March 11, 2021, Ben and I (Nadav) entered into a Discreet Log Contract on the bitcoin blockchain using a multi-oracle DLC. The oracles used were Bitfinex, Pierre Rochard and Suredbits. For the DLC to settle, 2 out of the 3 oracles had to attest to consistent BTC prices at maturity. The multi-oracle scheme can be thought of as analogous to a multisig address in Bitcoin. Typically in a multisig output, 2-of-3 key holders need to authorize any bitcoin transaction. With the DLC in this blog post, 2-of-3 oracles needed to independently agree on the BTC/USD price to activate settlement of the contract.

Using multiple oracles when constructing a DLC is a huge security improvement because our contract is no longer vulnerable to failure in the case that one of our oracles is compromised or becomes inoperable. Likewise, if we used even more oracles (e.g. 3-of-5, 4-of-7, 5-of-9, etc.), then we would be protected against multiple oracle failures (noting that this doesn’t mean you should use untrustworthy oracles). Not only does using multiple oracles offer better security guarantees, but DLC participants who use multiple DLCs are still able to generate fraud proofs for oracles which misbehave without needing to lose funds due to that fraud!

It is important for our example that two oracles (2-of-3) “agree” on the price. However, two oracles don’t need to sign exactly the same price, rather they only need to be “close enough” where how close is up to the DLC participants. For our contract, we decided to allow up to a $128 price difference. We will explain the technical details and considerations behind agreement bounds in the next blog post.

Setup

In this DLC, Ben went long BTC and I went short. Each of us put up $50 in collateral at an initial rate of 57,500 $/BTC. This means we each put up 87,105 satoshis in collateral. As such, our funding output had just over 174,210 satoshis (over due to fees). Ben and I each sent one another 14,826 signatures of off-chain transactions totaling about 5 MB each, which is quite remarkable considering that this covers all of the nearly 10 Quadrillion possible combinations of three numeric outcomes. In total, these signatures ensure that if the price of BTC is below $55,920 I get all funds, if it is above $59,080 then Ben gets all of the funds, and if it is in between then it pays out linearly to the both of us.

Settlement

In our example,Pierre Rochard signed $59,001, Bitfinex signed $59,000 and Suredbits signed $59,016. This means the two of three oracles Ben and I used to settle this DLC were Pierre Rochard and Bitfinex at an execution price of $59,001 resulting in this closing transaction … which gave Ben the vast majority of my collateral. They were our top two oracles in this contract and they differed by only a single dollar, which is far less than the allowed $128.

Whats next

Discreet Log Contracts enable defi on the largest cryptocurrency — Bitcoin. We will continue to provide tooling to help the bitcoin defi ecosystem flourish.

Stay tuned for our next blog post we will go into detail about how multi-oracle contracts are set up, what this $128 agreement bound means as well as how it is enforced!

Resources

Suredbits Slack

DLC Specification

Multi-Oracle Specification (WIP)

Krystal Bull (Oracle) Release

Oracle Explorer

DLC Telegram

DLC Mailing List

 

 

 

 

 

Post comment