Inspiration

Inspired by Kaiji(カイジ), which is Japanese famous comic. In this, Janken(“Rock-Paper-Scissors”) is played betting their chips. Now, NFT is booming. We believe that NFT betting game can ride on the trend.

What it does

Our project is a mini game. A player play Janken betting his NFT and Token.

How to play NFT betting

NFT betting is a player vs a player, taking 2 steps to play with.

At first, a player “make offer” to the player who owns the NFT the player wants. NFT rarity is different from each NFTs. So to guaranty fairness, object the required win times in total matches. For example, the high rarity NFT owner just need to win once in 3 times match. At the making offer time, a player choose his hands. The hands are hidden against the opponent. Only the view_key holder can see it.

Second, The opponent can take 2 actions, a one is “accept”. The other is “decline”. When the opponent accept the offer, the opponent submit his hands. Then, the match is processed in contract. The winner obtain the looser’s NFT. The transfer of NFT is executed in contract.

How to play Token betting

Token betting is player vs NPC(Non Player Character), taking 1 steps to play with.

A player submit a hand and an entropy with betting amount. The entropy is used for random number generation source.

The matches is processed automatically in the contract. If a player win, a player get “the betting amount - fee” equivalent amount of token. If the player is lost, a player is taken “the betting amount ” equivalent amount of token. If the match result is draw, a player just pay fee.

How we built it

We build on top of Secrete Network. And we are using cw721 as NFT.

Challenges we ran into

  • Hiding own hands from the opponent.
    • The biggest issue of Decentralized biting game is that the play data is open to public. A player who know blockchain well can play dirty easily.
  • reliable random number generation
    • In general, blockchain is transparent, so that random number generation source and the process is open to public.

Accomplishments that we're proud of

  • Own hands are hidden from the opponent
    • The playing data is securely stored in TEE, a faulty player never check it. Only view_key holder can see it.
  • a player can rely on the random number source inside of contract.
    • The random number generation source is made from every bettors input. To recover the random number source, a dirty player need to know every inputs of contract. It's impossible.

What we learned

We learned that Secrete Network is really suitable for decentralized game. Because we think that almost every game need data protection and reliable random number. To achieving those requirement is difficult on general blockchain. No longer need ChainLink, when we use Secrete Network.

What's next for Secret Janken Game

  • continuous upgrade of the playing logic
    • To enhance use experience we think contract game logic should be upgraded continuously, but the problem is the CosmWasm don't support backward compatibility of data. So we need to develop the old version's of data translation layer.

Built With

  • cosmwasm
  • cw721
  • node.js
  • secretnetwork
  • vuejs
+ 3 more
Share this project:

Updates