2

ANYONECANPAY can be used for crowdfunding, where pledged donations cannot be spent unless funding goal/soft cap is reached. But since output is committed, when soft cap is exceed, all the surplus will go to transaction fee. Any way to make the exceeded part to go to the fundraiser as ICOs typically do?

ALL|ANYONECANPAY

This construction can be used to make a "crowdfunding”-style transaction. Someone attempting to raise funds can construct a transaction with a single output. The single output pays the "goal" amount to the fundraiser. Such a transaction is obviously not valid, as it has no inputs. However, others can now amend it by adding an input of their own, as a donation. They sign their own input with ALL|ANYONECANPAY. Unless enough inputs are gathered to reach the value of the output, the transaction is invalid. Each donation is a "pledge," which cannot be collected by the fundraiser until the entire goal amount is raised.

0

Not by only using SIGHASH_ALL|SIGHASH_ANYONECANPAY. This is because the outputs cannot be modified.

SIGHASH_ALL|SIGHASH_ANYONECANPAY signs all of the outputs but only this one input, and it also allows anyone to add or remove other inputs, so anyone can contribute additional satoshis but they cannot change how many satoshis are sent nor where they go. - https://bitcoin.org/en/developer-guide#signature-hash-types.

But, the fundraiser does not have to submit the transaction that includes additional funds (because that would not benefit them, only miners). Once the first transaction is complete (minimum has been met), then others can verify that the minimum amount of funds have been raised, and then just create a normal transaction to the fundraiser.

  • What if when the minimum is first reached, it is exceeded by a large amount? For example, 1st pledge is 50 Bitcoins and 2nd is also 50 while the minimum is 60. Any way to get around this, with or without ANYONECANPAY? – sinoTrinity Sep 5 '18 at 7:14
  • What do you mean "get around this"? – JBaczuk Sep 5 '18 at 11:58
  • Getting around this constraint and receive full pledged amount, e.g., 50+50 Bitcoins? – sinoTrinity Sep 5 '18 at 20:23
  • You can create multiple transactions. If a funder is worried about not meeting a minimum, then they can wait until the first SIGHASH_ANYONECANPAY transaction confirms. – JBaczuk Sep 5 '18 at 20:43
  • > multiple transactions? What do u mean? > first SIGHASH_ANYONECANPAY transaction confirms? SIGHASH_ANYONECANPAY inputs are merged into a final transaction after minimum is reached and broadcast. What do u mean first tx confirms? There is only 1 tx. – sinoTrinity Sep 10 '18 at 20:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.