Technical details of Non-Fungible Pixels

Decentralized Advertising Platform

Getting Started

A non-fungible token (NFT) is a unit of data stored on a digital ledger, called a blockchain, that confirms a digital asset to be unique and therefore not interchangeable.

While there is no reason that distinguishes two tokens on a smart contract, two NFTs are different from each other on the same smart contract. Because, unlike fungible tokens, NFTs can contain an image, a location, music, a video, or similar data.

What’s inside the smart contract?

There are 3 different classes that run different tasks in the Non Fungible Pixels smart contract.

NFT class “Pixel”

This class allows to mint advertisement cells as NFT. After checking the price, size, and minting status of minting at least 1x1, maximum 3x3, from the user, this class runs a loop function that mints NFT and sends NFT to your wallet. Finally, you are the single owner of the cell that you just minted.

Marketplace ClassMarket

It allows the user who owns the cell to put the cell up for sale, cancel the sale, or buy the cell for sale. The price decision belongs to the seller of the NFTs in the marketplace. When a cell is sold through the marketplace, 10% is paid to the smart contract and 90% is paid to the user selling the cell. The team is going to have a 10% commission for each sale in the marketplace.

Image class “Estate”

This class allows adding or removing advertisement images that are exhibiting on the NFT cells. After checking the size, cell ownership, and image existence status, this class writes these data to the blockchain. There must be at least one (1x1) cell and a maximum of (3x3) 9 cells can be covered by advertisement image at once. If more than 9 cells are wanted to mint this process should be repeated.

An advertisement image that exhibits on cells can be removed only by the owner of these NFTs cells. If the NFT is sold, the buyer gets the all authorities on these cells like replacing images.

How to query and index?

Data such as minted NFTs, advertising images, or marketplace actions are all written to the Avalanche blockchain. However, requesting this data directly from the blockchain is not gives better results in terms of both performances and filtering data. As a solution to this problem decentralized, we implemented the Graph protocol to read and index through its API to our project.

As you can see above, all of the project Non Fungible Pixels are located on the blockchain. if you want to see the data using graphql query, you can query through this subgraph. And also you could create and deploy the subgraph by using this Github repository.

Web things?

The website of the project is completely static, so there is no need for a dynamic server. Therefore, anyone who uses the source code on our Github can create the same as Non Fungible Pixels application. We are going to share publicly all source codes after all cells are minted. By the way, the website is designed as responsive.

On the server-side, the whole process is provided by AWS. Route 53 is used for domain management, S3 is used for hosting static files of the application, ACM is used for SSL certificate management, and CloudFront is used for content distribution.

Due to the pay-as-you-go model of AWS, it is possible to host the interface and domain of Non-Fungible Pixels for very long periods at very low costs.

The whole source code smart contract, subgraph, and interface can be found on our GitHub page. After the sale of all cells is completed, the codes on GitHub will be made public and made available to the public.