From rusty at rustcorp.com.au Tue Nov 24 23:04:31 2015 From: rusty at rustcorp.com.au (Rusty Russell) Date: Wed, 25 Nov 2015 09:34:31 +1030 Subject: [Lightning-dev] crowdfunding with SIGHASH_ANYONE_CAN_PAY In-Reply-To: References: Message-ID: <87mvu3j8xs.fsf@rustcorp.com.au> Ryan Grant writes: > This was an interesting thought experiment for me, but upon reflection > there's no point in trying to do this in Lightning. > > Everyone considering a pledge can sign their part of the transaction, > for free, if they hold any coins on the Bitcoin blockchain. Only the > initiator needs to pay any transaction fee. Sure, but maybe you've got lightning funds already? Let's continue your analysis. We already know the protocol can be extended to pay to anything (what I have been calling "Atomic swap to X"). The general problem with swapping onto the blockchain is that it needs to be able to time out, since the basic deal is of form "I will pay you $5 iff you give me R in the next 24 hours". That can't be done natively in script, but it can be done as follows: First create a tx with a small output with scriptPubkey of form "pay to me, or after pay to anyone". Use that as one input to your crowdfunding tx. After the timeout, anyone can double-spend and thus invalidate the crowdfunding tx (make the amount cover a the expected txfee, and it's free money). Cheers, Rusty.