Álvaro Carvajal Castro

Home ~ RavenQuest


01. RavenQuest

RavenQuest is a Play2Earn blockchain game, where users can buy land and build their own game. RavenQuest Whitepaper.

Backend made using Go. Website made using server-side rendering. Since RavenQuest is a Play2Earn blockchain game, the backend needs to integrate some blockchain elements in it:

02. Land_Sale

The land sale is just a land ownsership sale, where users can buy an "ownership" spot on the game. A smart-contract was used for the sale, where users would pay with any ERC20 token and the contract will end emitting certain event, where the backend will then gather the event and insert specific information into the database.

Reading events is basically done with eth_getLogs and some specific filters (like block range for example). The thread runs on a ticker and periodically checks for new events that have not been processed before.

Since the sale was done on Polygon, blocks are not final, we can expect a fork, to ensure some security the thread only works with blocks that are atleast 22 blocks deep on the chain. Since Polygon PoS average block time is around 2 seconds this is not a big deal.

The contracts managed around 300.000 USD. Handle chain interactions with around 1500 users daily users.

03. NFTs

Users can interact with a multitude of NFTs inside the game. Minting is done a separated thread, where this thread will be pooling the database for new minting requests, then thanks to abigen a new token is issued if needed.

Since there are more operations (withdraw, deposit in-game) not always a new token will be issued. The contract contains a "isAvailable" field to prevent interactions with the token while its being used in-game.

All the meta-data is off-chain, served from the backend directly from the database after aplying some transformations on it.