{"type":"rich","version":"1.0","author_name":"npub1g6vxlp4e0nyhs2dqxxcryztyf5f5hyuaq93nw4r87zcnv0sdsa0qqsl5wd","author_url":"https://nostr.ae/npub1g6vxlp4e0nyhs2dqxxcryztyf5f5hyuaq93nw4r87zcnv0sdsa0qqsl5wd","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2017-02-06\n📝 Original message:\nI created a possible step by step protocol with checks that each step is\nsafe.\n\nI think your scheme needs a 2nd timeout, so Bob has a time between Alice\nbroadcasting AliceSecret and Alice closing the channel with TX2.\n\nTX1\n\nInput\n1 from Alice\n1 from Bob\n\nOutput\n1:  (Alice + Bob + timeout(2T)) OR (Bob + AliceSecret)\n1:  (Bob + timeout(T)) OR (Alice + AliceSecret)\n\nTX2\n\nInput\nTX1:1: signed by (Alice + Bob)\nOutput\nInitial channel paying Alice 100%\n\nProcess:\n\nStep 1\n\nAlice creates TX1, signs it and sends it to Bob.\n\nIf Alice refuses this step, then nothing has happened, so it is a safe\nabort.\n\nStep 2\n\nBob signs it and sends Alice the tx hash.\n\nBob could sign and broadcast it.  If he does that, then Alice spends her\noutput to get her money back, so it is a safe abort.\n\nIf Bob refuses to complete this step, Alice should spend her input to\nprevent Bob broadcasting the TX1 later.  This is also a safe abort.\n\nNOTE:\n*  This is an ongoing check Alice must perform.\n*  If (timeout / 2) passes before all the steps are completed, Alice should\ntry to\n**    double spend her input into TX1\n**    spend her output from TX1\n\nStep 3\n\nAlice creates TX2, signs it and sends it to Bob.\n\nIf Alice refuses to complete this step, then Bob simply discards TX1.\nAlice can't broadcast it since she does not have a fully signed version of\nTX1.\n\nStep 4\n\nBob signs TX2 and sends it to Alice.\n\nIf Bob refuses to complete this step, the Alice should spend her input or\nher output of TX1 (if Bob has broadcast TX1).  This is a safe abort.\n\nStep 5\n\nBob broadcasts TX1\n\nIf Bob refuses to complete this step, the Alice should spend her input.\nThis is a safe abort.\n\nStep 6\n\nAlice should make sure TX1 is included in the chain without mutation.\n\nIf it is ok, then Alice does nothing.\n\nIf it is mutated, then Alice should spend her output immediately.\n\nIf Alice refuses to complete this step, then Bob can reclaim his money\nafter the timeout and Alice loses access to her money.  Alice has an\nincentive to complete this step.\n\nStep 7 (mutated TX only)\n\nBob can spend his output using AliceSecret.\n\nIf Bob refuses to complete this step, then he doesn't get his money, but\nAlice is not harmed.\n\nStep 7 (valid setup)\n\nBob spends his output after the timeout.  Once he has spent his output,\nthen the channel is setup.\n\nThere is a potential race condition here.\n\nAfter the timeout has expired, Alice could broadcast 2 transactions\n- TX2 (to close the channel paying Alice 100%)\n- transaction to spend TX1/1 (i.e. Alice + Alice secret)\n\nBob would be broadcasting his transaction to claim TX1/1 at around the same\ntime.\n\nThe network might accept Alice's 2 transactions, before Bob has a chance to\nclaim TX1/0 (with Bob + AliceSecret).\n\nAdding an extra timeout with the later expiry to TX1/0 means that Alice\ncannot broadcast TX2 until Bob has a chance to claim his output.\n\n\nOn Mon, Feb 6, 2017 at 2:25 AM, Nicolas Dorier \u003cnicolas.dorier at gmail.com\u003e\nwrote:\n\n\u003e Alice opening channel of 1BTC\n\u003e\n\u003e Input:\n\u003e 1 BTC From Alice\n\u003e 1 BTC From Bob\n\u003e Output:\n\u003e 1 BTC Alice+Bob OR Bob+AliceSecret\n\u003e 1 BTC Bob+Timeout OR Alice+AliceSecret (aka the bounty)\n\u003e\n\u003e If bob is unresponsive, Alice can get the bounty.\n\u003e If Alice unresponsive, bob can get the bounty after timeout.\n\u003e If Alice takes the bounty, Bob can take the escrow .\n\u003e\n\u003e If Alice responsive, bob wait for getting the bounty. The use of the\n\u003e channel will start after bob get the bounty back.\n\u003e\n\u003e\n\u003e\n\u003e\n\u003e _______________________________________________\n\u003e Lightning-dev mailing list\n\u003e Lightning-dev at lists.linuxfoundation.org\n\u003e https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev\n\u003e\n\u003e\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20170206/ea7b8785/attachment.html\u003e"}
