Inspiration

Inspiration for the project came when one of our developers started playing online poker and blackjack. He often wondered if (a) the mathematical process for card randomization was suboptimal or (b) if a gambling oversight board could catch a casino forcing certain values on the infrequent occasion to boost their house edge.

What it does

Smart Contract Blackjack allows the player to wager eth against the Smart Contract House in this Blackjack dApp that utilizes Chainlink VRF for cryptograhically-guaranteed randomized deck shuffling. Cryptographically-verified randomness provides a more transparent game, reducing the need to place trust in the house. Smart contract tech is leveraged to provide instant payouts with each hand and remove the need for third-party escrow.

How we built it

Andy built the initial game logic in TypeScript and the UI/UX as a React frontend. With help from Rahul's impressive knowledge of Smart Contract technology, we were able to connect the two together and implement MetaMask wallet connection.

Challenges we ran into

Currently, the VRF request is not completing prior to the game start. While we move to correct this, we are using the same modular arithmetic method of card selection, but when the VRF request remains unfulfilled, the default math.random() method of TypeScript is used to generate a random integer.

Accomplishments that we're proud of

  • We have built a lean, quick, and powerful framework for playing BlackJack with a sleek UI.
  • This application is a stepping stone on the path to a more provably-fair system of online casino game.

What we learned

  • The advantages to using DeFi in online casino games are massive for the user.
  • Smart Contract BlackJack was built with core logic first, then UI, then the smart contracts. The next project we work on, it would be beneficial to build in the reverse order, as smart contracts are immutable and more laborious to change than TypseScript or CSS.

What's next for Smart Contract Blackjack

  • Correcting the outstanding issue(s) previously mentioned.
  • A Data Feed that issues cryptographic proofs of verifiable randomness.
  • Darkmode UI

Built With

Share this project:

Updates