Skip to content

interchained/crashGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crash-game — Interchained Provably Fair Crash Game

License: GNU General Public License v3.0 Copyright: 2024-2026 Interchained https://interchained.org

A provably fair crash-style GameFi application built on Redis atomic operations. Players bet USDx and cash out before the multiplier crashes. All game state and balance operations are secured by atomic Lua scripts — no race conditions, no double-spends.

Features

  • Provably Fair — Cryptographic seed system verifiable by any player
  • Atomic Balance Ops — All USDx bet/payout operations via Redis Lua scripts (zero double-spend risk)
  • Bankroll Manager — House edge and bankroll exposure tracking
  • Real-time Multiplier — WebSocket-delivered live crash curve
  • Auto-cashout — Players can set target multipliers for automatic exits
  • Game History — Full round history with crash points and provability proofs

Stack

Layer Technology
Backend FastAPI, Redis (atomic Lua scripts)
Frontend Next.js 15, React 19, TypeScript
Realtime WebSockets
Fairness HMAC-SHA256 server seed + client seed

Quick Start

pip install -r requirements.txt
cp .env.example .env
uvicorn main:app --reload --port 8000

Provably Fair System

Each round uses a server seed (pre-committed), a client seed (player-provided), and a nonce. The crash point is derived as:

hash = HMAC-SHA256(server_seed, client_seed + ":" + nonce)
crash_point = max(1.0, 100 / (house_edge%) * e^(-hash_float))

Players can verify any historical round by providing the server seed (revealed after the round) and their client seed.

Architecture

backend/inews_crash_game/
  game_engine.py      → Round lifecycle, multiplier curve
  provably_fair.py    → Seed generation and verification
  bankroll_manager.py → House exposure and edge management
  __init__.py

Environment Variables

REDIS_URL=redis://localhost:6379/0
JWT_SECRET=<your-secret>
HOUSE_EDGE=0.01   # 1% default

License

GNU General Public License v3.0 — see LICENSE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors