Flipstarter research: a simple smart contract for assurance payments

21 624
Avatar for emergent_reasons
4 years ago (Last updated: 3 years ago)

The initial assurance payment technology for Flipstarter uses Anyone-Can-Pay transactions. "Flipstarter 500k, 6 independent campaigns" will use that technique.

However we also said that user experience can be improved in the future by using smart contracts. This is the first article where I would like to explore additional techniques that Flipstarter or anyone can use to build voluntary funding solutions. Future articles will cover more sophisticated techniques or techniques that trade some level of trustlessness for better user experience.

Contents

Definitions

  • Assurance payment: Alternative way to say assurance contract, the general idea that funding is done on an all-or-nothing basis to increase fairness from the funder's perspective.

  • Coin: Common name for UTXO.

  • Contract: Short name for smart contracts using Bitcoin Cash p2sh (pay to script hash). More specifically, I will be talking about covenants.

A simple contract for assurance payments

Here is a contract (2020-03 still under review for correctness and safety) that is about as simple as possible for a trustless assurance payment. It allows many independent contracts to be created and then combined in one assurance payment.

All pledges with this contract have three shared requirements (with examples):

  • Forward amount: total output amount must be 1.0 BCH

  • Forward target: must pay to eatBCH#106

  • Expiration: can pay forward before block 700,000; after that can also refund

Each pledge with this contract has two unique requirements (with examples):

  • Refund amount: output amount must be the same as the funding input.

  • Refund target: must pay to the funder's address (or whatever they chose when they created the contract)


With those conditions, the three contracts below are unredeemable alone:


But they are redeemable if they cooperate in one transaction. This basically recreates the Anyone-Can-Pay transaction with contracts:


At or after the expiration block, each contract can also be refunded according to the instructions of the original funder:


How does it compare to Flipstarter version 1 - Anyone-Can-Pay + plugin?

  • Same: It accomplishes the same assurance payment.

  • Better (a lot better): Users can pay directly to a QR code with any common wallet. However wallets are still not smart enough to understand the parameters of the smart contract and show them to the user. The user has to trust that the address shown by a campaign is doing what they expect.

  • Better: Pledges are non-revocable until the campaign expires.

  • Worse: The contract solution requires significant extra implementation complexity due to a lack of infrastructure around creating, funding and redeeming contracts.

  • Worse: An Anyone-Can-Pay transaction can handle over 500 pledges. Due to the limit on single transaction size (100k Bytes for non-miners) + large smart contract size, a single assurance payment with these contracts can only handle about 100~200 pledges.

The complexity can be handled with time and investment.

The limited number of pledges is an issue because of the effective minimum pledge. For example, for a $100,000 campaign like the current Cash Fusion campaign by bitcoin.com, the effective minimum pledge is about $1,000. Although this reflects reality - that large contributions create the vast majority of the value in a campaign, it is not good for engagement and giving everyone a chance to put skin in the game.

Limited pledges can be solved with two techniques:

  1. More sophisticated contracts, which I will discuss in future articles.

  2. Avoiding the minimum problem by using tiers like common crowdfunding sites. Then we get a more reasonable picture.

Conclusion - need time and resources to establish a smart contract solution

The three things necessary for Flipstarter to implement this simple p2sh solution are:

  1. Peer review of the contract correctness and security.

  2. Infrastructure for creating, funding, tracking redeeming Flipstarter smart contracts.

  3. Implementation of fixed tiers instead of allowing people to pledge whatever amount they want between minimum and maximum.

This is one campaign that we could create for Flipstarter itself to fund this development.


Lead image by qimono from Pixabay

Sponsors of emergent_reasons
empty
empty
empty

19
$ 28.10
$ 15.00 from @molecular
$ 2.00 from @rosco
$ 2.00 from @im_uname
+ 13
Avatar for emergent_reasons
4 years ago (Last updated: 3 years ago)

Comments

This is one campaign that we could create for Flipstarter itself to fund this development.

great idea

$ 0.50
4 years ago

Sure

$ 0.00
3 years ago

A turing-funding machine haha.

$ 0.50
4 years ago

Hahaha..really

$ 0.00
3 years ago

Thanks for sharing such valuable information

$ 0.00
3 years ago

Wow amazing information dear thanks for sharing.... 🥰🥰

$ 0.00
3 years ago

I am subscribe your channel

$ 0.00
3 years ago

Very innovative services, but I think its not available here in South East Asia.

$ 0.00
3 years ago

Oh yes .. I like what ur sellin' here 👍

$ 0.10
4 years ago

Good approach, I gotta look into cashscript or spedn (recommendation on what's better?)

$ 0.10
3 years ago

Probably depends on your preference of coding style (check their examples). Both are awesome and developing quickly so keep an eye on both for sure.

$ 0.00
3 years ago

Great

$ 0.00
4 years ago

Good luck to you..its a very nice article to give information to those involve in this business. Im a good catcher of your article. Good luck and God Bless

$ 0.00
3 years ago

Flipstarter at it again! "This is a paradigm shift from any-one-can-pay to smart contract payment system". Kudos to the Flipstarter team!

$ 0.00
3 years ago

Amazing!

$ 0.15
4 years ago

Really very amazing

$ 0.00
3 years ago

🙇‍♂️

$ 0.00
4 years ago

Good luck to your team. This is a great idea. I hope you noticed my article about BCH this is my first time to wrote about bitcoincash in order to grow it especially in my country which is the Philippines.

$ 0.00
3 years ago