From aj at erisian.com.au Mon Nov 30 01:25:54 2015 From: aj at erisian.com.au (Anthony Towns) Date: Mon, 30 Nov 2015 11:25:54 +1000 Subject: [Lightning-dev] Return to the Layered Commit Transactions? In-Reply-To: <20151127212742.GA17286@sapphire.erisian.com.au> References: <20151125090754.GA29895@debian> <878u5krtts.fsf@rustcorp.com.au> <20151127051446.GA4583@sapphire.erisian.com.au> <20151127212742.GA17286@sapphire.erisian.com.au> Message-ID: <20151130012554.GA22914@sapphire.erisian.com.au> On Sat, Nov 28, 2015 at 07:27:42AM +1000, Anthony Towns wrote: > (You might want to add further constraints on the timeout based on fees, > of course -- the above is what you need to avoid being left holding > the bag) You might also want to batch the timeouts, so if you have 1000 concurrent HTLCs on a channel at any point in time [0] and expect 10% of them to timeout, you'd be better off expiring them in five batches of 20, rather than individually. That way you can spend them all to a single output, saving you both 19*34 bytes in that transaction, but also something like 19*130 bytes when you want to actually spend the outputs. (With 40 satoshi/byte fees @ $350/BTC, that's an overall saving of 2c or more per batched HTLC) Cheers, aj [0] I think the 100kB standardness limit on transactions means you can have at most about 3000 concurrent committed HTLCs on a channel, assuming your anchor is a single multisig transaction, and your outputs are all P2SH.