[Lightning-dev] crowdfunding with SIGHASH_ANYONE_CAN_PAY

Rusty Russell rusty at rustcorp.com.au
Tue Nov 24 23:04:31 UTC 2015


Ryan Grant <bitcoin-dev at rgrant.org> 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 <timeout> 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.


More information about the Lightning-dev mailing list