Cover photo

Minting ON-CHAIN erc-1155 tokens on $HAM

Welcome to a tutorial on minting fully on-chain erc-1155 tokens on the Ham L3 network using Net Protocol.

Minting ON-CHAIN

Minting on-chain refers to the process of uploading the entire artwork directly onto the blockchain. The main advantage of this method is that all the data is fully stored in a decentralized manner, eliminating the need for external storage solutions.

However, a significant drawback is that it is limited by file size and file type constraints. In this tutorial, we will specifically focus on saving SVG files as data URIs on the Ham blockchain.

For more detailed information about on-chain NFTs, I recommend reading this wonderful article:

https://www.fullyonchain.art/articles/why-fully-on-chain

Ham Chain 🍖

Ham Chain is a fast, cost-effective Layer 3 blockchain built on the OP Stack and Base. While saving files directly on the blockchain can be expensive, using Layer 3 solutions like Ham Chain reduces these costs, making on-chain file storage more affordable.

Besides that, Ham is at the forefront of a paradigm shift where users are prioritizing control, ownership, privacy, and interoperability over the censorship and ad-ridden experiences managed by centralized corporations.

Ham is empowering social connections with fun experiences built on decentralized systems.

A perfect place to start putting our art on-chain.

Net Protocol

In order to mint our artwork on-chain, we will need a smart contract to be injected into the blockchain. For this tutorial we gonna use: Net protocol.

Net Protocol is a decentralized permissionless messaging protocol written by Aspyn. Net is completely free and open source. You can explore the code on GitHub for more information.

Besides the messaging board, Net Protocol also offers a minting page to create smart contracts for Ham and Base, which we will discuss at the end of this tutorial.

Net protocol on Ham
Net protocol on Ham

Minting on your Art

Let us start minting our art fully on-chain on Ham. This requires the following steps:

  1. create our artwork

  2. convert our art to a svg file

  3. compress our file

  4. convert our svg file to a data uri base64 code

  5. mint our art

    First, we need to create a piece of art. I'm a fan of pixel art, so I designed a charming Tiny Dino holding a ham. To save this image on-chain, we need to convert it into an SVG format, which can then be rendered by our browser as a data URI.

png file
png file

Next, we need to convert our png file into an svg file. There are various online tools, and I found this one quite handy:

https://www.freeconvert.com/png-to-svg/download

After converting our PNG to an SVG, I strongly recommend compressing the file. As we know, file size is crucial for on-chain storage—the smaller, the better. That's why compression is our best friend in this process.

https://vecta.io/nano

Attached, you will find the compressed version of our SVG. We saved 74.3% without losing quality! Pretty cool.

compressed svg
compressed svg

Finally, we're ready to convert our image into a piece of code by turning the SVG into a Base64 data URI string using a Base64 encoder:

https://base64.guru/converter/encode/image/svg

What you get is a code snippet, which miraculously represents your art as a piece of code. You can copy the code into your browser window, and it should render the image above.

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5OTIiIGhlaWdodD0iOTkyIiB4bWxuczp2PSJodHRwczovL3ZlY3RhLmlvL25hbm8iPjxwYXRoIGQ9Ik0wIDBoOTkydjk5MkgwVjB6IiBmaWxsPSIjZjU0MjQ3Ii8+PHBhdGggZD0iTTM3MiAzMTBoMjQ4djYyaDYydjEyNGgtNjJ2NjJoNjJ2NjJINTU4djYySDQzNHY2MmgtNjJ2LTYyaC02MnYtNjJoNjJWNDM0aDYydi02MmgtNjJ2LTYyeiIgZmlsbD0iIzU3OGMzYyIvPjxwYXRoIGQ9Ik0zNzIgMTg2aDE4NnY2MmgxMjR2NjJIMzcyVjE4NnoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMzcyIDMxMGgyNDh2MTI0aC02MnYtNjJoLTYydjYyaC02MnYtNjJoLTYydi02MnoiIGZpbGw9IiM1NzhjM2MiLz48cGF0aCBkPSJNNjIwIDYyMGg2MnY2Mmg2MnYtNjJoNjJ2MTI0SDYyMFY2MjB6IiBmaWxsPSIjY2MzZjNmIi8+PHBhdGggZD0iTTQzNCA0OTZoMTI0djE4Nkg0MzR2LTYyaDYydi02MmgtNjJ2LTYyeiIgZmlsbD0iIzA4NDNmOSIvPjxwYXRoIGQ9Ik02MjAgNzQ0aDE4NnY2Mkg2MjB2LTYyeiIgZmlsbD0iI2ZiNmY3YyIvPjxwYXRoIGQ9Ik02ODIgNTU4aDYydjEyNGgtNjJWNTU4eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik01NTggNTU4aDEyNHY2Mkg1NTh2LTYyem0tNjIgMTI0aDYydjYyaC02MnYtNjJ6IiBmaWxsPSIjNTc4YzNjIi8+PHBhdGggZD0iTTMxMCA1NThoNjJ2NjJoLTYydi02MnoiIGZpbGw9IiNmZmMyYjQiLz48cGF0aCBkPSJNMjQ4IDU1OGg2MnY2MmgtNjJ2LTYyeiIgZmlsbD0iIzU3OGMzYyIvPjxwYXRoIGQ9Ik03NDQgNDk2aDYydjYyaC02MnYtNjJ6bS0xMjQgMGg2MnY2MmgtNjJ2LTYyeiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik01NTggNDk2aDYydjYyaC02MnYtNjJ6IiBmaWxsPSIjZjU0MjQ3Ii8+PHBhdGggZD0iTTMxMCA0MzRoNjJ2NjJoLTYydi02MnoiIGZpbGw9IiNmZmMyYjQiLz48cGF0aCBkPSJNNTU4IDM3Mmg2MnY2MmgtNjJ2LTYyeiIvPjxwYXRoIGQ9Ik00OTYgMzcyaDYydjYyaC02MnYtNjJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTQzNCAzNzJoNjJ2NjJoLTYydi02MnoiLz48cGF0aCBkPSJNMzcyIDM3Mmg2MnY2MmgtNjJ2LTYyeiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0zMTAgMzEwaDYydjYyaC02MnYtNjJ6IiBmaWxsPSIjZmZjMmI0Ii8+PC9zdmc+

Finally, we can inscribe our code snipped on the blockchain using the Net Protocol Open Edition Smart Contract Creator:

https://www.netprotocol.app/app/inscribed-drops/create

Inscribe on Net Protocol
Inscribe on Net Protocol

Net Protocols creator page is quite simple. The important part here is that you paste your code into the “Enter url manually...“ field, and you are connected to the Ham network. (You can also use the tool on Base if you are connected with your wallet to Base.)

Next, we give our artwork a name, description, mint price, and supply. Then press the magical “Inscribe drop” button.

A final pop-up window will appear, summarizing your drop. This also serves as a checkpoint—if your art is coded correctly, you should see a small thumbnail of your image.

review window
review window

And voila, we successfully inscribed our art fully on-chain on the Ham Network!

There are no secondary royalties and no fee to create an inscribed drop. On every mint of a paid inscribed drop, there’s a 5% fee (95% of mint fees go to the creator who made the drops, and 5% is a fee to me to help support the development of the Net protocol). On free inscribed drops, there’s no fee.

Big up for the developers providing creators with tools for putting our art on-chain. Special thanks to Asypn of Net Protocol and Deployer of Ham Chain.


Thanks for your time and interest for on-chain art. You can visit filter8.xyz for more information.

You can find me on warpcaster or twitter.

Wish you a wonderful day.

Your Filter 💜


Attached you can find my already successfully inscribed artworks on 🍖 Ham.

Dino loves Ham

https://www.netprotocol.app/app/inscribed-drops/mint/ham/0

Net Dino:

https://www.netprotocol.app/app/inscribed-drops/mint/ham/1

Hamcaster:

https://www.netprotocol.app/app/inscribed-drops/mint/ham/2


Subscribe