Inspiration

Ever mint an NFT you didn’t like? Everyone else's NFT looks great, except yours... You can’t get a refund. But others seem to think yours is cool. Or you want a NFT from a community member but have no ICP to buy it? We at Celestium Labs built SWAPP for the community so you can safely SWAPP NFTs in a trustless manner.

Currently, trades can be done, however not in a trustless manner. Consider this scenario: Two users have NFTs they’re willing to trade with each other. Each person will be expected to send their NFTs (one-by-one) via a wallet transfer to the other person’s wallet, and hope that the other person sends theirs in return. This could work with people who know and trust each other in real-life and are swapping face-to-face, for example. However, when the same scenario is presented between two individuals online, who have no relationship but desire each others’ NFT, the same level of trust may not be demonstrated. One person will inevitably send their NFT first and the other person could run off with that NFT, never to be heard from again, and there will be nothing the sender could do beyond that.

What it does

SWAPP allows you to trade multiple NFT’s simultaneously with your friends or strangers on the IC without risking losing your asset’s. By simply connecting your wallet you can get started.

  1. Create a swap room
  2. List one or more NFT’s and if you want an ICP amount
  3. Send the room link to a friend
  4. After you both listed NFTs, you then have to confirm
  5. Once both agree, the NFTs are going to be swapped

We charge 0.05 ICP for each as a transaction fee, so we can host the service.

Workflow

workflow of SWAPP

How we built it

SWAPP is hosted entirely on chain, both front and backend canisters. We have a custom DNS domain pointed to the frontend so it’s a friendly greeting to those who have yet to meet the IC. Through smart contracts we have made an asynchronous approach to SWAPP NFTs. Our escrow will make sure your goods are safe until both parties agree to the same conditions. SWAPP leverages IC’s gasless transaction capability. We take a small fee of 0.05 ICP. All source code is available on GitHub.

  • Backend Canister
    Written in Motoko.

  • Frontend Canister
    Written in Typescript with Next.js.

technical flow of SWAPP

Challenges we ran into

One notable challenge we encountered was interacting with NFT Standard APIs. It’s no surprise that the Internet Computer has many NFT architectures and no two standards are the same. Coming from Ethereum, the logic behind a 3rd party moving an NFT from one wallet to another (with permission), isn’t directly translated to the most used NFT standard currently used on the IC network. As a result, a secure workaround needed to be developed (ideally without wrapping). This development effort took several days, but was eventually solved.

Initially, the swap action was planned to be done using a allowance and approve system that’d only be activated once an NFT is presented by both parties. However, the method employed in SWAPP uses an escrow system that the parties can lock their pledges in before confirming the swap. Both methods will have helped us achieve the application’s objective regardless.

Accomplishments that we're proud of

We at Celestium Labs built SWAPP for the community so you can safely SWAPP NFTs in a trustless manner. We are proud to have built a working product that's been tested both internally by Celestium Labs, as well as by members of the IC Community.

The achievement that we are most proud of is creating a service where this is possible and secure while having significantly limited access to the methods in the NFT standard’s API. This forced us to think outside the box and utilise the powerful capabilities that the IC and Motoko offer.

What we learned

Since it was our first IC-Project we learned many things about the ecosystem and it's capability.

The largest lesson learned by the team was that not all issues should be looked at through the lense of another blockchain. What we mean by this, is that although the solution to performing swaps on the IC may have been found sooner if the NFT API methods exposed were the same/similar to those on another chain i.e. Ethereum, the power that the IC brings allows far more scope in solutions. Solutions that aren’t possible on other chains are made possible, and it therefore introduces a new dimension of problem solving.

Regarding the challenges we run into there also has to be mentioned the lack of atomicity on the Internet Computer. The assets won’t automatically return when transactions fail or the swap isn’t concluded by both parties. We had to set a three day threshold of inactivity, so assets aren’t locked up.

What's next for SWAPP

Currently SWAPP supports EXT standard NFTs listed on Psychedelic’s DAB. We plan to expand beyond by implementing more standards. Maybe even asset’s that aren’t hosted on the IC but on another Blockchain depending on the integration.

SWAPP supports both Plug and Stoic wallets currently, with the potential to support more wallets in the future as the ecosystem grows further.

We envision that SWAPP won’t be limited to private SWAPP rooms. By implementing asset traits a future use case could be swapping NFT’s with specific traits. The possibility to search for specific NFT traits you want or need and showing other users what you want will be an inherent necessity in our future plans regarding e.g. trading card games. We - Celestium Labs - are also planning to utilize it in our main product - Duelaliens.

We also plan on implementing a hub where users can list NFTs they’re willing to trade, and other users can create binding offers for those NFTs that’d be settled and swapped if the lister accepts. This way, users may discover NFTs they may not have previously known they wanted, and can try their luck for them with items in their inventory.

We envision to bring people together to get the NFT’s they really want.

Built With

+ 19 more
Share this project:

Updates