Bitcoin Forum
March 22, 2023, 03:43:18 PM *
News: Latest Bitcoin Core release: 24.0.1 [Torrent]
   Home   Help Search Login Register More  
Pages: [1]
Author Topic: [FBX] A self-contained prediction market in a coin (early work in progress)  (Read 1017 times)
wiggi (OP)
Sr. Member
Offline Offline

Activity: 403
Merit: 251

View Profile
November 07, 2013, 01:48:35 PM

This is about adding a new feature (embedded bet exchange) to a very old coin (Fairbrix).

win32 binaries:!6Q00TJ5Q!PhbhsRrlbJQbt0ZUuxikIXXoEw5MpCaydNVGcIsZRhA

Part 1: The Oracle (half finished and ready for testing, see below):

When it comes to settlement of bets, I think that ideas like "let nodes google automatically" are not that great.
Someone trustworthy is needed to decide the outcome, sign that data and put it in the blockchain
for the node's reading pleasure. The coin holders in their entirety are trustworthy because it's in their self interest.

- The oracle's answers is about the value of ticker symbols like 'BTCUSD', at specific points of time.
  Not about the exact value but always 1 out of 8 predefined answers like "">250", ">200 <=250" etc.
  The purpose is to settle bets, after all.

- Everyone with coins can vote for the oracle's answer (kinda Proof of Stake but no coin age required
  and votes are retractable until a final deadline)

- all data is stored in the blockchain encoded in regular transactions

Part 2: How to store orders for the prediction market (half finished):

- This is done *not* as contracts as described in bitcoin wiki but as balances held by addresses hard coded into the client.
  (i.e. a specific bet like ">75% probability that Bitcoin is worth more than 10000 Ripples on Dec 31, 2014" will have an address assigned to it)

- for a minimalist implementation:
 - quarterly expiration with one rollover month
 - up to 6 markets like the aforementioned BTCUSD
 - 5% minimum price tick
 - 7 order books per currency pair (because there are 8 possible oracle answers)
 - *2 for bid and ask
 - *2 for the rollover month
 these are 3192 addresses. (recycled after 1/2 year)

- Orders can be transmitted by sending coins to these addresses.
  Orders can be canceled by sending coins back to the originating address.
  Every node maintains all order books (and lists of matched and unmatched orders, per address) updated with every block.

- Now here comes the heretical part: the private keys of these addresses will be public.
  Nodes will scan every block before accepting it and reject blocks that try to send coins from special addresses unless
  - it's an unmatched order and coins go back to originating address.
  - it's a winning bet (after expiration) and coins go to originating address of the winner.
  the same way they already reject blocks for insufficient PoW, failed checkpoint tests or generally not following the rules.

Part 3-???, TODO list:

- Command line functions to build lists of unmatched orders and lists of matched orders
  and display the order books (custom time frame for testing)

- Implement cache system, all oracles's answers must be available immediately as they are
  needed to validate transactions and blocks

- Command line functions to trade (buy, sell, find active markets etc)

- Extend voting system to allow everyone (with coins) to list/delist ticker symbols for trading

- Implement custom "time in force" (encoded in least significant digits of satoshi amount) to
  automatically cancel orders, and auto sending of profits (after expiration).

- Allow the voting system to control essential features of the the coin itself


- Trading will only work after supermajority of miners use a new - yet unreleased - client version.

- It's a soft fork, old client versions will remain functional.

- No partial fills. This is due to the nature of bitcoin transactions,
  so locked and crossed markets are possible (==arbitrage opportunities for everyone)

*** If you have coins, vote for the oracle's answer: ***

- Vanitygen is required:

- In Fairbrix debug window|console type: "svlistvotings"
"index" : 2
"maturity date" : "close of Oct 31, 2013"
"vanitygen command" : "vanitygen -X95 fa5nwd"
  make an address using the vanitygen command, import the private key of the address in a wallet,
  no rescan required ("importprivkey <fairbrixprivkey> <label> false") and restart client to see the new address

- Read voting instructions (i.e. "command for help: svlistpairs 2")

- Check historical prices (e.g.,,

- Backup wallet(s), then vote by sending coins to the new address (IMHO according to output of "svlistpairs 2"
  the amount sent should be xxxx.xxxxx733, or xxxx.xxxxx734 if using btc-e prices only)

- Type "svgetoracle 2" to see your vote included (after tx is included in a block)

- Keep the coins in the new address until 30 days after Oct 31, 2013 16.00 EST, 'svgetoracle' will show
"maturity" : "close of Oct 31, 2013"
"voting closed" : "the results are final"

Please try to "cheat" (like voting twice with the same coins) and report bugs Wink
Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!