Ergo and crowdfunding

Translation temporarily unavailable. Showing original English.
Robert Wolf

6 settembre 2019

What is Crowdfunding?

Crowdfunding is a way of raising capital through the collective efforts of individuals. The campaigns are mostly started via the world wide web and allow projects and businesses to be funded by raising small amounts of money from a large number of people.
One of the best known examples for successful crowdfunding startups is Oculus Rift, a virtual reality headset. The company Oculus VR initiated its campaign in 2012 and was only two years later acquired by Facebook for $2 billion total. Besides the usual startups, there are also a lot of blockchain projects which went the way of crowdfunding, for example, Ethereum, Tron and EOS. Today, numerous platforms exist that allow you to publish your campaign. Some of the bigger ones are Indiegogo, Kickstarter, and Gofundme, only to name a few.
Crowdfunding has a lot of benefits: a wide reach, efficiency, and marketing aspects being the most convincing... But for now, let's get onto what's really important!

Introducing Crowdfunding on Ergo

A few days ago, on August 28th, core developer Kushti stated on the (Ergo forum)[www.ergoforum.org] that he managed to successfully write and implement code that allows users to start a crowdfunding campaign on top of the Ergo blockchain (as mentioned in the whitepaper page 6. This code even works with the current wallet API. Here is a quick guide on how to set up the wallet.
In this article, you will learn how to do exactly that: crowdfunding on top of Ergo! It also takes you through the proposal of the first campaign ever, which is to fund the post-EIP1 crowdfunding script development.
If you want to go into all the details, please read the following section, “The Script”. Otherwise, you can simply skip to reading the “How To Donate”, "How To Collect Donations", and “Crowdfunding Project Proposal” sections below that.

The Script

The simplest crowdfunding script, according to the ErgoScript White Paper (page 6), is “a script for the following crowdfunding situation: a project backer (with key backerPubKey) wishes to give money to a project (with key projectPubKey), but only if the project raises enough money (at least minToRaise) from other sources by a deadline (expressed in terms of HEIGHT).
To give money to the project, the backer will create an output box protected by the following script. The script contains two conditions: one for the case the deadline has passed (enabling the backer to get the money back) and one for the case it succeeded (enabling the project to spend the money if the amount is at least minToRaise before the deadline).

In order to ensure enough money has been raised, the script will search the output collection for a box with a sufficient value going to the projectPubKey. To check where the value of the output box is going, the script will read the script protecting the output box and compare it to the script corresponding to proveDlog(projectPubKey); this script can be obtained byprojectPubKey.propBytes.

As currently the API does not support embedding of custom environment variables (only predefined ones like HEIGHT), the only way to compile the script is to replace such variables in the script from the white-paper with concrete values. For example, consider that a crowdfunding campaign is successful if it is raising 500 Ergs before block number 50,000. For backerPubKey and projectPubKey we can use PK() function which accepts only P2PK serialized keys at the moment. Then the modified script from the WhitePaper becomes the following:

{
   val backerPubKey = PK("9h7DHKSDgE4uvP8313GVGdsEg3AvdAWSSTG7XZsLwBfeth4aePG")
   val projectPubKey = PK("9gBSqNT9LH9WjvWbyqEvFirMbYp4nfGHnoWdceKGu45AKiya3Fq") 
    
   val deadline = 50000
   val minToRaise = 500L * 1000000000 
   
   val fundraisingFailure = HEIGHT >= deadline && backerPubKey
   val enoughRaised = {(outBox: Box) =>outBox.value >= minToRaise 
                              && outBox.propositionBytes == projectPubKey.propBytes
                      }
        
   val fundraisingSuccess = HEIGHT < deadline && projectPubKey && OUTPUTS.exists(enoughRaised)
   fundraisingFailure || fundraisingSuccess                     
 }                              

How to Donate

First of all, JSON is not supporting multi-line strings, so you need to replace line breaks with \n.
Also, quotes are to be escaped, so use " instead of ". The resulting JSON will be sent to /script/p2sAddress.
To donate to a project, first get your address from /wallet/addresses, take e.g. the first of them. Put the address into the backerPubKey, so a request to /script/p2sAddress will look like the following after this step:

{
  "source": "{ 
    val backerPubKey = PK(\"9...\")
    val projectPubKey = PK(\"9gBSqNT9LH9WjvWbyqEvFirMbYp4nfGHnoWdceKGu45AKiya3Fq\")
    val deadline = 50000
    val minToRaise = 500L * 1000000000
    val fundraisingFailure = HEIGHT >= deadline && backerPubKey
    val enoughRaised = {
      (outBox: Box) => 
        outBox.value >= minToRaise && outBox.propositionBytes == projectPubKey.propBytes
    } 
    val fundraisingSuccess = HEIGHT < deadline && projectPubKey && OUTPUTS.exists(enoughRaised) 
    fundraisingFailure || fundraisingSuccess 
  }"
}    

with your address instead of “9…”.

Send the string to /script/p2sAddress to get a response like:

{
  "address": "GB3kh2izpWKvyZfMboQwsEscjPaZcz9WrzGqZB4ZrkzRreiFMV6HZYWXGMK3rqCjDCoPgWGNzfnYSUhivW4a1VRYPE7uZXwKnBcqWcRkiuTx6QW55EcPcWeELUsumwdtKoFtWY583nWnKZff"
}     

Copy address string (GB3… in our example) and send the money to it via /wallet/payment/send . A request to the API method to send 10 Ergs (10 Billion nanoErgs) will be like following:

[
 {
   "address": "GB3kh2izpWKvyZfMboQwsEscjPaZcz9WrzGqZB4ZrkzRreiFMV6HZYWXGMK3rqCjDCoPgWGNzfnYSUhivW4a1VRYPE7uZXwKnBcqWcRkiuTx6QW55EcPcWeELUsumwdtKoFtWY583nWnKZff",
   "value": 10000000000
 }
]

That’s all!

Now the wallet will automatically find the box on the blockchain, as it contains the public key which belongs to the wallet in the refund condition. The wallet then periodically checks whether the box is spendable by constructing a simplest transaction with the box as an input and just one output (to the same address). After refund height (50,000 in our example) the wallet will be able to spend the box and so the box value will be added to /wallet/balances.
Please note that this will not be the case after EIP-1 3 implementation as the wallet will use narrow recognition patterns by then.

How to Collect Donations

The wallet which is associated with the project public key will find incoming boxes on the blockchain. However, it will fail to make sure that boxes are spendable, as the wallet currently is using a simplest transaction for that, and the script is failing for such a spending transaction.
Before /wallet/boxes/uncertain method being implemented, the only way for a project to find incoming boxes. Then /wallet/transaction/send with manually provided (in “inputsRaw”) serialized boxes (use /utxo/byIdBinary to get the serialized box by its identifier).

Kushti did that by himself and got the following transaction.

Please note that EIP-1 will break this workflow as well.

Kushti proposes to raise 500 Ergs before block 50,000 to develop command-line scripts (in Python) for organizing and participating in crowdfunding campaigns after EIP-1 implementation. Command-line scripts are more suitable than doing requests manually and also could be used for building graphic interfaces on top of them.

The treasury did provide half of the funds, so others need to contribute the missing 250 Erg collectively. In case of a campaign failure refunds will be given automatically. As collecting pledges is not trivial at the moment, Kushti will lead the project role, so please use the following key, which is controlled by him:

9gBSqNT9LH9WjvWbyqEvFirMbYp4nfGHnoWdceKGu45AKiya3Fq

In order to donate any amount of money, please follow the “How To Donate” section above with replacing backerPubKey with your public key, and pledge amount with a proper value (please note that it is in nanoErgs, 1 Erg = 1.000.000.000 nanoErgs).

As always, if you have further questions, suggestions or want to participate in the movement, please join our social media channels or forum.

t.me/ergoplatform | t.me/ergo_mining | www.ergoforum.org

Share post

Ergo Infrastructure DAO: Decentralizzare la Spina Dorsale dell'Ecosistema Ergo

Ergo Infrastructure DAO: Decentralizzare la Spina Dorsale dell'Ecosistema Ergo

La missione di Ergo è sempre stata radicata nella decentralizzazione, non solo a livello di consenso, ma in tutto lo stack.

Ergo Platform

13 agosto 2025

Mew Finance: Un Toolkit DeFi Giocoso per l'Ecosistema Ergo

Mew Finance: Un Toolkit DeFi Giocoso per l'Ecosistema Ergo

Mew Finance è una suite di applicazioni decentralizzate sulla Blockchain Ergo.

Ergo Platform

12 agosto 2025

Lithos: Decentralizzare il Mining con Pool On-Chain

Lithos: Decentralizzare il Mining con Pool On-Chain

Lithos è un nuovo protocollo progettato per ristrutturare il funzionamento delle pool di mining spostandole on-chain, dando ai min.

Ergo Platform

24 luglio 2025

Sigma 6.0: Un Ergo più Intelligente e Flessibile

Sigma 6.0: Un Ergo più Intelligente e Flessibile

Sigma 6.0 è un importante aggiornamento proposto per la blockchain Ergo.

Ergo Platform

23 luglio 2025

Plasmare il Futuro di Rosen: Una Chiamata della Comunità su Cinque Proposte Chiave del Tesoro

Plasmare il Futuro di Rosen: Una Chiamata della Comunità su Cinque Proposte Chiave del Tesoro

Il co-fondatore di Rosen, Armeanio, ha presentato cinque nuove proposte al Tesoro di Rosen.

Ergo Platform

9 luglio 2025

L'Extended UTXO di Ergo e l'Ascesa dell'Intelligenza Economica Artificiale

L'Extended UTXO di Ergo e l'Ascesa dell'Intelligenza Economica Artificiale

Una Visione Pratica per Agenti Economici Autonomi Gli agenti economici autonomi sulla blockchain di Ergo svolgono un lavoro utile.

Ergo Platform

12 maggio 2025

ErgoHACK X: Intelligenza Artificiale sulla Blockchain di Ergo

ErgoHACK X: Intelligenza Artificiale sulla Blockchain di Ergo

Celebrare un Decennio di Innovazione Decentralizzata Unisciti al decimo anniversario di ErgoHACK e sii in prima linea nella rivolu.

Ergo Platform

10 aprile 2025

I partecipanti all'Hackaton V: mining and minting

I partecipanti all'Hackaton V: mining and minting

La registrazione per "ErgoHack V: Mining and Minting" è ufficialmente chiusa ed è tempo di esplorare ciò che i partecipanti hanno .

Ergo Platform

11 ottobre 2022

EIP37 Hardfork

EIP37 Hardfork

Dopo il merge di Ethereum, l'industria del mining di criptovalute ha assistito a un impressionante riorientamento del potere di ha.

Ergo Platform

3 ottobre 2022

ErgoHack V: incontra i nostri giudici

ErgoHack V: incontra i nostri giudici

Con le iscrizioni ora aperte, ErgoHack V si sta avvicinando rapidamente.

Ergo Platform

25 settembre 2022

Ergo: Dopo il merge di Ethereum

Ergo: Dopo il merge di Ethereum

Una discussione per la comunità mineraria Sono state un paio di settimane vorticose per l'industria del mining di criptovalute.

Ergo Platform

25 settembre 2022

La tabella di marcia di Ergo: cosa succederà. Parte 1

La tabella di marcia di Ergo: cosa succederà. Parte 1

Dal lancio sulla rete principale di Ergo il 1 luglio 2019, la blockchain ha raggiunto molti traguardi importanti.

Ergo Platform

24 settembre 2022

I premi di ErgoHack V

I premi di ErgoHack V

Con la fusione di Ethereum, stiamo assistendo a un cambiamento sismico nel panorama degli hashrate per le blockchain Proof of Work.

Ergo platform

18 settembre 2022

EIP-0028 di Ergo: ErgoAuth

EIP-0028 di Ergo: ErgoAuth

Quando si parla di blockchain, è importante ricordare che i wallet sono completamente anonimi.

Ergoplatform

4 settembre 2022

The Ergo Manifesto

The Ergo Manifesto

Il Manifesto Ergo desidera educare e offrire una panoramica di ciò che la tecnologia blockchain può raggiungere.

Ergo Foundation

3 settembre 2022

Ergo e il meccanismo di consenso di Autolykos: parte I

Ergo e il meccanismo di consenso di Autolykos: parte I

Quello che segue è un'analisi tecnica approfondita del meccanismo di consenso di Ergo, Autolykos.

Ergo Platform

28 agosto 2022

Ergo e il meccanismo di consenso di Autolykos: parte II

Ergo e il meccanismo di consenso di Autolykos: parte II

La scorsa settimana abbiamo introdotto un'analisi approfondita del meccanismo di consenso Autolykos di Ergo.

Ergo Platform

28 agosto 2022

Come acquistare Ergo da Kucoin

Come acquistare Ergo da Kucoin

Tutti gli aspetti di questo articolo non sono consigli finanziari. Ricontrolla tutte le informazioni fornite da altre fonti.

Ergoplatform

7 agosto 2022

Ethereum Mining Community e GPU Miners: il caso di Ergo dopo la fusione

Ethereum Mining Community e GPU Miners: il caso di Ergo dopo la fusione

Un cambiamento epocale in arrivo nel campo delle blockchain minabili Il panorama del mining di criptovalute Proof of Work sta per.

Ergoplatform

7 agosto 2022

Ergo: una risposta ai fallimenti della teoria monetaria moderna

Ergo: una risposta ai fallimenti della teoria monetaria moderna

Nel 2008, un gruppo o una persona sconosciuta ha rilasciato una riserva di valore peer-to-peer e l’ha chiamata Bitcoin.

Ergo platform

9 febbraio 2022

E' nata Ergoitaly.it

E' nata Ergoitaly.it

La prima community ufficiale Ergo in Italia Ergo è nato l'8 aprile 2019. Alle 20:41.

ErGonario

27 gennaio 2022