I always believed that NFTs can be more than just JPEG pictures. And with the concept of soul bound tokens, this can be leveraged for various real world use cases, issuing certificates being one of them. Gone are the days of paper certificates and the potential for fraud or forgery. With soul bound NFTs, issuing certificates on the blockchain has never been more secure and trustworthy.
Here’s why,
The current method of issuing certificates often relies on paper documents mostly, which are vulnerable to fraud and forgery. Even digital documents can be photoshopped. This can make it difficult to verify the authenticity of a certificate, and can lead to problems for the person or organization holding the certificate.
With the use of blockchain technology, and specifically soul bound NFTs, certificates can be issued and stored digitally in a secure and verifiable way. This eliminates the need for paper documents & prevents the use of photoshopped digital documents, and makes it easy to verify the authenticity of a certificate at any time.
In addition, soul bound NFTs offer the added benefit of being "soul bound," meaning that they are tied to a specific individual or organization in a unique and unchangeable way. This ensures that only the intended recipient can use the certificate which can be verified by anyone, and prevents any potential for fraud or forgery.
Overall, the use of soul bound NFTs on the blockchain for issuing certificates offers increased security, authenticity, and verifiability, and is a game-changer for the world of certificate issuance.
So, what exactly is a soul bound NFT?
NFT, as we all know now from Bored Apes & many other such projects is basically a way to verify the ownership and authenticity of digital assets one owns.
But technically speaking, it is a non-fungible token, a unique and indivisible digital asset that exists on a blockchain. Unlike fungible tokens, which are interchangeable and indistinguishable from each other (like bitcoin or other cryptocurrencies), NFTs are unique and cannot be replicated or replaced. This makes them ideal for representing things like art, collectibles, or other digital assets that have value and cannot be replicated.
A soul bound NFT is just a custom implementation of the regular NFT tokens but the difference here is, unlike regular NFT tokens, a soul bound NFT token cannot be transferred to someone else. Once it’s in your wallet, you can choose to either keep it or burn it if you no longer need it.
This means that the NFT can only be owned or burned by the intended recipient, and cannot be replicated or transferred to anyone else while being verifiable by anyone. This makes soul bound NFTs offer increased security and authenticity compared to other types of NFTs, and soul bound NFTs are often used for applications where ownership and verifiability are critical, such as in the issuance of certificates or other digital assets.
Based on the concept of soul bound tokens, I had the privilege to work on a project with my friend Anna Gandrabura, founder & instructor of an online e-learning platform (English For IT) who initially brought up this idea of issuing certificates to her students using a blockchain based solution such that they can be publicly verified by anyone & at the same time, remain true to who it has been issued to.
Thus, we made use of soul bound NFTs & launched certificate.english4it.online for both certificate issuers & students of English For IT.
How does it work?
As a verified issuer,
He/she can attest certificates to students who have graduated from their courses.
Once attested, the certificate can be dynamically generated by logging in at certificate.english4it.online/attest as an issuer.
This generated image is cryptographically signed by the issuer to the student who is receiving it so that this signature can later be verified.
The signed certificate (image) is uploaded to IPFS & is minted onchain as an NFT to the wallet of the student who has graduated from a course.
As a student,
He/she can login at certificate.english4it.online/profile with the wallet that’s registered with English For IT & view all certificates that have been issued or minted to his/her wallet.
This certificate can be verified using the signature it has been signed with.
All certificates are minted on Polygon & can be viewed on Opensea as well.
If a student doesn’t wish to hold a certificate, he/she can burn it but cannot sell or transfer it to someone else.
With the IPFS hash of the certificate, it can be viewed/downloaded anytime using any IPFS gateways or explorers like Opensea, etc.
As anyone,
He/she can view all the certificates issued either using certificate.english4it.online/certificates or at English For IT opensea collection or any other NFT explorers.
The signature of the certificate can be verified using our dapp.
How did we build it?
A project like this is both interesting and challenging to work with. And I love that!
It was all about the architecture design that took a while as we had to figure out three core functionalities.
Designing the database.
Dynamically generating certificate images.
Designing the UX for distributing certificates.
Writing the smart contract is the least complicated part of this project as it’s basically a standard ERC721 implementation with access control for minting certificates & soul bound overrides for transfers.
Designing the database
This is the second least complicated part.
While choosing the database, we had to think about who needs to access it & why so that we can either go for a full fledged option like SQL/NoSQL (Postgres/Mongo) or something that’s easy to use like Airtable. We then decided to go with Airtable as it’s easier for issuers to mutate data like a normal spreadsheet but also sufficient enough for our application.
Our application required the ability to establish and manage relationships between certificates issued, students enrolled, and courses offered. Airtable provides this capability out of the box, along with a user-friendly interface and granular controls over data access and permissions. This made it the ideal choice for our needs.
This saved us a lot of time in working on setting up a custom database cluster, configuring schemas, writing routes & authentication or even creating a separate frontend for it.
Dynamically generating certificate images
One of the challenges we faced in this project was the need to automate the generation of certificate images. We wanted to avoid the need for manual design and creation of images each time a student graduated. Initially, we considered using separate layers, as is common in many NFT projects. They basically have different separate individual layers of images for head, eyes, etc or whatever the final picture looks like & then programmatically combine them together using random generation so that each pfp looks unique. But we wanted something simpler and less code-intensive.
This led us to the idea of converting a HTML DOM element into an image, allowing us to design the element using JSX and populate it with dynamic details like the student's name and the course they graduated from. With the help of Chakra UI for styling and some calculations, we were able to produce high-quality certificate images that are generated automatically each time a student graduates. This solution was both efficient and effective, and allowed us to meet our goals for the project.
From this,
let dataUrl = await domtoimage.toPng(node, {
height: node.offsetHeight * scale,
width: node.offsetWidth * scale,
style: {
transform: 'scale(' + scale + ')',
transformOrigin: 'top left',
width: node.offsetWidth + 'px',
height: node.offsetHeight + 'px'
}
});
to this,
Designing the UX for distributing certificates
The most challenging aspect of this project was creating a seamless flow for minting and distributing certificates to students, both in terms of writing the code and designing the system. It required careful planning and execution to ensure that the certificates could be issued and verified securely and efficiently.
There were a few questions we had to ask ourselves,
Should we ask the students to claim the certificates by themselves?
Onboarding non-web3 individuals to the web3 ecosystem can be challenging, especially for students who are new to crypto and may not be familiar with the concept of onramps from fiat or interacting with smart contracts. In addition, the cost of gas for minting NFTs can be a barrier for students who want to receive their hard-earned certificates.
From a technical perspective, generating token URIs for NFTs presents its own set of challenges. Typically, the URI must be generated either on-chain or off-chain, and in the latter case, a base URI and an already-uploaded image must be available to map to the minted token. However, in our case, we need to generate the certificate images on the fly and wait for the IPFS hash to be returned at the time of minting, making it impossible to predict the token URIs in advance.
The only way is to pass the token URI at the time of minting as a parameter to the mint
function & if we allow students to mint/claim certificates on their own, this makes the contract vulnerable as they can pass any image URI to the mint
function while claiming their NFTs.
This lead us to the idea of dropping the certificates to a student’s wallet on our own so that we can control what token URI is passed over by using Access Control methods & Roles attached to mint
functions & to our Issuer wallets respectively.
What network should the NFTs be minted on?
We selected Polygon as our platform for issuing certificates because it offers low gas fees, compatibility with Ethereum's EVM, and support from Opensea. This allows us to distribute certificates to students in a cost-effective and reliable way, and to ensure that our certificates are easily verifiable and trustworthy.
In terms of technology, this project combines the best of both web2 and web3 worlds. On the frontend, we use NextJS for its rich features, server-side rendering, image optimization, and other benefits. Our backend, which communicates with Airtable, is secured using NextJS's inbuilt API routes and expiring JWT tokens and API keys.
For hosting the certificate images, we use IPFS, with AWS S3 as a secondary storage. While all the token URIs and images used in the contract are hosted on IPFS, we use AWS to generate dynamic OG tags for link previews of your certificates. This is because IPFS can be slow and doesn't provide the best experience for OG meta tags. However, we want to assure you that your certificates are hosted on IPFS, powered by Infura.
Finally, we use standard web3 libraries like EthersJS, Web3JS, and others for interacting with the contracts, connecting your wallet, and performing cryptographic functions.
Although this project involved a lot of work, we are proud to have paved the way for the use of NFTs in real-world applications. With the launch of English For IT - Soul bound NFT certificates, we have gained valuable experience and insights, and we believe that the use of soul bound NFTs is already starting to gain popularity in various industries.
It has the potential to revolutionize the way we think about certificate issuance, and we believe that it is a technology worth considering for schools, businesses, and individuals alike. Overall, we are excited about the future of soul bound NFTs and their potential to transform the world of certificate issuance.