Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A0239C000B for ; Fri, 28 Jan 2022 17:21:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 88FE784DF6 for ; Fri, 28 Jan 2022 17:21:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -4.2 X-Spam-Level: X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7-Lbqg8UlQfT for ; Fri, 28 Jan 2022 17:21:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by smtp1.osuosl.org (Postfix) with ESMTPS id 304C684DF4 for ; Fri, 28 Jan 2022 17:21:24 +0000 (UTC) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (authenticated bits=0) (User authenticated as jlrubin@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 20SHLL3D011370 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 28 Jan 2022 12:21:22 -0500 Received: by mail-lf1-f41.google.com with SMTP id x7so13109036lfu.8 for ; Fri, 28 Jan 2022 09:21:22 -0800 (PST) X-Gm-Message-State: AOAM533qnJcbb++TEs9vtmDzQryKFQR1iqNM3aVwOrbouZrcqoJOQw7O C7dM9ogrO6fqh/4ng9CV/jR7X9BiBa9yhCulWGg= X-Google-Smtp-Source: ABdhPJxHH6KP+AwE5tjGXx4pS2zsD4hDiHaljvq8F71FVjWIMPl1xoP5bSmwMRKrC6nxZuNVO/UVuBAZbxjBWx/5xAU= X-Received: by 2002:a05:6512:21c2:: with SMTP id d2mr6722969lft.247.1643390480903; Fri, 28 Jan 2022 09:21:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jeremy Date: Fri, 28 Jan 2022 09:21:09 -0800 X-Gmail-Original-Message-ID: Message-ID: To: Lloyd Fournier , Bitcoin Protocol Discussion Content-Type: multipart/alternative; boundary="000000000000d7727705d6a7a99f" Cc: dlc-dev@mailmanlists.org Subject: Re: [bitcoin-dev] CTV dramatically improves DLCs X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2022 17:21:25 -0000 --000000000000d7727705d6a7a99f Content-Type: text/plain; charset="UTF-8" Lloyd, This is an excellent write up, the idea and benefits are clear. Is it correct that in the case of a 3/5th threshold it is a total 10x * 30x = 300x improvement? Quite impressive. I have a few notes of possible added benefits / features of DLCs with CTV: 1) CTV also enables a "trustless timeout" branch, whereby you can have a failover claim that returns funds to both sides. There are a few ways to do this: A) The simplest is just an oracle-free CTV whereby the timeout transaction has an absolute/relative timelock after the creation of the DLC in question. B) An alternative approach I like is to have the base DLC have a branch ` CTV` which pays into a DLC that is the exact same except it removes the just-used branch and replaces it with ` CTV` which contains a relative timelock R for the desired amount of time to resolve. This has the advantage of always guaranteeing at least R amount of time since the Oracles have been claimed to be non-live to "return funds" to parties participating 2) CTV DLCs are non-interactive asynchronously third-party unilaterally creatable. What I mean by this is that it is possible for a single party to create a DLC on behalf of another user since there is no required per-instance pre-signing or randomly generated state. E.g., if Alice wants to create a DLC with Bob, and knows the contract details, oracles, and a key for Bob, she can create the contract and pay to it unilaterally as a payment to Bob. This enables use cases like pay-to-DLC addresses. Pay-to-DLC addresses can also be constructed and then sent (along with a specific amount) to a third party service (such as an exchange or Lightning node) to create DLCs without requiring the third party service to do anything other than make the payment as requested. 3) CTV DLCs can be composed in interesting ways Options over DLCs open up many exciting types of instrument where Alice can do things like: A) Create a Option expiring in 1 week where Bob can add funds to pay a premium and "Open" a DLC on an outcome closing in 1 year B) Create an Option expiring in 1 week where one-of-many Bobs can pay the premium (on-chain DEX?). See https://rubin.io/bitcoin/2021/12/20/advent-23/ for more concrete stuff around this. There are also opportunities for perpetual-like contracts where you could combine into one logical DLC 12 DLCs closing 1 per month that can either be payed out all at once at the end of the year, or profit pulled out partially at any time earlier. 4) This satisfies (I think?) my request to make DLCs expressible as Sapio contracts in https://rubin.io/bitcoin/2021/12/20/advent-23/ 5) An additional performance improvement can be had for iterative DLCs in Lightning where you might trade over a fixed set of attestation points with variable payout curves (e.g., just modifying some set of the CTV points). Defer to you on performance, but this could help enable some more HFT-y experiences for DLCs in LN Best, Jeremy -- @JeremyRubin On Mon, Jan 24, 2022 at 3:04 AM Lloyd Fournier via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > Hi dlc-dev and bitcoin-dev, > > tl;dr OP_CTV simplifies and improves performance of DLCs by a factor of *a lot*. > > > --000000000000d7727705d6a7a99f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Lloyd,

This is an excellent write up, the idea and benefits are clear.
<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ;font-size:small;color:#000000">
= Is it correct that in the case of a 3/5th threshold it is a total 10x * 30x= =3D 300x improvement? Quite impressive.

I have a few notes of possib= le added benefits / features of DLCs with CTV:

1) CTV also enables a = "trustless timeout" branch, whereby you can have a failover claim= that returns funds to both sides.
<= br>
There are a few ways to do this:<= /div>

A) The simplest is just an oracle-free <STH(timeout tx)> CTV wh= ereby the timeout=C2=A0transaction=C2=A0has an absolute/relative timelock a= fter the creation of the DLC in question.

B) An alternative approach = I like is to have the base DLC have a branch `<STH(begin timeout)> CT= V` which pays into a DLC that is the exact same except it removes the just-= used branch and replaces it with `<STH(timeout tx)> CTV` which contai= ns a relative timelock R for the desired amount of time to resolve. This ha= s the advantage of always guaranteeing at least R amount of time since the = Oracles have been claimed to be non-live to "return funds" =C2=A0= to parties participating


2= ) CTV DLCs are non-interactive asynchronously third-party unilaterally crea= table.

What I mean by this is that it is possible for a single party = to create a DLC on behalf of another user since there is no required per-in= stance pre-signing or randomly generated state. E.g., if Alice wants to cre= ate a DLC with Bob, and knows the contract details, oracles, and a key for = Bob, she can create the contract and pay to it unilaterally as a payment to= Bob.

This enables use cases like pay-to-DLC addresses. Pay-to-DLC ad= dresses can also be constructed and then sent (along with a specific amount= ) to a third party service (such as an exchange or Lightning node) to creat= e DLCs without requiring the third party service to do anything other than = make the payment as requested.


3) CTV DLCs can be composed in interesting ways

Options over DLC= s open up many exciting types of instrument where Alice can do things like:=
A) Create a Option expiring in 1 wee= k where Bob can add funds to pay a premium and "Open" a DLC on an= outcome closing in 1 year
B) Create = an Option expiring in 1 week where one-of-many Bobs can pay the premium (on= -chain DEX?).

=C2=A0See=C2=A0https= ://rubin.io/bitcoin/2021/12/20/advent-23/ for more concrete stuff aroun= d this.

There are also opportunities for perpetual-like contracts= where you could combine into one logical DLC 12 DLCs closing 1 per month t= hat can either be payed out all at once at the end of the year, or profit p= ulled out partially at any time earlier.

4) This satisfies (I think?)= my request to make DLCs expressible as Sapio contracts in https://rubin.io/bitcoin/2021/12= /20/advent-23/

5) An additional performance improvement can be ha= d for iterative DLCs in Lightning where you might trade over a fixed set of= attestation points with variable payout curves (e.g., just modifying some = set of the CTV points). Defer to you on performance, but this could help en= able some more HFT-y experiences for DLCs in LN

Best,

Jeremy

On Mon, Jan 24, 2022 at 3= :04 AM Lloyd Fournier via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote= :
Hi dlc-dev and bitcoin-de=
v,

tl;dr OP_CTV simplifies and improves performance of DLCs by a factor of *a =
lot*.

--000000000000d7727705d6a7a99f--