Andy-Waine / smartcontract-blackjack

The House is a Smart Contract in this Blackjack dApp that utilizes Chainlink VRF for cryptograhically-guaranteed randomized deck shuffling. Built for Chainlink's Spring '23 Hackathon.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸƒ Smart Contract Blackjack ♦️ ♠️ β™₯️ ♣️

The House is a Smart Contract in this Blackjack dApp that utilizes Chainlink VRF for cryptograhically-guaranteed randomized deck shuffling.

Demonstration .gif of the Application

πŸ“ Table of Contents

ℹ️ General Information

  • Start playing blackjack NOW with Smart Contract blackjack to cut out the middleman and avoid storing your money in a centralized escrow.
  • Greater shuffling randomization than traditional methods is achieved through Chainlink VRF's cryptographically guaranteed random number issuance.
  • This project was built for and submitted to the Spring '23 Chainlink Hackathon.

πŸ’» Technologies Used

  • chainlink
  • React
  • solidity
  • web3.js
  • truffle
  • ganache

πŸ”§ Setup

  • Ensure the latest recommended version of Node and npm are installed on your machine.
  • Clone this repository and run npm install to download all dependencies.
  • Run npm run start to serve the application locally (localhost:3000)
  • If the application throws a build error on main, try the demo branch to test the game and the application's UI (see 'Challenge' below for more details):

πŸ§—β€ Challenge πŸ§—β€

Currently, we are working to overcome the challenge of obtaining a VRF response prior to dealing. When building locally on `main`, the most up-to-date logic for VRF shuffling throws a build error. We have provided a `demo` branch for game testing with hardcoded values in place of the response. This is our highest-priority item, but we will wait until the judging period for the Spring '23 Hackathon is over to continue work on this.

πŸ“ˆ Advantages Over TradFi Blackjack

No Escrow Required Trustless Randomization Instant Payouts No Middleman Plug & Play
DeFi βœ… The only 'escrow' made is for your current hand's wager. You do not need to entrust a third party with any other funds. βœ… Utilizes transparent methods of cryptographically guaranteed randomness from Chainlink VRF for card deals and draws. βœ… Payouts are distributed with each hand as you play. βœ… The Smart Contract is automated and requires little overhead to remain operational. βœ… No account creation necessary. The user can begin playing instantly with a funded MetaMask account.
TradFi ❌ To bet, you must entrust your bankroll to an escrow account with a third party (the House). ❌ Methods of Randomization are not publicly available, requiring the user to trust the house is acting in good faith. ❌ Payouts are distributed asynchronously and may take several business days ❌ The House takes a sizable cut ('rake') from every hand and has high operational expenses. ❌ The user must create and verify an account, provide their banking information, and wire funds to begin playing.

πŸ€“ Explainer: VRF-Based Shuffling Method

Shuffling Process Visualization

πŸ‘‹ Meet the Team

Dev Profile Picture: Andy       Dev Profile Picture: Rahul

Andy Waine                                   Rahul Guha

About

The House is a Smart Contract in this Blackjack dApp that utilizes Chainlink VRF for cryptograhically-guaranteed randomized deck shuffling. Built for Chainlink's Spring '23 Hackathon.

License:MIT License


Languages

Language:TypeScript 59.2%Language:JavaScript 15.1%Language:Solidity 12.8%Language:CSS 12.3%Language:HTML 0.6%