Bitcoin Forum
June 23, 2024, 08:52:35 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: "Heads or tails" cointoss with Bitcoin transactions?  (Read 1021 times)
goodlord666 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


100%


View Profile
September 25, 2012, 07:54:19 PM
 #1

Hello,

it would be awesome if it were possible to do an unpredictable cointoss using bitcoin transactions such that you make a transaction of any amount and then have a public record of whether the cointoss turned out to be "heads" or "tails" (or 1/0).

We had a brief discussion on this recently here:
https://bitcointalk.org/index.php?topic=75252.msg1193694#msg1193694

But as it seems, the technology doesn't currently offer that possibility.

One could easily predetermine a future generated block, such as the next one, and see whether the timestamp turns out to be an even or an odd number. That would be sufficiently random and unpredictable, as well as publicly undisputable (for most earthly uses, anyway).

However, waiting on a block to be generated isn't practical for this.

Is it not possible to have the network append a small grain of random data to a tx msg that could not be predicted by the one making the transaction and thus make it serve as a reliable cointoss? Such as every node on the network flipping one bit in the tx msg (or not) as it passes it along?

It'd just be kinda cool.

gl






DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 25, 2012, 08:06:22 PM
 #2

If your random "source" comes from nodes it will be manipulated.  One could simply design a node which never loses.  There is no such thing as "the network" it is a network of individual nodes.

tx can't be modified because the exact tx is signed by the sender and that signature is only valid for the exact tx sent.  Even if you could modify the message your method would be trivial to defeat.  The attacker would simply only relay the tx to nodes under his control and thus control the number of binary "flips".

When building any system using the bitcoin network you should assume everything you receive is from malicious nodes and thus is untrusted until verified.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
September 25, 2012, 08:16:59 PM
 #3

satoshidice generated a huge pile of secrets, like many years worth.  They published hashes of each secret, and each day they reveal the prior day's secret.  You can compare the secret with your transaction hash and confirm that they aren't cheating.

That is one option.  The other option would be to put a delay in, and use the hash of the next block following the incoming transaction to decide if the flip won or not.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
September 25, 2012, 08:26:21 PM
 #4

Using the timestamp or other block data would make this vulnerable to a Finney attack.  You could mutually post an encrypted rock paper scissors roll in transactions, then mutually reveal the keys to see the results after they confirm.

There's no practical reason to do it in the blockchain; it would be faster to just do it in email or a TCP connection; but it could be done for novelty's sake.

It occurs to me that IP over blockchain would be possible.  I'm actually surprised no one has tried it.  If you think satoshidice is spammy you ain't seen nothing yet.  Smiley

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
runeks
Legendary
*
Offline Offline

Activity: 980
Merit: 1008



View Profile WWW
September 26, 2012, 12:38:18 AM
 #5

Is it not possible to have the network append a small grain of random data to a tx msg that could not be predicted by the one making the transaction and thus make it serve as a reliable cointoss? Such as every node on the network flipping one bit in the tx msg (or not) as it passes it along?
The creator of the transaction can add random information to the transaction if he wants. But other nodes receiving the transaction can't, because the transaction needs to be signed in order to be valid.

I think the problem here is more so related to the fact that a coin toss is non-deterministic, while all computer operations are deterministic. In other words, no one can practice a coin toss at home that always produces either heads or tails (not that I'm aware of at least), and then perform this toss when taking your bet. This is entirely possible with a computer, because you are in total control of the initial state and the operations that alter the initial state to produce some output.

In effect you are relying on some third party to provide you with random information. This is analogous to not performing a coin toss with a friend, but having a third friend toss the coin with a "coin tossing machine", which can replicate earlier tosses perfectly. You have no way of knowing if the coin toss done by the machine is really random, because nothing about the output  will tell you if it was random or not.

I think we are dealing with an age old problem of creating non-determinism out of a deterministic system. To the best of my knowledge it hasn't been solved yet.
helloworld
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
September 26, 2012, 01:12:08 AM
 #6

It occurs to me that IP over blockchain would be possible.  I'm actually surprised no one has tried it.  If you think satoshidice is spammy you ain't seen nothing yet.  Smiley

Could it also be used as a storage space, a bit like how Freenet works?
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 26, 2012, 01:15:37 AM
 #7

This is analogous to not performing a coin toss with a friend, but having a third friend toss the coin with a "coin tossing machine", which can replicate earlier tosses perfectly. You have no way of knowing if the coin toss done by the machine is really random, because nothing about the output will tell you if it was random or not.

Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
September 26, 2012, 07:39:54 AM
 #8

I think we are dealing with an age old problem of creating non-determinism out of a deterministic system. To the best of my knowledge it hasn't been solved yet.

Modern computer systems are nondeterministic.  Bitcoin is sufficiently affected by network latency and being a randomly-wired network that it's chaotic to the point of being impossible to create a discrete model; you have to do it statistically.  The same goes for /dev/random / urandom which is are collected / seeded from high quality chaos such as keyboard interrupts.

Computers also have true random number generators.  Thermal noise in a resistor is popular and inexpensive method to capture quantum mechanical randomness.

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
September 26, 2012, 07:43:42 AM
 #9

Could it also be used as a storage space, a bit like how Freenet works?

It already is.  There are a lot of small plaintext strings in the blockchain already, and likely a bunch of encrypted data that we can't measure.  It's pretty expensive storage per byte though.

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1129


View Profile
September 26, 2012, 11:26:26 AM
 #10

The creator of the transaction can add random information to the transaction if he wants.

Signature are themselves random, so every transaction is random including if you recreate it/resign it a few times from scratch.

However, that's obviously pointless for the requested use case because you can just keep resigning until you get the result you want, or pick k such that it gives the desired result.

The best way to use Bitcoin as an RNG is to just look at some bits of the hash of the block buried N blocks deep. If you want instant randomness, Bitcoin can't do that.

However there may be other cryptographic protocols that can, eg, MPC.
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!