Pages:
Author

Topic: RNG using Block informations - page 2. (Read 1935 times)

legendary
Activity: 1237
Merit: 1010
September 07, 2013, 10:26:58 AM
#8
Could you describe a specific use case?  i'm having a hard time imaging what the hmac_sha512 of a blockhash could be used for.

You could for instance take the first decimal via pregmatch and use it as a 0-9 RNG. My test script that I ran hundred of times (1 billion iterations each) verifies that it's evenly distributed 0-9 and no number is in favor.

Quote
Since I think the nonce is fairly random
Are you referring to the nonce in the block header?  If so, it's not necessarily random (it's possible to mine with nonce set to a constant, for example), and it's certainly quite biased.

Okay, how about taking the exact blocksize as the second secret then? That should be unguessable before the block gets found/generated?

Then how would you know it beforehand to use it yourself?

Not beforehand, the second a new block is found the information is there and I can use it for 1 conf txs.

Are you familiar with the usual techniques existing sites use to accomplish "provably fair" ?

If so what is it about their method(s) that make them unsuitable for your use-case (and thus requires you to re-invent their apparently not so elegant after-all wheel)?

I just want it to be a full transparent RNG layer on top of the block chain.
legendary
Activity: 2940
Merit: 1090
September 07, 2013, 08:57:44 AM
#7
Are you familiar with the usual techniques existing sites use to accomplish "provably fair" ?

If so what is it about their method(s) that make them unsuitable for your use-case (and thus requires you to re-invent their apparently not so elegant after-all wheel)?

-MarkM-
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
September 07, 2013, 07:32:19 AM
#6
Could you describe a specific use case?  i'm having a hard time imaging what the hmac_sha512 of a blockhash could be used for.

You could for instance take the first decimal via pregmatch and use it as a 0-9 RNG. My test script that I ran hundred of times (1 billion iterations each) verifies that it's evenly distributed 0-9 and no number is in favor.

Quote
Since I think the nonce is fairly random
Are you referring to the nonce in the block header?  If so, it's not necessarily random (it's possible to mine with nonce set to a constant, for example), and it's certainly quite biased.

Okay, how about taking the exact blocksize as the second secret then? That should be unguessable before the block gets found/generated?

Then how would you know it beforehand to use it yourself?
legendary
Activity: 1237
Merit: 1010
September 07, 2013, 06:27:04 AM
#5
HMAC is usually used where the first argument is secret, and the "message" is the second argument.

You can use the blockhash, or the merkle root hash, both are random and practically unpredictable. The nonce for most gaming sites are usually incrementing, unless you are talking about the blockchain nonce used for that particular block.

The block time would be optional and not needed.

What is your intended purpose? Some game? You mention "Provably Fair". I personally like this kind of topic.

If you use public information for your RNG, then the results are predictable after the fact. This is good for games where the results are needed later, such as raffles or lottos. Not so much for games where you want the results now, such as dice games.

Yeah, in PHP it's the other way around  Wink http://www.php.net/manual/en/function.hash-hmac.php

So I could just hmac the blochhash and merkleroot and would get a non-predictable hash. That's good to know! I will run a couple of tests with merkleroots then.
legendary
Activity: 1237
Merit: 1010
September 07, 2013, 06:21:25 AM
#4
Could you describe a specific use case?  i'm having a hard time imaging what the hmac_sha512 of a blockhash could be used for.

You could for instance take the first decimal via pregmatch and use it as a 0-9 RNG. My test script that I ran hundred of times (1 billion iterations each) verifies that it's evenly distributed 0-9 and no number is in favor.

Quote
Since I think the nonce is fairly random
Are you referring to the nonce in the block header?  If so, it's not necessarily random (it's possible to mine with nonce set to a constant, for example), and it's certainly quite biased.

Okay, how about taking the exact blocksize as the second secret then? That should be unguessable before the block gets found/generated?
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
September 07, 2013, 06:15:47 AM
#3
HMAC is usually used where the first argument is secret, and the "message" is the second argument.

You can use the blockhash, or the merkle root hash, both are random and practically unpredictable. The nonce for most gaming sites are usually incrementing, unless you are talking about the blockchain nonce used for that particular block.

The block time would be optional and not needed.

What is your intended purpose? Some game? You mention "Provably Fair". I personally like this kind of topic.

If you use public information for your RNG, then the results are predictable after the fact. This is good for games where the results are needed later, such as raffles or lottos. Not so much for games where you want the results now, such as dice games.
hero member
Activity: 560
Merit: 517
September 07, 2013, 06:08:36 AM
#2
Could you describe a specific use case?  i'm having a hard time imaging what the hmac_sha512 of a blockhash could be used for.


Quote
Since I think the nonce is fairly random
Are you referring to the nonce in the block header?  If so, it's not necessarily random (it's possible to mine with nonce set to a constant, for example), and it's certainly quite biased.
legendary
Activity: 1237
Merit: 1010
September 07, 2013, 05:34:16 AM
#1
Hey guys,

okay, first of all I'm new to this crypto stuff and I know the issue of "Provably Fair" has been discussed over and over again. Yet I haven't quiet found any definite answer to my approach. What I want to do is make the RNG more transparent by taking the information of the next/current block found (txconf=1).

My approach so far looks like this:

Code:
hmac_sha512($blockhash, $nonce)

Since I think the nonce is fairly random and could never be guessed, using it as the secret would give me quiet a strong random variable which is also transparent at the same time. Now I read a lot of stuff about blockhashes tending towards lower numbers, so I should add something to the hash to make it even more random.

Would you think adding the blocktime would make it even more random or isnt necessary:

Code:
hmac_sha512($blockhash, $nonce+$blocktime)

Cheers
Pages:
Jump to: