Inspiration
CardxCoin has already been in the industry exchanging gift cards for cryptocurrency as a centralized exchange. That has never been done in a decentralized way until now. This is my proof of concept of that
What it does
It allows for creating NFTs representing gift cards. The card information is saved to IPFS and used as the NFT metadata (the card number/pin data requires DECO and access controls so it was left unimplemented).The cool part is that the card NFTs have their own wallets containing collateral (the collateral earns interest using Aave). These are normal NFTs that can be traded and sold. A Marketplace smart contract legitimizes these card NFTs. It can balance check them using a web scraping script written for the Walmart website (currently using random number generated from chainlink as a stand-in).
How we built it
The UI is built with Vue. Chainlink is used to generate random numbers representing whether the underlying card balance is verified from Walmart's website Aave is used to generate interest on deposited collateral IPFS is used to store metadata ChargedParticles is used to create NFTs with wallets Smart contracts are written on layer 1 Ethereum in solidity
Challenges we ran into
There were some feasibility issues involving keeping confidential card information private, yet shareable with the Chainlink node that needs to check the balance. The technology needed is in development but not available yet so random numbers were used as a stand-in representation
Writing a script to check the balance of a card on Walmart's website was both harder than I expected, and also somewhat easier? It took 3 days to break the captcha, but luckily that's all the security they implemented.
Overall it was a project of large scope for a single person and the given time period.
This was also my first time writing a smart contract. It's stupid simple but that took a whole week.
Accomplishments that we're proud of
Although not everything could be done, it works on a technical level. Using smart contracts and collateral can align incentives of participants to solve an otherwise unsolvable problem. I genuinely believe it would be more expensive and risky to try and spend a card you have listed on the marketplace than it would be to find a role inside the marketplace (as a challenger ensuring the integrity of the cards or as a person with a card inside the marketplace).
What we learned
I learned a loooot about solidity. It was my first time and it was painful.
What's next for CardxCoin Dex
This definitely needs to be on a layer 2 solution to be feasible given gas prices and the relatively low value of gift cards. I am waiting on ChargedParticles to migrate their protocol for that.
I'm waiting on Chainlink for a solution for confidential information
It would be very easy to integrate more rewards than just Aave. Time locking functionality is available. This makes it feasible to have marketplace member NFTs airdropped tokens as a reward (while ensuring they don't unstake immediately).
Going full circle and having users purchase cards in a secure way from the marketplace.
Rewrite contracts to be less bad, then smart contract auditing
Funding hopefully
Built With
- solidity
- vue
- web3
Log in or sign up for Devpost to join the conversation.