Deed (short for DEcentralized EDucation) is an online educational platform built using smart contracts and DeFi tools. Our main objective with this project is to bring education to anyone, anywhere. Not only rewarding those who complete their courses but also making sure the teacher gets a share of the earned interest. The more successful students, the bigger the share of the teacher over the pooled returns. There are three different target audiences for this product: students, teachers and university owners . Students make up the majority of our users, they're the ones interested in learning and receiving incentives to do so. The first thing someone needs to do is connect with their Portis wallet and pick an ENS address (optional), then choose a classroom in any subject available. In this demo we are only able to validate answers with code, so courses like Programming Solidity, or learning Math, or similar are the only ones possible by now. Each classroom may vary conditions and parameters, such as teacher's cut, stake cost and duration. To begin the course, the student must either deposit the entry stake or ask for a grant. All deposits are locked inside the classroom pool. Students that don’t have DAI, can easily buy inside the dApp using uniswap. Then, the course study material, submitted by the classroom teacher, is available. The course material can be uploaded and downloaded from Sia, and registered in the classroom smart contract or in an ENS record. If the student fails to submit any answer before the deadline, his/her principal will not be recoverable, and will be sent to the university fund. If the student submits a correct answer, he/she will also receive a cut from the interest earned from all students, making it possible for the student to earn to learn. Teachers are the ones responsible for producing, uploading and managing study materials, as well as answering questions and helping out students. Once approved by the university, a teacher can create a classroom with the desired parameters and it will be open to anyone. At the end of the deadline they're rewarded with a share of the interest earned by the stake of all students. Students that complete courses may become teachers without even asking permission to the university admins. But what really makes deed unique is the toolkit provided for anyone to build their own university, without the common bureaucratic hassle, and with transparent and auditable operations. Entrepreneurs can start a university anywhere, without having to go through all the hurdles usually required, and also not restricting geographically their target audience. You can configure the school to be a philanthropic or for profit organization, and university cut rates, endowment parameters and student grants. Another feature is the ability to choose how to invest the funds. There are safer investments like supplying liquidity to Uniswap, investing on Aave and/or compound (or a mix of those), and even risky operations like borrowing tokens from Aave and Compound to leverage exposition. All of those are implemented in the dApp in this demo version. Funds managers need a special role to operate the university fund, and can be persons or smart contracts. This demo version has an example of automated funds manager built in.

DeEd showcase

How it's made

The smart contracts were built with Truffle and Buidler, using libraries from OpenZeppelin, 0x, and also from all stated sponsors. We used Buidler EVM to test out the contracts, it worked very well. We deployed most contracts with Truffle, but some we used remix for the sake of an easier on-chain interaction. We used etherscan only for tracking transactions. For the frontend, we have started with angular framework to create all services. We installed some pre-made themes and some components from bootstrap and material for a quicker start. We have built every single page, service and modal from scratch. The dApp uses ethers library to communicate with Ethereum. We have implemented 2 possible types of providers: Default provider from ethers (Infura + Etherscan), to be used to fetch public data while the user is not “logged in”; and Portis for all requests (signed or not) after “log in”. All the university data is stored in 2 contracts: 1 for the common university operations (registration of students, classrooms, and such things), and other for managing university funds. Every student must deploy a smart contract to hold its information on the registry, in order not to put too much weight on the already bloaty university contract. Since this transaction is costly, the university smart contract allows any request from GSN to the “register new student” method. This is the only method in the University smart contract that allows relayed calls. The smart contract of the student receives a small deposit on its behalf in the relayer, so the students can interact with the university before paying for it. The same storage logic applies for the classrooms. They have dedicated smart contracts for their data and logic, allowing even upgradability in how the classrooms operate. When a classroom is created, the teacher must deposit some LINK on it (or buy with DAI through unisap in the app) in order to make some oracle calls. The first and most important oracle call is for a random provider, that inputs a secret seed inside the classroom. The second and recurring oracle call is for classroom alarm, that grants that the course will be unlocked at the end of its duration, no matter what happens with the teacher. Students and teachers can claim their records inside the university ENS domain just by having a valid register inside the university smart contract. With this ENS domain, they can register their txt records that will be displayed in the application. Also, students may find classrooms by searching their ENS names instead of their addresses. Teachers may also use a txt record called “skylink” to share material uploaded to SIA with their students. This record will be served together with the smart contract information when students access their classroom materials. When a course begins, all funds must be invested on compound an/or aave (this ratio is a parameter that the teacher can set). When the course ends, this fund is recovered and split according to the rules of the classroom. The teacher can set up a cut from the principal (paid course) and/or from the interest earned by successful students. If all students fail the classroom, the teacher doesn't get any share from the returns, and all go to the university. Students that fail to send any answer (correct or incorrect) will not be able to recover their principal. The classroom smart contract handles all this logic. The example challenge used in the demo consists of a simple logic challenge, where the student needs to find a secret unique seed of his application by operating on 2 hints. The student can’t simply send an answer to the application smart contract. To be considered a valid answer, the student must deploy a custom made smart contract that solves the challenge and call the answer method correctly.