What is Tezos blockchain and how can you create NFTs on it (with code)?

Szymon Kolber
Rarible Protocol
Published in
5 min readJan 12, 2022

Let’s face it. We are all tired Ethereum’s high gas fees. $60 to mint an NFT or make a transaction? It’s just not feasible, especially in poorer countries where the average monthly income is really low (I’m living in Poland, so I know how low it can be). Just imagine, having to work for a full month to be able to mint 16 NFTs, or, to put into a better perspective, MAKE 16 TRANSACTIONS? Crazy. It’s natural, then, that people are looking for alternatives. What requirements should a blockchain meet in order to be counted as such?

Looking for alternatives (nothing personal, ETH)

In my opinion, a blockchain should meet at least 3 requirements before being used as an alternative to Ethereum, for NFT creation:

  • Fees should be cheaper than on ETH (obviously)
  • It should support smart contracts, written by experienced developers, that are advanced enough to support NFTs creation.
  • It should be big enough. Big enough is relative, but at least it should rank on the top 10 chains by market cap. A big market cap means a big community, which means (possibly) more innovation, etc.

Introducing: Tezos

Tezos happens to meet all these requirements. Let me now introduce you to this great software:

  1. Self-Amendment
    In my opinion, the most interesting design choice on Tezos is its ability to evolve. In pursuit of a strong, united community, without the need for hard forks, they’ve created a self-amendment algorithm that basically adapts proposed changes step by step (of course, only the ones accepted by the community). The algorithm is very strong, error-resistant and what there are currently a lot of different proposals for improvements.
  2. Proof Of Stake
    It is always nice to have a proof of stake mechanism: faster transactions, insanely low fees compared to PoW chains like Ethereum.
  3. Smart Contracts
    Tezos native smart contract’s language is Michelson, which facilitates formal verification.

As you can see, Tezos is a pretty stable option.

How to get funds in Tezos test wallet

Before we can mint an NFT, we actually need to have some sort of asset to spend. We use “faucets” for that. A Faucet is basically a software that can pour some crypto into your test account. You can find detailed instructions on how to do it here.

Creating NFTs on Tezos, programmatically

I am all about getting things done as fast and as efficiently as possible. That’s why we will use the Rarible Protocol for that. It allows you to create NFTs on a few blockchains right now, and one of them is Tezos (it also makes it very simple to do so). You can change your codebase from creating NFTs on Ethereum to Tezos in basically two lines. I also have a bonus for you. On Rarible, we’ve created a ready-to-code template, with Next JS, Tailwind CSS, and already configured Rarible SDK, which you can just clone from GitHub and follow along. Since the code of the Union SDK (the one which is already set for you) is pretty complicated, we won’t dive into it in this article.

Ready-to-go code template, if you want to follow along: https://github.com/kolberszymon/union-sdk-template

1. App file

We start by wrapping the whole app in SdkWalletConnecter and SdkContextProvider. Additionaly, we pick the desired wallet that we want to use in our project. Beacon is a provider that allows us to use Temple Wallet, which supports Tezos. 💡

_app.tsx (BTW you already have it on template file, I’m just importing it)

If you want to change the appearance of the “connect wallet” button, you can do it in sdk-wallet-connector.tsx, specifically using the Options function.

2. Index File

Simple mint application for showcase

The Index File is responsible for creating the view shown above.

Pass Collection ID

Collection ID is in a format called the “Union Address”. The Union Address is nothing more than the blockchain name in uppercase letters, followed by colon, followed by contract address. On most blockchain smart contracts there are accounts, just like any other, but with a few differences. They contain executable code. 👨‍💻

Examples of correct Union Addresses:

ETHEREUM: 0x6ede7f3c26975aad32a475e1021d8f6f39c89d82

TEZOS: KT18vSGouhJcJZDDgrbBKkdCBjSXJWSbui3i

When it comes to Rarible’s smart contract addresses, you can find most of them here.

Unfortunately, some of them (e.g. Flow, Tezos) can change due to continuous development, so if the one shown on the docs doesn’t work, the best place to find the right one is on discord (Rarible Protocol). Just ping us there. 😉

For Tezos, the address of the smart contract on Hangzhounet’s test network is:

KT18vSGouhJcJZDDgrbBKkdCBjSXJWSbui3i.

And you can see your test Tezos token by going to https://rinkeby.rarible.com/ and selecting the Tezos blockchain on the explore dropdown.

How to change networks on rinkeby.rarible

Pass Additional Parameters

Screen we see after passing correct collection ID

We use collection ID in order to determine a few things:

  • If Union Address is correct
  • If Lazy Mint is supported
  • If Multiple Supply is allowed

You can look through the response object to see all the properties.

Submitting Response Object To the Blockchain

After filling in all the wanted properties, it’s time to submit the transaction.

Mint operation
Successful transaction in console

Summary

And that’s it! It’s really simple, to be honest. Now let’s take a look at what we have learned:

  • What Tezos is and what is special about it,
  • Where to find the ready-to-code GitHub template,
  • How to create an NFT on Tezos blockchain

I hope you enjoyed this tutorial 🤞.

Link to the example from the article:

https://github.com/kolberszymon/rarible-tezos-tut

If you have any further questions, we are always ready to help you! Join our discord, and we will provide the support you need!

Rarible Protocol discord: https://discord.com/invite/zqsZsEWBbN

Consider subscribing to our weekly newsletter: https://www.getrevue.co/profile/raribleprotocol

My personal contact information:

Discord: Szymon From Poland#6093

GitHub: kolberszymon

LinkedIn: koblerszymon

Happy coding, amigos!

--

--

Szymon Kolber
Rarible Protocol

Blockchain, crypto, full-stack. Make the world decentralised again 🌎