Bitcoin Forum
January 21, 2021, 09:27:07 AM *
News: Latest Bitcoin Core release: 0.21.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 [5]
81  Economy / Marketplace / Re: Bitcoin Lottery: minimum amount just 0.01 bc! A few hours left... on: May 28, 2011, 06:00:22 PM
Then it must be 0.16 btc now =)
82  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (3 to go), minimum amount just 0.01 btc! on: May 28, 2011, 05:38:03 PM
Wait are you saying I am guaranteed 0.01 BTC in profit + a chance to win if I transfer you my 0.01 BTC?Huh?
Yes, that was actually the case Wink For me 6 * 0.03 = 0.18, bigger than the jackpot size Wink
83  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (3 to go), minimum amount just 0.01 btc! on: May 28, 2011, 03:03:12 PM
Size is 0.11 bitcoin now!
84  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (3 to go), minimum amount just 0.01 btc! on: May 28, 2011, 11:52:47 AM
I did now =)
85  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (3 to go), minimum amount just 0.01 btc! on: May 28, 2011, 11:11:01 AM
ok i finally managed to transfer Cheesy am i still on of the first 6 ?
Yes, but I didn't recieve it? http://blockexplorer.com/address/12AtrGLZmFQKe25EMtUy5fGWEBeHFdoGD3
86  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (3 to go), minimum amount just 0.01 btc! on: May 28, 2011, 07:56:11 AM
Just 14 hours to go! You can still get your 0.02 btc!
87  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 05:05:01 PM
Do you know whether the transaction hashes are totally random/uncontrollable? If so, the hashes can be added up and used for the random generator as quite easy alternative.
They are fairly random. BUT the RANDOM number for the winner has to come after all the tickets, for IF the user knows what transaction hash will win they could re-send over and over until they get a hash that wins. For mine, I wait till the tickets are in then set up finding who won.
Do you think it is secure now?

Edit: okay it is still possible for me to try and try till I win... so that's the reason to add the hash of block 1 and 2 after 0:00... =) I maybe implement that next week.
88  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 04:45:55 PM
Okay, I implemented a somewhat simple random generator. It is quite secure for now, but I will likely improve it in the future. The SHA 256 hash for the random string is:
Quote
8b3de709bd7c91e2eeeb42c2cce5f63f38866fa72075b3d4da8aa8c88f2c5a7c
89  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 01:31:23 PM
The algorithm changed by the way. The block size is now the average deposit.
90  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 01:30:20 PM
Do you know whether the transaction hashes are totally random/uncontrollable? If so, the hashes can be added up and used for the random generator as quite easy alternative.
They are fairly random. BUT the RANDOM number for the winner has to come after all the tickets, for IF the user knows what transaction hash will win they could re-send over and over until they get a hash that wins. For mine, I wait till the tickets are in then set up finding who won.
Yes I thought about that later. So basically secure hash the (big) random value and distribute the hash?
91  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 01:25:13 PM
I would like to join aswell, but I am new to bitcoin and only got 0.02 bc and it wont let me send 0.01
Always says something about transaction fee because the amount is too large!? Huh
The current client asks 0.01 btc if you send small amounts. That amount is far larger in the development code.
Strange that it won't let you send 0.01 if you have 0.02... Maybe try to get some other cents (mining, trading, etc)?
92  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 05:14:40 AM
Do you know whether the transaction hashes are totally random/uncontrollable? If so, the hashes can be added up and used for the random generator as quite easy alternative.
93  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 05:06:12 AM
Okay, great point! If the jackpot contains more than a few bitcoins I will surely look at what I can do. Your method is very nice by the way!
94  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 04:47:50 AM
I think I get what your doing... I think. I'm pretty tired and I don't know python so I'll have to look later.
I get that your trying to be open but even though people can see the code there is no way really for the users to know you are actually running it. Someone could just -say- they are going to run that code. Enter a few of their own entries. Tell the users that they ran the code but instead just pay themselves and make up results that fit. (I'm not saying you are doing this but for people to bet lot's of money they need CERTAINTY you can't cheat. I've seen a few lottery scams but I am willing to help you make it so that you can't cheat...) Anyways, good luck!
Yes, but I apply the same method as you do: people can see what comes in and out. So people can see it is paid to one / a few that participated=).
95  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 04:32:36 AM
Jackpot: 0.07, two days to go!
If the total jackpot is not more than a bitcoin I am inclined to reduce the size of the blocks (to not give everyone his deposit back, but get one or a few winners). I am thinking about what size would be the best? The average deposit?
Input welcome!
96  Economy / Marketplace / Re: Bitcoin Lottery: first 6 get 0.02 btc (directly), minimum amount just 0.01 btc! on: May 26, 2011, 04:08:07 AM
I sent you the 0.02 coin!
97  Economy / Marketplace / Re: Bitcoin Lottery: 100% payout, open source, with minimum amount of just 0.01 btc! on: May 25, 2011, 10:39:35 PM
The first 6 participants will get 0.02 bitcoin. So when you enter with 0.01 bitcoin you earn 0.01 and can also win the lottery!
98  Economy / Marketplace / Re: Bitcoin Lottery: 100% payout, with minimum amount of just 0.01 btc! on: May 25, 2011, 12:36:47 PM
Note: this lottery is just for fun, I don't want to earn any money with it.
99  Economy / Marketplace / Bitcoin Lottery: minimum just 0.01 btc! Next draw: July 1 Jackpot 1.52 btc on: May 25, 2011, 12:12:33 PM
What is the Bitcoin Lottery?

The Bitcoin Lottery is a lottery where anyone can win, the lottery takes no share and the process is transparent. The code that picks the winner(s) is open source.

How does it work?
You can send an arbitrary amount of bitcoins (minimum 0.01 bitcoin) to an adress. The adress for next lottery (closes July 1) is:

Quote
1LUeahDNnVwqh8utERNxPhoh7zdzSmh4AG
(view: http://blockexplorer.com/address/1LUeahDNnVwqh8utERNxPhoh7zdzSmh4AG)

When do I win and how much?
All bets are randomly assigned to a block. Each block is equal to the average deposit. The program picks randomly a block and returns the winners and their share (in percent).
For example, if you send 0.1 bitcoin and the average is 1 bitcoin, you probably end up in one block and then you win 10% of the draw.
If you send 1 bitcoin and the average is 1 bitcoin, you probably end up in two blocks randomly, for example 10 cents in one block and 90 cents in another. If you win with the first block you win 10%, the second block will return 90% of the draw. So to be sure to have the chance of winning 100% you need 2 bitcoins.
The program is designed in such a way the lottery will always return 100% of the jackpot size.

Don't you cheat?
No. The first and second block on 1 July (after 0:00 UTC) will be used as random strings by adding them and create a SHA256 hash.

The code (Python)
Code:
import math
tickets = [
    ["1Km4sASEeKUWPtjRaSxmVghF5FfkadWVei",2],
    ["18uZGH42pcmHVtZ8sux7bCf8oJJtSCAAJs",1],
    ["1Jmn97kfJ6DBBCuft6Z1oW8e2Lwgheyr6s",2],
    ["1Jmn97kfJ6DBBCuft6Z1oW8e2Lwgheyr6s",1],
    ["1Jmn97kfJ6DBBCuft6Z1oW8e2Lwgheyr6s",1],
    ]

class BitcoinLottery:
    def __init__(self):
        self.total = 0
        for x in tickets:
            self.total += x[1]
        self.BLOCKSIZE = int(math.ceil(self.total/float(len(tickets))))

    def shuffle(self, rand):
        i = 0
        prevx = 0
        for t in range(len(tickets)):
           j=0
           shuffle=0
           for x in range(t, len(rand)):
               j = j + ord(rand[x])
           shuffle = j % len(tickets) - i          
           tickets[i], tickets[i+shuffle] = tickets[i+shuffle], tickets[i]
           if (i < len(rand)-1):
               i+=1
           else:
               i=0  
   
    def calculate(self):
        blocks = []
        block=0
        for x in tickets:
            k = x[0]
            v = x[1]
            nblock=block
            while(v>0):
                r = self.BLOCKSIZE - block % self.BLOCKSIZE
                if (v <= r):
                    a = v
                    nblock+=v
                    v = 0
                else:
                    a = r
                    v -= r
                    nblock += r
                blocks.append([int(block/self.BLOCKSIZE),k,a])
                block = nblock
        rand = 0
        print("total: " + str(float(self.total)/100) + " bitcoins")
        for x in blocks:
            if (x[0] == rand):
                print(x[1] + " won " + str(float(x[2]*self.total)/10000 * (100/self.BLOCKSIZE)) + " bitcoins")
bit = BitcoinLottery()
bit.shuffle('3029309209i1');
bit.calculate()
Pages: « 1 2 3 4 [5]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!