Skip to content

darkswapfoundation/hashcash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hashcash

A decentralized lottery game built on the OYL protocol.

Overview

Hashcash is a lottery-style game where users can stake an alkane (token) for a chance to win a portion of the pot. The game is designed to be fair, transparent, and self-sustaining through a unique liquidity provisioning mechanism.

How it Works

  1. Blocklotto Alkanes: For each type of alkane that can be used in the game, a dedicated blocklotto alkane is created. These are instantiated from a blocklotto-factory.
  2. Entering the Lottery: A user sends a transaction with a specific quantity of an input alkane to the corresponding blocklotto alkane.
  3. Winning and Losing: The winner is determined by the last bit of the block hash.
    • Winners receive a conditional-token representing their share of the winnings for that block.
    • Losers receive a "sad face emoji" token, also a conditional-token, which has no value.
  4. Claiming Winnings: The winning token for a block can be redeemed in a subsequent block. The payout is proportional to the winner's stake in the total pot for that block. A winner is guaranteed to receive at least their initial stake back.
  5. Protocol Fee & Liquidity: If there are losing players in a block, 15% of the pot is used to create a liquidity pool (LP) on the OYL AMM for the <input-alkane>/HASHCASH pair. The resulting LP tokens are sent to the main hashcash alkane, controlled by the protocol's deployer. This mechanism helps to build liquidity for the HASHCASH protocol token.

Alkanes

  • blocklotto: The main game contract for a specific input alkane.
  • blocklotto-factory: A factory for creating new blocklotto alkanes.
  • conditional-token: Used to represent both winning and losing outcomes.
  • hashcash: The protocol's main alkane, which accrues LP tokens.

Development

This project is built using the Metaprotocol and Rust. The test suite is designed to be similar to the one in the oyl-protocol.

Getting Started

  1. Clone the repository.
  2. Install the necessary dependencies.
  3. Run the tests: cargo test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages