Ergo and crowdfunding

Translation temporarily unavailable. Showing original English.
Robert Wolf

6 de setembro de 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: Descentralizando a Espinha Dorsal do Ecossistema Ergo

Ergo Infrastructure DAO: Descentralizando a Espinha Dorsal do Ecossistema Ergo

A missão da Ergo sempre foi enraizada na descentralização, não apenas na camada de consenso, mas em toda a pilha.

Ergo Platform

13 de agosto de 2025

Mew Finance: Um Conjunto de Ferramentas DeFi Divertido para o Ecossistema Ergo

Mew Finance: Um Conjunto de Ferramentas DeFi Divertido para o Ecossistema Ergo

Mew Finance é um conjunto de aplicativos descentralizados na Blockchain Ergo.

Ergo Platform

12 de agosto de 2025

Lithos: Descentralizando a Mineração com Pools On-Chain

Lithos: Descentralizando a Mineração com Pools On-Chain

Lithos é um novo protocolo projetado para reformular como os pools de mineração funcionam, movendo-os para on-chain, dando aos min.

Ergo Platform

24 de julho de 2025

Sigma 6.0: Um Ergo Mais Inteligente e Flexível

Sigma 6.0: Um Ergo Mais Inteligente e Flexível

Sigma 6.0 é uma grande atualização proposta para a blockchain Ergo.

Ergo Platform

23 de julho de 2025

Moldando o Futuro de Rosen: Uma Chamada da Comunidade sobre Cinco Propostas Chave do Tesouro

Moldando o Futuro de Rosen: Uma Chamada da Comunidade sobre Cinco Propostas Chave do Tesouro

O co-fundador da Rosen, Armeanio, apresentou cinco novas propostas ao Tesouro de Rosen.

Ergo Platform

9 de julho de 2025

UTXO Estendido da Ergo e a Ascensão da Inteligência Econômica Artificial

UTXO Estendido da Ergo e a Ascensão da Inteligência Econômica Artificial

Uma Visão Prática para Agentes Econômicos Autônomos Agentes econômicos autônomos na blockchain da Ergo realizam trabalho útil em .

Ergo Platform

12 de maio de 2025

ErgoHACK X: Inteligência Artificial na Blockchain Ergo

ErgoHACK X: Inteligência Artificial na Blockchain Ergo

Celebrando uma Década de Inovação Descentralizada Participe do 10º aniversário do ErgoHACK e esteja na vanguarda da revolução da I.

Ergo Platform

10 de abril de 2025

Ergo Pulse com Charles Hoskinson

Ergo Pulse com Charles Hoskinson

“Quando olhamos para as coisas que Alex tem feito, a equipe tem feito e a comunidade tem feito, eles são logicamente consistentes .

Plataforma Ergo

13 de abril de 2022

Mais novo mercado de NFTs em Ergo está ganhando a atenção dos Ergonautas

Mais novo mercado de NFTs em Ergo está ganhando a atenção dos Ergonautas

Em Outubro de 2020, NFTs na blockchain Ergo foram lançados.

Plataforma Ergo

7 de abril de 2022

NIPoPoWs em Ergo: Inovações em Blockchain

NIPoPoWs em Ergo: Inovações em Blockchain

A blockchain Ergo está rapidamente se tornando conhecida dentro do espaço cripto como uma líder em desenvolvimento e inovação em b.

Plataforma Ergo

1 de abril de 2022

Prova de Trabalho, Energia e Ergo

Prova de Trabalho, Energia e Ergo

Introdução Prova de Trabalho (PoW, em Inglês) foi descrita no artigo original de Bitcoin como sendo composta de duas partes.

Plataforma Ergo

29 de março de 2022

Armazenando Ergo: SAFEW

Armazenando Ergo: SAFEW

Neste artigo, continuamos nossa série de guias para configurar e usar uma das muitas novas carteiras Ergo.

Plataforma Ergo

25 de março de 2022

Minerando Ergo no Windows

Minerando Ergo no Windows

Minerar Ergo como parte de uma pool de mineração é fácil, particularmente no Windows.

Plataforma Ergo

17 de março de 2022

What is a DAO (Decentralized Autonomous Organization)?

What is a DAO (Decentralized Autonomous Organization)?

Introduction A decentralized autonomous organization (DAO) is a new type of cooperative.

Ergo Platform

15 de março de 2022

Instruções: Cunhando um Token Não-Fungível (NFT) na Blockchain Ergo

Instruções: Cunhando um Token Não-Fungível (NFT) na Blockchain Ergo

O que é um NFT? Qualquer unidade de uma moeda corrente, como por exemplo o dólar estadunidense, é indistinguível de qualquer outr.

Plataforma Ergo

8 de março de 2022

Blockchain e a Motivação para Ergo

Blockchain e a Motivação para Ergo

Desde o nascimento de Bitcoin, tecnologia blockchain tem sofrido enormes avanços.

Plataforma Ergo

3 de março de 2022

Resultados do ErgoHack III

Resultados do ErgoHack III

Após um bem-sucedido ErgoHack III, o júri tomou sua decisão final! Há tantos projetos maravilhosos que participaram neste último.

Fundação Ergo

1 de março de 2022

A Adoção de Moedas Estáveis está no Horizonte?

A Adoção de Moedas Estáveis está no Horizonte?

Hoje, moedas estáveis lastreadas ao dólar americano (USD) somam quase U$185 bilhões de valor de mercado - um aumento de 500% des.

Plataforma Ergo

24 de fevereiro de 2022

DeFi em Ergo: Taxas usando Tokens Personalizados

DeFi em Ergo: Taxas usando Tokens Personalizados

Moedas de infraestrutura são importantes pois precisamos delas para pagas taxas de transações quando usamos sistemas financeiros.

Plataforma Ergo

22 de fevereiro de 2022

Explicativo Ergo: Aluguel de Armazenamento

Explicativo Ergo: Aluguel de Armazenamento

Resumo do Artigo: Aluguel de Armazenamento é uma taxa por armazenamento de longo prazo na blockchain Ergo.

Plataforma Ergo

18 de fevereiro de 2022

Uma Introdução a Privacidade e Segurança em Blockchain

Uma Introdução a Privacidade e Segurança em Blockchain

Depois que o primeiro artigo científico emergiu na internet em 2008, a tecnologia blockchain evoluiu tremendamente.

Plataforma Ergo

17 de fevereiro de 2022