From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 838CB982 for ; Tue, 1 May 2018 17:31:39 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id EAB1934F for ; Tue, 1 May 2018 17:31:38 +0000 (UTC) Received: by mail-wr0-f176.google.com with SMTP id g21-v6so11413645wrb.8 for ; Tue, 01 May 2018 10:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Hbjr9CkuUwcKvomkNYzzXKs6LpejoFv1zMaRZcCBt90=; b=oVx5qJ11++h+ctsRIRVvJhG4SI8tspt0do7nPkw05RnaslCPwKtG5nEG5ibggnPbMf J5d2XqX/Z/1cVUNNJz/wyGnIlj5klcL7Y+zXLufMYrqQQ8TrDb+Px19Ww3K8/zenligP nETn7q5Ncq3QUl4neiDf65cMuJm06YNQQ9+MYG4QHpJYl5ZwydM1LefFiR6deowlPR0Z gadzVhCTFHn6tbpXNRFXExZebNEs8D/bmmrBQUriR7JDIYr1gMrm0m/S0zOf2MQ20fYf e5i/Oy9hW2rAf2z6gRCajJCicyJjwJZYEiO9dxyiyt1U4ipQJcfCWtlknRdph8QhT3GH ufAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Hbjr9CkuUwcKvomkNYzzXKs6LpejoFv1zMaRZcCBt90=; b=OKOFkybuDI6xSiUhHwwVawsfvu9d2i30jFMMJhbmN12w/xNpqRUf0VrxpexSeBkrNZ kJcYIYSvNeQ1PsPVcGK2oNEp9ie7JPzEgtbqROyb5Lmx6u8DPffOuj0nKZ8XZQnu1UCn HZ9AkiOt36ljIjrfKBeoh/A/jDQ4i3q7k1leOoFAxNgNKiMbiBkfuGK3V0kHYp0g+8wo hCpKl6WD78wUsBo9lhi1pVUM3IFLSbKz+pRfHbmtQRTN+cW+AJUjYUt2BU12H+i9WuhB UOGOEdyxo+q8sL+Bf+EQ5sK7evHpLJvho3acpQLn23y6Maetba+r4WYdk5hfj9HXt07Q EDtw== X-Gm-Message-State: ALQs6tCumgGCtOYmZ/nODiq09KuJEvQTmUhH5DE8x4/Bw0NKOcEcQvjM sZa6wVHbN7lIekUwxF8xZWo= X-Google-Smtp-Source: AB8JxZpTGxWRtwg1o2MvtahjD47Ix1seo7+MotxNnLeCU5q7HtHu5zXwQ0sM7Me+T9nlpTuxzWZUSA== X-Received: by 2002:adf:b839:: with SMTP id h54-v6mr12311198wrf.141.1525195897619; Tue, 01 May 2018 10:31:37 -0700 (PDT) Received: from localhost ([2a02:aa16:1102:5480:e99:3f63:40a2:83e9]) by smtp.gmail.com with ESMTPSA id i10sm11102876wmf.24.2018.05.01.10.31.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 May 2018 10:31:36 -0700 (PDT) From: Christian Decker To: Jim Posen In-Reply-To: References: <874ljsitvx.fsf@gmail.com> <87vac7hakf.fsf@gmail.com> <87in87gx0q.fsf@gmail.com> Date: Tue, 01 May 2018 19:31:28 +0200 Message-ID: <87bmdzgu4v.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] eltoo: A Simplified update Mechanism for Lightning and Off-Chain Contracts X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2018 17:31:39 -0000 Jim Posen writes: > I'm still not following why this doesn't accumulate. > > In the example route, let's look at it from the point of view of C. C sees > the following regardless of whether D or E or someone behind E is the last > hop in the route: > > B -> HTLC(expire = X + delta) -> C -> HTLC(expire = X) -> D > > So D is not required to reveal the preimage before time X, and in the case > of an on-chain settle, C needs to be able to redeem the HTLC output through > the timeout clause before time X + delta. C can't redeem the HTLC (with > sufficient confirmations) at least until the settlement transaction is > confirmed. So it seems to me that regardless of the overall route and the > maximum CSV on it, the delta for the C hop has to be greater than the CSV > delay on the update transaction. And that this must be true at every hop > for the same reason. That'd be a purely reactionary behavior, i.e., chosing the delta in such a way that I can both settle the channel and have enough time to react to turn around and reveal the preimage. So with the assumptions we had before (CSV = 144 and CLTV delta = 144) you'd have an effective delta of 288 on each hop, yes. That's basically the case in which each channel reacts serially. You can trivially parallelize these closures by looking ahead and noticing that each hop really just cares about its own closure deadline, i.e., each node just cares to close 288 blocks before the CLTV expires, not that its delta w.r.t. to the downstream channel is that far in the future. So all we care about is that once we are due to give the upstream hop the preimage we've already closed the downstream channel and can now read the HTLC preimage from that channel. The CSV timeout isn't part of the delta on each hop, but we need to implement the deadline computation as: ``` CLTV - CLTV delta - CSV ``` instead of LN-penaltiy's ``` CLTV - CLTV delta ```