Hi guys, I'd like to introduce a site I've been working on:
Nolimits-Lottery.comFeatures- no registration
- no tickets
- no price limit
- instant results (kind of)
- the more you send the higher your chances
- 5 winners
- daily, weekly, monthly draws
- 2 confirmations
- provably fair
DescriptionSo, basically this is a lottery with unusual properties: it's completely anonymous, no registration required, it doesn't have tickets or number guessing, there is no limit to the amount of bitcoin you can send in the each draw and chances to win are proportional to the amount you've sent. So for example if the draw pool is currently 75 BTC and you've just sent 25 BTC, totalling the pool at 100 BTC, your chances to win will be 25%
WinnersThere're 5 winners in each draw: 1st place winner takes 50% of the pool, second - 25%, third - 12.5%, forth - 6.75%, fifth - 3.125%, remaining amount is the house edge.
DrawsCurrently there is DAILY, WEEKLY and MONTHLY draws, their names are self explanatory I think.
Provably fairIt is provably fair of course. We use a combination of server side seed and transactions hashes: a server side seed and is pregenerated for each draw and its hash published while the draw is active and when the draw ends we publish the original seed. We concatenate it with transaction hashes to generate an unpredictable number that is used to determine lottery winners, you can read more at the
Fairness pageAnd we also have a python script that implements the algorithm and verifies results, you can inspect and run it, just give the draw id: python verify.py 25
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import json
import requests
import sys
from hashlib import sha256
def make_draw(amounts, hash):
hash_num = int(hash, 16)
total = sum(amounts)
total_bits = len(bin(total)) - 2
rand_num = int(bin(hash_num)[-total_bits:], 2)
offset = 0
while rand_num > total:
offset += 1
rand_num ^= int(bin(hash_num)[-total_bits-offset:-offset], 2)
i = lottery(amounts, rand_num)
return i
def lottery(elements, rand):
value = 0
for i,el in enumerate(elements):
value += el
if rand <= value:
return i
def prettify(dictionary):
return json.dumps(dictionary, indent=4, sort_keys=True)
URL = 'http://nolimits-lottery.com/api/draw/' + sys.argv[1]
draw = requests.get(URL).json()
#print "DRAW: ", prettify(draw)
participations = sorted(draw['participations'], key=lambda p:p['amount'], reverse=True)
amounts = map(lambda p:p['amount'], participations)
combined_hash = sha256(reduce(lambda acc, p: acc + p['txid'], participations, draw['seed'])).hexdigest()
total = sum(amounts)
reward = total/2
fee = total * 0.03125
i=0
results = []
while reward >= fee:
if not participations:
if results: results[-1]['amount']+=total-fee
break
winner = make_draw(amounts, combined_hash)
result = dict(
participation_id=participations[winner]['id'],
place=i+1,
amount=reward
)
results.append(result)
winning_participation = participations.pop(winner)
amounts = map(lambda p:p['amount'], participations)
total = reward
reward = total/2
combined_hash = sha256(combined_hash + winning_participation['txid']).hexdigest()
i+=1
#print "RESULTS: ", prettify(results)
real_winners = sorted(draw['winners'], key=lambda p:p['place'], reverse=True)
expected_winners = sorted(results, key=lambda p:p['place'], reverse=True)
for i, winner in enumerate(real_winners):
if not expected_winners[i]['participation_id'] == winner['participation_id']:
print("VERIFICATION FAILED")
exit(1)
print("RESULT VERIFIED")
TestnetAnd you can test it out safely for free using testnet version
http://testnet.nolimits-lottery.com/ just use some testnet faucet like
http://testnet.mojocoin.com/ to get free testnet bitcoins
Any feedback and suggestions are appreciated and welcomed.
Good luck to all.