Skip to content

Conversation

@xavierdmello
Copy link

Pyth Examples Contribution

Type of Contribution

  • New Example Project
  • Bug Fix
  • Documentation Update
  • Enhancement
  • Hackathon Submission

Project Information

Project/Example Name: SlitherMoney – Trustless Multiplayer Slither with Real Stakes

Pyth Product Used:

  • Pyth Entropy
  • Pyth Price Feeds
  • Multiple Products
  • Other: —

Blockchain/Platform:

  • Ethereum/EVM (Base Sepolia)
  • Solana
  • Aptos
  • Sui
  • Fuel
  • Starknet
  • TON
  • Other: —

Description

What does this contribution do?

SlitherMoney is slither.io with money.
Players stake tokens and compete in a real-time multiplayer game where outcomes are verified on-chain. The example demonstrates how to build trustless, provably fair game mechanics using Pyth Entropy.

How does it integrate with Pyth?

SlitherMoney uses Pyth’s Entropy SDK to generate trustless, verifiable randomness for spawning apples. Each round:

  • Fetches a fresh entropy seed from Pyth
  • Hashes the seed with both players’ input logs
  • Compares player-submitted hashes for optimistic verification
  • Produces a provably fair winner used for payout settlement

Randomness cannot be predicted or influenced by players or the developer, ensuring fair apple placement and preventing RNG-based exploits.

What problem does it solve or demonstrate?

Centralized crypto games often hide RNG logic, enabling manipulation or rigging.
SlitherMoney demonstrates:

  • Verifiable on-chain randomness
  • Trustless game-state verification
  • Guaranteed fair outcomes even if the operator is malicious
  • A complete example of secure, real-money competitive gaming

Directory Structure (for new examples)

slithermoney/
├── contracts/ # Smart contracts
├── frontend/ # Browser client + wallet integration
├── README.md # Documentation
└── ...

Testing & Verification

How to Test This Contribution

Play live on Base Sepolia using testnet USDC.

Live Game: https://slithermoney.xavierdmello.com

Network: Base Sepolia

Contract Address:
0x82393d3dd11c31c252e120aa566bc59ac98cbd6b

Blockscout:
https://base-sepolia.blockscout.com/address/0x82393d3dd11c31c252e120aa566bc59ac98cbd6b

Demo URL:
https://ethglobal.com/showcase/undefined-85pci

Checklist
Code Quality

Code follows existing patterns in the repository

Proper error handling implemented

No hardcoded values (uses environment variables)

Testing

Tested locally and works as expected

No breaking changes introduced

Additional Context
Related Issues

Fixes # (none)

Screenshots/Demo

See demo link above.

Notes for Reviewers

This project showcases a fully trustless game loop powered by Pyth Entropy.
It is intended as a clear, minimal example of integrating verifiable randomness into real-time gameplay.

Thank you for contributing to Pyth Examples!

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