Updated 487 days ago

Cosmos Game of NFTs: ICS721 transfers with taxes and incentives

Outgoing Proxies for safe and secure ICS721 Interchain Transfers

  • Crypto / Web3

NFTs (and tokens in general) going interchain is a complex interaction between 2 chains.

This project covers these 2 hackathon challenges:

  1. Contract examples taxes and incentives
  2. Seamless UI for ICS721 transfers

Ark Protocol will do a demo based on Stargaze and Juno testnets. Repos: Wasm code: https://github.com/arkprotocol/ics721-plus Frontend code: https://github.com/arkprotocol/ics721-frontend

Both repos are currently private, with access for the Stargaze team. Once approved and ready for mainnet, we aim to make it public.

  1. Taxes and Incentives Contracts We have provided 6 different ICS721 outgoing proxy contracts, including (optional) taxes (aka 'transfer fee') for ICS721 transfers. Once a fee is defined, an NFT holder needs to send funds - as transfer fees - for transferring an NFT to another chain.

NOTE: by the design of the ICS721 contract, once an outgoing proxy is set, then transfers are only(!) eligible by using this outgoing proxy! Technically there are ways of bypassing this - but it'll be hard and insecure (read more below).

For the receiving chain, we have provided - a simple but safe and straight forward - incoming incentives contract. Funds are send to this contract, where holders can make claim_incentives call on these funds. Each user is eligible to do a one-time claim per NFT.

NOTE: another way is having an ICS721 callback, for automatically incentivizing a recipient. Callbacks will be highly beneficial for other uses cases as well (like automatically listing an incoming NFT on a marketplace, swapping funds/IBC tokens e.g. into STARS, airdrops, and other ICS721-based utilities).

  1. Frontend with 2 UIs covering a Profile page for transfers and an ICS721 dashboard on each chain

Once connected a user may looked up all owned NFTs in the Profile page. Once a holder select an NFT and triggers an ICS721 transfer, there is a step-by-step guide:

  1. Select target chain (IBC Channel)
  2. Enter target wallet for NFT recipient
  3. Approve Outgoing Proxy eligible to transfer an NFT
  4. Transfer

In step 2, the transfer dialog by default suggests its counterpart as target recipient (e.g. "starsXYZ") for the owner's source wallet (e.g. "junoXYZ"). At the beginning everyone will be noobs related to ICS721. Hence a guided transfer will be essential for users getting familiar with ICS721. Later an additional one-click transfer will be a no-brainer for approving a proxy and sending an NFT with counterpart wallet and to a preferred chain.

In addition to the Profile page, there is also the ICS721 dashboard. It shows all existing ICS721 contracts (aka ICS721 Service Providers) on each chain. A user can select an ICS721 contract for getting more infos. These details will provide answers for these questions:

  • how many collections are using this service?
  • how many incoming NFTs have arrived?
  • how many outgoing NFTs have been send?
  • is this the home chain for collection XYZ?
  • is this collection escrowed by ICS721?
  • who owns this NFT?
  • is NFT escrowed by ICS721?

There is a lot more showcase and demo - depending on your time :). Like:

  • Different use cases for outgoing proxies contracts
  • Tools for builders

I. Different use cases for outgoing proxies contracts

a. rate limited (e.g. max transfers of X NFTs per day) b. channel whitelist proxy: transfer only for given IBC channels (since EVERYONE is able to create new channels on existing IBC contracts, like for exploits) c. collection whitelist proxy and code id whitelist proxy: transfers only for given collections or cw721 code ids. This way an exploited, custom cw721 contracts will be avoided d. collection channels whitelist proxy: allowing creators to control whether their collection can be transferred and on which channels (=chains)

II. Tools for builders

Ark Protocol supports the NFT community for going interchain. For making this happened, we have build libs, packages and tools for builders to build ICS721 utilities:

a. macros The code for each outgoing and incentives contract is pretty slim. The reason for this is: each uses one of these 2 macros we have build:

For more details checkout the READMEs, starting here: https://github.com/arkprotocol/ics721-plus/blob/main/README.md

b. packages

There are multiple packages for builders integrating in their contract:

  • whitelist and whitelist map (e.g. used in outgoing proxies)
  • multi test code for testing proxies and ICS721
  • example usages are shown in contracts folder

Also for the frontends we plan to provide components and js libs for builders to use.