Giter Club home page Giter Club logo

chess's Introduction

Chess Game

This is a regular 3D chess game, and we plan to add blockchain and play-to-earn logic to make it a decentralized platform. The main technologies used are react.js, node.js, mongodb, three.js, WebGL, etc. It's not required for you to be familiar with this stack but you should be an expert in solidity and web3 programming as a blockchain developer.

As a test, you should try to add a router by calling any function from the below smart contract and integrating it to the llgchessgame play.js file.

https://bitbucket.org/lucid-land/llgchessgame/src/master/routes/play.js - This is a js file where you should make an api. https://bscscan.com/address/0x4691f60c894d3f16047824004420542e4674e621 - This is a smart contract that you should interact with.

You can test the result in the console.

JS/TS Node Communication

Viem is the last web3 TS library, wins in security, size, flexibility and performance from Ethers and Web3. See the detailed comparison.

Code Generation

The eth-sdk was abandoned in favor of Viem and Typechain.

Private Key

We will import the known private key into a keystore, in order to ensure that it's encrypted on disk, so users will only send their password. A more robust way would be to use account ERC-4337 account abstraction, suited for larger transaction in defi field.

Available Accounts
==================

(0) 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 (10000.000000000000000000 ETH)

Private Keys
==================

(0) 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

The keystore with the encrypted private key is saved in the ./key folder. The password is user1

Shamir Secrect Sharing

In order to avoid storing the private key, we will use the shamir-secret-sharing library, so user can send his part of the private key and we store the other part. To split the private key, we can use the sss-cli:

Manually Split and Recover private key

# Install sss-cli
cargo install --git https://github.com/dsprenkels/sss-cli --branch v0.1

# Make 4 shares with recombination threshold 3
echo "Tyler Durden isn't real." | secret-share-split -n 4 -t 3 >shares.txt

# Take the first 3 shares and combine them
head -n 3 shares.txt | secret-share-combine
  • UPDATE: found a new very well written in pure TS, avoiding the gyp calls to the C lib above.

chess's People

Contributors

henry-hz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.