From rusty at rustcorp.com.au Thu Nov 22 05:12:54 2018 From: rusty at rustcorp.com.au (Rusty Russell) Date: Thu, 22 Nov 2018 15:42:54 +1030 Subject: [Lightning-dev] [PATCH] First draft of option_simplfied_commitment In-Reply-To: <8027ECDC-1A1D-4372-856B-388A1A5C58CC@mattcorallo.com> References: <87bm6jp42a.fsf@rustcorp.com.au> <1ea6ecfd-0f17-4aab-44c8-3c3e457cc4d6@bluematt.me> <87va4qnj7g.fsf@rustcorp.com.au> <8027ECDC-1A1D-4372-856B-388A1A5C58CC@mattcorallo.com> Message-ID: <8736rtn19l.fsf@rustcorp.com.au> Matt Corallo writes: > Ah, oops, indeed, that is much cleaner :). Still need a CSV of 1, though :(. OK, let's walk through this: Locally offered HTLC: - Local HTLC-Timeout tx is CLTV delayed, but remote can fulfill without delay. Remote offered HTLC: - Local HTLC-Success tx can be done without delay, but remote timeout is CLTV. IOW: - HTLC output scripts get a `1 OP_CSV OP_DROP` in the non-revoked branch: OP_DUP OP_HASH160 OP_EQUAL OP_IF OP_CHECKSIG OP_ELSE + 1 OP_CHECKSEQUENCEVERIFY OP_DROP ... - HTLC-Success tx needs nSequence = 1. - Similarly any self-generated fulfullment tx needs nSequence = 1. Yech. I still want a new RBF rule where if you pay twice the current package *feerate* your tx is accepted, overriding RBF rules 3, 4 & 5. Probably need to increase the effective minrelay feerate for any txs adding to that package, similarly (using that double-previous-package-feerate). That would mean we're back to a single P2WSH(OP_TRUE) with less blockchain spam, and life is simple. But I'll debate this on bitcoin-dev :) Cheers, Rusty.