Skip to content
ย 
ย 

Latest commit

ย 

History

773 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฐ OpenHouse Backend

Backend canisters for OpenHouse Casino - The first casino where YOU can be the house

Built by Alexandria - an open-source gaming studio on the Internet Computer.

Note: This repository contains only the backend canisters. The frontend is maintained separately in the OpenHouse repository.

๐ŸŽฏ What Makes OpenHouse Different

Traditional online casinos keep all the profits and hide their odds. OpenHouse flips this entirely:

๐Ÿ’ฐ Revolutionary Economic Model

You can own the house - Instead of playing against a faceless corporation, users provide the house liquidity and own shares of the games. The house money is provided by users like you, who earn a portion of the casino's profits.

Transparent 1% house edge - Every game maintains exactly 1% house edge, verifiable through:

  • Open-source code you can audit
  • Internet Computer's VRF (Verifiable Random Function) for provably fair randomness
  • Publicly visible multiplier tables and payout calculations

$ALEX stakers earn 100% of revenue - OpenHouse is built by Alexandria studio, and all revenue flows to $ALEX token stakers. The revenue model is beautifully simple: a 1% fee on house money withdrawals goes directly to $ALEX stakers.

โœจ Core Principles

  • Provably Fair: Every game result is cryptographically verifiable using IC's VRF
  • Bot Resistant: VRF randomness cannot be predicted or manipulated
  • Fully Transparent: All code is open-source, all odds are public
  • Community Owned: Users provide liquidity, users own shares, users verify fairness

The name "OpenHouse" is a triple play on words:

  • We're the house (casino)
  • Everything is open-source with transparent odds
  • The house is open to everyone - you can become the house

๐ŸŽฎ Live Games

Game Description House Edge Max Win Play Now
Crash Multiplier rises until crash - cash out before it's too late 1% 1000x Play
Plinko Drop a ball through pegs into multiplier slots 1% 1000x Play
Roulette Beat the dealer to 21 ~1% 2.5x Play
Dice Roll over or under your target number 1% 100x Play

Frontend: https://pezw3-laaaa-aaaal-qssoa-cai.icp0.io

๐Ÿ’Ž Economic Model & Revenue

How Being "The House" Works

In traditional casinos, the house provides all liquidity and takes all profits. At OpenHouse:

  1. Users provide house liquidity - Deposit ckUSDT (stablecoin pegged to $1) to become a liquidity provider (LP)
  2. Receive ownership shares - Get LP tokens representing your share of the house
  3. Earn from the edge - The 1% house edge flows to LP holders proportionally
  4. Withdraw anytime - Pull your liquidity plus earnings whenever you want

Revenue Distribution

OpenHouse has a transparent, simple revenue model:

  • Players play games with a transparent 1% house edge using ckUSDT
  • Liquidity providers earn from the house edge on every bet
  • $ALEX stakers receive 100% of platform revenue via a 1% fee on LP withdrawals
  • No hidden fees - That's it. No rake, no VIP programs, no misleading promos

Built by Alexandria

OpenHouse is created by Alexandria, an open-source gaming studio building on the Internet Computer. All OpenHouse revenue flows to $ALEX token stakers, making this casino a revenue-generating product for the Alexandria ecosystem.

Why this matters:

  • Aligned incentives: Alexandria succeeds when OpenHouse succeeds
  • Long-term thinking: Not a cash grab, but ecosystem building
  • Open-source commitment: Transparency is core to Alexandria's mission
  • Community first: $ALEX stakers benefit from all Alexandria products

๐Ÿ—๏ธ Architecture

OpenHouse backend is built as a modular system where each game runs in its own Internet Computer canister:

openhouse-backend/
โ”œโ”€โ”€ crash_backend/          # Crash game canister (fws6k-tyaaa-aaaap-qqc7q-cai)
โ”œโ”€โ”€ plinko_backend/         # Plinko game canister (weupr-2qaaa-aaaap-abl3q-cai)
โ”œโ”€โ”€ roulette_backend/       # Roulette game canister (wvrcw-3aaaa-aaaah-arm4a-cai)
โ”œโ”€โ”€ dice_backend/           # Dice game canister (whchi-hyaaa-aaaao-a4ruq-cai)
โ”œโ”€โ”€ life1_backend/          # Game of Life - Server 1 (pijnb-7yaaa-aaaae-qgcuq-cai)
โ”œโ”€โ”€ life2_backend/          # Game of Life - Server 2 (qoski-4yaaa-aaaai-q4g4a-cai)
โ””โ”€โ”€ life3_backend/          # Game of Life - Server 3 (66p3s-uaaaa-aaaad-ac47a-cai)

Each game backend is written in Rust and independently manages:

  • Game logic and rules
  • Random number generation via IC VRF
  • Bet placement and payout calculation using ckUSDT
  • Game history and statistics

๐Ÿš€ Quick Start

โš ๏ธ Important: OpenHouse runs entirely on IC mainnet. There is no local testing environment - all development and testing happens in production.

# Deploy all backend canisters
./deploy.sh

# Deploy specific backend
./deploy.sh --roulette-only
./deploy.sh --life-only
./deploy.sh --life2-only
./deploy.sh --life3-only

# Deploy with tests
./deploy.sh --test

Note: Frontend is deployed separately from the OpenHouse repository.

๐Ÿ”ฌ How Provable Fairness Works

1. Verifiable Random Function (VRF)

Every game uses the Internet Computer's raw_rand() function, which provides cryptographically secure randomness that:

  • Cannot be predicted before generation
  • Cannot be manipulated after request
  • Can be verified by anyone on-chain

2. Transparent House Edge

The house edge is hardcoded in the game logic and visible in the source code:

// Example from Plinko
const HOUSE_EDGE: f64 = 0.01; // 1% house edge

fn calculate_payout(multiplier: f64, bet: u64) -> u64 {
    let payout = (bet as f64) * multiplier * (1.0 - HOUSE_EDGE);
    payout as u64
}

3. Open Source Verification

Anyone can:

  1. Read the game logic on GitHub
  2. Verify the deployed canister matches the source code
  3. Calculate expected return from multiplier tables
  4. Confirm house edge matches claims

๐ŸŽฒ Game Details

Crash

  • Multiplier starts at 1.00x and increases
  • Cash out before the crash to win
  • Crash point determined by VRF
  • Min bet: 0.01 USDT | Max win: 1000x

Plinko

  • Drop ball through 8, 12, or 16 rows of pegs
  • Choose risk level: Low, Medium, or High
  • Different multiplier distributions per configuration
  • Min bet: 0.01 USDT | Max win: 1000x

Roulette

  • Classic Roulette rules
  • Dealer stands on 17
  • Roulette pays 3:2
  • Min bet: 0.01 USDT | Max win: 10 USDT

Dice

  • Roll a number from 0-100
  • Predict over or under your target
  • Adjustable win chance from 1% to 98%
  • Min bet: 0.01 USDT | Max win: 100x

๐Ÿ› ๏ธ Development

Prerequisites

  • dfx (IC SDK)
  • Rust and Cargo
  • Git

Project Structure

openhouse-backend/
โ”œโ”€โ”€ crash_backend/
โ”‚   โ”œโ”€โ”€ src/lib.rs           # Crash game logic
โ”‚   โ””โ”€โ”€ crash_backend.did    # Candid interface
โ”œโ”€โ”€ plinko_backend/
โ”‚   โ”œโ”€โ”€ src/lib.rs           # Plinko game logic
โ”‚   โ””โ”€โ”€ plinko_backend.did   # Candid interface
โ”œโ”€โ”€ roulette_backend/
โ”‚   โ”œโ”€โ”€ src/lib.rs           # Roulette game logic
โ”‚   โ””โ”€โ”€ roulette_backend.did # Candid interface
โ”œโ”€โ”€ dice_backend/
โ”‚   โ”œโ”€โ”€ src/lib.rs           # Dice game logic
โ”‚   โ””โ”€โ”€ dice_backend.did     # Candid interface
โ”œโ”€โ”€ life1_backend/
โ”‚   โ”œโ”€โ”€ src/lib.rs           # Game of Life - Server 1
โ”‚   โ””โ”€โ”€ life1_backend.did    # Candid interface
โ”œโ”€โ”€ life2_backend/
โ”‚   โ”œโ”€โ”€ src/lib.rs           # Game of Life - Server 2
โ”‚   โ””โ”€โ”€ life2_backend.did    # Candid interface
โ”œโ”€โ”€ life3_backend/
โ”‚   โ”œโ”€โ”€ src/lib.rs           # Game of Life - Server 3
โ”‚   โ””โ”€โ”€ life3_backend.did    # Candid interface
โ”œโ”€โ”€ deploy.sh                # Deployment script
โ”œโ”€โ”€ dfx.json                 # IC configuration
โ””โ”€โ”€ CLAUDE.md                # Detailed developer guide

Testing on Mainnet

# Deploy changes
./deploy.sh

# Test Crash backend
dfx canister --network ic call crash_backend get_game_state

# Test Plinko backend
dfx canister --network ic call plinko_backend get_stats
dfx canister --network ic call plinko_backend get_multipliers '(16, variant { High })'

# Test Roulette backend
dfx canister --network ic call roulette_backend get_stats

# Test Dice backend
dfx canister --network ic call dice_backend get_stats
dfx canister --network ic call dice_backend calculate_payout_info '(50 : nat8, variant { Over })'

# Test Life backends
dfx canister --network ic call life1_backend greet '("Tester")'

๐Ÿ“Š Monitoring

Check canister status and health:

# View canister cycles
dfx canister --network ic status crash_backend
dfx canister --network ic status plinko_backend
dfx canister --network ic status roulette_backend
dfx canister --network ic status dice_backend

# View on IC Dashboard
open https://dashboard.internetcomputer.org/canister/fws6k-tyaaa-aaaap-qqc7q-cai

๐Ÿค Contributing

OpenHouse is open-source and welcomes contributions:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Deploy and test on mainnet
  5. Submit a pull request

Adding New Games

See CLAUDE.md for detailed instructions on adding new games to the platform.

๐Ÿ“š Resources

๐Ÿ” Security

  • All randomness from IC's VRF - cryptographically secure
  • Each game manages its own treasury independently
  • Open source allows public security audits
  • Mainnet-only deployment ensures production-grade security

๐Ÿ“œ License

OpenHouse is open-source software. See LICENSE file for details.


The house always has an edge. At OpenHouse, that edge is transparent - and you can own it.

Built with โค๏ธ by Alexandria

About

Transparent Casino Powered by Internet Computer Randomness

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages