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.
Viem is the last web3 TS library, wins in security, size, flexibility and performance from Ethers and Web3. See the detailed comparison.
-
why-TS - Viem was written from scratch in TS, and here is a point for their design decision in avoiding JS, security.
The eth-sdk was abandoned in favor of Viem and Typechain.
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
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:
# 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.