DeChess

Play chess with your friends on a decentralized peer-to-peer platform, featuring unique cross-chain NFT pieces that you can collect and show-off when you play.

Description

DeChess is a decentralized platform that allows users to play games of chess with each other through secure peer-to-peer channels. All played games are stored and archived decentrally, but they remain easily and quickly accessible by anyone, for purposes such as analysis. Users can also optionally purchase and collect NFTs which are different chess pieces/sets, which can be displayed to anyone that the user is playing, these pieces can be minted, purchased, exchanged and sold on multiple networks, and a piece that you own on any network can be put on display when you’re playing.

DeChess showcase

How it's made

This project used ReactJS along with the Ant Design UI library to build the front end. The UI of the chessboard is put together using the React Chessground framework, and the chess logic such as move validation uses the Chess.js library. Players log in using MetaMask, and challenge another player via an Ethereum address or an ENS domain, and they sign a message to create and join a game. Once they join the game, they subscribe to a Streamr stream, and their clients will publish moves to the stream when they make a move, and vice versa to receive a move. Chess.js is also used to keep a log of moves to show on the front end. On the NFT side of things, users mint pieces on Polygon via smart contracts made by a DAO NFT platform called Mol LeArt, and that lets us do things like setting/altering transaction fees, whitelisting accounts, setting multi-sig wallets, among other things. The NFTs are also deployed on the Ethereum mainnet using the Rarible protocol. Additionally, we did testing of minting on the Rinkeby testnet and the Mumbai testnet. We also had some special pieces which were randomly generated; it chooses from a certain number of preset characteristics as well as random colors for certain parts. This required the use of the Chainlink VRF function which let us verifiably generate random numbers for us to randomly generate these special pieces. We keep track of NFTs on the Ethereum mainnet using the Covalent API, and NFTs on Polygon using Moralis.

Technologies used

ChainlinkCovalentENSIPFSMetaMaskPolygonRarible ProtocolSolidityStreamr