Skip to content

Conversation

Arvmor
Copy link
Contributor

@Arvmor Arvmor commented Feb 15, 2025

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.

keccak256(RUST_CHECKSUM + _score) == hash_submitted_by_player

Issues

However, the current keccak256 hashing approach is prone to replay 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

.env file
PRIVATE_KEY = "0x...."
image

Looking forward to this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant