11-22-2024
BSV
$67.31
Vol 216.93m
-4.56%
BTC
$98015
Vol 123321.58m
3.41%
BCH
$485.64
Vol 2282.17m
8.5%
LTC
$89.11
Vol 1429.79m
5.76%
DOGE
$0.38
Vol 9414.24m
-0.18%
Getting your Trinity Audio player ready...

This post was first published on Medium.

No, not ICO

We show how to develop a crowdfunding platform on Bitcoin. Similar to Kickstarter, funding is all or nothing. That is, if the fundraising target is not reached, the funds are guaranteed to be returned.

Kickstarter Logo

Compared to Kickstarter, our approach is automatically enforced by Bitcoin, does not entrust funds to a trusted third party, and enjoys low fees.

We first introduce a traditional way to achieve this and present an improved version afterwards.

A first try: Lighthouse

Early Bitcoin developer Mike Hearn built a crowdfunding platform Lighthouse based on assurance contracts. It uses SIGHASH flags ALL | ANYONECANPAY.

ANYONECANPAY inputs
ANYONECANPAY inputs can be combined

  • ALL ensures all the funds go to the desired recipient and the total is exactly a certain target. The recipient and target cannot be altered after signing, preventing donations from being redirected.
  • ANYONECANPAY ensures each contributor can pledge independently. Each signs her own input and hands the partially transaction to the recipient, who combine all inputs in a single transaction and redeem the funds.

Note that before the target is reached, the sum of input values is less than the output value, the transaction is invalid and the recipient cannot claim the funds.

Improvement

The above crowdfunding has several drawbacks:

  1. A contributor can withdraw his pledge fund at any moment
  2. The fundraising cannot be oversubscribed. Even if people want to contribute more than the target, the extra amount will be paid as fees to miners, instead of going to the recipient.

To improve, each contributor locks her fund into the following contract and broadcasts a transaction containing it. This commits her fund, which cannot be withdrawn before a deadline.

Contract Crowdfund
Contract Crowdfund

If enough total funds have been raised before the deadline, the beneficiary can collect all pledged funds as in Figure 1, by calling pledge() at Line 13. Otherwise, each contributor can retract her fund after the deadline as in Figure 2, by calling refund() at Line 28.

pledged funds
Figure 2: Campaign failure

Recommended for you

David Case gets technical with Bitcoin masterclass coding sessions
Whether you're a coding pro or a novice, David Case's livestream sessions on the X platform are not to be...
November 21, 2024
NY Supreme Court’s ruling saves BTC miner Greenidge from closing
However, the judge also ruled that Greenidge must reapply for the permit and that the Department of Environmental Conservation has...
November 20, 2024
Advertisement
Advertisement
Advertisement