Next Article in Journal
Enhancing Aerospace Industry Efficiency and Sustainability: Process Integration and Quality Management in the Context of Industry 4.0
Next Article in Special Issue
Exploring the Acceptance and User Satisfaction of AI-Driven e-Learning Platforms (Blackboard, Moodle, Edmodo, Coursera and edX): An Integrated Technology Model
Previous Article in Journal
Why Uncertainty in Deep Learning for Traffic Flow Prediction Is Needed
Previous Article in Special Issue
The Impact of E-Learning Technologies on Entrepreneurial and Sustainability Performance
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Building a Blockchain-Based Decentralized Crowdfunding Platform for Social and Educational Causes in the Context of Sustainable Development

by
Bogdan Tiganoaia
1,* and
George-Madalin Alexandru
2
1
Entrepreneurship and Management Department, National University of Science and Technology POLITEHNICA Bucharest, 060042 Bucharest, Romania
2
Computer Science Department, National University of Science and Technology POLITEHNICA Bucharest, 060042 Bucharest, Romania
*
Author to whom correspondence should be addressed.
Sustainability 2023, 15(23), 16205; https://doi.org/10.3390/su152316205
Submission received: 3 October 2023 / Revised: 7 November 2023 / Accepted: 15 November 2023 / Published: 22 November 2023
(This article belongs to the Special Issue Sustainable Education and Technology Development)

Abstract

:
Blockchain technology contributes to achieving the Sustainable Development Goals. Education for sustainable development (ESD) is UNESCO’s education sector response to the urgent and dramatic challenges the planet faces. The traditional way of donating money to charitable causes, such as education, has been through centralized methods and organizations that lack transparency, and donors often do not have a clear understanding of how their contributions are being utilized. Blockchain technology, particularly, platforms like Ethereum and Polygon, has the potential to address the issues associated with traditional donation systems. This paper proposes a decentralized web3 application that utilizes blockchain technology to enhance transparency and efficiency in educational donations in the context of sustainable development. The platform leverages decentralized protocols and smart contracts to ensure secure and transparent transactions, enabling donors to track the utilization of their contributions and ensuring their funds reach their intended beneficiaries. This paper discusses the design and implementation of the platform, highlighting its features and potential for transforming the landscape of charitable donations. This software application can be used in education, and a demo plus some scenarios/work cases are presented/analyzed. The main results and contributions open other future research directions for not only authors.

1. Introduction

The goals for sustainable development, named the SDGs, means a total of 17 general targets with a highlight on sustainable development aspects related to:
  • Education, poverty, and equality.
  • The changes in climate, infrastructure, water, and land.
  • Production and consumption.
The target for these SDGs is the year 2030.

About Sustainability Education

UNESCO shares knowledge, produces information, and provides policy support plus technical guidance to its Member States. It implements projects related to the SDGs. It also acts as an advocate with one objective: that governments are able to provide quality Climate Change Education (CCE) [1].
Education for sustainable development is an exciting new field. The objective is to highlight the connections between the environment, society, and economy. This contributes to a sustainable future [2]:
  • Students are able to understand and apply the concepts (at a basic level) and principles related to sustainability.
  • Students know about sustainability viewed as a triad: economic plus ecological plus social systems.
Today, the blockchain is an important and new technology. Its impact is related to:
  • The economy, as it can transform interactions (it is about social interactions);
  • Public institutions;
  • Our relationship with the environment [3].
How does blockchain technology contribute to achieving the SDGs? The answer can be considered as follows:
  • Blockchain technology has apps that regard sustainable goals in different ways.
  • It offers resilience and security capabilities, without any implications that may harm third parties.
  • The blockchain guarantees precision in the surveillance of actions [4]. We can use smart contracts, which validate the actions that occur within the blockchain.
The paradigm shift that started with blockchain technology can be seen in the world’s biggest companies like Google, IMB, and Meta (formerly Facebook), which are adopting this technology to build new decentralized applications or to integrate it into already existing products to enhance security, transparency, and innovation.
Decentralized applications are software apps that live and run on the blockchain instead of on a single server. These applications can benefit from security (most blockchains use cryptographic algorithms to secure data), user privacy, and a lack of censorship.
Blockchain technology is most commonly used in the financial and banking industries, with protocols like AAVE allowing you to stake digital assets like cryptocurrencies and stable coins to receive incentives and borrow assets against your collateral. The advantages of blockchains can also benefit the educational industry:
  • Shah et al. [5] presented a combined approach in which they integrated a blockchain for storing student information, used a machine learning algorithm to forecast the potential job roles for students post-graduation, and evaluated the outcomes using various machine learning methods.
  • Zhang et al. [6] presented an innovative approach aimed at improving the management of teaching information in higher education with the integration of blockchain technology.
  • Gresch et al. [7] presented a fresh technique for enhancing the transparency of educational certificates with the application of blockchain technology. They integrated blockchain networks at every stage of the system, ensuring the secure transmission of student certificates.
People often donate money to charities because they wish to give back to society and their communities, because they believe in a certain cause, or because they have experienced some traumatic events and the donations of others have been helpful to them or their loved ones. Some of the main causes that people donate money to support include, for example:
  • Disaster relief: to assist those affected by natural disasters like earthquakes, hurricanes, and floods.
  • Health causes: to assist those in need of financial assistance for surgeries or to support research into diseases such as cancer, Alzheimer’s, or Parkinson’s.
  • Animal shelters.
  • Education: to support local schools and universities as well as to provide scholarships and school supplies for students in need.
With the development of technology, donations can now be made using a variety of channels, including social media, online donation platforms, and SMS. The Blackbaud Institute conducted research on charitable giving [8], and it estimated that the total amount of donations made in the United States in 2021 was around USD 46.4 billion, of which USD 2.9 billion came from online donations, representing a 42% increase in overall online giving since 2019. The problem with these traditional ways of donating money to charities is that they lack transparency. Centralized organizations, also known as banks, handle the processing of donated money, and most of the time, the donors do not have a clear understanding of how their contributions are being utilized. Furthermore, the distribution of the raised funds may be slow and bureaucratic, with funds often taking a long time to reach the intended beneficiaries.
The technology of distributed and decentralized networks has advanced significantly over the past few years, particularly blockchain technology. Numerous public decentralized blockchain protocols like Bitcoin, Ethereum, Elrond, and Polygon have been developed and are used by millions of users daily. This paper proposes an alternative solution to the conventional methods of donating funds to charities, which uses a decentralized blockchain protocol and allows users to transparently see how all the contributions are being utilized to support each cause. This paper is divided into seven sections: the second presents the motivation and the weaknesses of the existing centralized methods; the third presents the main concepts and technologies (such as blockchain, smart contracts, wallets, Ethereum, and Polygon); the fourth describes the proposed solution and its implementation; the fifth illustrates a short demo of the platform; the sixth discusses the security of the smart contract; and the final section wraps up this article and discusses some ideas for future development.

2. Motivation

To design the solution and a smart contract, we started with the problems of the existing tools that we want to solve or improve, namely:
  • High fees: By using a public blockchain protocol, such as Polygon, we can eliminate the commissions applied by donation collection platforms. However, in order to interact with the platform, in particular, with its smart contract, users have to pay fees imposed by the Polygon network to secure it. These fees are significantly lower compared with existing platforms. For example, if we compare the fees of 2.9% + USD 0.30 for each transaction on the GoFundMe platform with the fees paid to the Polygon network for a donation of USD 100, we obtain the following results:
    GoFundMe: out of USD 100, USD 3.2 is tax-represented and USD 96.8 reaches beneficiaries
    Proposed solution: out of USD 100 paid to MATIC, the full amount will reach the balance of the contract, with the user paying separately a transaction fee of MATIC 0.00015112, which means less than USD 0.001 (calculated taking into account the network load at that time and using the price of 0.61 USD/MATIC on 11 June 2023).
  • Bureaucracy and delays: Some platforms, such as DonorsChoose, use a platform campaign verification process to ensure that they follow some rules and standards. Due to the public nature of the smart contract, anyone can interact with it and create new campaigns. After the completion and expiration of the campaign deadline, their initiators can immediately use the amounts collected, without any further delays.
  • Lack of transparency: This is a sensitive and difficult issue to address. Although most platforms provide users with a transparent way to track the progress of donations after the end of the campaign and the transfer of money to beneficiaries, there is no longer a possibility to follow how they are used to support the case. The proposed solution implements, with smart contracts, a functionality in which the initiators of the campaigns must provide a description of the transaction, the address of the recipient, and the amount they intend to use. For example, there may be a campaign that aims to raise donations for the purchase of beds to equip a ward in a hospital. After the end of the campaign, after the necessary funds are collected, the initiator of the campaign can use the platform to send the necessary amount to the bed merchant. This can be performed using a form that completes the description of the transaction (for example, the name of the beneficiary hospital and the number of beds purchased can be mentioned), the amount of the transaction, and the address of the consignee (in the case of the above-mentioned example, the address of the bed trader, which can theoretically be verified on the official website of the trader). All these transactions are public and available both on the blockchain and within the platform, providing transparency to donors and the opportunity to monitor the progress and use of donations.
  • Geographical limitation: As mentioned above, platforms are generally only available in certain countries, such as the United States and some countries in Europe or Asia. Due to the decentralized idea of the blockchain, the proposed solution is available regardless of the geographical region in which the users are located, provided that the law of the country in which the activity takes place allows the holding and trading of cryptocurrencies [9].

3. Main Concepts and Technologies

3.1. Blockchain

Blockchain technology is considered by universities as an approach to improving the teaching and learning process. It encourages the participation of all stakeholders like
(1)
Undergraduates;
(2)
Professors;
(3)
Family members [10].
Blockchain technology is based on Distributed Ledger Technology (DLT), which enables direct transactions between users without the need for intermediaries or a centralized authority to oversee them [11]. Transactions are validated with a consensus mechanism within an interconnected network of computers.
What is a blockchain? In 1991, Stuard Haber and W. S. Stornetta published a paper titled “How to Time-Stamp a Digital Document” [12], in which they proposed a method for digitally time-stamping documents using hash functions, digital signatures, and data stored in blocks. This paper is considered to be the first description of the blockchain concept. Now, we refer to the term “blockchain” as a distributed database or ledger that is shared among the nodes of a computer network and stores data into blocks that are chained together using different consensus algorithms. Being open and distributed, the blockchain provides immutability, security, and transparency.
In 2008, Satoshi Nakamoto published a paper titled “Bitcoin: A Peer-to-Peer Electronic Cash System”, in which he proposed a decentralized financial instrument using a digital currency called Bitcoin. It proposes a “peer-to-peer network using proof-of-work to record a public history of transactions” [13].
There are several organizations with connections in the development of a blockchain, such as:
  • IBM is the most involved and a principal investor.
  • Mastercard is another organization that has over 100 blockchain patents filed. This company uses technology to increase protection against fraud and to reduce transaction costs [14].
According to Investopedia [15], the three biggest blockchain companies are
  • → Coinbase Global Inc. (San Francisco, CA, USA)—COIN;
  • → Canaan Inc. (Beijing, China)—CAN;
  • → Galaxy Digital Holdings Ltd. (New York, NY, USA)—BRPHF.
Last, but not least, some authors used blockchain technology to develop the BookChain project—a secure library book for storing and sharing in academic institutions. For details, please visit [16]. Another application of blockchain technology is an electronic voting system—for more information, see [17].

3.2. Cryptocurrency

A cryptocurrency is a decentralized digital currency that uses cryptography to secure transactions and that lives on a blockchain, which may be interpreted as a public digital ledger that records all transactions made using the cryptocurrency. In contrast with traditional fiat currencies, cryptocurrencies are not issued, regulated, or backed by any financial institution. Instead, the transactions are verified and approved by a network of users that uses various consensus algorithms such as Proof-of-Work or Proof-of-Stake.
The popularity of blockchain technology and cryptocurrencies increased considerably after the launch of Bitcoin in 2009. As stated on CoinMarketCap’s website (https://coinmarketcap.com, accessed on 10 September 2023) [18], on 23 April 2023, there were 23,562 cryptocurrencies with a total market capitalization of USD 1.17 trillion. According to a report conducted by Crypto.com (for more information see https://crypto.com/, accessed on 10 September 2023), on-chain data analysis revealed that the total number of global crypto owners reached 425 million in December 2022 [19].
In addition, according to the “Developer Report” by Electric Capital, there are 23,343 active developers in crypto monthly.

3.3. Polygon

The blockchain Trilemma [20] covers the challenges faced by developers in building a blockchain that is secure, decentralized, and scalable without sacrificing any of these characteristics.
Even though it sacrificed its scalability, the Ethereum Foundation has focused its efforts on building a decentralized and secure blockchain. As a result, transactions can be slow and expensive. According to the Etherscan website (see [21]), on 24 April 2023, the average gas price was around Gwei 44, which means that a simple transaction on the Ethereum network costs about USD 1.78 and takes roughly three minutes to complete.
As stated on their website, “Polygon is a Layer 2 scaling solution” (see [22]). As a Layer-2 protocol, Polygon intends to increase transaction speed and reduce costs for users rather than duplicate Ethereum’s functionalities.
The native cryptocurrency of the Polygon Network is MATIC. As a comparison, the current number of transactions made on Ethereum per second is around 11, while on Polygon, it is 34. However, Polygon promises the potential of over 7000 transactions per second. If we look at the cost and completion time of a simple transaction, the average gas price on 24 April 2023 was Gwei 439.6, which means that a transaction costs about USD 0.00823 and takes between 30 and 60 s to complete. Compared with Ethereum, this is 3 to 6 times faster and 215 times less expensive.

3.4. Sustainable Development Goals

Some important SDGs (selection from a set of 17 Goals) include:
  • Goal No. 1: NO POVERTY;
  • Goal No. 4: QUALITY in EDUCATION;
  • Goal No. 5: GENDER EQUALITY;
  • Goal No. 7: CLEAN ENERGY and AFFORDABLE ENERGY;
  • Goal No. 11: SUSTAINABLE CITIES AND COMMUNITIES.

4. Application for Social and Educational Causes

The web platform in this study is designed to facilitate interaction between blockchain and the deployed smart contract by creating an intuitive and user-friendly interface to create new campaigns and donate money to support the causes. The platform is developed using Next.JS (NodeJS [23] is also a solution for developers) framework, which is a React framework that enables the creation of full-stack web applications (for more information, see [24]).
The modules of the application are described below.

4.1. Frontend

The frontend part of the application is developed using React, HTML, and CSS, and its role is to provide an interactive and intuitive interface for users to easily interact with the platform. Also, this module facilitates communication between the user, the smart contract, and the backend of the application. Using the frontend, users can view and donate cryptocurrencies to already-running campaigns, create a new campaign, and claim raised funds for their own campaigns.

4.2. Backend

The backend part of the application is developed using JavaScript language, and its role is to handle the server-side logic, data storage, and communication with other systems.

4.3. IPFS module

4.3.1. The IPFS

The IPFS (InterPlanetary File System) is “a peer-to-peer hypertext protocol designed to preserve and develop the knowledge of humanity by transforming the web into an up-to-date, resilient and more open platform” [25]. It was created to solve the problems of scalability, redundancy, and censorship associated with traditional architectures for storage and file transfer. This protocol is ideal for the proposed platform because we can use it to store large files outside the blockchain network, such as pictures, and to store only immutable and permanent links to those files on the blockchain.

4.3.2. The IPFS Module

The platform interface provides the ability to add a representative picture for each campaign. In the contract, there is no possibility of storing pictures for campaigns. The classic solution would be to add the pictures to a database (more info about databases and SQL in [26]), but this would limit the decentralized nature of the proposed solution. To avoid using a centralized database specific to the platform, we chose to use the IPFS protocol to store campaign images and saved the reference to the picture uploaded on IPFS in the contract for each campaign. Subsequently, this reference is used by the application interface to retrieve the picture from the IPFS and display it to users.

4.4. Wallet Connect

In order to use the platform, it is mandatory to have a wallet. When a wallet is created on the blockchain, it generates two paired keys: a public key that is used for identification and a private key that is used for authorization (e.g., for signing transactions). In the new Web 3.0 iteration, decentralized applications will now authenticate users by using wallets.
For implementing the connection to a crypto wallet, RainbowKit (https://www.rainbowkit.com, accessed on 15 of September 2023 [27]) is used, which is a React library that facilitates the wallet connection to decentralized applications.

4.5. Smart Contracts

Smart contracts are programs that are stored on a blockchain and run when predetermined conditions are achieved. Smart contracts are used to automate the running of an agreement. There is no involvement of intermediaries or time loss. Smart contracts can automate workflows. They can trigger the next action when conditions are achieved [28]. A smart contract works as a simple “if/when...then...” statement. These statements are inserted into the code of the blockchain. When the transaction is finished, the blockchain is then updated. The conclusion refers to the fact that the transaction cannot be changed. Another important aspect here is that only parties who have been granted permission can view the results (based on [28]). The concept of “smart contracts” was first introduced in the early 1990s by computer scientist Nick Szabo in his work titled “Formalizing and Securing Relationships on Public Networks” [29]. Bitcoin is the first blockchain that uses this new concept, with Vitalik Buterin affirming in the Ethereum whitepaper that “Bitcoin protocol actually does facilitate a weak version of a concept of “smart contracts”” [30].
Nowadays, smart contracts are implemented in numerous blockchain protocols, such as Ethereum [21,31] and Elrond [32], and can be seen as self-executing programs that ensure that the terms of an agreement are respected or fulfilled without the need for trust among the involved parties.
The smart contract for our applications is developed using Solidity. It is an object-oriented high-level language used for smart contracts. Ethereum is considered the most known and secure blockchain, with a total of more than 500,000 validators as of December 2022. The main disadvantage of it is that it has a low level of scalability; it can only process 10–30 transactions per second, resulting in high gas fees. To solve the scalability issue and to avoid the high gas fees of the Ethereum network, which is seen as a Layer-1 blockchain, we chose to use the Polygon network. It is an overlay of Ethereum, also known as a Layer-2 protocol, that offers higher speed and lower gas fees. This Layer-2 protocol can handle around 700 TPS, and the gas fees are around USD 0.01 per transaction. The contract is deployed on the Polygon public blockchain, and users can interact with it using either the platform or directly on the blockchain using the Polygon scan website. The smart contract was developed by the authors without any additional cost.
Figure 1 shows the scheme of the contract and the data structures used. The data structures used are as follows:
  • Donation: for each donation, this structure retains the donated value and the address of the donor;
  • Transaction: for each transaction made by the campaign initiators, this structure retains the donated value, the address of the recipient, and a description of the transaction;
  • Campaign: this structure is used to retain information relevant to a campaign, namely: an ID, name, objective, balance, address of the originator, number of donations, a deadline saved in UNIX timestamp format (UNIX timestamp = number of seconds past from 1 January 1970 until now), a description of the campaign, a flag to know whether or not the campaign is over, a reference to the image of the campaign uploaded to the IPFS, and the final amount raised.
The structure of an intelligent contract is similar to the structure of a class in an object-oriented language such as C++ or Java. The “Crowdfunding” contract encapsulates the main functionality of the crowdfunding platform and provides the necessary functions and mapping for the management of campaigns, donations, and transactions. It contains the following attributes and methods:
  • Attributes:
    • Owner: the address of the contract owner;
    • indexOfCampaign: the global variable used to assign a unique ID to each campaign;
    • Campaigns: the map structure that associates the ID of a campaign with the structure of the campaign;
    • userDonationPerCampaign: mapping that retains the amount donated by each donor for each campaign;
    • donationsPerCampaign: mapping that retains donations for each campaign;
    • transactionsPerCampaign: mapping that retains transactions performed for each campaign after its completion.
  • Methods:
    • createCampaign: a function that allows users to create a new campaign, check the deadline to ensure it is in the future, register the campaign in the campaigns mapping, and increment indexOfCampaigns;
    • Donate: allows users to donate to a campaign, check the amount donated, update the campaign balance, record the donation in the DonationsPercampaign mapping, and increase the number of donations for the campaign;
    • endCampaign: allows the owner of a campaign to end the campaign, check that the campaign is still active and the deadline has been exceeded, and update the status of the campaign;
    • useFunds: allows the owner of a campaign to use the funds collected, check various conditions such as the fact that the campaign has been completed, the caller is the owner, the balance of the campaign is not zero, the amount used is positive, etc., update the campaign balance, record the transaction in mapping transactionsPerCampaign, and transfer the funds to the recipient;
    • getCampaign: getter function that returns information about a campaign;
    • getBalanceOfContract: getter function that returns the balance of the contract;
    • getUserDonationPerCampaign: getter function that returns the amount donated by a specific user for a specified campaign;
    • getCampaigns: returns a list of “Campaign” structures that represent all the campaigns created so far;
    • getDonationsPerCampaign: returns a list of “Donation” structures that represent all registered donations for a specified campaign;
    • getTransactionsPerCampaign: returns a list of “Transaction” structures that represent all transactions performed for a specified campaign.
The following diagram—see Figure 2, represents how the crowdfunding platform is structured:

5. A Short Demo for Educational Campaigns

An Introduction to Ethereum

Ethereum is a technology that is home to digital money, global payments, and applications [33].
Ethereum is a decentralized open-source blockchain platform that natively supports smart contracts. It was first introduced in 2014 by Vitalik Buterin in his paper entitled “Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform” [30] and later launched in 2015. When the Ethereum network originally started, it relied on a proof-of-work consensus system that let miners compete by solving mathematical problems to add new blocks to the chain and earn Ether as a reward. Later, in 2022, Ethereum switched to a proof-of-stake algorithm. In this new proof-of-stake model, miners stake their own Ether into a smart contract and use it as collateral in order to validate new blocks and earn rewards in Ether proportional to the amount they staked.
Ether (ETH) is the native cryptocurrency of the Ethereum network. As stated on their website, “Ether is the main internal crypto-fuel of Ethereum” [33], and it is used as payment for transaction fees when users interact with the network or as collateral for staking in order to secure the network and earn rewards.
Regarding Ethereum, two important concepts can be discussed:
  • Accountability in Ethereum—for details, see [34].
  • Anonymity in Ethereum—for details, see [35].
In this section, we will illustrate how you can use the platform to create a charity or educational campaign, donate to different causes, and claim the raised funds after the campaign goal is reached. Blockchain technology can be used for developing applications for other uses such as voting applications in non-profit systems (universities, communities, etc.). These applications can be described by use case. Next, we detail a short demo for educational campaigns.
Step 1: When you first access the platform—see Figure 3, you will be redirected to the Donate page where you can see all the ongoing campaigns.
Step 2: If you click on the “Create campaign” button, a form for creating a new campaign will be displayed—see Figure 4.
Step 3: After you fill the form by adding a title, telling your story, and setting the goal (in MATIC) and the deadline for your campaign, at the bottom of the form, you will see a message that informs you that you should first connect your wallet in order to create a new campaign—see Figure 5. You can connect your wallet using the button at the top right corner.
Step 4: After you click on the “Connect wallet” button—see Figure 6, a new modal will appear, from which you can choose the wallet provider you want to use.
Step 5: After you connect your wallet, in the right top corner, you will see some information regarding your wallet like the balance of your account and a part of your public address. Also, a submit button will appear on the bottom of the form. After clicking on the “Submit new campaign” button, you will be asked to sign a transaction because this way you interact with the smart contract, which is deployed on the Polygon Mumbai testnet. Figure 7, Figure 8 and Figure 9 show some other aspects related to a new campaign.
Step 6: After successfully creating the campaign, you can either close the modal or choose to go to the campaign page. We chose to close the modal and go to the “Donate” page—see Figure 10 and Figure 11, where we were able to see the newly created campaign.
Step 7: You can now click on the newly created campaign, and a new page will open displaying relevant information for the campaign like the amount raised, the number of days left, the number of backers, the number of donations, the story, and a list with all the donations.
Step 8: Now, you can support this campaign. First, you need to fill in the amount of MATIC you want to donate and after that, you can click on the “Donate” button. You will be asked again to sign a transaction and after the transaction is complete, a message will be displayed. Some other aspect related to the campaign can be viewed in the Figure 12, Figure 13, Figure 14, Figure 15, Figure 16, Figure 17, Figure 18 and Figure 19.
Step 9: After closing the modal, we now can see that the campaign raised 100% of the goal. Also, we can see the list of donations.
Step 10: Now, if we scroll down, we can see an “End Campaign” section. This section only appears when you are the owner of the contract. After successfully raising all the funds needed for your campaign or after the deadline has passed, you can click on the “Finish campaign” button to end the campaign and claim the raised amount. You will be asked again to sign a transaction, and after the transaction is finished, a new message will appear on the screen.
All the interactions with the smart contract can also be found on Polygon scan, which provides users with a transparent view of what is happening on the crowdfunding platform.

6. Security of the Smart Contract—Unit Testing

Unit tests are a form of software testing that focuses on verifying the individual functionality of its smallest components, called units. These can be functions, methods, or classes of an application. The main purpose of unit tests is to validate the correct behavior and functionality of these units. You can develop your apps by using [36] and monitor them by using [37].
In the blockchain environment, a single mistake can compromise the security of the contract and implicitly of its funds. Once a contract is loaded on a blockchain, it becomes public and immutable, and any errors in the contract can no longer be resolved. These errors can lead to contract vulnerabilities that can be exploited by malicious users, and for this reason, contract testing is a necessary step.
The Hardhat development environment also provides support for testing contracts by writing unit tests. In Figure 20, the coverage percentage of the code with the unit tests written for the verification of the contract is presented. It measures the coverage of instructions, decision-making branches, functions, and lines in the code. The percentage for covering branches is 94.74% because we failed to simulate the case where the transfer of cryptocurrencies between the contract and an external address fails.

7. Contributions, Future Work, Limitations and Conclusions

7.1. Contributions

This platform aims to demonstrate the potential of blockchain technology and decentralized applications, provide a decentralized and transparent system for creating and managing crowdfunding campaigns, and enable greater trust and accountability between donors and recipients in the field of charitable giving to support educational causes. Some contributions include:
  • Bibliographic research on the paper topic: Polygon, Ethereum, blockchain, smart contracts, etc.;
  • The design of the platform (including the architecture of the platform);
  • The implementation of the web application, which consists of the frontend and backend;
  • The implementation of smart contracts for the platform;
  • A short demo for charity and educational campaigns.
This project tries to innovate by providing a decentralized solution for raising funds for schools, students, and the educational field in general. It uses the latest technologies like Next.JS for the web platform development and also combines blockchain protocols like Polygon, which is the network where the smart contract is deployed, and IPFS, where the platform stores images to not limit the decentralized character of the proposed solution.

7.2. Future Work

The platform’s next stage is to offer a brand-new, improved user interface. Also, we plan to integrate multiple blockchains and cryptocurrencies, explore the use of non-fungible tokens (NFTs) as a means of incentivizing donations, and integrate smart contracts to automate and streamline fund distribution. Blockchains can reshape the educational system as we know it. In this context, blockchains provide significant benefits that can secure processes. Blockchains create security and trust, as they eliminate the need for an intermediary to validate transactions.

7.3. Limitations

Generally speaking, the desire for objectives like decentralization, transparency, and privacy has limitations. Also, the platform’s user interface and experience are still in their early stages. The user interface is on the second version and could also be improved.
Regarding the application, it is not fully decentralized due to some data that are not stored on the blockchain, and we aim for them to be improved or corrected in case of errors. The application stores information like images or descriptions of the charities and any other relevant data.

7.4. Conclusions

The Sustainable Development Goals (more info in [38])—SDGs—are a set of 17 general targets focused on sustainable development issues. The following is a selection from this set of 17 goals:
  • Goal no 2: Zero hunger;
  • Goal no 3: Good health plus well-being;
  • Goal no 6: Clean water plus sanitation;
  • Goal no 8: Decent work plus economic growth;
  • Goal no 9: Industry, innovation, and infrastructure;
  • Goal no 10: Reduced inequalities;
  • Goal no 12: Responsible consumption plus production;
  • Goal no 13: Climate action;
  • Goal no 14: Life below the water;
  • Goal no 15: Life on the land;
  • Goal no 16: Justice, peace, and strong institutions;
  • Goal no 17: Partnerships for goals.
According to this direction, in this paper, we propose a decentralized web3 application that utilizes blockchain technology and addresses the problems of traditional donation systems by creating a platform where people can create and manage charitable campaigns to support educational causes, all of which are performed by interacting with a smart contract deployed on a public blockchain. The platform leverages decentralized protocols and smart contracts to ensure secure and transparent transactions, enabling donors to track the utilization of their contributions and ensure their funds reach their intended beneficiaries. The main contributions are highlighted in a separate section. The limitations and future works are also provided. The software application can be used for now in education, but not only, and it will have some new features in the near future.

Author Contributions

Methodology, B.T. and G.-M.A.; Software, G.-M.A.; Validation, G.-M.A.; Investigation, B.T.; Resources, B.T.; Writing—original draft, G.-M.A.; Writing—review & editing, B.T.; Visualization, G.-M.A.; Project administration, B.T.; Funding acquisition, B.T. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by POLITEHNICA BUCHAREST.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Education for Sustainable Development. Available online: https://www.unesco.org/en/education-sustainable-development (accessed on 2 May 2023).
  2. What Is Sustainability Education? 2021. Available online: https://online.sou.edu/degrees/education/msed/curriculum-and-instruction-stem/what-is-sustainability-edu/ (accessed on 2 May 2023).
  3. Sirimanne, S.N.; Freire, C. How Blockchain Can Power Sustainable Development. 2021. Available online: https://unctad.org/news/how-blockchain-can-power-sustainable-development (accessed on 2 May 2023).
  4. Blockchain and Its Impact on the SDGs (Sustainability Objectives). Available online: https://icommunity.io/en/blockchain-sdgs/ (accessed on 2 May 2023).
  5. Shah, D.; Patel, D.; Adesara, J.; Hingu, P.; Shah, M. Integrating machine learning and blockchain to develop a system to veto the forgeries and provide efficient results in education sector. Vis. Comput. Ind. Biomed. Art 2021, 4, 18. [Google Scholar] [CrossRef] [PubMed]
  6. Zhang, L.; Ma, Z.; Ji, X.; Wang, C. Blockchain: Application in the System of Teaching Informatization Management of Higher Education. In Proceedings of the 2020 3rd International Conference on Smart BlockChain (SmartBlock), Zhengzhou, China, 23–25 October 2020; pp. 185–190. [Google Scholar] [CrossRef]
  7. Gresch, J.; Rodrigues, B.; Scheid, E.; Kanhere, S.S.; Stiller, B. The Proposal of a Blockchain-Based Architecture for Transparent Certificate Handling. In Business Information Systems Workshops. BIS 2018; Abramowicz, W., Paschke, A., Eds.; Lecture Notes in Business Information Processing; Springer: Cham, Switzerland, 2019; Volume 339. [Google Scholar] [CrossRef]
  8. MacLaughlin, S.; Perrotti, E.; Thomson, A. Charitable Giving Report. Blackbaud Institute. February 2022. Available online: https://institute.blackbaud.com/wp-content/uploads/2022/03/BBI_CGR_2022.pdf (accessed on 24 April 2023).
  9. The World’s Leading Cryptocurrency Platform. Available online: https://crypto.com/ (accessed on 2 May 2023).
  10. Chinnasamy, P.; Ramani, D.R.; Ayyasamy, R.K.; Jebamani, B.J.A.; Dhanasekaran, S.; Praveena, V. Applications of Blockchain Technology in Modern Education System—Systematic Review. In Proceedings of the 2023 International Conference on Computer Communication and Informatics (ICCCI), Coimbatore, India, 23–25 January 2023. [Google Scholar] [CrossRef]
  11. Michael, J.; Cohn, A.; Butcher, J.R. Blockchain technology. Journal 2018, 1, 35–45. Available online: https://www.steptoe.com/a/web/171269/3ZEKzc/lit-febmar18-feature-blockchain.pdf (accessed on 20 April 2023).
  12. Haber, S.; Stornetta, W.S. How to Time-Stamp a Digital Document; Springer: Berlin/Heidelberg, Germany, 1991; pp. 437–455. [Google Scholar]
  13. Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. 2008. Available online: https://bitcoin.org/bitcoin.pdf (accessed on 20 April 2023).
  14. Cernian, A.; Vlasceanu, E.; Tiganoaia, B.; Iftemi, A. Deploying blockchain technology for storing digital diplomas. In Proceedings of the CSCS23: The 23th International Conference on Control Systems and Computer Science, Bucharest, Romania, 26–28 May 2021; IEEE Computer Society: New York, NY, USA, 2021; pp. 322–328. [Google Scholar]
  15. 6 Biggest Blockchain Companies. Available online: https://www.investopedia.com/10-biggest-blockchain-companies-5213784 (accessed on 2 May 2023).
  16. Chinnasamy, P.; Elumalai, A.; Ayyasamy, R.K.; Kavya, S.P.; Dhanasekaran, S.; Kiran, A. BookChain: A Secure Library Book Storing and Sharing in Academic Institutions using Blockchain Technology. In Proceedings of the 2023 International Conference on Computer Communication and Informatics (ICCCI), Coimbatore, India, 23–25 January 2023. [Google Scholar] [CrossRef]
  17. Dai, H.-N.; Wu, J.; Wang, H. Blockchain for Electronic Voting System—Review and Open Research Challenges. Sensors 2021, 21, 5874. [Google Scholar] [CrossRef]
  18. Coin Market Cap. Available online: https://coinmarketcap.com/ (accessed on 2 May 2023).
  19. Crypto Market Sizing. January 2023. Available online: https://content-hub-static.crypto.com/wp-content/uploads/2023/01/Cryptodotcom_Crypto_Market_Sizing_Jan2023-1.pdf (accessed on 24 April 2023).
  20. Musharraf, M. What Is the Blockchain Trilemma? Available online: https://www.ledger.com/academy/what-is-the-blockchain-trilemma (accessed on 1 May 2023).
  21. Ethereum Gas Tracker. Available online: https://etherscan.io/gastracker (accessed on 30 April 2023).
  22. What Is Polygon. Available online: https://wiki.polygon.technology/docs/home/polygon-basics/what-is-polygon (accessed on 30 April 2023).
  23. Next-Generation Node.Js and TypeScript ORM. Available online: https://www.prisma.io/ (accessed on 20 April 2023).
  24. React Framework for the Web. Available online: https://nextjs.org/ (accessed on 20 April 2023).
  25. The Official Website of IPFS. Available online: https://ipfs.tech/ (accessed on 29 August 2023).
  26. PostgreSQL: The World’s Most Advanced Open Source Relational Database. Available online: https://www.postgresql.org/ (accessed on 20 April 2023).
  27. RainbowKit—The Best Way to Connect a Wallet. Available online: https://www.rainbowkit.com/ (accessed on 2 May 2023).
  28. IBM. Available online: https://www.ibm.com/topics/smart-contracts (accessed on 1 August 2023).
  29. Szabo, N. Formalizing and securing relationships on public networks. First Monday 1997, 2. [Google Scholar] [CrossRef]
  30. Buterin, V. A next-generation smart contract and decentralized application platform. White Pap. 2014, 3, 1–36. [Google Scholar]
  31. The Official Website of Ethereum. Available online: https://ethereum.org/ (accessed on 2 May 2023).
  32. The Official Website of the MultiversX. Available online: https://multiversx.com/ (accessed on 2 May 2023).
  33. Ethereum Whitepaper. Available online: https://ethereum.org/en/whitepaper/ (accessed on 2 May 2023).
  34. Gramoli, V. What Is Blockchain Accountability, and Why It Matters? Available online: https://www.redbelly.network/blog/what-is-blockchain-accountability-and-why-it-matters (accessed on 1 October 2023).
  35. Pseudonymity and Anonymity: Be Untraceable in the Blockchain World. Available online: https://www.immunebytes.com/blog/pseudonymity-and-anonymity-be-untraceable-in-the-blockchain-world/ (accessed on 1 October 2023).
  36. Electric Capital Developer Report. Available online: https://github.com/electric-capital/developer-reports/blob/master/dev_report_2022.pdf (accessed on 1 May 2023).
  37. Bring Your Code, We’ll Handle the Rest. Available online: https://railway.app/ (accessed on 20 April 2023).
  38. Population and the Sustainable Development Goals. Available online: https://populationmatters.org/un-sdgs/?gclid=Cj0KCQjwsIejBhDOARIsANYqkD1vyLpVSL9Xf_bsHFT_MCGZxFW99a4Tm6byzQzf5mAaGWf3_HoVRCgaAg8jEALw_wcB (accessed on 2 May 2023).
Figure 1. Smart contract and data structures used.
Figure 1. Smart contract and data structures used.
Sustainability 15 16205 g001
Figure 2. The architecture of the application.
Figure 2. The architecture of the application.
Sustainability 15 16205 g002
Figure 3. Donate page where all ongoing campaigns are displayed.
Figure 3. Donate page where all ongoing campaigns are displayed.
Sustainability 15 16205 g003
Figure 4. Form for creating a new campaign.
Figure 4. Form for creating a new campaign.
Sustainability 15 16205 g004
Figure 5. Filled form for creating a new campaign.
Figure 5. Filled form for creating a new campaign.
Sustainability 15 16205 g005
Figure 6. Modal for choosing which wallet provider you want to use.
Figure 6. Modal for choosing which wallet provider you want to use.
Sustainability 15 16205 g006
Figure 7. Form for creating a new campaign with the submit button active.
Figure 7. Form for creating a new campaign with the submit button active.
Sustainability 15 16205 g007
Figure 8. Signing the transaction for creating a new campaign.
Figure 8. Signing the transaction for creating a new campaign.
Sustainability 15 16205 g008
Figure 9. Display message after the campaign was successfully created.
Figure 9. Display message after the campaign was successfully created.
Sustainability 15 16205 g009
Figure 10. Donate page displaying the newly created campaign—Part 1.
Figure 10. Donate page displaying the newly created campaign—Part 1.
Sustainability 15 16205 g010
Figure 11. Donate page displaying the newly created campaign—Part 2.
Figure 11. Donate page displaying the newly created campaign—Part 2.
Sustainability 15 16205 g011
Figure 12. The Donate page ready for a donation of MATIC 0.5.
Figure 12. The Donate page ready for a donation of MATIC 0.5.
Sustainability 15 16205 g012
Figure 13. Signing a transaction for donating to the campaign.
Figure 13. Signing a transaction for donating to the campaign.
Sustainability 15 16205 g013
Figure 14. Display message after the donation was successful.
Figure 14. Display message after the donation was successful.
Sustainability 15 16205 g014
Figure 15. Campaign page with the updated state.
Figure 15. Campaign page with the updated state.
Sustainability 15 16205 g015
Figure 16. Campaign page with the “End Campaign” section.
Figure 16. Campaign page with the “End Campaign” section.
Sustainability 15 16205 g016
Figure 17. Signing the transaction for finishing the campaign and claiming the raised funds.
Figure 17. Signing the transaction for finishing the campaign and claiming the raised funds.
Sustainability 15 16205 g017
Figure 18. Display message after ending the campaign successfully.
Figure 18. Display message after ending the campaign successfully.
Sustainability 15 16205 g018
Figure 19. The Polygon scan—the transparent view of the crowdfunding platform.
Figure 19. The Polygon scan—the transparent view of the crowdfunding platform.
Sustainability 15 16205 g019
Figure 20. Percentage of coverage of written unit tests.
Figure 20. Percentage of coverage of written unit tests.
Sustainability 15 16205 g020
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Tiganoaia, B.; Alexandru, G.-M. Building a Blockchain-Based Decentralized Crowdfunding Platform for Social and Educational Causes in the Context of Sustainable Development. Sustainability 2023, 15, 16205. https://doi.org/10.3390/su152316205

AMA Style

Tiganoaia B, Alexandru G-M. Building a Blockchain-Based Decentralized Crowdfunding Platform for Social and Educational Causes in the Context of Sustainable Development. Sustainability. 2023; 15(23):16205. https://doi.org/10.3390/su152316205

Chicago/Turabian Style

Tiganoaia, Bogdan, and George-Madalin Alexandru. 2023. "Building a Blockchain-Based Decentralized Crowdfunding Platform for Social and Educational Causes in the Context of Sustainable Development" Sustainability 15, no. 23: 16205. https://doi.org/10.3390/su152316205

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop