Quick Programming
Published in

Quick Programming

Soulbound NFTs with EIP-4671

And what soulbound tokens can be used for.

While still in its early stages, and likely to change, it is an interesting idea to try and figure out what soulbound, or Non-Tradable Tokens (NTT), can be useful for. And in this article, we will check out the soulbound token standard also known as EIP-4671.

Since the EIP is still in ‘draft’ status, we will look at it according to the current specifications. This might change in the future.

What and Why?

Soulbound tokens can be seen as similar to NFTs. They can hold information, and metadata, and they come from a single smart contract. They can, however, not be transferred or traded.

So what can soulbound tokens be used for? There are some obvious answers for when blockchain tech becomes more mainstream such as legal documents like IDs, driver's licenses, business registrations, or high school diplomas.

Other uses include use cases similar to POAPs, such as registering attendance or rewarding users with proof of achievement for something they’ve done for the community as a whole. They cannot be transferred or traded which gives them no value other than proof of achievement or attendance.

For now, I personally think that NTTs will be a way to reward users inside of a community for work they’ve done or for holding tokens. Similar to NFT airdrops that currently take place in a lot of communities. I think is excellent if NTTs will be shown on your profile on websites like OpenSea so you can still use them to ‘flex’ on other community members even when you’re unable to trade them.

The Interfaces

The basic interface is fairly simple and not very similar to NFTs since it only features the most basic functionality an NTT would need.

We specify events for when a new token has been minted, and when one has been revoked so we can give or revoke access as soon as something changes.

We also have a few functions similar to NFT functions which we can use to get the balance and tokens of an address. We also have isValid and hasValid to see if certain tokens have been revoked or if they are still valid.

What we’re missing here though, are functions responsible for distributing tokens.

EIP-4671 gives us a few options regarding minting, and while we don’t necessarily have to follow them, we will look at the delegation extension which lets us give an operator the right to mint a token.

Another very easy option is to use the pull extension. This allows users themselves to mint their own tokens via a website that sends the transaction with a proper signature to allow minting. This does require a backend such as NodeJS to securely provide a valid signature.

The official code for all these interfaces, and how to implement these interfaces, can be found on Ethereum’s Github page here. It has all extensions including Pull and Delegate.

We will not be implementing them together in this article though. I will likely create an article in the future specifically for implementing the standard in a real world application.

Conclusion

I’m interested to see what NTTs will be used for in 5 years time. I hope a lot of NFT communities implement it for giving users something extra, and I know that I will likely do the same!

Thank you so much for reading and have an excellent day.

Consider supporting me by getting a Medium membership. It helps me out a lot, it won’t cost you anything extra, and you can read as many Medium articles as you like!

Follow me on Twitter and gm.xyz to keep up with me and my projects.

Check out Pixel Pizzas on the Polygon Blockchain.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
mbvissers.eth

I occasionally write about programming and smart contracts. Follow me on Twitter @0xmbvissers