Bitcoin Forum
November 02, 2024, 05:54:01 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Looking for random number generator based on blockchain  (Read 185 times)
LordShanken (OP)
Sr. Member
****
Offline Offline

Activity: 1112
Merit: 256


View Profile
December 05, 2022, 01:28:52 AM
 #1

Hello,

I am organizing a contest in which there will be a certain number of users. Everyone has a number.
In order to award a prize to one user, I'd like to make a blockchain based draw.
I want there to be no doubts and everyone was sure that the draw was 100% fair.
Is there any service/website that provides something like this?
(It's not about building something like this from scratch, because I'll probably need this only once.)
crwth
Copper Member
Legendary
*
Offline Offline

Activity: 2940
Merit: 1280


https://linktr.ee/crwthopia


View Profile WWW
December 05, 2022, 01:43:01 AM
 #2

Why not use the numbers or letters generated on a particular block? Like get the end of that and based on it or something.

Like block number X, let's say 766000. Get the hash of that, like 00000-42787 or something, then that's it.

The winning number would be 7. Or if you are choosing 00 - 99, it would be 87, something to that regard. Maybe this could help without generating anything like a program of some sort.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
LordShanken (OP)
Sr. Member
****
Offline Offline

Activity: 1112
Merit: 256


View Profile
December 05, 2022, 01:51:56 AM
 #3

Why not use the numbers or letters generated on a particular block? Like get the end of that and based on it or something.

Like block number X, let's say 766000. Get the hash of that, like 00000-42787 or something, then that's it.

The winning number would be 7. Or if you are choosing 00 - 99, it would be 87, something to that regard. Maybe this could help without generating anything like a program of some sort.

Interesting idea. Thank you for your suggestion.
I asked because I think I saw someone using something like this a while ago in some Bitcointalk contest. However, when I googled it, I couldn't find anything like that.
It is possible that someone has dealt with something like this and will answer here, if not, I will use your idea. Thanks
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
December 05, 2022, 01:05:47 PM
Merited by NeuroticFish (1), ABCbits (1), bitmover (1)
 #4

I asked because I think I saw someone using something like this a while ago in some Bitcointalk contest. However, when I googled it, I couldn't find anything like that.
Yes, using data from a block header is the most common way to settle a competition in a provably fair way, since it would be almost impossible for the person running the competition to manipulate the outcome.

Essentially, you get everyone to pick a number. Once all the votes are in, you pick an arbitrary block not too far in the future, look at its hash, and figure out the winner based on whatever criteria you used.

For example, the latest block is 765990, with the hash 000000000000000000019e0b0004a91010b557be966bfae8718a584d0d15a656. Bear in mind the hash is in hex, so the characters are from 0-9 and a-f.

So you could release 16 tickets from 0-f, and whoever matches the final character wins.
Or you could release 100 tickets from 00-99, and whoever matches the final two numbers wins (ignoring any letters).
Or you could release 256 tickets from 00-ff, and whoever matches the final two characters wins.
And so on.
bitmover
Legendary
*
Offline Offline

Activity: 2478
Merit: 6285


bitcoindata.science


View Profile WWW
December 05, 2022, 05:24:03 PM
 #5

I asked because I think I saw someone using something like this a while ago in some Bitcointalk contest. However, when I googled it, I couldn't find anything like that.
Yes, using data from a block header is the most common way to settle a competition in a provably fair way, since it would be almost impossible for the person running the competition to manipulate the outcome.

Essentially, you get everyone to pick a number. Once all the votes are in, you pick an arbitrary block not too far in the future, look at its hash, and figure out the winner based on whatever criteria you used.

This is the most common method and it is used quite a look in bitcointalk games and round section.

One example here:
https://bitcointalk.org/index.php?topic=5405097.0

LoyceV
Legendary
*
Offline Offline

Activity: 3486
Merit: 17613


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 05, 2022, 05:35:04 PM
 #6

Is there any service/website that provides something like this?
I've provided this service for Little Mouse.

Quote
(It's not about building something like this from scratch, because I'll probably need this only once.)
There's not much to it: choose a future block, and take the hash as input to create a semi-random result. This works for any number of participants.

▄▄███████████████████▄▄
▄█████████▀█████████████▄
███████████▄▐▀▄██████████
███████▀▀███████▀▀███████
██████▀███▄▄████████████
█████████▐█████████▐█████
█████████▐█████████▐█████
██████████▀███▀███▄██████
████████████████▄▄███████
███████████▄▄▄███████████
█████████████████████████
▀█████▄▄████████████████▀
▀▀███████████████████▀▀
Peach
BTC bitcoin
Buy and Sell
Bitcoin P2P
.
.
▄▄███████▄▄
▄████████
██████▄
▄██
█████████████████▄
▄███████
██████████████▄
███████████████████████
█████████████████████████
████████████████████████
█████████████████████████
▀███████████████████████▀
▀█████████████████████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀

▀▀▀▀███▀▀▀▀
EUROPE | AFRICA
LATIN AMERICA
▄▀▀▀











▀▄▄▄


███████▄█
███████▀
██▄▄▄▄▄░▄▄▄▄▄
████████████▀
▐███████████▌
▐███████████▌
████████████▄
██████████████
███▀███▀▀███▀
.
Download on the
App Store
▀▀▀▄











▄▄▄▀
▄▀▀▀











▀▄▄▄


▄██▄
██████▄
█████████▄
████████████▄
███████████████
████████████▀
█████████▀
██████▀
▀██▀
.
GET IT ON
Google Play
▀▀▀▄











▄▄▄▀
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6310


Self-proclaimed Genius


View Profile
December 07, 2022, 02:34:34 AM
 #7

It is possible that someone has dealt with something like this and will answer here, if not, I will use your idea. Thanks
There's a downside to that method though: you can't provide an exact time of the draw since blocks aren't always on schedule.
If the application is not strict to schedule, then it's good.

Also, do not use it if the amount at stake is a lot higher than the block reward (like 10x+) since a pool/solo miner can risk it to try produce another block hash with the winning number.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Timelord2067
Legendary
*
Offline Offline

Activity: 3850
Merit: 2238


💲🏎️💨🚓


View Profile
December 09, 2022, 02:55:44 PM
 #8

If you're interested in further reading then head over to random.org which has information on true randomness based on background noise versus longstrings of numbers.

There are tools for generating sets of numbers, scrambling lists - even choosing truly random colour palates. (Plus there is an app for your phone for random generation on the run).

NeuroticFish
Legendary
*
Offline Offline

Activity: 3850
Merit: 6583


Looking for campaign manager? Contact icopress!


View Profile
December 09, 2022, 07:01:58 PM
 #9

If you're interested in further reading then head over to random.org which has information on true randomness based on background noise versus longstrings of numbers.

There are tools for generating sets of numbers, scrambling lists - even choosing truly random colour palates. (Plus there is an app for your phone for random generation on the run).

It may be me, but I never liked random.org -based contests/raffles; there was always a chance the organizer may not play fair.
And I think that OP's point was not to generate "black box" randomness he cannot prove (and get accused he didn't do a fair draw) and instead use blockchain for obtaining in a transparent manner a "random enough" number whenever it's needed.

So imho the previous answers are explaining good some easy options OP can use. (I find the answer given by o_e_l_e_o the most complete and with good example too for easy understanding.)

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Timelord2067
Legendary
*
Offline Offline

Activity: 3850
Merit: 2238


💲🏎️💨🚓


View Profile
December 10, 2022, 01:08:14 AM
Merited by NeuroticFish (1)
 #10

I want there to be no doubts and everyone was sure that the draw was 100% fair.

That's the vexed question most participants of any competition have that a draw is unbiased.  The pilot episode of the TV series M*A*S*H has the winning ticket taped to the bottom of the glass jar.  Lotteries with ping pong balls have been rigged where a dot of paint was applied to weigh down some balls so others would be favoured.  Cards can be marked and roulette wheels have magnets to pull the ball to a certain slot - the list of rigged games of chance are seemingly endless from a search online.

If you start with the notion that your participants will accept the method used to draw results, then there shouldn't be any questioning of the results once they are obtained.

It may be me, but I never liked random.org -based contests/raffles; there was always a chance the organizer may not play fair.

That's quite true and your point is completely valid.  You've hit the nail on the head that sites such as random.org can be perceived as being biased and it's only the OP's word if they were to use a screen shot of the results hence the use of something beyond the control of us mortals (the block chain hashes).

So imho the previous answers are explaining good some easy options OP can use.

My suggestion was if the OP is interested in further reading on the subject of randomness in general.




Also, do not use it if the amount at stake is a lot higher than the block reward (like 10x+) since a pool/solo miner can risk it to try produce another block hash with the winning number.

Even the block chain result could be swayed one way or another it would seem.

o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
December 10, 2022, 12:54:56 PM
 #11

Even the block chain result could be swayed one way or another it would seem.
You would need a miner which has enough hashrate to produce multiple valid blocks in the time it takes the rest of the network to find a single valid block, and the prize of the competition would have to be sufficient for the miner to sacrifice a guaranteed block reward (currently in the region of $108,000) for a chance at winning your prize. Assuming 100 tickets, then even if the miner got incredibly lucky and found 3 blocks in the time it took the rest of the network to find one, you are still only talking about a less than 3% chance of finding one which lets them win. So as nc50lc points out, you would need a prize in the region of millions of dollars to make it even worth attempting.

And you can easily mitigate this by posting a hash of a message saying which block will choose the winner, and the revealing the contents of that hash after the block in question has been mined.
LoyceV
Legendary
*
Offline Offline

Activity: 3486
Merit: 17613


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 10, 2022, 01:22:53 PM
 #12

And you can easily mitigate this by posting a hash of a message saying which block will choose the winner, and the revealing the contents of that hash after the block in question has been mined.
In case of collusion with miners to cheat the lottery, I would assume the host is in on it. So the miners will know the content of the hidden hash, and can use that to alter the outcome.
It's all quite far fetched though, especially since changing the block hash doesn't even guarantee a certain desired result. All it does it change the random, which leads to a different winner.

▄▄███████████████████▄▄
▄█████████▀█████████████▄
███████████▄▐▀▄██████████
███████▀▀███████▀▀███████
██████▀███▄▄████████████
█████████▐█████████▐█████
█████████▐█████████▐█████
██████████▀███▀███▄██████
████████████████▄▄███████
███████████▄▄▄███████████
█████████████████████████
▀█████▄▄████████████████▀
▀▀███████████████████▀▀
Peach
BTC bitcoin
Buy and Sell
Bitcoin P2P
.
.
▄▄███████▄▄
▄████████
██████▄
▄██
█████████████████▄
▄███████
██████████████▄
███████████████████████
█████████████████████████
████████████████████████
█████████████████████████
▀███████████████████████▀
▀█████████████████████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀

▀▀▀▀███▀▀▀▀
EUROPE | AFRICA
LATIN AMERICA
▄▀▀▀











▀▄▄▄


███████▄█
███████▀
██▄▄▄▄▄░▄▄▄▄▄
████████████▀
▐███████████▌
▐███████████▌
████████████▄
██████████████
███▀███▀▀███▀
.
Download on the
App Store
▀▀▀▄











▄▄▄▀
▄▀▀▀











▀▄▄▄


▄██▄
██████▄
█████████▄
████████████▄
███████████████
████████████▀
█████████▀
██████▀
▀██▀
.
GET IT ON
Google Play
▀▀▀▄











▄▄▄▀
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
December 10, 2022, 07:12:14 PM
 #13

All it does it change the random, which leads to a different winner.
The assumption is that the miner would be changing the winner to themselves or someone who is willing to split the prize with them. But as above, the chance of them finding a block which also picks the "right" winner from 100 or more tickets is very small indeed.

In case of collusion with miners to cheat the lottery, I would assume the host is in on it. So the miners will know the content of the hidden hash, and can use that to alter the outcome.
So you get the host to commit to a block number without revealing it, such as via a hash as I suggested above. You also get every participant to commit to an offset number, also without revealing it, say between -500 and +100. Assuming the number of participants is n, then the host waits until 100*n blocks beyond the block number they chose (just in case every participant chose +100 as their offset number), and then reveals the block number. All the participants also reveal their offset number, everything is summed, and that is the block number you use to pick the winner. Provided at least one participant is honest, then the block number cannot be predicted. And if every participant is in on the scam, then what's the point in the first place?

But again, this is all needlessly complex and would only even be worth thinking about if the competition in question had a prize worth millions or even tens of millions of dollars.
buwaytress
Legendary
*
Offline Offline

Activity: 2982
Merit: 3687


Join the world-leading crypto sportsbook NOW!


View Profile
December 10, 2022, 07:31:38 PM
 #14

Adding on to the very suitable suggestions above of using hash of future block, I even think simpler outcomes like tx count or input count are easier and plan to use it for a future lottery I'll be doing (hash is simple for me but it does seem to confuse others).

A lot easier to collude than hash, but as pointed out above as well, absolutely doesn't make financial sense for such a small prize, if anyone would think a miner might collude to win it might as well pursue flat earth theories.

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!