How to mint a NFT on Etho Protocol and store it on it’s distributed IPFS

Etho Protocol has now EVM compatible NFT support

Etho Protocol is an Ethereum virtual machine (EVM) capable blockchain providing IPFS. It just has been upgraded to the latest functionality via a hard fork. This is an important step forward as it provides solidity compatibility and at the same time solves the problem of distributed content, permanence, copyright and proof.

Proof of originality

When an NFT is created and linked to a digital file that lives on some other system, how the data is linked is very important. There are a few reasons why traditional HTTP links aren’t a great fit. Why? An HTTP link is pointing to some content which can be changed at any time. In case of IPFS the CID or IPFS hash is pointing to the content. Adding data to IPFS generates a content identifier (CID) that’s directly derived from the data itself. Because a CID can only ever refer to one piece of content, we know that nobody can replace or alter the content without breaking the link. So as long as the hash is available in the IPFS network, the content is there and the hash can be resolved.

Also when creating a CID, that process is logged on the blockchain. If you are the rightful owner of the digital property, you can actually prove that you are the owner. Moreover you can actually prove when it has been submitted in time. If another NFT with exactly the same CID comes up later, it must be created later and therefore it is a copy.

IPFS on Etho Protocol

Etho Protocol provides not only the blockchain but also IPFS in one product. The IPFS part is provided via an SDK for developers, but luckily there are also websites providing this as a service. Pinable.io is one of them and they have a free tier, so we will use this in our example. So let us start.

We start with getting us a great file to store, why not use this piece of art.

$ETHO development on Kucoin as of today

We head to pinable.io, register for a free account and then upload the above picture. This generates the following CID which can be accessed via the ipfs gateway: https://ipfs.io/ipfs/QmaZZQDU7UfEaz9C3eqrd9LfuQSDEEuePp4Wa4gn9vN5d3

Now we have a content specific address, so we can turn to the NFT creation.

Creating an NFT contract

ETHO is fully EVM compatible, so whatever you do with Ethereum, you can do with Etho Protocol. We follow here a modified a guide from Henrique Centieiro. We head over to the Ethereum Remix IDE and make a new Solidity file, for example, “etho_erc721.sol”.

Click the ‘Create New File’ and enter ‘etho_erc721.sol’

We will use the 0xcert/ethereum-erc721 contract to create our NFT Smart Contract.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "https://github.com/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-metadata.sol";import "https://github.com/0xcert/ethereum-erc721/src/contracts/ownership/ownable.sol";contract newNFT is NFTokenMetadata, Ownable {constructor() {nftName = “ETHO trade curve 20210829”;nftSymbol = “ETHO”;}function mint(address _to, uint256 _tokenId, string calldata _uri) external onlyOwner {super._mint(_to, _tokenId);super._setTokenUri(_tokenId, _uri);}}

We take the above and paste it into the Remix IDE.

Above solidity code pasted into remix

Next we head to the compile section of Remix and compile the etho_erc721.sol file. After the successful compilation a green tick will be at the compilation window and we can head to the deployment window.

As we want to deploy on the live Etho Protocol blockchain, make sure that you have configured Metamask for ETHO Protocol and that you have 1 ETHO to spare. So we need an address with $ETHO. If you have not configured Metamask or don’t know what Metamask is, head over to the Etho Protocol documentation and you will be helped.

Now all that is assumed we use in Remix “Injected Web3” as the method of deployment execution environment.

Injected Web3 is the method to deploy in conjunction with Metamask on the live Atlas release of Etho Protocol

When you select this method a Metamask window will pop up and ask which account to connect to the website:

Select the account with some coins available as you need to pay the gas fees

Once accepted in Metamask the account comes up on Remix.

Time to deploy the NFT contract as a model contract by pressing deploy. Metamask will respond immediately:

Confirm the gas fee for the contract, which is ridiculously low with currently 0.02 cents at the time of writing. After a couple of seconds the the TX hash can be viewed in the explorer:

Returning to Remix it shows the transaction recorded and the contract can be expanded. If that is done you can see the mint function we will use next.

We will expand the mint function and add the account address in the _to field, followed by a token id. The Token id can be any number, and can be used to have a collection of different tokens, so we start at 1. Last we enter the IPFS link we previously have created in the _uri field: https://ipfs.io/ipfs/QmaZZQDU7UfEaz9C3eqrd9LfuQSDEEuePp4Wa4gn9vN5d3

Then we trigger the transaction, by pressing the “transact” button.

Confirming the transaction will cost us another 0.00154 US cents. Great, we are not going to be poor like on the Ethereum network. Again via Metamask you can checkout the explorer and the TX hash which brings you then to the created NFT as below

Summary

All functionality works out of the box and at a cost of approx 0.02 US cents, which makes minting NFTs a lot of fun.

Etho Protocol is providing a one stop solution with an integrated IPFS. With our solution not only the contract itself is distributed but also the related data.

We are looking for some great NFT designs and would be glad if you would share them with us on our Etho Protocol blockchain. Mention us on Twitter Etho Protocol if you publish something cool.

This is just the first step. We will be working with market places to get them on board. We believe that NFT market places and creators will find the Etho Protocol proposition very attractive.

Host with us @ http://ethoprotocol.com | #DecentralizeEverything | Member @ http://BPSAA.vision | Discord: http://discord.gg/RA4AZx9 | TG: http://t.me/Ether_1