RPS Battle - Play-to-Earn Rock Paper Scissors on Solana

Player V Player Solana Browser Game with Program Included

$400.00
Last Updated 3 months
Demo

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

  1. Create or Join - Player 1 creates a game by depositing their bet (0.05 - 0.5 SOL). Player 2 joins by matching the bet.

  2. 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.

  3. 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 AmountTotal PotPlatform FeeWinner Receives
0.05 SOL0.10 SOL0.005 SOL0.095 SOL
0.10 SOL0.20 SOL0.01 SOL0.19 SOL
0.25 SOL0.50 SOL0.025 SOL0.475 SOL
0.50 SOL1.00 SOL0.05 SOL0.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

  1. Solana Program (Anchor/Rust)

    • Complete game logic
    • Tested and deployed on Devnet
    • Ready for Mainnet deployment
  2. Frontend Application (Next.js)

    • Full UI with wallet integration
    • Game lobby, creation, and active game views
    • Battle animations
  3. 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:

  1. Connect GitHub repository
  2. Set root directory to /app
  3. 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.

$400.00USD

One-time payment • Lifetime access

Source codeLifetime updatesCommercial license
Pay with:
BTC
ETH
USDT
SOL
BNB
+20

Product Info

CategoryNFTs & Games
Blockchainsolana
Last Updated3 months

RPC Providers

Need a reliable RPC endpoint for your dApp? Get started with these trusted providers:

$400.00

Your Code Belongs on Web3

Ship smarter dApps, plug into our marketplace, and grow with the next wave of the internet.