GSoC’22 Week 1 & 2: Colorful Permutations

Sadashay Kanungo
SCoRe Lab
3 min readJul 3, 2022

--

This is the second in a series of blogs covering my journey as a contributor in GSoC ’22 at SCoRe Lab. Here, I share the progress of the project and just think out loud.

Follow me here… | Linkedin | Github |

Progress Update

NFT Toolbox is gradually taking shape. Starting from scratch, I spent the first couple of weeks finalizing the Package structure and developing two NFT functionalities — the Generate functionality and the Upload Functionality. Let us go through them one by one.

Package Structure

The package is written in Typescript using a Class based approach. There is a wrapper class — Toolbox which is the default export from the package. It contains simplified methods for initializing and utilizing the various functionalities that the package provides.

The first class is the Collection Class. It represents an NFT collection and contains all the related attributes and methods. The Generate method of Collection Class provides the NFT Image and metadata generation functionality from a Schema of Layer Images.

Secondly we have the IPFS Abstract Class and the five Classes extending it - Pinata, NFTstorage, Infura, Storj and Arweave. Each of these classes represents an IPFS Service (IPFS-Alternative in case of Arweave). The Upload method on each of these classes internally connects to the API of the service and provides the upload functionality for hosting NFT Collections on IPFS.

Generate Functionality

Generative Art has emerged as a popular sub-sector within the NFT world. One of the most common algorithms used by creators is Layer Superimposition. Find out more about the algorithm here.

To implement this functionality in NFT-Toolbox, the Generate Method has been provided in the Collection class. It takes a schema of Layers as input and generates Image and Metadata files by superimposing them in various permutations. The HashLips Art Engine has been used as a reference while developing this method. Find the source code and examples for usage of the functionality here.

Upload Functionality

Among the technological solutions required for monetizing a digital asset and creating an NFT out of it was the need for Cheap Permanent Autonomous Storage. This problem was first solved by the Inter Planetary File System (IPFS). Some of its alternatives like Filecoin, Arweave, Storj DCS and Sia have also been launched. But IPFS remains the go-to platform for hosting digital assets for NFTs. Find out more about IPFS and its role in NFT creation here.

Uploading files to IPFS requires running an IPFS node and connecting to its global network. Since many users might not have the resources or willingness to do this on their local machines, various IPFS Service Providers have come up. NFT Toolbox provides support for five such services. NFT.storage, Pinata, Infura and Storj are IPFS pinning services while Arweave is an alternative to IPFS and has its own global network. NFT Toolbox users can choose any of these services based on their requirements and preferences. To implement the Upload functionality, the Upload method has been provided in the classes for all services. This method uploads the asset files, automatically updates the metadata files with the CID of uploaded assets and then uploads the metadata files. With this, the collection becomes ready for use in any NFT contract. Find the source code and examples for usage of this functionality here.

What’s Next?

In the coming weeks, we move to the Web3 activities of NFT creation. I will create the Contract Class for representing an NFT Smart Contract. And develop the Write and Deploy functionalities for it. With this, NFT Toolbox will be able to generate various customizations of ERC721 and ERC1155 Smart contracts and deploy them to Ethereum and Ethereum-compatible blockchains.

That’s all for now. See you in the next blog!

--

--