RPS Battle - Play-to-Earn Rock Paper Scissors on Solana
Player V Player Solana Browser Game with Program Included
Description
RPS Battle - Play-to-Earn Rock Paper Scissors on Solana
Overview
RPS Battle is a fully decentralized, peer-to-peer Rock Paper Scissors game built on Solana. Players compete head-to-head for real SOL stakes, with all game logic and payouts handled entirely on-chain through a custom Solana program.
No house edge. No centralized control. Just pure player-vs-player competition.
How It Works
Game Flow
-
Create or Join - Player 1 creates a game by depositing their bet (0.05 - 0.5 SOL). Player 2 joins by matching the bet.
-
Pick Your Move - Once matched, both players simultaneously choose Rock, Paper, or Scissors. Neither player can see the other's choice until both have locked in.
-
Reveal & Win - Choices are revealed automatically. Winner takes 95% of the total pot. In case of a draw, both players get their bet back (minus the small platform fee).
Provably Fair
The game uses a commit-reveal scheme to ensure fairness:
- When you pick your choice, it's encrypted (hashed) before being sent to the blockchain
- Your actual choice remains hidden until both players have committed
- Only after both players lock in, the choices are revealed and verified on-chain
- No one can cheat - not even the platform operator
Revenue Model
Platform Fee: 5%
A 5% fee is taken from the total pot when a game concludes:
| Bet Amount | Total Pot | Platform Fee | Winner Receives |
|---|---|---|---|
| 0.05 SOL | 0.10 SOL | 0.005 SOL | 0.095 SOL |
| 0.10 SOL | 0.20 SOL | 0.01 SOL | 0.19 SOL |
| 0.25 SOL | 0.50 SOL | 0.025 SOL | 0.475 SOL |
| 0.50 SOL | 1.00 SOL | 0.05 SOL | 0.95 SOL |
The fee percentage is configurable in the Solana program (can be adjusted from 1% to 10% or any value).
Draw Scenario
- Both players receive their original bet back
- Platform still takes the 5% fee (split between both players)
Technical Architecture
On-Chain Components (Solana Program)
All game logic runs on-chain through a custom Anchor program:
- Game Creation - Creates an escrow account, holds player bets
- Matchmaking - Second player joins and deposits matching bet
- Commitment Phase - Both players submit encrypted choices
- Reveal Phase - Players reveal choices, program verifies and settles
- Payout Distribution - Winner receives funds automatically, platform fee sent to operator wallet
Frontend (Next.js)
- Modern React UI with Tailwind CSS
- Wallet integration (Phantom, Solflare)
- Real-time game state polling
- Battle animations
- Fully responsive design
Key Features
Decentralized & Trustless
- All funds held in program-controlled escrow accounts
- No central server can manipulate outcomes
- Payouts happen automatically via smart contract
Fair Play Guaranteed
- Commit-reveal prevents any player from seeing opponent's choice
- On-chain verification ensures no tampering
Timeout Protection
- If opponent abandons the game, you can claim victory after ~1 minute
- No funds get stuck
Instant Settlement
- Games settle in seconds on Solana
- Winner receives SOL directly to their wallet
Low Fees
- Solana transaction fees are fractions of a cent
- Only the 5% platform fee applies
What's Included
-
Solana Program (Anchor/Rust)
- Complete game logic
- Tested and deployed on Devnet
- Ready for Mainnet deployment
-
Frontend Application (Next.js)
- Full UI with wallet integration
- Game lobby, creation, and active game views
- Battle animations
-
Deployment Guide
- Step-by-step Vercel deployment instructions
- Mainnet migration guide
- Configuration options
Customization Options
The buyer can easily customize:
- Platform Fee - Change from 5% to any percentage
- Platform Wallet - Set your own wallet to receive fees
- Bet Amounts - Adjust minimum/maximum bets
- Branding - Update colors, logo, and styling
- Network - Deploy on Devnet or Mainnet
Tech Stack
- Blockchain: Solana
- Smart Contract: Anchor Framework (Rust)
- Frontend: Next.js 14, React 18, TypeScript
- Styling: Tailwind CSS
- Wallet: Solana Wallet Adapter (Phantom, Solflare, etc.)
Deployment
The app is ready to deploy on Vercel with one click:
- Connect GitHub repository
- Set root directory to
/app - Deploy
For production, simply update the program ID and switch to Mainnet.
Perfect For
- Crypto gaming platforms
- NFT communities looking to add gamification
- DeFi projects wanting engagement features
- Anyone wanting to launch a P2E game quickly
Support
Full documentation and code comments included. The codebase is clean, well-structured, and easy to extend for additional features like:
- Tournaments
- Leaderboards
- NFT integration
- Additional game modes
Built with Solana. Provably fair. Ready to earn.
Disclaimer: Web3.Market is a marketplace platform that facilitates the sale of digital products between independent sellers and buyers. We do not develop, endorse, or guarantee any product listed on this platform. All products are provided by third-party sellers and are sold "as is." Web3.Market assumes no responsibility or liability for the functionality, security, legality, or any use or misuse of products purchased through this platform. Buyers are solely responsible for evaluating the suitability of any product for their intended purpose and for ensuring compliance with all applicable laws and regulations. By purchasing, you acknowledge that Web3.Market shall not be held liable for any direct, indirect, incidental, or consequential damages arising from the use of any product.
One-time payment • Lifetime access
Product Info
RPC Providers
Need a reliable RPC endpoint for your dApp? Get started with these trusted providers: