v1.0
No trust. No oracles. Provably random.
Any Ethereum wallet can use BetHorde to place or accept bets. Public key cryptography generates fair random outcomes.
Players bet against Houses, not against BetHorde.
Takes only apply to player winnings:
View Bet button can be used to see details on bets that have not been resolved yet. From this view, bets can also be resolved by houses (or forced if they are over 24 hours old).
Navigation links within bet view move through bets placed against a particular house.
Players select the odds of winning and specify the amount to bet. Player has a 1 / odds chance of winning and winnings equal amount × odds (minus house and contract takes).
The protocol below is used to generate random values:
Players place bets by selecting a house and specifying:
Houses have 24 hours to resolve bets by providing a cryptographic signature.
Bets that are not resolved within 24 hours can be forced by any ETH wallet. Forcing is an automatic win for the player. House take on a forced bet goes to the wallet that forced it, instead of the house. It is stored in a house account for that wallet.
Be cautious of houses with recent last low balance time (houses can 'front-run' winning bets by betting against themselves to run out of funds for accepting bets). Last low balance time records last time house balance was below maximum loss after a bet was placed.
Houses are opened with the following parameters:
Funding can be added at any time. Withdrawing funds and adjusting parameters can only happen when a house is paused and all bets have been resolved. To prevent houses from pausing to avoid incoming winning bets, a pause only starts 250 blocks after it has been requested.
Houses decide the outcome of bets by signing a bet randomness value with the private part of a 2048-bit RSA key. Houses provide public part of this key in advance, so that only one signature is valid.
This script can be used to securely generate RSA keys in Python and also includes code for signing with these keys. Bets can be signed by providing the private key to the site, or by directly supplying the signed value.
Public part of generated RSA key needs to be provided to BetHorde, but the private part should be saved and kept secret.
Note: if house does not sign bet within 24 hours, any ETH wallet can force a bet (player win) and claim house take.
Houses addresses are stored in a list and this site displays the first contract in the list by default. Each time a house resolves a bet, it advances one place towards the front, so the most active houses will be at the front of the list.
Web UI is not needed to interact with BetHorde . A copy of the contract is on Ropsten for development and testing.
Devs can be reached by contacting u/bethorde and donations are welcome.
All code hosted on Github.
Smart contract was extensively tested (test code may be released if there is interest). Web UI might have minor issues. Comments are welcome and users are welcome to create additional UIs for this contract.
Smart contract prevents several forms of cheating: