Before I submit the CIP I would like to hear your thoughts
Updated 6/1/2017
Abstract
Always have an active bet that users can play against and with settlement every few hours.
This is achieved by adding an automated contract addresses…
- Automated oracle feed that broadcasts a random value based on the blockhash
- Automated bets placed on “the house” side with a slight edge
Motivation
Stimulate usage of the Counterparty betting system.
Lotteries will always be available and not require another human to play against, nor a trusted human oracle.
This will solve the chicken-egg problem where no infrastructure, and no usage, has deterred a Counterparty betting ecosystem from developing.
In addition, this proposal will lead to increased demand for XCP from players, and the automated player will accumulate XCP over time, effectively burning it.
Rationale
The oracle will broadcast a value every 24 blocks (roughly every 4 hours). A wide range of lotteries can be played on this one feed. The probabilites one can play on will be 1/2, 1/4, 1/8, 1/16, etc, up to 1/1,048,576.
The automated player will always bet on the side that gives the lowest payout (and highest probability of winning) in return for a slight edge. This is similar to how the house operates in a casino.
Therefore there will always be an active lottery on Counterparty. A human player only needs to make one bet transaction to participate. Once it confirms it matches instantly, then it takes up to a few hours before the oracle decides the outcome and the protocol pays out winnings.
Economically this will work since many humans, when faced with a potentially high payout, willingly accept a negative expected return. The automated player, on the other hand, will over time accumulate more and more XCP, allowing for larger bets.
Specifications
The oracle will use a burn address - 1CounterbetXXXXXXXXXXXXXXXXXWhGbTM - the address is valid, yet has no private key.
Every 24 blocks the oracle will broadcast either of the following values (with probabilities):
2 (1/2)
4 (1/4)
8 (1/8)
16 (1/16)
32 (1/32)
64 (1/64)
128 (1/128)
256 (1/256)
512 (1/512)
1024 (1/1024)
2048 (1/2048)
4096 (1/4096)
8192 (1/8192)
16384 (1/16384)
32768 (1/32768)
65536 (1/65536)
131072 (1/131072)
262144 (1/262144)
524288 (1/524288)
1048576 (1/1048576)
1048577 (1/1048576)
The fee will be 0.05% and the time value will be set to the block height (not the block’s timestamp).
The automated player will operate from the same address.
Every 24 blocks the player will place a ‘not equal’ bet on the next broadcast. It will rotate between the values
4, 8, 16, 32, 64, 128, and 1024. It will always wager half its balance but require a counterwager
that gives the human player a 99% expected payout after the fee.
Technical Implementation
For every block, prior to parsing transactions, calculate a = block_height MOD 24
If a = 0
prepare a broadcast.
If a = 1
prepare a bet.
Broadcast will carry parameters source, fee_fraction, text, timestamp, value
.
The constant ones are source = 1CounterbetXXXXXXXXXXXXXXXXXWhGbTM
, fee_fraction = 0.0005
and text = 'Random'
.
The timestamp
will be set to the current block_height
and the value
will be generated as follows:
Find b = block_hash MOD 1048576
If b >= 1048576/2 value = 2
Elseif b >= 1048576/4 value = 4
Elseif b >= 1048576/8 value = 8
...
Elseif b >= 1048576/524288 value = 524288
Elseif b >= 1048576/1048576 value = 1048576
Elseif b = 0 value = 1048577
The broadcast will be added to the DB as the first transaction of the current block.
Bet will carry parameters source, feed_address, bet_type, deadline, wager_quantity, counterwager_quantity, expiration, target_value, leverage
The constant ones are source = 1CounterbetXXXXXXXXXXXXXXXXXWhGbTM
, feed_address = 1CounterbetXXXXXXXXXXXXXXXXXWhGbTM
, bet_type = 3
, expiration = 22
and leverage = 5040
.
The deadline = block_height + 22
and wager_quantity = xcp_balance / 2
The target_value
will be set as follows:
Find c = block_height MOD 7
If c = 4 target_value = 4
Elseif c = 0 target_value = 8
Elseif c = 3 target_value = 16
Elseif c = 6 target_value = 32
Elseif c = 2 target_value = 64
Elseif c = 5 target_value = 128
Elseif c = 1 target_value = 1024
The counterwager_quantity
is determined the following way:
If target_value = 4 counterwager_quantity = wager_quantity * 0.33761189
If target_value = 8 counterwager_quantity = wager_quantity * 0.14442599
If target_value = 16 counterwager_quantity = wager_quantity * 0.06734949
If target_value = 32 counterwager_quantity = wager_quantity * 0.03257770
If target_value = 64 counterwager_quantity = wager_quantity * 0.01602778
If target_value = 128 counterwager_quantity = wager_quantity * 0.00795018
If target_value = 1024 counterwager_quantity = wager_quantity * 0.00098691
The bet will be added to the DB as the first transaction of the current block.
End CIP
See further discussions: