project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Stylus BattleCard

A simple Lucky Draw App, using a novel synchronous VRF design made possible by Arbitrum Stylus.

Stylus BattleCard

Created At

ETHGlobal Brussels

Project Description

DRand is a threshold network producing verifiable random numbers as a public utility. Unfortunately, it is notoriously difficult to use those numbers on EVM chains without additional trust assumptions since the cryptographic algorithms are not natively supported. Using Stylus, we were able to practically implement the required algorithms and verify drand beacons directly on chain. As a result, users can play their turn in chance games all within one transaction after querying DRand for their randomness and supplying it, without any intermediaries. To prove this concept, we implement a simple Lucky Card game on Arbitrum Sepolia.

How it's Made

We use the Rust Stylus SDK to implement all of our smart contract code. In particular, this allows reusing Rust cryptographic libraries to perform operations on BLS12-381 efficiently. The verifier contract remains interoperable with solidity contracts. Contracts rely on the block timestamp to require a round number slightly in the future for the next action. The frontend is made using Dynamic Framework, which facilitates easy user onboarding, especially for a card game, since users can login using only email, where Dynamic generates an address for Arbitrum Sepolia to play an exciting game of lucky draw. Components use mainly Material UI for styling.

background image mobile

Join the mailing list

Get the latest news and updates