12021-07-08T00:22:23  *** belcher_ <belcher_!~belcher@user/belcher> has joined #lightning-dev
  22021-07-08T00:24:58  *** belcher <belcher!~belcher@user/belcher> has quit IRC (Ping timeout: 240 seconds)
  32021-07-08T00:29:19  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
  42021-07-08T00:33:22  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 240 seconds)
  52021-07-08T01:15:40  *** willcl_ark <willcl_ark!~quassel@user/willcl-ark/x-8282106> has quit IRC (Ping timeout: 252 seconds)
  62021-07-08T01:26:05  *** willcl_ark <willcl_ark!~quassel@user/willcl-ark/x-8282106> has joined #lightning-dev
  72021-07-08T01:42:20  *** yonson <yonson!~yonson@2600:8801:d900:7bb::d7c> has quit IRC (Remote host closed the connection)
  82021-07-08T01:42:29  *** yonson <yonson!~yonson@2600:8801:d900:7bb::d7c> has joined #lightning-dev
  92021-07-08T01:44:37  *** yonson <yonson!~yonson@2600:8801:d900:7bb::d7c> has quit IRC (Remote host closed the connection)
 102021-07-08T01:44:46  *** yonson <yonson!~yonson@2600:8801:d900:7bb::d7c> has joined #lightning-dev
 112021-07-08T02:05:57  *** hex17or <hex17or!~hex17or@gateway/tor-sasl/hex17or> has quit IRC (Ping timeout: 244 seconds)
 122021-07-08T02:08:26  *** hex17or <hex17or!~hex17or@gateway/tor-sasl/hex17or> has joined #lightning-dev
 132021-07-08T02:31:18  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
 142021-07-08T02:37:30  *** bitromortac_ <bitromortac_!~admin@gateway/tor-sasl/bitromortac> has quit IRC (Remote host closed the connection)
 152021-07-08T02:37:54  *** bitromortac <bitromortac!~admin@gateway/tor-sasl/bitromortac> has joined #lightning-dev
 162021-07-08T03:04:24  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 265 seconds)
 172021-07-08T03:36:53  *** hex17or <hex17or!~hex17or@gateway/tor-sasl/hex17or> has quit IRC (Ping timeout: 244 seconds)
 182021-07-08T03:38:50  *** hex17or <hex17or!~hex17or@gateway/tor-sasl/hex17or> has joined #lightning-dev
 192021-07-08T03:47:46  *** roasbeef_ <roasbeef_!~roasbeef@172.92.21.52> has quit IRC (Ping timeout: 240 seconds)
 202021-07-08T03:55:36  *** bitdex <bitdex!~bitdex@gateway/tor-sasl/bitdex> has joined #lightning-dev
 212021-07-08T05:02:46  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
 222021-07-08T05:34:36  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 268 seconds)
 232021-07-08T06:31:31  *** hex17or <hex17or!~hex17or@gateway/tor-sasl/hex17or> has quit IRC (Ping timeout: 244 seconds)
 242021-07-08T06:31:51  *** hex17or <hex17or!~hex17or@gateway/tor-sasl/hex17or> has joined #lightning-dev
 252021-07-08T07:32:18  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
 262021-07-08T07:44:00  *** rusty <rusty!~rusty@203.221.41.134> has quit IRC (Ping timeout: 252 seconds)
 272021-07-08T07:47:34  *** gioyik <gioyik!~gioyik@gateway/tor-sasl/gioyik> has quit IRC (Quit: WeeChat 3.1)
 282021-07-08T08:04:47  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 252 seconds)
 292021-07-08T08:46:31  *** cdecker6 <cdecker6!~cdecker@243.86.254.84.ftth.as8758.net> has joined #lightning-dev
 302021-07-08T08:50:47  *** cdecker <cdecker!~cdecker@243.86.254.84.ftth.as8758.net> has quit IRC (Ping timeout: 272 seconds)
 312021-07-08T08:50:47  *** cdecker6 is now known as cdecker
 322021-07-08T09:16:49  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
 332021-07-08T09:45:16  *** aechu <aechu!~major@gateway/tor-sasl/major> has joined #lightning-dev
 342021-07-08T10:03:15  <fiatjaf> _aj_:
 352021-07-08T10:03:17  <fiatjaf> `cltv_expiry_delta` needs to take the `to_self_delay` into account
 362021-07-08T10:03:29  <fiatjaf> I don't follow why that's the case though
 372021-07-08T10:06:33  <_aj_> fiatjaf: suppose you're sending an HTLC across 4 channels A->B B->C C->D D->E ; each of those channels happen to not be very actively maintained so there's a one week "to_self_delay" on each of them, so everyone has plenty of time to sync up the block chain and do justice txs or eltoo-newer-state txs if there's a problem
 382021-07-08T10:07:08  <fiatjaf> ok
 392021-07-08T10:07:23  <_aj_> fiatjaf: if your tx has a 4h (or, more generally, less than 4 weeks) locktime, what happens?
 402021-07-08T10:08:15  <_aj_> fiatjaf: without layered commitments, the C->D channel gets closed, then it takes a week to actually be able to claim the HTLC by which time the timeout is passed, so even if Dave knows the preimage, he's out of luck because Carol can reclaim the funds
 412021-07-08T10:08:16  <fiatjaf> you broadcast the update transaction
 422021-07-08T10:08:24  <fiatjaf> oh
 432021-07-08T10:09:00  <fiatjaf> why? I thought you could broadcast the settlement transaction, and the HTLC is an output from that, no?
 442021-07-08T10:09:04  <_aj_> fiatjaf: with layered commitments, as soon as the C->D state gets dropped to the chain, Dave can reveal the HTLC preimage, at which point Carol can only get the funds if she can do a justic tx (or eltoo newer-state update)
 452021-07-08T10:09:11  <fiatjaf> nevermind, I get it, you can't broadcast the settlement transaction
 462021-07-08T10:09:25  <fiatjaf> what do you mean by "state"?
 472021-07-08T10:09:39  <fiatjaf> update transaction or settlement transaction? (I think these are the terms used in the eltoo paper)
 482021-07-08T10:09:47  <_aj_> update transaction
 492021-07-08T10:10:03  <_aj_> with layered commitments, the update+settlement txs are effectively combined i think
 502021-07-08T10:10:21  <fiatjaf> but how?
 512021-07-08T10:10:29  <_aj_> that's what the email describes?
 522021-07-08T10:10:30  <fiatjaf> you have a script in there with everything mixed?
 532021-07-08T10:10:33  <fiatjaf> haha
 542021-07-08T10:10:36  <fiatjaf> ok, I'll try again
 552021-07-08T10:10:56  <fiatjaf> to read the email
 562021-07-08T10:11:00  <_aj_> iirc, the initial "hey let's close the channel to state X" looks like a 1-input n-output
 572021-07-08T10:11:46  <_aj_> you can then claim any of the n-2 HTLC outputs by revealing a preimage or demonstrating the locktime has passed, but can't *actually* take the funds for any of the n outputs until the "1 week" is up
 582021-07-08T10:11:57  <_aj_> so there's n UTXOs sitting in the utxo db
 592021-07-08T10:13:07  <_aj_> so if you want to go from state X to X+Y, you then have an n-input m-output tx that spends all the n outputs, including the ones that were claimed by revealing a HTLC preimage/etc, and creating m new outputs for state X+Y, and you can then claim any of those HTLCs where the preimage is known, etc
 602021-07-08T10:19:38  <fiatjaf> ok, I'm trying but I can't even ask questions at this point
 612021-07-08T10:21:10  <_aj_> state X=100 is [Carol: 5000 sat, Dave: 6000 sat, HTLC(2000sat, hash, time, C->D), HTLC(1000sat, hash2, time2, D->C)] say
 622021-07-08T10:22:23  <_aj_> so to unilaterally close to that with eltoo layered commitment as i proposed (if i'm remembering it right), you post a tx with 1-input, ie the channel funding tx from way back when, right?
 632021-07-08T10:22:43  <fiatjaf> right, but then state Y=101 is [Carol: 5000 sat, Dave: 9000 sat], how do we make state Z=102? does it spend two outputs from Y or 4 outputs from X?
 642021-07-08T10:23:04  <fiatjaf> _aj_: right
 652021-07-08T10:23:45  <_aj_> and there's immediately 4 outputs: Carol, Dave, and the two HTLCs. None of those can be 100% claimed for another week yet. But the layered commitment says that Dave should be able to reserve the 2000 sat output immediately if he knows the preimage for "hash" to prevent Carol from claiming it in case "time" will have passed before the 1 week does
 662021-07-08T10:24:00  <fiatjaf> where do you post the preimages though?
 672021-07-08T10:24:01  <_aj_> so Dave reveals the preimage for hash and semi-claims that output immeditely
 682021-07-08T10:24:39  <fiatjaf> you edit the presigned transaction to add the preimages? can you do that with anyprevout?
 692021-07-08T10:24:54  <_aj_> so 1-input, 1-output, so there's still 4 utxos with values 5000 6000 2000 1000, but the 2000 one is going to Dave or to state 101 or 102 etc
 702021-07-08T10:25:04  <_aj_> so suppose Carol has state 102
 712021-07-08T10:25:29  <_aj_> and state 102 is [Carol: 8000, Dave: 6000] for simplicity
 722021-07-08T10:26:07  <_aj_> so Carol makes a 4-input, 2-output tx, claiming each of the 5000, 6000, 2000, 1000 outputs, and creating 8000 and 6000 outputs
 732021-07-08T10:26:41  <_aj_> those outputs have a new relative time lock of a week probably (at least in general if there's more than 2 parties in the eltoo channel)
 742021-07-08T10:27:02  <_aj_> but eventually the week passes, and Carol and Dave claim their balances and all is good
 752021-07-08T10:27:03  <fiatjaf> ok, but doesn't Carol have to have that tx beforehand? signed by Dave?
 762021-07-08T10:27:17  <_aj_> she needs the _signature_ beforehand
 772021-07-08T10:27:36  <fiatjaf> no way, this is magic
 782021-07-08T10:27:45  <_aj_> but with ANYPREVOUTANYSCRIPT a single signature can sign all those utxos to a single new output despite them having different values
 792021-07-08T10:28:01  <_aj_> (where the magic fails is being able to include fees in any of this)
 802021-07-08T10:28:56  <fiatjaf> but you can still include fees with anyonecanpay|single, right?
 812021-07-08T10:29:15  <fiatjaf> ok, so Dave signs _once_?
 822021-07-08T10:29:21  <_aj_> for 1-in 1-out SINGLE works great -- so when Dave's revealing the preimage that works
 832021-07-08T10:29:28  <fiatjaf> and then Carol can use Dave's signature for anything?
 842021-07-08T10:29:41  <_aj_> Dave signs once per state, and Carol keeps the signature for the most recent state
 852021-07-08T10:29:49  <_aj_> and that signature's valid for any prior state
 862021-07-08T10:31:23  <fiatjaf> I still don't get where did Dave reveal the preimage
 872021-07-08T10:31:31  <_aj_> well, needs a signature for each active HTLC as well, and it might be like 3 rather than 1)
 882021-07-08T10:31:55  <fiatjaf> also why can't Carol, having Dave's signature that is valid for anything, rewrite Dave's output to her
 892021-07-08T10:32:18  <_aj_> Dave posted state 100, [input: funding tx; output: carol_100, dave_100, htlc1_100, htlc2_100]
 902021-07-08T10:32:44  <_aj_> Dave then revealed the preimage for htlc1, by posting a tx: [input: htlc1_100, output: htlc1_100_for_dave]
 912021-07-08T10:33:27  <_aj_> Carol has a signature that's ANYPREVOUTANYSCRIPT | ALL so it's only valid for the outputs corresponding to state 102
 922021-07-08T10:34:42  *** RubenSomsen <RubenSomsen!sid301948@user/rubensomsen> has joined #lightning-dev
 932021-07-08T10:35:46  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 272 seconds)
 942021-07-08T10:39:20  <fiatjaf> ok, I think I get it
 952021-07-08T10:39:24  <fiatjaf> maybe
 962021-07-08T10:41:09  <fiatjaf> but what if Carol has state 102 but Dave publishes state 100 + the HTLC he had in there?
 972021-07-08T10:42:06  <fiatjaf> that means each state needs to know how to spend each previous HTLC ever created in the channel
 982021-07-08T10:42:27  <_aj_> Carol's tx is either [input: carol_100, dave_100, htlc1_100, htlc2_100, output: carol_102, dave_102] _or_ [input: _, _, htlc1_100_for_dave, _; output: _, _]   (_ = same)
 992021-07-08T10:42:43  <_aj_> yes, it doesn't work with HTLCs, only PTLCs
1002021-07-08T10:42:56  <_aj_> well it works with HTLCs, but you have to remember every HTLC
1012021-07-08T10:43:21  <fiatjaf> ok, I see this is mentioned in the email
1022021-07-08T10:43:58  <fiatjaf> how is it different with PTLCs? I don't follow
1032021-07-08T10:44:16  <fiatjaf> PTLCs aren't each their own transaction that spends from the state also?
1042021-07-08T10:45:07  <_aj_> with PTLCs you reveal the preimage via a signature that you negotiate out of band, you don't need to encode the point/hash into the scriptPubKey
1052021-07-08T10:45:13  *** rusty <rusty!~rusty@103.93.169.121> has joined #lightning-dev
1062021-07-08T10:49:11  <fiatjaf> thank you very much
1072021-07-08T10:49:45  <_aj_> no worries; glad i'd refreshed on this earlier today...
1082021-07-08T11:18:38  <_aj_> rusty: fyi https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-July/019243.html
1092021-07-08T11:19:07  *** bitdex <bitdex!~bitdex@gateway/tor-sasl/bitdex> has quit IRC (Quit: = "")
1102021-07-08T11:38:13  *** rusty <rusty!~rusty@103.93.169.121> has quit IRC (Quit: Leaving.)
1112021-07-08T11:38:22  *** rusty <rusty!~rusty@103.93.169.121> has joined #lightning-dev
1122021-07-08T11:54:49  *** rusty <rusty!~rusty@103.93.169.121> has quit IRC (Ping timeout: 258 seconds)
1132021-07-08T12:33:04  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
1142021-07-08T13:06:00  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 268 seconds)
1152021-07-08T15:33:41  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
1162021-07-08T15:44:25  *** gioyik <gioyik!~gioyik@gateway/tor-sasl/gioyik> has joined #lightning-dev
1172021-07-08T16:07:02  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 252 seconds)
1182021-07-08T17:04:48  *** ryanthegentry <ryanthegentry!~ryanthege@2605:a601:ab05:f800:8847:b0f7:baea:de97> has quit IRC (Quit: Client closed)
1192021-07-08T17:07:05  *** VzxPLnHqr_ <VzxPLnHqr_!VzxPLnHqr@gateway/vpn/protonvpn/vzxplnhqr> has joined #lightning-dev
1202021-07-08T17:08:44  *** VzxPLnHqr <VzxPLnHqr!VzxPLnHqr@gateway/vpn/protonvpn/vzxplnhqr> has quit IRC (Ping timeout: 252 seconds)
1212021-07-08T17:42:13  *** roasbeef <roasbeef!~roasbeef@172.92.21.52> has joined #lightning-dev
1222021-07-08T17:53:29  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
1232021-07-08T19:31:23  *** stonefox <stonefox!~stonefox@user/stonefox> has quit IRC (Quit: The Lounge - https://thelounge.chat)
1242021-07-08T19:32:01  *** stonefox <stonefox!~stonefox@user/stonefox> has joined #lightning-dev
1252021-07-08T19:42:38  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Remote host closed the connection)
1262021-07-08T19:51:35  *** bitromortac_ <bitromortac_!~admin@gateway/tor-sasl/bitromortac> has joined #lightning-dev
1272021-07-08T19:51:50  *** bitromortac <bitromortac!~admin@gateway/tor-sasl/bitromortac> has quit IRC (Ping timeout: 244 seconds)
1282021-07-08T20:17:27  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
1292021-07-08T20:39:53  *** bitromortac_ <bitromortac_!~admin@gateway/tor-sasl/bitromortac> has quit IRC (Ping timeout: 244 seconds)
1302021-07-08T20:40:03  *** bitromortac <bitromortac!~admin@gateway/tor-sasl/bitromortac> has joined #lightning-dev
1312021-07-08T20:46:15  *** nathanael <nathanael!~nathanael@user/nathanael> has quit IRC (Excess Flood)
1322021-07-08T20:46:26  *** nathanael <nathanael!~nathanael@user/nathanael> has joined #lightning-dev
1332021-07-08T20:47:12  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Ping timeout: 252 seconds)
1342021-07-08T20:55:17  *** BlueMatt <BlueMatt!~BlueMatt@ircb.bluematt.me> has quit IRC (Ping timeout: 268 seconds)
1352021-07-08T20:55:27  *** BlueMatt <BlueMatt!~BlueMatt@ircb.bluematt.me> has joined #lightning-dev
1362021-07-08T21:05:22  *** valwal <valwal!~valwal@96.224.58.144> has quit IRC (Ping timeout: 240 seconds)
1372021-07-08T21:05:42  *** dongcarl <dongcarl!~dongcarl@96.224.58.144> has quit IRC (Ping timeout: 272 seconds)
1382021-07-08T21:11:22  *** roasbeef <roasbeef!~roasbeef@172.92.21.52> has quit IRC (Remote host closed the connection)
1392021-07-08T21:24:01  *** roasbeef <roasbeef!~roasbeef@172.92.21.52> has joined #lightning-dev
1402021-07-08T22:29:40  *** bitromortac_ <bitromortac_!~admin@gateway/tor-sasl/bitromortac> has joined #lightning-dev
1412021-07-08T22:29:56  *** bitromortac <bitromortac!~admin@gateway/tor-sasl/bitromortac> has quit IRC (Ping timeout: 244 seconds)
1422021-07-08T22:34:25  *** dongcarl <dongcarl!~dongcarl@96.224.58.144> has joined #lightning-dev
1432021-07-08T22:45:05  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has joined #lightning-dev
1442021-07-08T23:19:40  *** bitdex <bitdex!~bitdex@gateway/tor-sasl/bitdex> has joined #lightning-dev
1452021-07-08T23:25:44  *** bitdex <bitdex!~bitdex@gateway/tor-sasl/bitdex> has quit IRC (Ping timeout: 244 seconds)
1462021-07-08T23:43:19  *** bitdex <bitdex!~bitdex@gateway/tor-sasl/bitdex> has joined #lightning-dev
1472021-07-08T23:58:15  *** AaronvanW <AaronvanW!~AaronvanW@45.161.24.65> has quit IRC (Remote host closed the connection)