BSV
$53.28
Vol 34.11m
-7.43%
BTC
$96507
Vol 49655.33m
-2.23%
BCH
$452.05
Vol 400.59m
-3.47%
LTC
$99.79
Vol 934.66m
-4.79%
DOGE
$0.31
Vol 6137.02m
-8.87%
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

Google unveils ‘Willow’; Bernstein downplays quantum threat to Bitcoin
Google claims that Willow can eliminate common errors associated with quantum computing, while Bernstein analysts noted that Willow’s 105 qubits...
December 18, 2024
WhatsOnChain adds support for 1Sat Ordinals with new API set
WhatsOnChain now supports the 1Sat Ordinals with a set of APIs in beta testing; with this new development, developers can...
December 13, 2024
Advertisement
Advertisement
Advertisement