Author

Topic: Worldwide bitcoin lottery (Read 1649 times)

member
Activity: 112
Merit: 10
Power The world for FREE!
January 21, 2016, 05:28:27 AM
#36
I always support ideas of expanding bitcoin services, but i'm not sure you will have profits with bitcoin lottery site without great deal of
advertising, since there are already sites that offer bitcoin lottery. In regards to running a honest service, you should obtain a valid licence
on bases of which you can run legitimate operation. Looking forward on development of this.
you are so right. Because if certain ads have the support you get relief funds for the gifts you give. But it doesn't matter if you already have the funds for prizes. But the advertising is very important to support the lottery site that you will manage. And the most important thing is you have to get the valid license and have an honest service, so that all customers are not upset with you. I'll wait for the next developments, hopefully can be resolved
hero member
Activity: 1005
Merit: 500
January 21, 2016, 05:19:48 AM
#35
All of gambling sites are centralized  has inherent weakness potential been scammer  or lacking security! So many ppl are always stepping away new gambling sites! What I want to say is that there are one block chain P2P lotto called VPN coin! If you are interested, have a look here https://bitcointalksearch.org/topic/m.11344199
member
Activity: 100
Merit: 10
January 18, 2016, 10:12:26 AM
#34
Yes, I feel your point and I wish project of big bitcoin lottery was successful as well. As you know scams in bitcoin world are rather frequent and with such big sum of money you have to convince people that you as the lottery creator/manager/owner won't run away with the jackpot. 5000 BTC is overwhelming money and can bend the will of almost any man. In Short we need PERFECT way of keeping money of participants safe.

I completely agree, as this was also part of my 2 initial questions.
2. Securing the bitcoins
This is where I really hope to get some input from some of the users in here. (The more sceptic, the better)
How should I do to proff to participants, that price money are secured and intact?
First of all I do not like the idea of storing all that bitcoin in an online wallet, since these can be hacked.
Second I do not like to use any "escrow services" as this is just moving the risk of fraud from 1 place to another.
I hope someone can suggest a complete transparent setup where participants at any time can verify that the prize pool is intact and I way where bitcoins can only be paid to winners.
And off course cannot be hacked.
Is this possible ?

I will put company with gambling license behind, but would really like to provide real proff, if any have some good suggestions.
legendary
Activity: 1862
Merit: 1004
January 18, 2016, 09:57:21 AM
#33
From my experience I can tell you that bitcoin gamblers prefer direct gambling over 'passive'  and that is main reason why bitcoin lotteries are not popular enough,
and instead we have multitude of Dice, Slots, Black Jack and other popular casino games. I never seen any lottery site being even remotely popular as some Dice sites.
You would have some seriously great system and huge budget for advertising for you to success with your lottery project.
Yes, I agree. But what I am really missing is gambling with life altering potential wins, which in the intension here. All I have seen so far is where you can win some fairly small prizes. I think the largest prize I have seen is around 120 BTC. So my hope is that a provably fair system offering 5000 BTC as main prize would get some attention. I want this to be alternative to all the state lotteries out there.

Yes, I feel your point and I wish project of big bitcoin lottery was successful as well. As you know scams in bitcoin world are rather frequent and with such big sum of money you have to convince people that you as the lottery creator/manager/owner won't run away with the jackpot. 5000 BTC is overwhelming money and can bend the will of almost any man. In Short we need PERFECT way of keeping money of participants safe.
member
Activity: 100
Merit: 10
January 18, 2016, 09:35:27 AM
#32
your lottery is offering a 5000 BTC win? or did I understand something wrong?

Yes, this is the intention.

So it will work as follows:

You purchase a ticket of 0.01 BTC to enter into level 1 of the lottery.
Once 10 tickets are sold, then they will grouped into a batch (level 1 batch).
Here the first draw will happen, and the prize here is (20% of ticket costs) 0.02 BTC to the winning ticket. The winning ticket will also enter into a level 2 batch.

So when 100 tickets are sold, then 10 level 1 winners have been found and their will be 10 tickets in the level 2 draw. (Which for example could be 15% of ticket costs, 100 x 0,01 = 0.150 BTC)
The winner of the level 2 draw receives this prize and enters automatically into level 3 draw.

and so on ...

At level 7 (final level), then the prize will be 5000 BTC. Off course you need to be lucky to win this. But chances are still much better than state lotteries.
legendary
Activity: 1176
Merit: 1001
The most Professional Cryptocurrency Casino
January 18, 2016, 09:21:21 AM
#31
my eye balls want to jump, when i see the prize, did you really will paid to the winner or you just want try scam us ?sorry no offense, because i see based on ticket cost is really high and for this point is very suspicaz
legendary
Activity: 1974
Merit: 1014
All Games incl Racer and Lottery game are Closed
January 18, 2016, 08:09:47 AM
#30
From my experience I can tell you that bitcoin gamblers prefer direct gambling over 'passive'  and that is main reason why bitcoin lotteries are not popular enough,
and instead we have multitude of Dice, Slots, Black Jack and other popular casino games. I never seen any lottery site being even remotely popular as some Dice sites.
You would have some seriously great system and huge budget for advertising for you to success with your lottery project.
Yes, I agree. But what I am really missing is gambling with life altering potential wins, which in the intension here. All I have seen so far is where you can win some fairly small prizes. I think the largest prize I have seen is around 120 BTC. So my hope is that a provably fair system offering 5000 BTC as main prize would get some attention. I want this to be alternative to all the state lotteries out there.

your lottery is offering a 5000 BTC win? or did I understand something wrong?
member
Activity: 100
Merit: 10
January 18, 2016, 08:04:43 AM
#29
From my experience I can tell you that bitcoin gamblers prefer direct gambling over 'passive'  and that is main reason why bitcoin lotteries are not popular enough,
and instead we have multitude of Dice, Slots, Black Jack and other popular casino games. I never seen any lottery site being even remotely popular as some Dice sites.
You would have some seriously great system and huge budget for advertising for you to success with your lottery project.
Yes, I agree. But what I am really missing is gambling with life altering potential wins, which in the intension here. All I have seen so far is where you can win some fairly small prizes. I think the largest prize I have seen is around 120 BTC. So my hope is that a provably fair system offering 5000 BTC as main prize would get some attention. I want this to be alternative to all the state lotteries out there.
legendary
Activity: 1862
Merit: 1004
January 18, 2016, 07:33:12 AM
#28
From my experience I can tell you that bitcoin gamblers prefer direct gambling over 'passive'  and that is main reason why bitcoin lotteries are not popular enough,
and instead we have multitude of Dice, Slots, Black Jack and other popular casino games. I never seen any lottery site being even remotely popular as some Dice sites.
You would have some seriously great system and huge budget for advertising for you to success with your lottery project.
member
Activity: 100
Merit: 10
January 18, 2016, 07:18:46 AM
#27
Just use their order in the Bitcoin blockchain. No need for timestamps. Sort by block number first, and position within block second. Nobody can dispute that ordering. You can get the ordered list of transactions within a block:
I agree, this can be done. I would however still need to get final timestamp of when "batch" completed. (If I want to stick with https://beacon.nist.gov/ and select random beacon from there)
Can blockchain timestamp here be trusted for that? (https://blockchain.info/tx-index/b6f6991d03df0e2e04dafffcd6bc418aac66049e2cd74b80f14ac86db1e3f0da?format=json)

The 2nd option is better, but if you can somehow make it that the external source can't cheat either, that would be best. That's what pevpot's 5 billion iterations is about - preventing the miner from knowing how his block affects the result.
I also agree very much with this.
legendary
Activity: 1988
Merit: 1317
Get your game girl
January 18, 2016, 06:06:06 AM
#26
1. The algorithm for selecting the winner in each should be a random algorithm based only on the bitcoin addresses participating.
I believe that it will very important, that this algorithm is public, so everyone can test that the draw is not tampered with in any way. But also must be so complex that nobody can predict any outcomes.
This part I think I have already covered with an algorithm that I have worked on and tested over the past couple of months.

Hey are you writing the algorithm from scratch ? I can test the efficiency of the algorithm also MTTF (Mean Time To Failure),just so you can check how reliable it is.I can do this for free.Pm me,just in case.
member
Activity: 100
Merit: 10
January 18, 2016, 06:02:29 AM
#25
I always support ideas of expanding bitcoin services, but i'm not sure you will have profits with bitcoin lottery site without great deal of
advertising, since there are already sites that offer bitcoin lottery. In regards to running a honest service, you should obtain a valid licence
on bases of which you can run legitimate operation. Looking forward on development of this.

I agree, advertising is needed.
I already have existing company with gambling license i Curacao, which I also believe is necessary for trust.
member
Activity: 100
Merit: 10
January 18, 2016, 05:49:18 AM
#24
1 ticket cost 0.01 and the winning prize is 5BTC for every 10 bets? do you mean that you will not earn a profit from it?

I will make profit from this.
The intetion so far is to put 80% of ticket price into prize pool. 10% reserved for affiliates and 2% reserved for charity of some sort. This leaves 8% gross profit.
This will be sustainable in the long run for development costs, gambling license costs, support etc.
legendary
Activity: 1722
Merit: 1000
Satoshi is rolling in his grave. #bitcoin
January 15, 2016, 05:56:44 PM
#23
I always support ideas of expanding bitcoin services, but i'm not sure you will have profits with bitcoin lottery site without great deal of
advertising, since there are already sites that offer bitcoin lottery. In regards to running a honest service, you should obtain a valid licence
on bases of which you can run legitimate operation. Looking forward on development of this.
hero member
Activity: 952
Merit: 503
January 15, 2016, 05:34:50 PM
#22
1 ticket cost 0.01 and the winning prize is 5BTC for every 10 bets? do you mean that you will not earn a profit from it?
legendary
Activity: 2940
Merit: 1333
January 15, 2016, 03:48:02 PM
#21
Question however is, since many point to pevpot, which use provably fair on their site. But there is also some point of trust https://www.pevpot.com/provably-fair to get the “blockHash”. So is this then provably fair?
I am fighting in my head a bit with this term.

I would call pevpot provably fair, because the only "trusted source" of randomness is coming from the guy who mines a particular block, and he *cannot know* the effect of his blockhash on the result of the lottery until an hour or two after he has committed to it.

The only problem here is that I am assuming that hardware doesn't exist that is capable of running a chain of a five billion pbkdf2 operations end to end in less than an hour.

blockcypher.com is used to put the ticket into it’s correct position order by time. So in a lottery batch (block) there are 10 tickets. How would they get their position (0 to 9) if not by at timestamp or some sorting algorithm?

Just use their order in the Bitcoin blockchain. No need for timestamps. Sort by block number first, and position within block second. Nobody can dispute that ordering. You can get the ordered list of transactions within a block:

Code:
$ bitcoin-cli getblock $(bitcoin-cli getblockhash 393457) | head -n 15
{
  "hash": "000000000000000006479b1d342159d8602976ad70880d44efbd78ad4aa90aee",
  "confirmations": 1,
  "size": 999832,
  "height": 393457,
  "version": 4,
  "merkleroot": "b53786c6435be31943cd2928469c5448966e05932c957d8f4b6444a14c55ddc5",
  "tx": [
    "f4605008afcbe1cd2a5e3a615ae8b62224a7e8b1e40541a043512892f783eaeb",
    "47fe1f5519389f5bc28b00245da528a843f0c071b2fdf7e5ef95ea00e674c9d7",
    "89d7a09abaa992c7bf66b975aec85657105227a392c45b5d2d9000044f278eac",
    "9a0f81ac609c9211c97a41d1219c693902685ca78022be60ba716e715f0072cb",
    "4c02830cdc86ae9e7cb7f1d1098244b11268e79c0ca2536743c02db4ce17f482",
    "d666cdcb0c1969fe7e936071c6ae7f18b11b375a8d29a17fd2ec863b7a0a6c75",
    "398a46ca9dc6a996f9deb937289ae6c885b017823bef58bb33e46efe673326fc",

Since it seems like one has to choose between 100% provably fair and not use any external sources. (As I read your reply then any form of external source, then it is not provably fair)

It seems to me that it is OK to use an external source so long as that external source commits to its decision before it could know the effect of its decision. For example, at Just-Dice I could use random.org to pick the server seeds and it wouldn't matter because at the time of server seed selection I know neither the client seed nor how the player is going to play.

What system would you prefer:
A provably fair system (where you cannot remove the organiser option to be dishonest)?
Or
A system based on random beacon from some source? (Must rely on external source to be fair, but organiser cannot cheat)

I don't think the first option is viable. Nobody will play a lottery where the operator can cheat undetectably.

The 2nd option is better, but if you can somehow make it that the external source can't cheat either, that would be best. That's what pevpot's 5 billion iterations is about - preventing the miner from knowing how his block affects the result.
VTC
member
Activity: 84
Merit: 14
January 15, 2016, 11:31:03 AM
#20
The sources in your example rely on trust.  You need to trust they won't change the data, that their website is up and running, and that they have a complete history of the data (hard drives fail and maybe they didn't make a backup)

The best external source is the blockchain since it's public and unchangeable.  For example, Pevpot uses a blockhash as the external source, and about 2 hours worth of hashing iterations on it.  The blockchain is public and no miner has enough incentive (or power) to undo 2 hours worth of blocks.  

You should look at
https://www.pevpot.com/provably-fair
https://www.pevpot.com/verify
as it is superior to your method.
member
Activity: 100
Merit: 10
January 15, 2016, 06:03:07 AM
#19
Proof and trust are incompatible
I see and I agree thinking about this. But would that not actually mean, that the use of any random beacon would mean, that it cannot be considered provably fair? This would always rely on some data input from somewhere and no matter whether everybody in the world knows that I (the organizer) would not have any control over this, then it could still be argued that the data source could be dishonest.

On the other hand making something provably fair would (in this case) need some “secret token” or similar as previously mentioned, which then will be public after the draw and user could check this against the hash string they got when purchasing the ticket. But this leaves organizer with edge if he was dishonest as he knows all the factors.
This is a headache.

Question however is, since many point to pevpot, which use provably fair on their site. But there is also some point of trust https://www.pevpot.com/provably-fair to get the “blockHash”. So is this then provably fair?
I am fighting in my head a bit with this term.

It's hard to follow. I think it could use some proofreading and possibly renumbering. What is a "lottery block" exactly?
Yes, this could surely need some explanation, which I will try to do.
Every time 10 lottery tickets are sold, then a draw will happen between these 10 tickets for 20% percent of the combined ticket value. This is what I call a block (in this case a level 1 block).
Let’s say a ticket cost 10 mBTC, then the prize pool in this draw is 20 mBTC.
The winner of a level 1 block will automatically enter into a level 2 block.

A level 2 block is created, when 10 x 10 = 100 tickets are sold (10 level 1 blocks). The 10 winners of their level 1 block will enter into a level 2 block (Which now also holds 10 tickets). Here the prize pool will be 15% of the combined ticket value. (100 x 10 x 15% = 150 mBTC). The winner of a level 2 block draw will automatically enter into a level 3 block.
Level 3 block is created and draw is made when 10 x 10 x 10 = 1000 tickets are sold and so on….
I hope this explains the system a bit better and why I use “lottery block”. Maybe it would be better and more correct to call it a batch instead.

It sounds as if we don't have to trust blockcypher.com at all, because the random beacon has the final say in who wins. In fact why do we even need to use blockcypher.com? What do we lose by simply using the random beacon at block_time + 10 minutes alone to pick the winning ticket? Hash the beacon, divide by 10, and the remainder is the winner. What does simplifying the draw to such an extent take away? I think your currently described system is entirely dependent on the government beacon to decide the winner, so why bother with all the extra complication? If the beacon site is cheating, they can make any ticket win under either system, and if they aren't then both systems are equally "fair".
Or did I miss something?
blockcypher.com is used to put the ticket into it’s correct position order by time. So in a lottery batch (block) there are 10 tickets. How would they get their position (0 to 9) if not by at timestamp or some sorting algorithm?
I could rely on when I receive payment internally, but then some API service for receiving money could be down and the participant who should have had position 6, then gets position 8. And then after the draw this person calculates that if he had been in position 6, then he would have won.
So blockcypher.com is for ordering tickets. Also the lastest timestamp in the batch is also used to determine which random beacon to get from government site. One could argue, that organiser could tamper with timestamps internally to get the random beacon that serves his purpose. Am I right ?

I think you need to specify which version of mt_rand you're using. Its output changes depending on the version of PHP. Better would be to use something more standard so we don't have to install PHP to verify results.
Yes, if this is used off course version is needed as I know it has changed during versions. This might be something completely different on live version as long as it produce identical result of identical seeds.

Question:
Since it seems like one has to choose between 100% provably fair and not use any external sources. (As I read your reply then any form of external source, then it is not provably fair)
What system would you prefer:
A provably fair system (where you cannot remove the organiser option to be dishonest)?
Or
A system based on random beacon from some source? (Must rely on external source to be fair, but organiser cannot cheat)
legendary
Activity: 2940
Merit: 1333
January 15, 2016, 03:44:27 AM
#18
So an updated algorithm and flow:

1. Points of trust
In order to make something provably fair we need one or more points of trust.
For this lottery algorithm the following 2 places are used:
- blockcypher.com
- https://beacon.nist.gov

I think you are missing the point. Proof and trust are incompatible. We prove the game is fair so that you don't have to trust anyone.

I can tell you that Pythagoras' Theorem is true and show you it stated in a trustworthy publication, or I can prove it to you. Once I have proved it to you, you know it is true even if you don't trust the publication that stated it. Proof removes the need for trust.

blockcypher.com is used to determine the receiving time of payment for a ticket
https://beacon.nist.gov is used to select a random beacon

I would say that you have two holes in your proof. Either one of those two entities could be dishonest - you cannot prove that they aren't.

2. Lottery blocks
We referring to a "lottery block", then I refer to a draw with 10 participants.

2. The flow

It's hard to follow. I think it could use some proofreading and possibly renumbering. What is a "lottery block" exactly?

The seed is a combination of the bitcoin addresses in the ordered ticket_info_array and a random beacon found at https://beacon.nist.gov. The timestamp used for calling their API will be lottery block lock time + 10 minutes. Since these random beacon are calculated each minute, then this ensures that no one knows this until after the lottery block is locked. See calculateSeed() as getRandomBeacon() for reference.

I think you need to specify which version of mt_rand you're using. Its output changes depending on the version of PHP. Better would be to use something more standard so we don't have to install PHP to verify results.

It sounds as if we don't have to trust blockcypher.com at all, because the random beacon has the final say in who wins. In fact why do we even need to use blockcypher.com? What do we lose by simply using the random beacon at block_time + 10 minutes alone to pick the winning ticket? Hash the beacon, divide by 10, and the remainder is the winner. What does simplifying the draw to such an extent take away? I think your currently described system is entirely dependent on the government beacon to decide the winner, so why bother with all the extra complication? If the beacon site is cheating, they can make any ticket win under either system, and if they aren't then both systems are equally "fair".

Or did I miss something?
member
Activity: 100
Merit: 10
January 14, 2016, 08:55:56 AM
#17
So an updated algorithm and flow:

1. Points of trust
In order to make something provably fair we need one or more points of trust.
For this lottery algorithm the following 2 places are used:
- blockcypher.com
- https://beacon.nist.gov

blockcypher.com is used to determine the receiving time of payment for a ticket
https://beacon.nist.gov is used to select a random beacon

2. Lottery blocks
We referring to a "lottery block", then I refer to a draw with 10 participants.

2. The flow
2.1 - Buying the ticket
A participant will buy a ticket by sending a fixed amount to a certain bitcoin address
Upon receiving this payment, then users bitcoin address will appear public in the lottery block.

2.2 Completing the lottery block
When payment is received for 10 tickets, then the lottery block is considered complete and a proces will start to determine the various tickets postions in the block as well as "lottery block lock time".
At this time the ticket information will look something like this

$ticket_info_arr = array(
   0   => array('address' => '149PWxjK2Qhk8dstLM1dj1xjK3vMFAqYAQ'),
   1   => array('address' => '1DSWekGtets5FGEDM9sMn8FriRwF5oRoKv'),
   ...
   9   => array('address' => '12jhjtTgCiobesqqXvFuZbePqVKppbyw8Q')
);


2.2.1 - Adding information to tickets
For each of the tickets purchased a call will be made to the API of blockcypher.com to dertermine the their timestamp. (See function getTimeTicketReceivedfor reference)
Tickets are now ordered according to their timestamp from blockcypher.com (in case of equal timestamp down to the millisecond, then algorithm is used to sort, see ticketArraySorter() for reference)

Once this information is collected, then it will all be display public and the draw will start approximately 10 minutes later.

2.2.2 - Get lottery block lock time
The "lottery block lock time" which later will be used to dertermine the url to call for the random beacon is found as the latest timestamp of any transaction in the lottery block.

3. The draw
The draw is based on mt_rand with a seed.

3.1 - Getting the seed
The seed is a combination of the bitcoin addresses in the ordered ticket_info_array and a random beacon found at https://beacon.nist.gov. The timestamp used for calling their API will be lottery block lock time + 10 minutes. Since these random beacon are calculated each minute, then this ensures that no one knows this until after the lottery block is locked. See calculateSeed() as getRandomBeacon() for reference.

So with this approach I belive it will be provably fair.

Here are the functionality:


function getSortedTicketInfoArray($ticket_info_arr) {
   
   foreach ($ticket_info_arr as $key => $ticket_info) {
      $ticket_info_arr[$key]['received'] = getTimeTicketReceived($ticket_info['tx_hash']);
   }
   
   usort($ticket_info_arr, 'ticketArraySorter');
}

function ticketArraySorter($a, $b) {
   $date_time_a = new DateTime($a['received']);
   $date_time_b = new DateTime($b['received']);
   
   if($date_time_a->getTimestamp() == $date_time_b->getTimestamp()) {
      
      if($date_time_a->format('u') == $date_time_b->format('u')) {
         
         $sorter_a = crc32($a['tx_hash']);
         $sorter_b = crc32($b['tx_hash']);
         
         if($sorter_a == $sorter_b) {
            
            $append = 0;
            
            while ($sorter_a == $sorter_b) {
               $sorter_a = crc32($a['tx_hash'].''.$append);
               
               $append++;
            }
         }
         
         return $sorter_a > $sorter_b ? 1 : -1;
         
      } else {
         return $date_time_a->format('u') > $date_time_b->format('u') ? 1 : -1;
      }
      
   } else {
      return $date_time_a->getTimestamp() > $date_time_b->getTimestamp() ? 1 : -1;
   }
}


function getTimeTicketReceived($tx_hash) {
   $url   = 'http://api.blockcypher.com/v1/btc/main/txs/'.$tx_hash;
   $json   = file_get_contents($url);
   $data   = json_decode($json);
   return $data->received;
}

function drawWinner($ticket_info_arr){
   
   $lottery_block_lock_time = getMaxTimeFromTicketInfoArray($ticket_info_arr);
   
   $random_beacon = getRandomBeacon($lottery_block_lock_time);
   
   $seed = calculateSeed($ticket_info_arr, $random_beacon);
   
   mt_srand($seed);
   
   $idx = mt_rand(0, count($address_arr) - 1);
   
   return $address_arr[$idx];
}

function getRandomBeacon($lottery_block_lock_time) {
   $timestamp   = strtotime($lottery_block_lock_time) + 60 * 10;
   
   if($timestamp > time() - 60) {
      return false;
   }
   
   $url      = 'https://beacon.nist.gov/rest/record/'.$timestamp;
   $sxe      = simplexml_load_file($url);
   
   return (string) $sxe->outputValue;
}

function getMaxTimeFromTicketInfoArray($ticket_info_arr) {
   
   $time = null;
   
   foreach ($ticket_info_arr as $ticket) {
      if(is_null($time) || $ticket['time'] > $time) {
         $time = $ticket['time'];
      }
   }
   return $time;
}

function calculateSeed($ticket_info_arr, $random_beacon){
   
   $hashed_addresses = '';
   
   foreach ($ticket_info_arr as $ticket_info){
      $hashed_addresses .= hash_hmac('sha256', $ticket_info->address, $random_beacon);
   }
   
   return crc32($hashed_addresses);
}


- So all secret token and salt is removed.
- Organisers should not be able to gain any advantage.
- Timestamps rely on 3rd party source.

Please feel free to give any comments.









member
Activity: 100
Merit: 10
January 14, 2016, 04:59:05 AM
#16

So now I can post the algorithm, that is developed

[...]

# A secret token and secret salt is made for every lottery block of 10 tickets

[...]

Again, please point out any problems with this method.

If the aim is to make it impossible for you to cheat by buying tickets, why are there any secrets?

If knowing the secret seeds would help a player cheat then knowing them would also help you cheat.

And if knowing the secret seeds would not help a player cheat then they don't need to be secret.

I didn't look much deeper into your algorithm, but I see you are using timestamps, which is usually problematic. Who decides the time at which a ticket was purchased. Transactions don't have timestamps, and different peers on the Bitcoin network will see transactions at different times. Are we going to take blockchain.info's word for when they first saw the transaction? If so, that's a point of trust. Or are we using the timestamp of the block containing the transaction? Then we're relying on the miner of that block. When there's 5000 BTC at stake it might be worth discarding a few 25 BTC blocks if their timestamp means we lose the raffle. And so on... But the 'secret' thing stands out as a bigger concern first.

Hi dooglus,

First of all, thank you for taking your time to reply on this.

I will try to address your points below:
"If the aim is to make it impossible for you to cheat by buying tickets, why are there any secrets?"
The secret token and secret salt is not put there to prevent organiser from cheating, but this is put there in order for participants not to cheat.
Please notice, that the secret token and salt is made public right after the draw and then participants can reverse engineer to verify that nothing has been altered since they purchased their ticket.
Upon receiving the the payment for at ticket, then the getLotteryHash() is made public along with the timestamp of entry.

"And if knowing the secret seeds would not help a player cheat then they don't need to be secret."
Thats actually a very good point. I guess the random beacon applied after the block is locked would would remove the need for any secret.
I will update algorithm. Thanks.

"I didn't look much deeper into your algorithm, but I see you are using timestamps, which is usually problematic"
I agree that timestamps are usually problematic. But here the timestamp of the ticket only serves as to put ticket into a position and the position is public shown instantly, then I am not sure how this could be problematic. The timestamp of the last ticket is off course also used to determine which date to get the random beacon from, but this is again not known a the time of last purchase.
I am think that off course "swapping positions" could be possible, if not external timestamp is used? But you alreayd know your position upon purchase.
I am not sure why timestamps would be an issue here. But if they are, then this off course needs to be fixed.

So timestamp of your purchase (Which currently is through to be internal server time, UTC) gives you the position in the lottery block (which will be a number between 0 and 9)
This is public the second we receive this.

The timestamp of the last ticket purchased (position 9) will be used as the timestamp for "locking" the lottery block.
The point however is that the random beacon is unknown at this point in time, so it makes no sense to alter with this.

I am more concerned, whether the random beacon is random enough or whether somebody knowing all the factors could manipulate this?

I will revert later with updated algorithm.


legendary
Activity: 2940
Merit: 1333
January 14, 2016, 02:59:01 AM
#15
1. The algorithm for selecting the winner in each should be a random algorithm based only on the bitcoin addresses participating.
I believe that it will very important, that this algorithm is public, so everyone can test that the draw is not tampered with in any way. But also must be so complex that nobody can predict any outcomes.
This part I think I have already covered with an algorithm that I have worked on and tested over the past couple of months.

I don't think this is as easy as you think it is to get right. I'll respond further when you post the algorithm, below.

I hope someone can suggest a complete transparent setup where participants at any time can verify that the prize pool is intact and I way where bitcoins can only be paid to winners.
And off course cannot be hacked.
Is this possible ?

I don't think it's possible using Bitcoin. Maybe using an Ethereum smart contact you could do something like this, where the contract takes care of paying out the winner and only the winner. As I understand it, if you have access to the bitcoins to send them to the winner, you also have access to the bitcoins to send them to yourself, or to someone who blackmails you, etc.

You could check RHavar thread (search it, https://www.pevpot.com/) - he made +EV lottery. I don't think you could compete this. As your will be -EV and have  big reputation here.

just for info....all casinos are -EV and all fiat and BTC lotteries are -EV

pevpot.com is a +EV BTC lottery. The site pays out more in prizes than it takes from players. The difference comes from sponsors who advertise on the site.

"EV" means "expected value" by the way.

You should really take a look at the pevpot thread since it is a great example of how to make a provably fair lottery, and the thread is a decent example of how to work with the forum community to improve the site.

Ultimately, however, we are left having to trust RHavar to pay out the correct winner each week, and not to steal the coins for himself. But at least we can be confident that the winner was fairly selected - we can verify the result for ourselves, and know that nobody was able to manipulate the result. (Well, everyone is able to manipulate the result, but it takes so long to calculate the effect of each manipulation that by the time your calculation finishes it is too late).

Normally I would not trust anyone claiming EV+ in lottery as this is not sutainable business model.

The idea is that players will flock to the site to play the +EV game, which will make the site attractive for advertisers, who will fund the +EV-ness of the site. I'm not sure how well it's working out, since I'm pretty much the only sponsor, and that's mostly only because I was given 1 BTC by the guy who won the first draw, and asked to use it to sponsor future draws.

So now I can post the algorithm, that is developed

[...]

# A secret token and secret salt is made for every lottery block of 10 tickets

[...]

Again, please point out any problems with this method.

If the aim is to make it impossible for you to cheat by buying tickets, why are there any secrets?

If knowing the secret seeds would help a player cheat then knowing them would also help you cheat.

And if knowing the secret seeds would not help a player cheat then they don't need to be secret.

I didn't look much deeper into your algorithm, but I see you are using timestamps, which is usually problematic. Who decides the time at which a ticket was purchased. Transactions don't have timestamps, and different peers on the Bitcoin network will see transactions at different times. Are we going to take blockchain.info's word for when they first saw the transaction? If so, that's a point of trust. Or are we using the timestamp of the block containing the transaction? Then we're relying on the miner of that block. When there's 5000 BTC at stake it might be worth discarding a few 25 BTC blocks if their timestamp means we lose the raffle. And so on... But the 'secret' thing stands out as a bigger concern first.
member
Activity: 100
Merit: 10
January 13, 2016, 08:31:03 AM
#14
So now I can post the algorithm, that is developed

The following has been taken into consideration:
1. Must be random
2. Must be provably fair
3. Organiser must not be able to tamper with result (Or take any advantage of knowing secret token / salt)

Please let me know, if you see any problems (at all)
# LOTTERY
# A secret token and secret salt is made for every lottery block of 10 tickets
# When someone enters lottery, then the following is made public
# - BTC Address
# - The time when ticket was bought
# - Lottery HASH - getLotteryHash()

$secret_token   = "some-secret-token";
$salt         = "some-salt";

function getLotteryHash($address,$salt,$secret_token) {
   return hash_hmac("sha256",$address.$salt,$secret_token);
}


When a block of 10 lottery tickets are filled, then the lottery block will be locked
The following will be displayed online
- Timestamp (UTC) of when the block was locked
Selecting random beacon
This we will select from https://blockchain.info/
The value selected will be the "Total number of Bitcoin transactions" for the date when the Lottery block was locked
(If the lottery block is locked less than 2 minutes before midnight, then the following day will be used)
The drawWinner($address_arr) function is run every hour until a winner is found
- $address_arr is ordered by time of enter
When winner is published, then $secret_token and $salt will also be published

function drawWinner($address_arr, $secret_token, $lottery_block_lock_time){
   
   if(is_null($random_beacon = getRandomBeacon($lottery_block_lock_time))) {
      return false;
   }
   
   mt_srand(calculateSeed($address_arr, $secret_token, $random_beacon));
   
   $idx = mt_rand(0, count($address_arr) - 1);
   
   return $address_arr[$idx];
}

function calculateSeed($lottery_bet_address_arr, $secret_token, $random_beacon){
   
   $hashed_addresses = '';
   
   foreach ($lottery_btc_address_arr as $address){
      $hashed_addresses .= hash_hmac('sha256', $address, $secret_token.$random_beacon);
   }
   
   return crc32($hashed_addresses);
}


function getRandomBeacon($lottery_block_lock_time) {
   
   $date = date('Y-m-d', strtotime($lottery_block_lock_time) + 60 * 2);
   
   $time = strtotime($date.' 18:15:05');
   
   $json = file_get_contents('https://blockchain.info/da/charts/n-transactions?format=json×pan=30days');
   
   $data = json_decode($json);
   
   foreach ($data->values as $info) {
      if($info->x == $time) {
         return $info->y;
      }
   }
   return null;
}


Again, please point out any problems with this method.
legendary
Activity: 2156
Merit: 1082
January 13, 2016, 05:49:54 AM
#13
generally, i play more in lottery (italian lottery, superenalotto and lotto), i don't have understand why the bitcoin user like play a dice game and not a lottery, with big bonus.
i think a good idea can is associate a bitcoin lottery with a normal lottery ? Example, the number of winner is the same of italian lottery
member
Activity: 100
Merit: 10
January 13, 2016, 03:39:08 AM
#12
There isn't any particular interest in general in BTC gambling.

You could check RHavar thread (search it, https://www.pevpot.com/) - he made +EV lottery. I don't think you could compete this. As your will be -EV and have  big reputation here.

If "EV" means "Expected Value"?
Normally I would not trust anyone claiming EV+ in lottery as this is not sutainable business model.
legendary
Activity: 1974
Merit: 1014
All Games incl Racer and Lottery game are Closed
January 13, 2016, 03:02:26 AM
#11
There isn't any particular interest in general in BTC gambling.

You could check RHavar thread (search it, https://www.pevpot.com/) - he made +EV lottery. I don't think you could compete this. As your will be -EV and have  big reputation here.

could you please read this again There isn't any particular interest in general in BTC gambling. and explain why there is no interest in BTC gambling? or are you only showing us your nice signature?

just for info....all casinos are -EV and all fiat and BTC lotteries are -EV
member
Activity: 100
Merit: 10
January 13, 2016, 02:46:25 AM
#10
Storing btc part comes later but first who will trust and buy lottery from you or your company? Because in lottery quite a big amount will be generated before you distribute to the winner so I don't think any one will trust new company and put money into it.

I completely agree. If nobody trust it, then no tickets will be sold. A little advantage is that the company is not brand new, but I still agree that some sort of control of funds deposited into the lottery is needed. This is excatle my questiob whether this is possible in some way, or will I have to coorporate with a big accounting firm or similar to hold these funds.
member
Activity: 100
Merit: 10
January 13, 2016, 02:39:22 AM
#9
There isn't any particular interest in general in BTC gambling.

You could check RHavar thread (search it, https://www.pevpot.com/) - he made +EV lottery. I don't think you could compete this. As your will be -EV and have  big reputation here.

Can someone help me with the abbreviation "EV". Not sure what this is.
legendary
Activity: 1162
Merit: 1002
January 13, 2016, 02:35:13 AM
#8
There isn't any particular interest in general in BTC gambling.

You could check RHavar thread (search it, https://www.pevpot.com/) - he made +EV lottery. I don't think you could compete this. As your will be -EV and have  big reputation here.
hero member
Activity: 910
Merit: 1000
January 13, 2016, 02:05:42 AM
#7

first thing came up my mind is: another ponzi but this time he gave us the ceiling ... 5000 BTC and he's gone

don't expect much unless you become registered company (provide people legal way to chase you...just in case) or use escrow ... guess there is no other way 



@wusolini
I know there are many ponzi schemes out there. This is excatly why I do not want to do this before I have checked evertyhing needed to make it complete transparent. Good point with the company. I already have such and the company also have a gambling license. This is just basic stuff. But I want suggestions how to even further ensure that funds are kept save and available for winning tickets. It must be possible in some way.
Also no need to do ponzi scheme on this, since less than 100% percent of revenue goes back to winners, so there is already profit. If you have any suggestions how to make storing of paid in bitcoins transparent, I will be very happy to hear about this.

Storing btc part comes later but first who will trust and buy lottery from you or your company? Because in lottery quite a big amount will be generated before you distribute to the winner so I don't think any one will trust new company and put money into it.
member
Activity: 100
Merit: 10
January 13, 2016, 02:00:55 AM
#6

first thing came up my mind is: another ponzi but this time he gave us the ceiling ... 5000 BTC and he's gone

don't expect much unless you become registered company (provide people legal way to chase you...just in case) or use escrow ... guess there is no other way 



@wusolini
I know there are many ponzi schemes out there. This is excatly why I do not want to do this before I have checked evertyhing needed to make it complete transparent. Good point with the company. I already have such and the company also have a gambling license. This is just basic stuff. But I want suggestions how to even further ensure that funds are kept save and available for winning tickets. It must be possible in some way.
Also no need to do ponzi scheme on this, since less than 100% percent of revenue goes back to winners, so there is already profit. If you have any suggestions how to make storing of paid in bitcoins transparent, I will be very happy to hear about this.
legendary
Activity: 1190
Merit: 1000
no need to carry heavy money bags anymore
January 12, 2016, 02:55:34 PM
#5

first thing came up my mind is: another ponzi but this time he gave us the ceiling ... 5000 BTC and he's gone

don't expect much unless you become registered company (provide people legal way to chase you...just in case) or use escrow ... guess there is no other way 

hero member
Activity: 812
Merit: 1000
January 12, 2016, 10:32:57 AM
#4
Not going to comment on the flaws of the system but this is my general opinion on Bitcoin lotteries, a lot many have been tried in the past but almost all of them failed because of low/no interest.

Even if you can make it completely fair and trusted, you'd have a hard time getting people to bet, gamblers (BTC gamblers especially) have no patience and prefer instant results and things with less complications, which is why you'll see most of them playing on dice, because it is as easy as 1+1=2 and it is instant, you can bet 100s of times in a minute and results are instant, whether you win or lose.

But if you still think you want to do this then make a test website with your system to start with and then testers can share their views on what is good/bad and what needs to be changed.
hero member
Activity: 700
Merit: 500
January 12, 2016, 09:28:45 AM
#3
Please also mention if you see any potential places for mistrust as my aim will be to make this complete transparent and fair.
To be honest i am not a security developer or an expert in these subject but i am fairly sure that Nico,dooglus and other active guys are going to point it out as soon as they see any flaw or anything which might not be considered fair in some sense.
legendary
Activity: 1974
Merit: 1014
All Games incl Racer and Lottery game are Closed
January 12, 2016, 02:07:10 AM
#2
Hi all,

I am a fairly new member to the bitcointalk community and is seeking some help from experienced users.

I have been working on a business idea for a couple of months now involving lottery and bitcoins.
However it seems like there in general is a lot of scam (and thereby mistrust) within Bitcoin businesses in general.
This is why I need help. So let me first tell about the business idea.

I want to establish a world wide lottery, where you by transferring a certain amount to a certain bitcoin address will have entered with a ticket.
The idea is that 1 in 10 tickets will win, while one very lucky ticket will win 5.000 Bitcoins (based on 1 ticket cost of 0,01 btc)
So to explain:
Every time 10 tickets are sold, then these 10 tickets enter into a draw for 20% of the total ticket costs.
A random ticket is selected and the winnings are paid back to the winner. If you win in this first round, then you also advance to the second round.

So when 10 x 10 tickets have been sold, then a new draw between the previous 10 advancing tickets will occur for 15% of the total ticket price (of 100 tickets) and the winner will advance to 3rd round.

and so on... until a very lucky winner have won 5000 bitcoin.

Well I am have had a few considerations.

1. The algorithm for selecting the winner in each should be a random algorithm based only on the bitcoin addresses participating.
I believe that it will very important, that this algorithm is public, so everyone can test that the draw is not tampered with in any way. But also must be so complex that nobody can predict any outcomes.
This part I think I have already covered with an algorithm that I have worked on and tested over the past couple of months.

2. Securing the bitcoins
This is where I really hope to get some input from some of the users in here. (The more sceptic, the better)
How should I do to proff to participants, that price money are secured and intact?
First of all I do not like the idea of storing all that bitcoin in an online wallet, since these can be hacked.
Second I do not like to use any "escrow services" as this is just moving the risk of fraud from 1 place to another.
I hope someone can suggest a complete transparent setup where participants at any time can verify that the prize pool is intact and I way where bitcoins can only be paid to winners.
And off course cannot be hacked.
Is this possible ?

Please also mention if you see any potential places for mistrust as my aim will be to make this complete transparent and fair.

Regards Snezzy


I would propose that you read the following thread  and pay attention to @dooglus answers and explanations

https://bitcointalksearch.org/topic/btc-rafflecom-provably-fair-referral-system-player-vs-player-1312679
member
Activity: 100
Merit: 10
January 11, 2016, 09:28:30 AM
#1
Hi all,

I am a fairly new member to the bitcointalk community and is seeking some help from experienced users.

I have been working on a business idea for a couple of months now involving lottery and bitcoins.
However it seems like there in general is a lot of scam (and thereby mistrust) within Bitcoin businesses in general.
This is why I need help. So let me first tell about the business idea.

I want to establish a world wide lottery, where you by transferring a certain amount to a certain bitcoin address will have entered with a ticket.
The idea is that 1 in 10 tickets will win, while one very lucky ticket will win 5.000 Bitcoins (based on 1 ticket cost of 0,01 btc)
So to explain:
Every time 10 tickets are sold, then these 10 tickets enter into a draw for 20% of the total ticket costs.
A random ticket is selected and the winnings are paid back to the winner. If you win in this first round, then you also advance to the second round.

So when 10 x 10 tickets have been sold, then a new draw between the previous 10 advancing tickets will occur for 15% of the total ticket price (of 100 tickets) and the winner will advance to 3rd round.

and so on... until a very lucky winner have won 5000 bitcoin.

Well I am have had a few considerations.

1. The algorithm for selecting the winner in each should be a random algorithm based only on the bitcoin addresses participating.
I believe that it will very important, that this algorithm is public, so everyone can test that the draw is not tampered with in any way. But also must be so complex that nobody can predict any outcomes.
This part I think I have already covered with an algorithm that I have worked on and tested over the past couple of months.

2. Securing the bitcoins
This is where I really hope to get some input from some of the users in here. (The more sceptic, the better)
How should I do to proff to participants, that price money are secured and intact?
First of all I do not like the idea of storing all that bitcoin in an online wallet, since these can be hacked.
Second I do not like to use any "escrow services" as this is just moving the risk of fraud from 1 place to another.
I hope someone can suggest a complete transparent setup where participants at any time can verify that the prize pool is intact and I way where bitcoins can only be paid to winners.
And off course cannot be hacked.
Is this possible ?

Please also mention if you see any potential places for mistrust as my aim will be to make this complete transparent and fair.

Regards Snezzy







Jump to: