Feat: Earn ERC20 tokens per score. #94
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PoC
Earn ERC20 tokens (Ethereum Tokens) as the player scores in the game!
Cryptography / Anti-cheat mechanism
The current implementation uses the
Keccak256 checksum
of the binary game./riverraidrust
as a simple authentication method to ensure the game has not been modified, preventing the player from modifying or cheating.Issues
However, the current keccak256
hashing approach
is prone toreplay attacks
(players re-submitting the same transaction to gain more tokens without playing the game).Solution
Potentially, We could use
ZKPs
(Zero-Knowledge Proofs) to verify the legitimacy of the player score and prevent falsely submitted scores.Test Example
Current Smart Contract is deployed at RiverRust Contract 0xfef49b2e79ee1d04ebf792eb3060049ff05d59bd on Base chain.
You can find a test example of the player receiving $RIVER tokens based on their in-game score via this transaction
Looking forward to this PR!