CertiFy is a blockchain-based certificate issuing and verification application built with Flutter, using Supabase as its database and Solidity for its Smart Contract, compatible with any EVM (Ethereum Virtual Machine).
VID-20230522-WA0008.mp4
Link to youtube video demonstration👇
CertiFy was inspired by the urgent need to address the issue of counterfeit certificates. The traditional verification process is time-consuming and bureaucratic, and the involvement of intermediaries can lead to corruption.
Our platform demonstrates that combining blockchain technology with Supabase's powerful features can provide a secure and transparent solution to this pressing problem.
We have currently deployed this using a local blockchain through Truffle and Ganache. We haven't deployed it on the mainnet because we are both students who lack the necessary funds for proper deployment.
The application has 2 main components: Organization and Person.
-
The organizer can issue certificates (currently only in PDF) to a registered person using their email.
-
The certificates issued to a person can be viewed on their screen along with the name of the organization that issued the certificate.
-
When a certificate is issued, the hash of the student email, organization email, and a hash of PDF contents is computed.
-
These details are then stored on the blockchain using our smart contract and the corresponding transaction hash is stored on Supabase's database. The pdf itself is stored on Supabase's storage for downloading it in the future.
-
The transaction hash will make it possible for anyone to verify the authenticity manually by entering the hash into a website such as https://getblock.io (blockchain explorers).
-
Each certificate detail stored on the blockchain has an additional boolean variable called
isRevoked
associated with it. -
When a certificate issued by the organization is deleted, the details & file stored on Supabase is deleted.
-
We modify this variable on the blockchain to
true
indicating this particular certificate has been revoked. This preserves the immutability of the blockchain. -
In the certificate verification screen, the user has to enter all the student email, and organization email and upload the original PDF.
-
We recompute the hashes and use the smart contract to check f such a certificate is stored and if it is not revoked. If all these conditions match, we return true, indicating the certificate is valid.
-
For every valid certificate, we will also show the corresponding transaction hash so a user can manually verify using blockchain explorers.
-
We've utilized Supabase's authentication system to enable organizations and users to sign up. In our opinion, this is one of the most impressive features provided by Supabase, as it was incredibly fast and simple to set up.
-
We store user and certificate details using Supabase's database. This enables us to export a schema, encouraging others to self-host and support open source!
-
Additionally, we store every PDF uploaded by users using Supabase's storage. This feature enables us to swiftly facilitate certificate downloads for users in the future. Conventionally, this process would require extensive server-side setup, but Supabase has made it hassle-free!
To install and run this project locally, you need to have Flutter, Truffle, Ganache, Node.js with npm installed on your machine.
-
Clone this repository:
https://github.com/AryanSarafDev/certify.git
-
Navigate to
lib/contracts
-
Install dependencies using
npm install
-
Start Ganache and create a workspace with your project folder and add
lib/contracts/truffle-config.js
in workspace.
-
Open the
.env file
and enter the appropriate details as listed below. -
Copy your
private key address
from Ganache and paste it forPRIVATE_KEY
-
Create a Supabase project and copy your
API URL
andpublic key
fromSettings > API
and paste it forSUPABASE_URL & SUPABASE_KEY
-
Create two tables called
everyone
(which stores user details) andorganization
(which stores the issued certificate details) using the following schema code:create table public.everyone ( id bigint generated by default as identity not null, created_at timestamp with time zone null default now(), uid text not null default ''::text, username text not null default ''::text, isorg boolean null default false, isper boolean null default false, oid text null default ''::text, email text null default ''::text, constraint everyone_pkey primary key (id) ) tablespace pg_default;
create table public.organization ( id bigint generated by default as identity not null, created_at date null, email text null default ''::text, certificate text null default ''::text, uid text null default ''::text, oid text null default ''::text, certname text null default ''::text, orgname text null default ''::text, hashval text null, filename text null default ''::text, orgemail text null default ''::text, transhash text null, constraint organization_pkey primary key (id) ) tablespace pg_default;
-
Compile and deploy the smart contract by opening the terminal at
lib/contracts
:Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
,truffle compile
andtruffle migrate
-
Run the app on your emulator and enjoy!
To use this app as an organizer or a person, you need to sign up with your email and password using Supabase Auth.
-
You can create certificates by filling out a form with the student's email and uploading a pdf file of the certificate.
-
You can view all the certificates you have issued in a list.
-
You can revoke or delete any certificate you have issued by clicking on the corresponding buttons in the table.
-
You can view all the certificates you have received in a list with their details.
-
You can download any certificate you have received by clicking on the download button in the table.
-
You can verify any certificate by entering its student email, organization email, and certificate hash.
-
You can see if the certificate is valid or not based on the result of verifying its hashes using blockchain technology.
This project is licensed under the MIT License - see LICENSE file for details.
This project was created by: