Bad Debt Tycoon

A survival strategy economy sim where you claw your way out of debt by playing rock paper scissors.

Bad Debt Tycoon

Created At

ETHOnline 2025

Project Description

Bad Debt Tycoon (bdt) is a dead simple (but secretly complex), stupid resource management battle royale/survival game of rock paper scissors, with a player-led economy born from players decisions and emergent gameplay.

Players can enter a battle royale (each player for themselves) by putting at stake a certain amount of a token. Against that token, they receive :

  • an amount of in-game currency (that can only can be used in this battle royale game)
  • a number of in-game "lives"
  • a deck of cards, with an equal amount of rock, paper, and scissors cards
  • a secret randomly assigned objective card

Players "fights" each others with a game of rock paper scissors, with the loser giving one of their "life" to the other player, and each played card is destroyed. They can trade everything with each others: lives, cards, currency... And bribe each others to reveal some information about their status (what cards they have left, what is their secret win condition, their debt status).

To win, players must escape with at least N lives, 0 cards remaining, and enough in-game currency to cover their exit fee (the amount they received at the beginning) OR complete their hidden objective (eg: having 6 lives, beating 4 players without a single loss...). The twist is, the game economy is designed to collapse. Every given unit of time (eg: every 20 minutes, every hour etc.), ALL players lose some of their in-game currency automatically, while exit costs rise.

Additionally to their own deck, there's also a shared deck that anyone can draw from by using the in-game currency. These cards have different effects that can drastically change the game for the person that draws from it (draw an additional scissors card, decrease/increase their debt, allow them to keep their star in the next face off if they lose, lose all their coins but gain an additional 6 lives...). Besides drawing from that central deck, all players can use their in-game currency to add specific cards to this deck, shuffle it, or remove cards. So players can stack it in their favor, or add chaos cards.

The game economy is player-driven, meaning not only players can trade between each others, but also use the in-game lending market to for instance trade 1 life for 50 coins instantly... However, interacting with this entity is a double-edge sword, as they'd have to repay based on how much time there's left in the game, and failing to pay mean they won't be able to exit.

Of course, players can also decide to exit early, but they will forfeit a % of their stake (unless they completed their objective card). If they stay until the end but didn't fulfill the requirements of the tournament, they lose their stake, which is added to the winners pool.

Winners get their stake back, + split the winners pool between themselves.

Ultimately, the depth comes from player agency: trade lives for currency, take out loans (creating debt spirals), draw from the random central card deck (with whatever that entails to) or manipulate it, bribe others. The secret win conditions and rule changes add another layer of strategy and force players to do something. It's a fair game of pure luck that requires no skills but with rules designed to be unfair... and that players must bend as much as they can.

How it's Made

Bad Debt Tycoon uses a modular smart contract architecture with a hybrid onchain/offchain design. Each tournament consists of rules, player resources financial state tracked onchain, while some of the game mechanics are coordinated by a trusted backend oracle that uses Rivet actors to coordinates actions.

Onchain, each tournament deploys 5 minimal proxy contracts:

  • Hub: Owns player state, coordinates modules
  • Combat: Manages battles between players (winner, loser, outcome modifiers, resource exchanges)
  • Mystery Deck: Handles shared deck actions (draw, add/remove cards, shuffle deck)
  • Trading: Facilitates resource exchanges (post, cancel, accept offers)
  • Randomizer: Provides verifiable randomness

Modules communicate through the Hub contract. All state changes emit events that the backend consumes for reconciliation through Envio Hypersync and Hyperindex, meaning we have both trustless actions/information and trusted actions/information (via our trusted backend oracle) :

Onchain (Trustless)

  • Stakes, prize pool, fees
  • Player resources (lives, coins, total cards)
  • Tournament lifecycle & status
  • Exit/forfeit validation

Offchain (trusted backend):

  • Combat matchmaking & resolution
  • Deck order (shuffling, adding, removing, peeking)
  • Trade validation

The amount of cards in hand, lives and coins of a player are public and visible to all, while individual card breakdown (rock, paper, scissors) count are tracked offchain by the backend. Similarly, the shared mystery deck card count is visible to all, while the exact cards it contains and their order is done on the backend.

As for randomness, the game uses a hybrid approach to prevent prediction while maintaining some form of verifiability:

  • Onchain VRF (Pyth Entropy): Provides publicly visible random seed
  • Backend secret: the each tournament actor generates their own additional private seed (actor state is isolated, meaning an actor only has access to its own state)
  • Combined PRNG: Uses the onchain seed + backend secret for : - Player objective assignment - Mystery deck composition & shuffle order

This dual-seed approach ensures that even though the Pyth VRF output is public, the actual game outcomes (next card drawn, specific objectives) remain unpredictable. The backend tracks all its seed changes and reveals the seed order at tournament end for post-game verification (if a player demands it). The algorithm used for PRNG is xoshiro128+.

Hardhat was used for smart contract development, testing and deployment.

By the end of the project, I realized that my hybrid approach was good, but my execution wrong: 80% should be offchain, and at most 20% of the logic onchain. Game state and mechanics do not belong onchain. That's my error though - so I'll be remaking the game later on because I like the concept.

background image mobile

Join the mailing list

Get the latest news and updates

Bad Debt Tycoon | ETHGlobal