Ark Protocol: Building Interchain NFT Utilities
Our mission is to build interchain NFT utilities, allowing interchain NFT transfers between chains and enabling access to utilities across multiple chains.
About Ark Protocol
Ark Protocol’s mission is to build interchain NFT utilities that can be used by ANY collection on ANY chain at ANY time, using the Inter-Blockchain Communication protocol (IBC) to enable the transfer of NFTs between different blockchains and allowing smart contracts to access utilities on other chains.
NFTs and Collections
Anatomy of a Contract
NFTs so far can:
Mint
Transfer NFT ownership to another wallet address
Send a NFT to a contract address (marketplace, staking contract, etc…)
Burn
NFT collections are managed by a collection contract known as “CW721”. The NFT data is stored there (“contract storage”). Anything you do with your NFT requires you to interact with the CW721 contract. So when a user transfers an NFT to another wallet, it updatesthe owner (“key”) in the contract storage with a new wallet address (“value”). From a technical perspective NFTs are and cannot be “moved”, out of the contract.
Interacting with a Collection
The CW721 NFT contract is the entry point for user interactions. All changes to the NFT data are done in the collection contract. Contracts follow a “push-principle”: you need to tell a contract to do something. Contracts await incoming messages and then execute the specified task in the message. When you interact with the NFT you are actually sending a message to a contract. For example, when you transfer your NFT (“TransferNft”) the collection contract does the following:
The collection contract receives the incoming TransferNft message with the token id (NFT) and the new owner address (recipient).
The contract validates ownership of the NFT and eligibility to change ownership.
The contract then changes the NFT’s ownership to the new address.
The CW721 / collection contract works this way for the above 4 use cases. (mint, transfer, send and burn).
NFT Utilities: The Power of “SendNft” Message!
The CW721 / collection contract accepts for above 4 use cases these messages: mint, transfer, sent and burn.
Sending an NFT to a contract on another chain is where the power of utilities come into account! Sending does two things:
Transfers ownership of the NFT to a target contract. Remember the NFT is “locked/owned” now by the target contract.
The target contract then executes the incoming message from the collection contract.
What are utilities? Utilities depend on what the contracts are designed to provide. A contract provides different parts of the utilities (code and logic), whereas each part (utility code) is triggered by a defined message.
IBC and ICS: enabling Interchain Utilities
Simply said, the Inter-Blockchain Communication (IBC) Protocol handles data transportation between 2 blockchains. IBC has been specified in an Inter-Chain Standard (ICS) design document. IBC is the ICS-1 spec.
Each contract can be IBC-enabled (“IBC contract”). IBC defines channels for communication between two chains. Precisely, a channel connects an IBC contract on one chain to an IBC contract on another chain. A channel sends packets between both contracts. This way a source contract sends a packet to a channel, the channel passes it (“relaying packets”) on to the target contract on the other side. That target contract receives it and sends back either a success or fail packet (“acknowledgement”) back to the source contract.
All the packets are handled by a relayer. Relayers listen to channels on each side/chain and pass packets between the chains. .
So what are IBC-enabled contracts (“IBC dApps”) in general? They provide interchain utilities! Contracts built on top of IBC accept messages and utilize contracts on other chains.
Interchain contracts allow users to benefit from utilities on all chains with ONE wallet.
The most recognized “IBC dApp” is Interchain Standard 20 (ICS20) for Fungible Token transfers across chains. ICS20 is the base for providing DEX and DeFi utilities such as swapping. DEXes use ICS20 for example to transfer (“deposit”) JUNO to the Osmosis chain, which then can be swapped to STARS and transfer it back to a wallet on Stargaze.
What is ICS721?
Simply said, ICS721 is another contract NFTs can be sent to. Remember, as stated above: NFTs cannot be moved. They stay in the CW721 contract storage. Sending to a contract means that contract owns that NFT. This owner data is updated in the CW721 contract store.
ICS721 allows NFTs (aka “CW721 tokens”) to be transferred to another chain. Sending will do the following:
ICS721 on source chain A sends an IBC message to the ICS721 contract on the target chain B. The message contains all NFT data that will need to be transferred over.
The relayer passes a packet to the target contract in the form of a message.
The target contract then creates a new collection contract and duplicates the NFT by minting it in this newly created collection contract on the target chain. Finally it sends an acknowledge packet back to the source chain.
The relayer passes the acknowledged packet to the source contract.
The source contract receives the acknowledge message and processes it - depending on whether it is a success or fail acknowledge message.
As a result there are two collections. A collection exists on each chain. But, since the original NFT is sent to the ICS721 contract on the source chain (“home chain”), it is locked by this contract. Essentially the NFT on the source chain (“home chain”) is locked and inactive on this side and on the other side it is an active NFT that is owned by another wallet on the target chain.
Interchain NFT Utilities
ICS721 is the base for providing interchainchain NFT utilities. Like launchpads, marketplaces, airdrops and snapshots for a collection bridged over multiple chains.
Both fungible and non-fungible IBC contracts work with the same principles:
ICS20 locks a native fungible token (coin) on the source chain and creates a bridged token on the target chain.
ICS721 locks an original non-fungible token (NFT) on the source chain (aka collections “home chain”) and mints a bridged NFT on the target chain (aka “sub chain”).
ICS721 allows all collections to be transferred to other chains. In addition with the rise of IBC-enabled contracts, collections will also take advantage of these utilities on other chains.
By its nature it is possible to have multiple channels on each IBC contract and multiple IBC contracts on each chain. Sending NFT A and NFT B from the same collection to the same target chain, but through a different channel will result in:
An original (OG, “native”) collection on the home chain
The collection is split into 2 collections on the target chain!
Note: ICS20 works exactly the same. A coin can be transferred through different channels and will technically have a different denominator on the target chain for each channel!
This is one effect of having a decentralized app and blockchain. It creates huge opportunities for all of us - but there are also risks and side-effects that need to be addressed. In some way it is similar to the interchain namespace discussion. Check here Jake’s blog on Interchain Name System.