From aj at erisian.com.au Mon Oct 11 06:29:51 2021 From: aj at erisian.com.au (Anthony Towns) Date: Mon, 11 Oct 2021 16:29:51 +1000 Subject: [Lightning-dev] Lightning over taproot with PTLCs In-Reply-To: <20211009011207.GA3984@erisian.com.au> References: <20211009011207.GA3984@erisian.com.au> Message-ID: <20211011062951.GA5165@erisian.com.au> On Sat, Oct 09, 2021 at 11:12:07AM +1000, Anthony Towns wrote: > 2. The balance transaction - tracks the funding transaction, contains > a "balance" output for each of the participants. > 3. The inflight transactions - spends a balance output from the balance > transaction and provides outputs for any inflight htlc/ptlc transactions. > 4. Layered transactions - spends inflight htlc/ptlc outputs by revealing > the preimage, while still allowing for the penalty path. I don't think the layering here quite works: if Alice forwarded a payment to Bob, with timeout T, then the only way she can be sure that she can either reclaim the funds or know the preimage by time T is to close the channel on-chain at time T-to_self_delay. Any time later than that, say T-to_self_delay+x+1, would allow Bob to post the inflight tx at T+x (prior to Alice being able to claim her balance directly due to the to_self_delay) and then immediately post the layered transaction (4, above) revealing the preimage, and preventing Alice from claiming the refund. Cheers, aj