Pages:
Author

Topic: [ANN] Bitcointalk Giveaway Manager - page 2. (Read 713 times)

legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
January 25, 2023, 07:16:36 PM
#13
Bugs:
Now we have an integer (1 to 16777215) from the blockhash.
This should be:
0 to 16777215

For additonal winners, the past winners are removed from the list and one more digit is added from the blockhash. A maximum 50 was added to avoid bugs.
That's too much. The shortest block hash until now is:
Code:
0000000000000000000000005d6f06154c8685146aa7bc3dc9843876c9cefd0f
That's only 40 characters. To be (very) safe, you should probably limit it to about 30 winners if you keep the method of adding a digit. My preferred alternative: add a nonce for each winner: take the sha256sum of "blockhash+1" and use those digits. That gives an unlimited number of potential winners.

I did a test, and checked the first 3 winners: your math checks out Smiley

Thank you, very sharp. I made all your suggestions, already in production.

About this nonce alternative, I will take a look later.

Quote
Feature requests Cheesy
Can you add a "unique URL" and "future block" feature? Example: If I enter 4 usernames, I'd like to be able to pick a block in the future. That should give me an URL that I can share here, so participants can follow the giveaway.
Even if the block isn't in the future, a unique URL would be really cool to share the results.

I hade to use some cryptography to accomplish this, but it was easier than I expected.

I saved all the saved data in a variable and encrypted it using AES.
Then I saved this encrypted data in a unique URL.

As it is not sensible data, I just added the private keys in the script file.
When you load it, data decrypted and will fill out automatically.

Easily shareable!

Take a look:
https://bitcoindata.science/giveaway-manager/?U2FsdGVkX19E08GaMJDY1QNCMHlxQ4BoXO/TAEUSso0BHeEzziPww8wbM4/X+GHSUiyN6SPx0ilvAwu+//A7plknuyGUx/JgM/n8+qEoXeQzEisCo5zzepIskxTJefviVPRZwtFw6sUujNaJmlryVkWJ5t6eicz+NAemMECso3+8BS5hJ9k1qiZi/OtbyZFV0KR3BXxGKcZab+zKKDitPw==

Quote
To select the Target Block: can you show the current latest block (773565) instead of "1" to start with?

Done!!!




Tell me if you see any more bugs !
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
January 25, 2023, 11:41:00 AM
#12
Bugs:
Now we have an integer (1 to 16777215) from the blockhash.
This should be:
0 to 16777215

For additonal winners, the past winners are removed from the list and one more digit is added from the blockhash. A maximum 50 was added to avoid bugs.
That's too much. The shortest block hash until now is:
Code:
0000000000000000000000005d6f06154c8685146aa7bc3dc9843876c9cefd0f
That's only 40 characters. To be (very) safe, you should probably limit it to about 30 winners if you keep the method of adding a digit. My preferred alternative: add a nonce for each winner: take the sha256sum of "blockhash+1" and use those digits. That gives an unlimited number of potential winners.

I did a test, and checked the first 3 winners: your math checks out Smiley



Feature requests Cheesy
Can you add a "unique URL" and "future block" feature? Example: If I enter 4 usernames, I'd like to be able to pick a block in the future. That should give me an URL that I can share here, so participants can follow the giveaway.
Even if the block isn't in the future, a unique URL would be really cool to share the results.
To select the Target Block: can you show the current latest block (773565) instead of "1" to start with?
legendary
Activity: 1988
Merit: 1718
January 25, 2023, 09:52:37 AM
#11
It's really great that you are doing the work and creating such a page. This will surely enable newbies to hold a fair and equitable free raffle to avoid misunderstandings like current Rbah´s free raffle. While it doesn't solve the payout issue, but it is a good step in the right direction.  Smiley

-snip- However, I can add this feature. I will take a look. -snip-
Examplens suggestion is really good. This definitely gives more opportunities to use the site in different ways.  Smiley
legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
January 25, 2023, 08:46:07 AM
#10
here, the giveaway initiator just randomly adds participants? how does each participant know his winning number?
Are you thinking about the possibility that everyone chooses their own "random" number, like the previous way by an entry in the thread? I know that many people have their "lucky" numbers and always choose them if they are available.


About this, the conclusion of the discussion was that those giveaways are easily verified.

This giveaway manager is more focused in the contests like this, where people just add their addresses. Each participant number is in the order of applications.
https://bitcointalksearch.org/topic/50-in-btc-giveaway-5435424

However, I can add this feature. I will take a look.

There's only a small bug. If you set the number of winners to 50, only 1 winner will be selected.

Thanks, That is really a bug. Now fixed.
legendary
Activity: 2380
Merit: 5178
January 25, 2023, 08:32:58 AM
#9
Now you can add up to 50 winners (i put those limits to avoid unnecessary  loops with big numbers).
I just tested the tool with some random inputs and it seems that everything is working well.
There's only a small bug. If you set the number of winners to 50, only 1 winner will be selected.
legendary
Activity: 3248
Merit: 3098
January 25, 2023, 08:10:46 AM
#8
here, the giveaway initiator just randomly adds participants? how does each participant know his winning number?
Are you thinking about the possibility that everyone chooses their own "random" number, like the previous way by an entry in the thread? I know that many people have their "lucky" numbers and always choose them if they are available.
legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
January 25, 2023, 12:11:41 AM
#7
Simple math: you use 1 digit, 0-9, and have 6 participants. That means the first 4 participants have 2 out of 10 chance, the last 2 have 1 out of 10 change of winning.
Easy fix: use 6 digits. Or even more. That makes the difference between positions in the list very small.

With already 4095 chances (fff), I believe the changes are OK, but I will add 3 more (ffffff)

That is a nice suggestion for the problem.

Then I can roll again with 1 more digit for each subsequent winner.

Added all the changes!

Now you can add up to 50 winners (i put those limits to avoid unnecessary  loops with big numbers).

Also, it has now 6 digits to find the first winner.
legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
January 24, 2023, 04:53:57 PM
#6
Simple math: you use 1 digit, 0-9, and have 6 participants. That means the first 4 participants have 2 out of 10 chance, the last 2 have 1 out of 10 change of winning.
Easy fix: use 6 digits. Or even more. That makes the difference between positions in the list very small.

With already 4095 chances (fff), I believe the changes are OK, but I will add 3 more (ffffff)

That is a nice suggestion for the problem.

Then I can roll again with 1 more digit for each subsequent winner.
hero member
Activity: 1643
Merit: 683
LoyceV on the road. Or couch.
January 24, 2023, 04:36:11 PM
#5
Simple math: you use 1 digit, 0-9, and have 6 participants. That means the first 4 participants have 2 out of 10 chance, the last 2 have 1 out of 10 change of winning.
Easy fix: use 6 digits. Or even more. That makes the difference between positions in the list very small.
legendary
Activity: 2380
Merit: 5178
January 24, 2023, 04:35:09 PM
#4
LoyceV is right about different chances of winning.

Assume that there are 10 participants.

The participant number 1 wins the game if the outcome is 0, 10, 20, 30, ... 4090.
The participant number 2 wins the game if the outcome is 1, 11, 21, 31, ... 4091.
The participant number 3 wins the game if the outcome is 2, 12, 22, 32, ... 4092.
........
........
The participant number 10 wins the game if the outcome is 9, 19, 29, 39, ...., 4089

The participants 1-6 will have slightly bigger chance than participants  7-10.
The chance of winning for participants 1-6 will be  410/4096 and the chance of winning for participants 7-10 will be 409/4096
legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
January 24, 2023, 04:26:50 PM
#3
What if there's more than 1 winner?

This is an additional feature. I can think about a solution for this. I can just add one more hex digit for each new winner to be rolled.

Quote
What if the hash ends on 007 and there are 8 participants?

The result to this operation is 7
You can check in the jsfiddle
https://jsfiddle.net/ruxqjoLt/

Quote
I'm wondering if all candidates have the same odds: what if the number of participants is large: my gut feeling tells me the first one on the list is more likely to be picked than the last one (LoyceV do the math).

I don't know if that makes sense, maybe someone who knows more statistic can help us. DdmrDdmr?
The number is a 3 digit hex, maximum 4095 in decimal.

If the division has no remainder,  it is zero so the first in list.
It cannot has  more remainders than the number it is divided by...

It looks OK to me. But I am no math specialist
hero member
Activity: 1643
Merit: 683
LoyceV on the road. Or couch.
January 24, 2023, 03:59:14 PM
#2
What if there's more than 1 winner?
What if the hash ends on 007 and there are 8 participants?
I'm wondering if all candidates have the same odds: what if the number of participants is large: my gut feeling tells me the first one on the list is more likely to be picked than the last one (LoyceV do the math).
legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
January 24, 2023, 03:44:24 PM
#1
Based on suggestions from many users in this post I created this simple tool to give more transparency and credibility to giveaways here, specially from honest newbies


https://bitcoindata.science/giveaway-manager/



Giveaways can now have their results easily verified.

It is also possible to save and share the results in a unique URL.



Provably fair giveaway manager

As the blockhash is just a number, its last 6 digits is converted to decimal using this function:

Code:
var decimal = parseInt(blockhash.slice(-6), 16);

Now we have an integer (0 to 16777215) from the blockhash.

After dividing this decimal by the number of participants, we use the modulo operator (%) to get the division remainder becomes the index_number.

This index_number is applied in the participants list, to get the position of the winner.

Code:
var index_number = decimal % competitors.length;
var winner = competitors[index_number];

For additional winners, the past winners are removed from the list and one more digit is added from the blockhash. A maximum 30 was added to avoid working with big numbers.



If you find this useful  , please refer this tool in upcoming giveaways
Pages:
Jump to: