Efinity has its first playable NFTs! Our friend Simon K and his team at MyMetaverse are the first across the finish line in this regard, and we’re super excited to share how you can do the same.
The process of moving NFTs to Efinity is still young, so we created this comprehensive guide on integrating or creating your own NFT collection using Efinity and the Enjin Open Platform. This guide intends to go through the ins and outs of how to bring your NFTs to Efinity — the number 1 cross-chain highway for NFTs.
This post will go through some conceptual aspects of Efinity and the Open Platform, and will get a bit technical where necessary. But don’t worry — this blog piece is aimed at everyone.
So let’s dive in! But first…
Efinity is a chain designed specifically for NFTs. It is not a general-purpose chain, but rather one in which NFTs are a core part of the chain, recognized at the protocol level. Token creation, transfers, and purchases are the network’s priority.
Enjin is working on building the foundation of Efinity on Polkadot. The Efinity blockchain is a parachain that benefits from Polkadot’s architecture for its consensus and security.
Efinity’s features are designed to work silently in the background and allow users to experience their favourite collectables and in-game items without worrying about how the network operates, or even needing to know anything about blockchain.
Below is an easy three-step procedure to create your very first NFT.
The Open Platform is, at least for now, the codename for Enjin Platform 2.0.
In time, the Open Platform will be a platform and GraphQL-based API that can interact with not just Efinity but also Ethereum for creating tokens and collections, managing token transfers, and a few other features such as wallet management and data indexing.
Beyond support for different networks, there is one other major component to the Open Platform: it's fully open-sourced. A developer’s dream.
Because the Open Platform is being developed as a package for the Laravel PHP framework, any developer can easily integrate it into their own backend infrastructure and projects.
Gone are the days of heavy-loaded schemas. The Open Platform is easier to manage, and you have full control — including extending and/or overriding parts of the package to suit your exact needs.
The Open Platform, as a package built for Laravel 9, must be run locally in your infrastructure as part of a Laravel app. However, we are also looking into creating an Enjin-hosted version of the Open Platform with an easy-to-use web front end, similar to the existing Enjin Cloud platform.
Below, you can see a brief outline/diagram of how Efinity, the Open Platform, the Daemon, and API all work together. Each part plays an integral role, with the developer only needing to plug into one element.
A blockchain collection is a project in the Efinity blockchain that allows developers and users to create Fungible Tokens (FTs) and Non-Fungible Tokens (NFTs) under a specific collection.
With a collection, the collection owner can freely define and configure both fungible and non-fungible tokens on the Efinity blockchain without any sort of limits. The opportunities are endless.
A collection can also define properties that apply to all tokens created within it, e.g. such as whether all tokens should be forced to a single-mint mode.
A token on the blockchain is often referred to as a coin, however, on the Efinity blockchain, a token is an asset that allows developers and users to create Fungible (FTs) and Non-Fungible (NFTs). Just as on the Enjin Platform, you can create ERC-1155 digital assets or tokens.
On Efinity, each token with (1) supply can be classified as an NFT, but if the same token has more than one (1) supply, it should be classified as an FT.
With the concepts above well organized and jotted down, let's discuss the creation aspect of your collection and NFTs.
Starting the Open Platform locally is easy, though it is currently in Alpha state. If you’d like to learn more about joining the Alpha, feel free to get in touch with us through this link here.
Assuming you have already joined our Alpha and have the Open Platform starter running as expected, it’s time to go over everything that is currently possible in the Open Platform.
The following items show some of the main features available right now:
Querying is the GraphQL way to ask for data. It’s similar to the GET action in REST-based APIs.
You can use the Open Platform to retrieve information about multiple collections, tokens, transactions, wallets, users, and events.
There are different types of Efinity objects that can be mutated through the API.
Using the GraphQL mutations, the Open Platform allows you to create information on tokens or token collections, perform transactions, set attributes to tokens, set up royalties, create wallets on your user's behalf, burn tokens, freeze transactions, and many other features.
Now, to the fun part!
There are three suggested approaches as a suggestion for developers when it comes to organizing and structuring your token IDs: Bitmask, Ranges, and Hashes.
This isn't something you need to worry about much right now -- we'll publish an advanced guide later for organizing complex token hierarchies.
You can also see an example of encoding the type of a token as a bitmask by looking at the WrappedTokenId struct in our demo smart contract game.
So for now, let's focus on creating your first collection on Efinity.
The go-to approach on Ethereum is to use the ERC-721 contracts, which often means separating the projects by contract. As an example, we can use the Happy cat and Happy dog collections.
The project/wallet owners have split each and every contract as a single collection, which appears as follows:
Inside each of these contracts, we have a set of tokens, and each token can be assigned to its own metadata; the same approach can be applied to Efinity, as shown in the diagram.
In the context of Efinity adopters from MyMeta, their approach was based on collections, where they created a single collection for every project they own.
After selecting the foundation of your collection, you can begin creating both your collection and your tokens.
The parameters that you must consider at this stage are the supply of the tokens that you wish to create, such as whether they are FTs or NFTs, the attribute of the tokens such as the supply type, and how you wish to distribute these tokens to your community.
To create a collection, you can see our example mutation:
By doing so, you are effectively sending a transaction to the blockchain to create a collection for your project that will house all of your future FTs and NFTs!
In the following example, we see how the create token mutation behaves:
You now have a collection and your first token all set up!
Following that, keep in mind that you will need to set the name, description, and image for both your collection and the token(s) that you’ve created.
The following mutations demonstrate how these work on Efinity as the attributes of collections and tokens are stored on the blockchain:
In terms of setting the attributes of your own tokens, this is how it goes. These attributes allow you to assign specific keys to your tokens, such as a name, description, image URI, or even a .JSON file containing all of these keys nested into a single file hosted locally on your end.
In the case of the MetaHome NFTs, these attributes could indicate how the home should be laid out, or with any given special properties.
And that concludes this educational blog piece on how to bring NFTs to Efinity!
We hope this provides some insight into what goes into creating playable NFTs on Efinity, and the approaches to take when creating your collections and NFTs.
To recap, here are a few key points to summarize:
In this article, we went through how NFTs are created with Efinity, from a blockchain and a conceptual standpoint.
While we know there’s a bit to go for mainstream adoption across the space, we’re excited to see how everything plans out. It’s only just the beginning, with more and more projects planned to use Efinity to create their own journeys and experiences.
The opportunities are endless and you can start truly creating your own, decentralised game, project, or app. Go out there and adventure on.
In the words of Simon K from MyMetaverse:
If you’re interested in learning more about everything in this blog piece, check out the following links, (we think they will help you):