Bitcoin Forum

Bitcoin => Project Development => Topic started by: ben-abuya on May 26, 2011, 03:34:13 PM



Title: [RFC] Betcoin
Post by: ben-abuya on May 26, 2011, 03:34:13 PM
Betcoin

Betting, or prediction markets could be a central building block in the bitcoin economy. These markets can essentially assume the major functions of currency exchanges, stock markets, and insurance policies and provide invaluable prediction information. In fact, it’s hard to overestimate the power of unregulated prediction markets. If this proposal pans out, they could be implemented entirely within the bitcoin framework, and thus will inherit all of bitcoin’s distributed goodness.

The central insight here is that these prediction markets do not require a centralized referee at all, and therefore can be settled automatically by miners. The outline below borrows a lot of ideas from Intrade. It applies to a binary event outcome, so it’s not directly applicable to currency exchanges and the like, but if the basic idea is valid, it could probably be extended to more open ended bets pretty easily, as long as the value at risk can be bounded.

How it could work:

1. Someone creates a bet on a distributed betting board. The bet is made up of a unique bet id, a human-language description of the bet, a description of which circumstances will lead to a true or false outcome, and an expiration date. The expiration date can occur before the outcome happens. The bet is authenticated and entered into the block chain by a miner.

2. Once the bet is created, trade commences. A party can put in either a bid or an offer on a distributed board. Parties use the board to connect to counter-parties and transact a trade. Short selling is an integral part of the system, but is fully covered by an escrow payment.

3. If Alice and Bob agree on a trade of x shares at price y btc, they submit a secure trade agreement to the betcoin network. The price of a share can range between 0 and 10 (representing the probability that the event will occur as described). A miner authenticates the trade and adds it to the block chain. This includes a bitcoin transfer from each party to a special escrow account, which will cover any possible losses. This amount is between 0 and 10 btc per bet share. If either party does not have enough bitcoins to cover the escrow, the trade is invalid and does not enter the block chain.

4. Trade continues as usual until the expiration date. At this point, the bet is closed. The miner closes out all bets as follows: A closing price is determined by checking the last traded price in the block chain. Trades entered after the expiration date are invalid and do not enter the block chain. Bitcoins are transferred to all parties from the escrow account, awarding them the closing price of the bet, multiplied by the number of shares they’ve purchased. Parties also recieve their residual escrow funds back, minus the closing price multiplied by the number of shares they’ve sold.

5. If the event outcome has been determined in the real world, the bet price should reflect the outcome very closely and should be near 0.0 or 10.0. The bet can therefore be considered successfully closed.

6. If the event outcome has not been determined, the bet price should be very close to the concensus probability that it will happen. Trade can continue on a parallel bet that is either identical, or very similar to the original bet, and has an expiration date in the future. Speculation will ease the transition between bet series.

I haven’t seen this idea described this way before, so i’d love to get feedback on any glaring flaws I haven’t thought of. Assuming it holds water, I’m very interested about how much of it can be implemented in the current bitcoin design itself. Obviously this is a first, naive sketch and there’s plenty of room for improvement.


Title: Re: [RFC] Betcoin
Post by: Cusipzzz on May 26, 2011, 03:38:29 PM
Versions of this are already being built - I'm finishing one up myself. Basically Betfair (sports) / Intrade (current events) with fixed contract size and btc accounting.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on May 26, 2011, 03:51:22 PM
Versions of this are already being built - I'm finishing one up myself. Basically Betfair (sports) / Intrade (current events) with fixed contract size and btc accounting.

From what I understand, Intrade and Betfair determine the outcome of the event themselves and then settle the amounts. Does your version require an outside observer to determine the event outcome?


Title: Re: [RFC] Betcoin
Post by: Cusipzzz on May 26, 2011, 03:56:53 PM
Yes, my version requires me to verify and mark the outcome of an event.

However, these outcomes are very public and easily verified if any mistakes are made.

I understand you want to add your 'bets' to the blockchain and have a version of auto-settlement - but frankly I'd prefer less blockchain spam / escrow accounting and have it be fully post-up to remove the counterparty risk.

Of course the site would need to be trusted, a la mtgox. I already run a site that has been handling transactions for hundreds of trusting users since January, so that should help.

But of course there will be competition and if another solution works better, then so be it.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on May 26, 2011, 04:20:52 PM
To me, the most important part of this kind of betting is that it would be as immune to government crackdown as bitcoin. As soon as there's a centralized referee, it becomes a lot easier to go after that entity. And the more the entity hides its identity, the harder the trust issues become.

So the question I was posing is whether it's possible to have a betting market that doesn't require any more centralization than bitcoin itself, and whether my analysis has big problems that I'm not identifying.


Title: Re: [RFC] Betcoin
Post by: Cusipzzz on May 26, 2011, 04:30:10 PM
I understand what you are saying - we'll see. It is possible, the blockchain can store arbitrary data. There would need to be an upgrade to the client to support the new rules / miner aspect.

Perhaps this would be better as a separate blockchain supported by those who intend to use it? I really don't like the idea of additional blockchain spam in the main chain. It's growing fast enough already.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on May 26, 2011, 04:39:11 PM
Yeah, I'm really not at the stage where I'm suggesting adding anything to bitcoin yet. I'm just trying to feel out the concept and see what the weaknesses are. It wouldn't bother me too much to have a separate block chain for this, maybe with modifications, à la namecoin.

I do think the idea that you might not need a referee for bets is somewhat novel, so I'd love to see some discussion on that.


Title: Re: [RFC] Betcoin
Post by: dacoinminster on May 26, 2011, 11:15:36 PM
I've given this idea a LOT of thought (the thread I started on the topic is in my signature). Thanks to ben-abuya for pointing me to this thread.

I absolutely agree that this sort of thing is going to be the backbone of bitcoin value in the future. A couple thoughts:

1) As you suggest, you will always want to have a human-readable description of the bet, but some bets could be machine-readable. For instance, a URL could be provided along with a regular expression that scrapes a webpage for a specific value (like the current price of the S&P 500 for instance). Miners (or some other 3rd-party intermediary) could be set up to settle the bet without any human intervention.

2) Check out the capability of multi-party contracts in bitcoin. This allows a mediator to settle disputes without the option of stealing the money in play. The mediator is only needed if the betters have a dispute. There's a thread on it somewheres . . .

3) If no central mediator is needed (or if there are lots of trusted mediators available) then all you need is a censorship-free place to post your bets of questionable legality (or unquestionable illegality). Certainly Freenet or TOR could be used, but they are both a pain (IMHO). I prefer that data about bets be stored in the block-chain somehow.



Title: Re: [RFC] Betcoin
Post by: ben-abuya on May 27, 2011, 01:35:20 PM
Hi dacoinminster, thanks for weighing in. Some notes, below:

1) Bets can be machine readable, but this is a problematic single point of failure, especially if a miner is closing out a huge bet. The website in question could easily be down, or it could be hacked, possibly in anticipation of the bet closing. Still, that's a cool idea.

2) Yep, I read up on that thread, but it requires trusted mediators.

3) I'd like to focus on this. The major idea I wanted to test here is that for prediction markets, mediators or referees are never needed. The problem with (1) and (2) is they introduce weaknesses that Bitcoin doesn't have, and it's precisely Bitcoin's resistance to those weaknesses that make it so great. What I'd like to see is a prediction market that is as strong as Bitcoin itself, thereby expanding the Bitcoin economy from just currency and payment to pretty much of all of finance.

4) As an example of how powerful this is, if we can do a prediction market for BTC/USD with just a next generation bitcoin client, it will be as hard to shut down that market as it is to shut down bitcoin itself. Of course if you're betting on USD going up in value, you won't gain possession of any actual dollars. But that's ok, because determining the exchange rate is the hard part, the part that requires mass coordination of the market. Once we've done that, I can just meet up with some guys at a hackerspace and swap USD cash for bitbills or bitcoins. Or I could do a small bank transfer with someone on #bitcoin-otc. The exchange rate will already be set by the prediction market, and both sides can use it to hedge the exchange if they want to. It will never really be possible to shut down this kind of micro exchange between individuals, there's nobody important to go after, and no great risk if you're caught. The safest, most robust interface between meatspace and the Bitcoin economy is masses of individual people, doing small deals across the boundaries. The heavy lifting gets done either entirely in the Bitcoin economy (btc transfers, prediction markets) or entirely in meatspace (car manufacturing).

5) If this does take off, Government will be so severely crippled by the loss of finance, and finance itself will be so utterly transformed, that the meatspace side will start changing fast, too.


Title: Re: [RFC] Betcoin
Post by: dacoinminster on May 27, 2011, 02:43:58 PM
Hi dacoinminster, thanks for weighing in. Some notes, below:

1) Bets can be machine readable, but this is a problematic single point of failure, especially if a miner is closing out a huge bet. The website in question could easily be down, or it could be hacked, possibly in anticipation of the bet closing. Still, that's a cool idea.

2) Yep, I read up on that thread, but it requires trusted mediators.

3) I'd like to focus on this. The major idea I wanted to test here is that for prediction markets, mediators or referees are never needed. The problem with (1) and (2) is they introduce weaknesses that Bitcoin doesn't have, and it's precisely Bitcoin's resistance to those weaknesses that make it so great. What I'd like to see is a prediction market that is as strong as Bitcoin itself, thereby expanding the Bitcoin economy from just currency and payment to pretty much of all of finance.

4) As an example of how powerful this is, if we can do a prediction market for BTC/USD with just a next generation bitcoin client, it will be as hard to shut down that market as it is to shut down bitcoin itself. Of course if you're betting on USD going up in value, you won't gain possession of any actual dollars. But that's ok, because determining the exchange rate is the hard part, the part that requires mass coordination of the market. Once we've done that, I can just meet up with some guys at a hackerspace and swap USD cash for bitbills or bitcoins. Or I could do a small bank transfer with someone on #bitcoin-otc. The exchange rate will already be set by the prediction market, and both sides can use it to hedge the exchange if they want to. It will never really be possible to shut down this kind of micro exchange between individuals, there's nobody important to go after, and no great risk if you're caught. The safest, most robust interface between meatspace and the Bitcoin economy is masses of individual people, doing small deals across the boundaries. The heavy lifting gets done either entirely in the Bitcoin economy (btc transfers, prediction markets) or entirely in meatspace (car manufacturing).

5) If this does take off, Government will be so severely crippled by the loss of finance, and finance itself will be so utterly transformed, that the meatspace side will start changing fast, too.

I am so delighted to meet somebody else who is thinking about bitcoin in exactly the same way I do!

Regarding #2, the mediators don't need to be used at all unless there is actually a problem with the bet. I.E. You and I can settle a bet without the mediator signing the transaction at all - it is only in the (presumably rare) case of a dispute that the mediator gets involved. They have no way to steal the money, so you only need to trust them to not be in collusion with one of the betters, which is a much lower bar of trust to clear.

Regarding #4, you are absolutely right. The neat thing is that any bitcoin prediction market that is also traded in real-life (like stocks, bonds, commodities, etc) will automatically stay in sync with the legitimate exchanges due to arbitrage.

Personally, I envision a future bitcoin client (or plug-in) that is a full-featured stock-trading platform which can be used to speculate on any real-life security. The interface would match existing stock trading interfaces as closely as possible (to attract real stock traders to use it), but it would be completely distributed and unstoppable like bitcoin.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on May 27, 2011, 06:20:15 PM
I am so delighted to meet somebody else who is thinking about bitcoin in exactly the same way I do!

Thanks for the kind words :)

It's true that mediators would only be needed if a problem arises, and I'm sure this would be a workable system, but these mediators could become big targets. The more they're trusted by everyone, the more they become a big bull's eye for the government, because they're both widely known and relatively important elements in the system. Of course they will keep their real identity hidden, but as I mentioned before, all you need is one tiny thread to connect their real identity to the cloaked identity. That's why distributing these crucial roles among all the players is so important. Also, the outcome isn't always clear. You'd think it would be pretty obvious to everyone who won the US presidential election the day after the polls close. But what would happen on a bet on Bush/Kerry?

The point about the arbitrage is really important. In an unregulated market, I see arbitrage artists and speculators fulfilling a crucial role in bridging all the different prediction markets together into a coherent picture of the world that reflects meatspace stuff as well. In fact, this stuff would be a lot harder to design without speculators.

Yeah, I think there will be lots of cool bitcoin clients in the future. Bitcoin is only a protocol after all. But I see prediction markets as a generalization of stock markets, currency exchanges, sports betting, futures markets, and possibly even insurance policies and bounty schemes. So all you really need is well designed prediction market support in the core bitcoin protocol. The market will then come up with the actual prediction contracts.


Title: Re: [RFC] Betcoin
Post by: dacoinminster on May 27, 2011, 06:31:02 PM
Yeah, I think there will be lots of cool bitcoin clients in the future. Bitcoin is only a protocol after all. But I see prediction markets as a generalization of stock markets, currency exchanges, sports betting, futures markets, and possibly even insurance policies and bounty schemes. So all you really need is well designed prediction market support in the core bitcoin protocol. The market will then come up with the actual prediction contracts.

Finally somebody who truly gets it. I was starting to feel like a lone prophet wearing a sandwich sign on a street corner.

Now we just have to find somebody to do it. Curse my reliance on a day-job!


Title: Re: [RFC] Betcoin
Post by: matsh on May 27, 2011, 08:32:29 PM
I find this really exciting too!

What if the outcome of a bet could be described as the outcome of a program, and then whomever wants to bet money either way just have to scrutinize the program and decide if they understand what it does or not? For example, Java is a safe language in the respect that you can specify a safe sandbox within it can execute, and all miners would compile the Java code whenever necessary and execute it. Then, instead of as a proof of an expensive work done, there would be a kind of voting of the outcome? Or stick with the current scheme, letting the winner settle the bet?

But bets can be so huge, such as when they are for how currencies swings (billions of USD, I'd gather), letting a single winner get a % out of the transaction wouldn't be reasonable, rather wait for several winners and then let them share the bounty?

I'd love to create a prototype for this. Alas, my C++ days are waaay behind me, so I'd have to pick up a Java or Scala port of a miner.


Title: Re: [RFC] Betcoin
Post by: Cusipzzz on May 27, 2011, 08:41:46 PM
I think it's a great idea for an alternate chain. Like I said, it will be a lot of overhead, aka 'spam' in the blockchain. A protocol designed for exactly this type of system would be very cool, call it PredictionCoin or something.


Title: Re: [RFC] Betcoin
Post by: dacoinminster on May 27, 2011, 09:38:32 PM
Miners deciding bets make me nervous because of the possibility of a rogue miner sabotaging a billion-dollar bet.

Alternate block-chains make me nervous, because they aren't backed by the bitcoin network's hashing power.

I personally believe that the whole thing can be accomplished with little-to-no change to the existing protocol.

Consider:

1) The existing block chain is getting onerous to download anyway. I believe there are already plans in place to download "just the headers" (whatever that means) to speed up the experience of a new client joining. Presumably bet information would not be included in the headers - just who owns what money.

2) I believe that bet data and other "meta data" can be included in the block chain without adding too much spam. There are a couple of ways this can be done:
      a) By embedding data into the bet prices themselves (I'm experimenting with that concept here: http://forum.bitcoin.org/index.php?topic=10008.0 )
      b) By encoding meta data and stashing it in secret spots around the internet. This data would only be findable and usable if you knew to look for it because you found a pointer to it in the bitcoin block chain. Think of it as a hash table where each address is a key to find a secret spot on the internet where the data can be retrieved. I have a proof-of-concept running on my PC right now that does this.
      c) By literally encoding all the meta data into the block-chain, but have miners charge per byte for the distributed storage so that people aren't wasteful with it.


Title: Re: [RFC] Betcoin
Post by: matsh on May 27, 2011, 10:10:15 PM
I definitely see the benefit of riding on top of the powerful Bitcoin mining machinery that now exists, and I think that is where we are going in the future. People will build DNS and prediction markets into the block chain in an accepted way, since miners would possibly benefit from this. And everyone wins if all miners together build up a very resistant machinery that can't be stopped.

However, we can't pollute the blocks, and perhaps this can be done by just pointing at a reference in Freenet!? If you really want to stop a prediction bet that isn't going where you want, then you'd have to kill Freenet, which is a very tough nut to crack. Also, after a bet is settled, it could be deleted from the chain in some controlled manner.

So, in Freenet someone would post a blob of Java code that anyone could inspect. If they agree of how that Java code works (fetching a stock price here, a temperature there, whatever, from the net and then multiplying it together and divide by the number of hits by Lady Gaga, then fine. The code could under the rules of the bet be compiled and executed.

Yes, I see the risk of letting one single miner decide the outcome of a bet, so perhaps some bets could be setup so that it requires 1000 winners that vote on the outcome of the programs they have executed, then divide the booty described in the bet?


Title: Re: [RFC] Betcoin
Post by: dacoinminster on May 27, 2011, 10:26:50 PM
Yes, I see the risk of letting one single miner decide the outcome of a bet, so perhaps some bets could be setup so that it requires 1000 winners that vote on the outcome of the programs they have executed, then divide the booty described in the bet?

It's not clear to me how this would work. Can you explain more?

Here's an idea:

Perhaps a special type of miner could be run concurrently with the rest of the network. When this "bet miner" signs a block, it would also run the last N bet engines and include the results in the block that it signs. Once a bet has N signatures from these special miners, it is eligible to pay out to the party/parties that got the majority of votes. Perhaps a special bet transaction fee could be included that is paid only to these "bet miners" and not to normal miners, in order to encourage adoption of the new mining code.


Title: Re: [RFC] Betcoin
Post by: matsh on May 27, 2011, 10:42:23 PM
Yes, I see the risk of letting one single miner decide the outcome of a bet, so perhaps some bets could be setup so that it requires 1000 winners that vote on the outcome of the programs they have executed, then divide the booty described in the bet?

It's not clear to me how this would work. Can you explain more?

Oh, I was just speculating. I'm sure you know the machinery better than me.

Here's an idea:

Perhaps a special type of miner could be run concurrently with the rest of the network. When this "bet miner" signs a block, it would also run the last N bet engines and include the results in the block that it signs. Once a bet has N signatures from these special miners, it is eligible to pay out to the party/parties that got the majority of votes.

Yes, that makes sense. The minority would probably be malformed miners, or miners that tries to highjack a bet. Why reward them?

Perhaps a special bet transaction fee could be included that is paid only to these "bet miners" and not to normal miners, in order to encourage adoption of the new mining code.

Yes, that might be an interesting setup. Also, if the miners could see/evaluate the bounty offered by the bet, then they could decide if it was worth the effort, which would make miners flock around the most valuable bets, which makes sense to everyone.

Darn, I must work on this!


Title: Re: [RFC] Betcoin
Post by: dacoinminster on May 27, 2011, 10:52:36 PM
Darn, I must work on this!

There are early bitcoin adopters who are now worth millions of dollars from their early investment. I wouldn't be surprised if one or more of them pushes this concept, sponsors it, and/or pays people to work on it, since it would probably make them from millionaires into billionaires if it was successful.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on May 28, 2011, 09:58:08 AM
I think it's a great idea for an alternate chain. Like I said, it will be a lot of overhead, aka 'spam' in the blockchain. A protocol designed for exactly this type of system would be very cool, call it PredictionCoin or something.

I haven't really thought that much about whether this kind of thing should evolve into the main chain or fork a new one. There seem to be advantages to both. But I don't think there will be a lot of overhead or spam. What I described are just transactions, like any other transaction in Bitcoin. The text of the bet itself doesn't have to be in the blockchain, just the bet's unique id, and a signature to ensure the text can't be changed later. Once it's in the block chain, everybody can be sure they're betting on the same thing by just referencing the bet id.

The bet wagers themselves are also just regular transaction type entries. Making a 10 btc wager is no different than transfering 10 btc to someone. It's no more or less spam.


Title: Re: [RFC] Betcoin
Post by: Mike Hearn on May 28, 2011, 10:23:43 AM
I haven't really understood how this is supposed to be linked to measurable reality without some kind of program to measure the outcome, but on the topic of multiple block chains:

  • Bitcoin is not "immune to government crackdown". How much regulatory attention it gets will probably be related to how it gets used. As online gambling is illegal in some places (US, Japan) merging it into the core Bitcoin system increases, not decreases, the risk of problems.
  • Alternate chains can share work and interoperate with Bitcoin, yet still be an independent system.

Given that there's no real downside to having an independent chain and multiple upsides, that's the approach I'd take if I wanted to do this. It lets miners opt-in to taking part, which respects their right to decide how their computational resources are used. If bets end up involve running arbitrary programs (Java or otherwise) you'll definitely want a separate network that can share work.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on May 28, 2011, 02:22:03 PM
I haven't really understood how this is supposed to be linked to measurable reality without some kind of program to measure the outcome...

I want to start with the first point about measurable reality. The idea here is that there is no official arbiter of measurable reality in the world anyway. Who decides that Obama is president? There are all kinds of events that happen, votes are reported, opponents concede, chads hang, and supreme court justices put out rulings. In the end, people just kind of fall into a clear consensus that the Prez is the Prez, and sometimes they don't.

In the vast majority of bets with some kind of expected clear outcome, like a football game or a presidential election, the prediction market itself will tend to a binary 10.0 or 0.0 once the event has been decided, say the football game is over, or Obama's opponent concedes. If we expire the bet and pay out 9.95, that's pretty much as good as some arbitrary referee calling it 10.0.

And if we expire the bet in the middle, a month before the election, at 8.23, that's ok too because there's another bet going on at about the same price that you can jump to as your bet expires. They will be tracking each other due to arbitrage. This is how future contracts work. If you think about it, betting on the wheat harvest with future contracts is the same as betting on a football game. There is no objective second when the probability of the Redskins winning jumps to 10.0. It's pretty much 10 when they're winning 42-0 with 1 minute left, and it's not even quite 10.0 when the ref calls the game, because something can always be overturned. Who knows, maybe there's proof the Cowboys were throwing the game. In that sense, the market price of 9.95 is more accurate than the arbiter calling it 10.0 at the moment of the whistle.

So how does the miner call the contract? It just takes the last valid trade before the expiration time, and that's the close. The market should make sure that's a good proxy for reality. The only thing that makes this different from wheat contracts is that you don't actually own any wheat, and you don't own any "Redskins win". That's why we have to keep money in the escrow to pay up in the end.

  • Bitcoin is not "immune to government crackdown". How much regulatory attention it gets will probably be related to how it gets used. As online gambling is illegal in some places (US, Japan) merging it into the core Bitcoin system increases, not decreases, the risk of problems.
  • Alternate chains can share work and interoperate with Bitcoin, yet still be an independent system.

I didn't actually say that Bitcoin is immune to government crackdown, I said any system based on Bitcoin would be as immune to government crackdown as Bitcoin. It's a valid point that making Bitcoin even scarier than it is to governments puts even more pressure on it. However, if Bitcoin can't stand up to government interference, it loses most if its charm to me at least. And with or without betting, if it becomes a threat to government, they better hope they can take it down. Betting on football games is the least of their problems.

That's also a great point about alternate chains interoperating with Bitcoin. It would be very cool to think about how that would work. Looking at the code a bit, it's also clear that Bitcoin has a ton of functionality that's not being used yet. Who knows what it's capable of, even with the current design.


Title: Re: [RFC] Betcoin
Post by: TierNolan on June 23, 2011, 12:24:18 PM
I want to start with the first point about measurable reality. The idea here is that there is no official arbiter of measurable reality in the world anyway. Who decides that Obama is president? There are all kinds of events that happen, votes are reported, opponents concede, chads hang, and supreme court justices put out rulings. In the end, people just kind of fall into a clear consensus that the Prez is the Prez, and sometimes they don't.

There was a proposal for reducing the cost of "measuring reality".  I think it was probably by Robin Hanson (http://www.overcomingbias.com/).

The idea is that you can combine multiple bets into a single bet. 

Instead of betting on "the price of <something> on <date>", there is a bet (X) of "if <random event happens>, the price of <something> on <date>, otherwise you get your money back".  The random event would need to be checkable within the system (say the last few digits of the block hash). 

The expected price of the X contract is the same as the price of the main contract.

The main bet becomes "the average of the bid/ask price of X on <date>".  The 2nd bet can be verified within the system, since you are just checking the bid/ask price at a particular time.

If there were 1000 bets being checked, only one of them would be picked.  This makes the real world cost 1000 times lower. 

If low enough, miners could manually check those events.

An additional option would be to have a reputation system for checkers.  You could include a list of acceptable referee's addresses and how strongly you value their opinion.

The "referee bonus" is split between all referees who gives an opinion in proportion to how strongly their were rated by the parties in the transaction.

I think the 2 methods could be combined.  Ideally, it would be set up so that someone could take loads of low fee contracts and combine them into one large fee contract.

Quote
So how does the miner call the contract? It just takes the last valid trade before the expiration time, and that's the close. The market should make sure that's a good proxy for reality. The only thing that makes this different from wheat contracts is that you don't actually own any wheat, and you don't own any "Redskins win". That's why we have to keep money in the escrow to pay up in the end.

If 90% of the miners used that rule, the effect is that you aren't actually betting on the result, you are betting on the market price.  What if someone floods the market just before close?


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 23, 2011, 07:42:33 PM
If 90% of the miners used that rule, the effect is that you aren't actually betting on the result, you are betting on the market price.  What if someone floods the market just before close?

Yeah, that's the basic assumption here. That the best measure of the result we have is the current market price. That's the assumption before the result is "known", so why not continue the assumption once the event has happened? Since as I mentioned before there isn't necessarily a clear cutoff of when it happened anyway.

I don't think miners are ever going to be able to adjudicate even the simplest of outcomes, that's just not what they're about. That's why I'm interested in hearing criticisms of my scheme.


Title: Re: [RFC] Betcoin
Post by: TierNolan on June 23, 2011, 07:59:19 PM
Yeah, that's the basic assumption here. That the best measure of the result we have is the current market price. That's the assumption before the result is "known", so why not continue the assumption once the event has happened? Since as I mentioned before there isn't necessarily a clear cutoff of when it happened anyway.

It makes all the difference. 

You are betting "what will the market close at?".  It would make no difference what was in the actual text of the bet was.

The reason betting market tend to go to the actual value is that no matter what price they close at, the exchange pays out based on the actual result.

Quote
I don't think miners are ever going to be able to adjudicate even the simplest of outcomes, that's just not what they're about. That's why I'm interested in hearing criticisms of my scheme.

The other part of my suggestion was to have a referee.

Actually, apparently, the bitcoin system can have more complex rules than just pay money to X.  However, don't think it can have "split money between these people".


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 24, 2011, 05:20:47 PM
You are betting "what will the market close at?".  It would make no difference what was in the actual text of the bet was.

The reason betting market tend to go to the actual value is that no matter what price they close at, the exchange pays out based on the actual result.

I'm not sure about that. Why is the GBP/USD at 1.6? The exchange isn't going to pay out based on some actual result. Your payout at any given time is the market price. The only difference here is that there's an abrupt change in events. When a field goal is good at the end of a game the exchange rate will quickly change to very close to 1.0 for the winning team. But similar things can happen with stock and commodity options.

The other part of my suggestion was to have a referee.

Actually, apparently, the bitcoin system can have more complex rules than just pay money to X.  However, don't think it can have "split money between these people".

That's true. Bitcoin has scripting, but that scripting is very limited in the context we're talking about. For instance, the scripting can't affect the amount so you wouldn't be able to split payments. It certainly can't interface with a referee. But I don't think the p2p system should interface with stuff like that. It should stay deterministic based on the data it has itself. There's plenty of room to build systems around it that would make use of a referee.



Title: Re: [RFC] Betcoin
Post by: TierNolan on June 25, 2011, 02:19:48 AM
I'm not sure about that. Why is the GBP/USD at 1.6? The exchange isn't going to pay out based on some actual result. Your payout at any given time is the market price. The only difference here is that there's an abrupt change in events. When a field goal is good at the end of a game the exchange rate will quickly change to very close to 1.0 for the winning team. But similar things can happen with stock and commodity options.

That is trading actual stuff, so the price is determined by supply and demand.  If you buy $1, then someone has to give up $1.

Futures need something to actually link them to reality.

"This future pays whatever its closing price is" doesn't have any connection back to reality.

Imagine a future of the form "This future pays $1 if event X happens".

If there was a 30% chance of the event happening and the price of the future was 60c, then people would start selling and push the price down (since 30% chance of $1 is worth less than the 60c price).

However if the future said "This future should pay $1 if event X happens, but will actually just pay out the closing price", then there is nothing to force the future to the right price.  If the price is 60c, then why would it drop?


Title: Re: [RFC] Betcoin
Post by: netrin on June 25, 2011, 06:33:40 AM
I've been bashing my brains trying to come up with a simple and distributed prediction market. I have not yet succeeded. In the meantime, I came up with a betting model that is time sensitive, which I think could show predictive insight over time. You can't sell your position, but later wagers cost more depending on the weight of similar previous wagers.

I'd love to hear your comments. The general rules are here: http://pastehtml.com/view/ay9nwzagt.html
And an example (Mt. Gox opens trade) event: http://forum.bitcoin.org/index.php?topic=22298.0


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 09:15:10 AM
However if the future said "This future should pay $1 if event X happens, but will actually just pay out the closing price", then there is nothing to force the future to the right price.  If the price is 60c, then why would it drop?

Right, that's the exact question this hinges on. My hypothesis is that some kind of game theory magic would make this work. Trading is about the market coordinating to reveal expectations. The only thing the market has to coordinate on in these contracts is the event that it's about. You have no idea what the closing price of the contract is going to be, but you do have a good idea about who's going to win the football game. Would you bet lots of money against a redskins win contract if they're up by 21 points with a minute left to go? Speculators would be the key. You'd think they'd step in and make the bet against anybody trying to manipulate the closing price. It's also possible to make the closing price chosen semi-random by not picking the exact closing price but randomly picking the closing price from on of the last few blocks or something.

I'm not saying this is a sure thing, but if it works it opens up amazing possibilities, especially for an automatic bitcoin-style p2p market that doesn't rely on any point of failure and can't be shut down.


Title: Re: [RFC] Betcoin
Post by: TierNolan on June 25, 2011, 10:17:11 AM
Right, that's the exact question this hinges on. My hypothesis is that some kind of game theory magic would make this work.

The problem is that the current price is also the best guess at what it will close at.  If I sell lots of the future, it pushes the price down and then that's the new best guess.

Quote
Trading is about the market coordinating to reveal expectations. The only thing the market has to coordinate on in these contracts is the event that it's about.

So I sell lots of futures at $0.30 and then announce

"I have BTC 1 million and I am going to keep the price at $0.01, feel free to try to override me"

It would come down to how strong the social effect is. 

A better plan might be to always pay out the full amounts.

"The intention is for this event to pay out $1 if event X happens by <date>, but is actually determined by the first period of 7 days stability after <date + 2 weeks>".  Stability means that for 7 days, it closes either all 7 above $0.50 or all 7 below $0.50.

Once the event has happened, there should be general knowledge of what the result is.  Bets which close "wrong" would be pretty rare and could be well advertised.

If normally those types of event end being corrected by traders, then that will force the market to the right value.


Title: Re: [RFC] Betcoin
Post by: pyrrhos on June 25, 2011, 10:58:23 AM
Very nice, this is why I still read this forum. The idea of letting the final outcome be decided in a self regulatory way by the last matched price is at least very intriguing, like all self-regulating schemes. In this case, however, it becomes almost philosophical: the sole and only thing that links a particular bet with the real world is its verbal description, the string that accompanies the bet-id. I wonder if that is enough to make this work. If it is, we would have a have a robust betting system and a proof of the power of words!
Considering the above loose connection with the real world, an issue with betcoin would be that the outcome of a bet could be determined more by the funds that one pours into it into one or the other direction rather than its description. As a thought experiment which i think would give some extra insight to if this would work or not, consider the following bet: "the outcome of this bet will be true". Or even: "this is an undefined bet". In such a case, I think, the bet outcome will lean towards where the most funds have been put. This is not what one wants when betting.
So in my opinion it is funds vs the power of words that will determine whether betcoin would work as proposed.

A, perhaps less elegant, alternative would be that the one that initiates a bet also gets to decide its outcome. Let the market decide which initiators (identified by their key) it trusts and which it doesn't.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 11:42:46 AM
Very nice, this is why I still read this forum. The idea of letting the final outcome be decided in a self regulatory way by the last matched price is at least very intriguing, like all self-regulating schemes. In this case, however, it becomes almost philosophical: the sole and only thing that links a particular bet with the real world is its verbal description, the string that accompanies the bet-id. I wonder if that is enough to make this work. If it is, we would have a have a robust betting system and a proof of the power of words!
Considering the above loose connection with the real world, an issue with betcoin would be that the outcome of a bet could be determined more by the funds that one pours into it into one or the other direction rather than its description. As a thought experiment which i think would give some extra insight to if this would work or not, consider the following bet: "the outcome of this bet will be true". Or even: "this is an undefined bet". In such a case, I think, the bet outcome will lean towards where the most funds have been put. This is not what one wants when betting.
So in my opinion it is funds vs the power of words that will determine whether betcoin would work as proposed.

If you had described the bitcoin idea to me and I had understood it perfectly before it was tried, I think I'd be pretty skeptical about it working, at least to the degree it's currently working. I think the only way to know for sure if this thing has a chance is to try it, but I'm not as brave as Satoshi so I want to get some critical feedback first.

I would guess that bets with vague descriptions wouldn't get a lot of market action, because everybody would know that the system wouldn't work well for those bets. If the bet was described well, say Redskins beat or tie Cowboys in next week's game, and somebody poured tons of money into the Cowboy side at the 2 minute whistle and the Redskins up by 21 points, people would either assume that they knew something very weird about the eventual outcome, or that they stand to make a lot of money betting against them. This would draw speculators like sharks to blood. After this happened a couple of times, I think people would realize it's a bad idea to go against speculators. Governments find this out all the time. On the other hand, if the speculators get killed and the closing price doesn't reflect reality, people will stop using this. Working on this project is a bet on the former.

Another point I want to bring up is that there will likely be overlapping contracts for the same thing. So there will be arbitrage opportunities as well, and you'd have to game all of the different contracts. The contracts might not be identical, and could overlap partially with other contracts (there's a contract on whether the Redskin's starting quarterback is going to be fit for the game after an injury), so the interlocking pieces could strengthen the whole structure.

A, perhaps less elegant, alternative would be that the one that initiates a bet also gets to decide its outcome. Let the market decide which initiators (identified by their key) it trusts and which it doesn't.

Yep, I could see that happening. But if this is totally anonymous there's nothing stopping the initiator from putting in a ton of sidebets. They would trash their reputation, but for big bets, the easy money might be irresistible. Homo economicus would fix the bet if the expected return from his side betting was greater than his perceived value of his reputation. It's also possible that wouldn't be a big problem, because of the enormous value of a good reputation. The other thing that bother me a bit about this is you might see concentration of power in a few entities, whereas betcoin strives to avoid that. That might be an impossible task though.


Title: Re: [RFC] Betcoin
Post by: pyrrhos on June 25, 2011, 12:46:22 PM
A, perhaps less elegant, alternative would be that the one that initiates a bet also gets to decide its outcome. Let the market decide which initiators (identified by their key) it trusts and which it doesn't.

Yep, I could see that happening. But if this is totally anonymous there's nothing stopping the initiator from putting in a ton of sidebets. They would trash their reputation, but for big bets, the easy money might be irresistible. Homo economicus would fix the bet if the expected return from his side betting was greater than his perceived value of his reputation. It's also possible that wouldn't be a big problem, because of the enormous value of a good reputation. The other thing that bother me a bit about this is you might see concentration of power in a few entities, whereas betcoin strives to avoid that. That might be an impossible task though.

I agree, anonymity is not a goal necessarily nor is the goal to stop someone to concentrate power if (s)he deserves it. Betcoin would provide indestructibility, anonymity if desired, and the transaction ease of bitcoin.

Perhaps the right approach for betcoin would be to focus on an abstract concept called "conditional transaction" where a transaction takes place only when a certain condition is met at a certain time. The condition could be set by the initiator of the bet who chooses one of the predefined validation methods that the betcoin protocol would offer. It can be the "last price" or the "initiators decision" or anything that can be reliably and indisputably decided by any miner. The validation methods could even work as plug-ins that betcoin miners and clients choose to incorporate. If enough miners incorporate it then it becomes an official validation method.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 12:54:19 PM
Perhaps the right approach for betcoin would be to focus on an abstract concept called "conditional transaction" where a transaction takes place only when a certain condition is met at a certain time. The condition could be set by the initiator of the bet who chooses one of the predefined validation methods that the betcoin protocol would offer. It can be the "last price" or the "initiators decision" or anything that can be reliably and indisputably decided by any miner. The validation methods could even work as plug-ins that betcoin miners and clients choose to incorporate. If enough miners incorporate it then it becomes an official validation method.

Yeah, I think flexibility is a virtue here. This is exactly the idea of bitcoin's scripts. So you'd have an operator that pushes the initiator's value determination to the stack, and you'd have an operator that pushes the last price to the stack. The script logic itself is up to the sender of the transaction. Another cool operator would be a random number operation. That would allow trivial p2p lotteries and other games of chance. I was thinking you could base that on the nonce, because that would be hard to game for the miner.


Title: Re: [RFC] Betcoin
Post by: just_someguy on June 25, 2011, 01:30:31 PM
Quote
Yeah, I think flexibility is a virtue here. This is exactly the idea of bitcoin's scripts. So you'd have an operator that pushes the initiator's value determination to the stack, and you'd have an operator that pushes the last price to the stack. The script logic itself is up to the sender of the transaction. Another cool operator would be a random number operation. That would allow trivial p2p lotteries and other games of chance. I was thinking you could base that on the nonce, because that would be hard to game for the miner.

Bitcoin proper will never allow you to natively reference outside data in a script. It took me a while to understand why but suffice to say there is a reason you can't even get a bocknumber or timestamp pushed on the stack.

However, Mike's "oracle" transaction script opens up a world of possibilities. http://en.bitcoin.it/wiki/Contracts
By chaining together many simple oracle's you can come up with any derivative transaction you like.
The details of what is being "bet" on are completely opaque to the miner.

To use the cowboys/redskins example you would just need an oracle that spit out signed event results. The trustability of the oracle could be verified in the bitcoin blockchain by each party wanting to participate but without involving the miners.
However, maybe you only want to bet if its raining during the game. We each trust a certain weather oracle and know its format so we can generate a transaction chaining the two conditions together but taking opposite sides of the bet. The possibilities are endless: Timestamps, lotteries, sports, private games, politics, stock market, etc.








Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 02:41:48 PM
Bitcoin proper will never allow you to natively reference outside data in a script. It took me a while to understand why but suffice to say there is a reason you can't even get a bocknumber or timestamp pushed on the stack.

I don't think it would be a good idea to put betcoin in bitcoin anyway. It would be a separate project like namecoin. I'm interested in the precise reasons putting stuff like block numbers, transaction amounts, and results of old blocks in the script is dangerous. Aren't these things as easy to validate as everything else?

However, Mike's "oracle" transaction script opens up a world of possibilities. http://en.bitcoin.it/wiki/Contracts
By chaining together many simple oracle's you can come up with any derivative transaction you like.
The details of what is being "bet" on are completely opaque to the miner.

To use the cowboys/redskins example you would just need an oracle that spit out signed event results. The trustability of the oracle could be verified in the bitcoin blockchain by each party wanting to participate but without involving the miners.
However, maybe you only want to bet if its raining during the game. We each trust a certain weather oracle and know its format so we can generate a transaction chaining the two conditions together but taking opposite sides of the bet. The possibilities are endless: Timestamps, lotteries, sports, private games, politics, stock market, etc.

Wow, he's added a lot of cool stuff since the last time I checked. This is another great option, and is kind of a generalization of the contract initiator calling the bet. I suppose if you use several independent oracles the outcome should be pretty good. Is there a way for oracles to get paid for their work here? Maybe they could include a public key in the script and only release the private key to you out-of-band if you pay up.


Title: Re: [RFC] Betcoin
Post by: just_someguy on June 25, 2011, 03:01:01 PM
Quote
I'm interested in the precise reasons putting stuff like block numbers, transaction amounts, and results of old blocks in the script is dangerous. Aren't these things as easy to validate as everything else?
In the block number example lets say you could push block number onto the stack and you had a transaction script that relied on it being before a certain block.
The transaction is floated and accepted in to a block as valid.
Then a chain reorg occurs. All the transactions that aren't double spends or coinbase transactions will be mined in to the new chain. However, it is possible the completely valid transaction relying on block number now becomes invalid because when the script is evaluated the new block number is too high.
Compound this by having transactions in the chain that have built upon the old and completely valid transaction but are now invalid.
You get the same problem with pushing on timestamps, etc.

Quote
Wow, he's added a lot of cool stuff since the last time I checked. This is another great option, and is kind of a generalization of the contract initiator calling the bet. I suppose if you use several independent oracles the outcome should be pretty good. Is there a way for oracles to get paid for their work here? Maybe they could include a public key in the script and only release the private key to you out-of-band if you pay up.

Your oracle can be as complex as you want and there is nothing stopping them from charging for their services. The existing bitcoin miners are verifying the results as long as the parties involved accept the oracle's reality.
You could write a single oracle service that creates a contract based on a hundred different factors and the bitcoin miners could verify the result. All you would need is the oracle to rollup both sides of the action into a single derivative identifier. You get the transaction based on OracleSig(derivative, true) and I get the transaction OracleSig(derivative, false). The bitcoin script doesn't care whats behind the derivative id, just that its signed by the given private key. The blockchain doesn't even know there was an oracle involved, it just sees a script that evaluates to true.



Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 03:25:22 PM
In the block number example lets say you could push block number onto the stack and you had a transaction script that relied on it being before a certain block.
The transaction is floated and accepted in to a block as valid.
Then a chain reorg occurs. All the transactions that aren't double spends or coinbase transactions will be mined in to the new chain. However, it is possible the completely valid transaction relying on block number now becomes invalid because when the script is evaluated the new block number is too high.
Compound this by having transactions in the chain that have built upon the old and completely valid transaction but are now invalid.
You get the same problem with pushing on timestamps, etc.

Are there any other dangers other than chain re-org? Couldn't this be mitigated by waiting for a large number of confirmations? Namecoin uses that strategy.


Title: Re: [RFC] Betcoin
Post by: just_someguy on June 25, 2011, 03:32:57 PM
Here's on of the discussion on the subject:
http://forum.bitcoin.org/?topic=6900.0;all

With the oracle approach you don't really need to go through all the trouble. Start an oracle service that signs arbitrary with data with the current chain height.
If you and another party think its safe then just use that. That allows you to base transactions on chain height without risking everyone else.
The same can be done for a time based transaction. Using the oracle approach is much safer. If the oracle signs arbitrary data with the time then it doesn't matter whether the chain gets reorged or not. Your transaction will still be valid even if you don't/can't broadcast until after the time has passed.



Title: Re: [RFC] Betcoin
Post by: qualia8 on June 25, 2011, 03:43:53 PM
I suggest you look at, for instance, the "Mike Huckabee to Announce" contract on Intrade.  Even though Huckabee said live on his show that he will not run, his contracts are not selling for .01.  Odd, especially since Intrade *will* settle these contracts at zero in December.

The question is simply where the big money is at.  If the big money is wrong, it's still right!


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 04:16:08 PM
I suggest you look at, for instance, the "Mike Huckabee to Announce" contract on Intrade.  Even though Huckabee said live on his show that he will not run, his contracts are not selling for .01.  Odd, especially since Intrade *will* settle these contracts at zero in December.

The question is simply where the big money is at.  If the big money is wrong, it's still right!

I think the problem with that bet is that there isn't any big money. There's not much volume there, and it apparently isn't a very interesting wager for people to get in on. Also, since Intrade will close this at 0, how is that supposed big money going to be right?

Here's on of the discussion on the subject:
http://forum.bitcoin.org/?topic=6900.0;all

Awesome thread, thanks. I'd never had expected that OP_BLOCKNUMBER would work in the sense of "the current block bitcoin is up at time of verification". But it appears that OP_BLOCKNUMBER in the sense of "the block number at the time of block insertion" could still work, with the caveat of the re-org problem.

With the oracle approach you don't really need to go through all the trouble. Start an oracle service that signs arbitrary with data with the current chain height.
If you and another party think its safe then just use that. That allows you to base transactions on chain height without risking everyone else.
The same can be done for a time based transaction. Using the oracle approach is much safer. If the oracle signs arbitrary data with the time then it doesn't matter whether the chain gets reorged or not. Your transaction will still be valid even if you don't/can't broadcast until after the time has passed.

Yes, but I have a big problem with known centralized entities like this, even if they're not that centralized and they're pseudonymous. Here's why: suppose the market in question is a bet on the heroin crop, used by drug vendors to determine and hedge prices. The oracle or oracles might become the target of a well-funded DEA investigation. They would use block chain analysis, search warrants, CI's and anything else they could think of to uncloak the pseudonymity. In an oracle-less scheme there is no such high value target. You might not think a heroin market is a good idea, but I'm envisioning a global financial market built on this that's immune to regulation. The SEC might go after oracles in stocks, bonds, gold, dollar and pig bellies with the same gusto.


Title: Re: [RFC] Betcoin
Post by: o on June 25, 2011, 05:27:56 PM
I have read the awesome contract proposed recently and I think it is a must for the Bitcoin in the future. However, I do not understand how your proposal can avoid the mediation if any conflicting occurs?

You proposal seems need the network to access external data. So, who decide whether condition is matched? If the external data is used, how can you sure that the network determine the result are honest? and I dont know why you said that your network is more resistant from the regulation.


Title: Re: [RFC] Betcoin
Post by: cartman on June 25, 2011, 06:34:04 PM
dangerous idea: an anonymous censor resistant marketplace of user-created bets is also an implementation of the assassins-market. one could bet that some target person is still alive until date xy and an assassin could accept the bet and make the event happen...


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 06:55:59 PM
dangerous idea: an anonymous censor resistant marketplace of user-created bets is also an implementation of the assassins-market. one could bet that some target person is still alive until date xy and an assassin could accept the bet and make the event happen...

Yeah, bitcoin is a dangerous idea, too. Any powerful technology is dangerous.

I have read the awesome contract proposed recently and I think it is a must for the Bitcoin in the future. However, I do not understand how your proposal can avoid the mediation if any conflicting occurs?

You proposal seems need the network to access external data. So, who decide whether condition is matched? If the external data is used, how can you sure that the network determine the result are honest? and I dont know why you said that your network is more resistant from the regulation.

There's no conflict possible, everybody agrees to the terms ahead of time. The network doesn't have to access external data, since payout is based solely on closing prices, which is internal data. It's an unorthodox approach so you might want to reread the original proposal. It should be more resistant to regulation because regulators like a few high profile players, and they like to prevent everybody else from getting in the game. With this, there are no high profile players. Like bitcoin, if you want to shut it down, you have to shut down everybody.


Title: Re: [RFC] Betcoin
Post by: TierNolan on June 25, 2011, 09:17:05 PM
dangerous idea: an anonymous censor resistant marketplace of user-created bets is also an implementation of the assassins-market. one could bet that some target person is still alive until date xy and an assassin could accept the bet and make the event happen...


The fact that it relies on social pressure could also help here.  A contract about someone who was murdered could very easily have a close price as if the person was still alive.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 25, 2011, 11:16:52 PM
dangerous idea: an anonymous censor resistant marketplace of user-created bets is also an implementation of the assassins-market. one could bet that some target person is still alive until date xy and an assassin could accept the bet and make the event happen...


The fact that it relies on social pressure could also help here.  A contract about someone who was murdered could very easily have a close price as if the person was still alive.

Heh, kind of like throwing an opposing home run ball back. Interesting.


Title: Re: [RFC] Betcoin
Post by: luv2drnkbr on June 26, 2011, 12:35:09 AM
I am very disappointed that this thread has nothing to do with poker.


Title: Re: [RFC] Betcoin
Post by: JoelKatz on June 26, 2011, 12:10:56 PM
It seems pretty simple to do this with no third party verifier:

1) To place a bet, you place a transaction that can be claimed either:
 A) By you, up to a certain time in the near future.
 B) By the person you're placing the bit with, after a certain date just before the event.
 C) By you, at any time well after the event. (1 day, say)

2) To accept the bet, your partner places a transaction that can be claimed either:
 A) By him, any time after a time just before the event.
 B) By you, at a time well after the event. (1 day, say)

3) If he doesn't accept the bet, you claim back your money per 1A. Make sure to take back your bet if it's not accepted. If you take back your bet after the bookie places his, he takes back his bet using 2A (he'll have to wait a bit).

4) If you win, you claim both transactions using 1C and 2B, a bit after the event.

5) If you lose, he claims both transactions using 1B and 2A as soon as he knows you lost.

Yes, your bookie can cheat you. But that's much less of a problem than trusting a central authority.


Title: Re: [RFC] Betcoin
Post by: Michiko on June 26, 2011, 12:16:04 PM
There are many of interesting problems and ideas around prediction markets with Bitcoin connection. The idea of integrating betting (conditional transactions sounds more professional...) into the core of the system, e.g. the block chain, naturally causes a lot of controversy. Unfortunately this discussion overshadows other interesting points raised in the original post.

If only for my personal benefit - could I please encourage further discussions of other aspects of prediction markets? I'd be especially interested in reading some more discussions with posters like dacoinminster or ben-abuya etc. who have voiced related ideas in other sections.

(Sorry if this is considered thread-jacking; I've mostly joined & posted 5x newbies to restart discussion around prediction markets. Maybe a more established member could start a new thread if preferred. I'd like to understand better how would the block chain cope with even a moderately successful implementation - cf Betfair's daily transaction numbers? Or, how can this 'escrow' service handle offsetting of opposite bets since it won't be able to do margining? How does the market communicate to the 'oracle' part which transaction-bets are in demand? Etc. ) 


Title: Re: [RFC] Betcoin
Post by: just_someguy on June 26, 2011, 01:26:52 PM
Re-reading some of this thread I realize my grammar goes way down hill when I type from my iphone.

Yes, your bookie can cheat you. But that's much less of a problem than trusting a central authority.

There isn't a central authority just an entity that you and your counter party agree to trust for a single transaction.

Competing "authorities" is way better than trying to use a block chain for external data. Lets use the intrade example.
(I'm not an internet gambler so I may not describe how intrade works correctly)

Intrade has a prediction market with enough saturation in the market that it reaches a critical mass become a reliable indicator.
Alice wants to place a wager with Bob on an intrade event. Alice does not trust Bob and vice versa.
They want the bet to be settled in bitcoin and both will cheat the other player if given a chance since that's the way it seems to go on the internet.
Ben starts an anonymous intrade settlement service on TOR. There are many, this is Ben's.
Ben publishes a public key and claims to honestly sign and report the outcome of every intrade event. (This could be done by intrade directly but lets assume they aren't interested.)

To decide whether to trust Ben Bob and Alice each examine the Bitcoin block chain proper looking for all script contents containing Ben's public key. They each independently verify the results against their known list of intrade outcomes. Each is satisfied that Ben reports results honestly. They also decide on a time oracle using the same process.

Using a combination of the techniques on the contract wiki entry Bob and Alice exchange a transaction with the following properties:
If the event happens Alice wins, if not Bob wins. If the agreed upon time has passed each gets their money back. (This handles event cancellation but it could be done directly by Ben without the time oracle.)

Benefits of this scenario:
Neither Alice nor Bob can cheat each other.
Ben cannot collude with either because he doesn't know about the bet.
Bitcoin becomes the escrow agent.
Charlie and Dan don't trust Ben's intrade service. They are not forced to use it.

Variations of this scenario:
All miners are owned by governments that do not allow gambling. Because of this Ben charges a fee for each event pairing. The fee covers the generation of a unique public key for each matched bet. Ben does not publicly publish paring results until a few days after the event has occurred. In the interim he only provides event results to Alice or Bob. The bitcoin network still validates all betting transactions because they appear no different than regular transactions. By the time event results are published the transaction is too far down the chain to reverse.






Title: Re: [RFC] Betcoin
Post by: JoelKatz on June 26, 2011, 01:35:51 PM
Neither Alice nor Bob can cheat each other.
Ben cannot collude with either because he doesn't know about the bet.
I see how you can have one or the other of these properties, but I don't see how you can have both.

In order to rig it so that nether Alice nor Bob can cheat each other, the transactions must be published in the hash chain. Otherwise, Alice or Bob could simply post a conflicting transaction to the hash chain and empty the account that was supposed to be used to pay the other. But if the transactions are published in the hash chain, how can Ben not know about the bet?

Update: Ahh, I figured out a way to make it work. Alice creates four transactions:
1) A transaction to lock her money in escrow such that it can only be claimed by transactions 2, 3, or 4 - by hash.
2) A transaction to take her money back if Bob does not accept the bet.
3) A transaction to pay Bob if he wins.
4) A transaction to take her money back if she loses.

She posts '1' to the hash chain. She holds 2 and 4 for herself. She passes 3 to Bob.

Now, Ben cannot tell from just seeing 1 what it means, since the transactions that involve him (3 and 4) are not posted yet. Bob, if he wins, can post transaction 3 himself to claim his winnings.


Title: Re: [RFC] Betcoin
Post by: just_someguy on June 26, 2011, 05:43:21 PM
Quote
I see how you can have one or the other of these properties, but I don't see how you can have both.

You are right. I meant more in the practical sense that he could collude once but then it would essentially kill his business since the falsely reported outcome would be openly visible in the block chain.

As far as locking the money up so it can't be spent I'm assuming the technique from the contracts wiki would work:

Quote
Two transactions are used: one (the contract) is created and signed but not broadcast right away. Instead the other transaction (the payment) is broadcast after the contract is agreed to lock in the money, and then the contract is broadcast.
This is to ensure people always know what they are agreeing to.


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 26, 2011, 07:21:09 PM
It seems pretty simple to do this with no third party verifier

I dunno, to me trusting the other side in the bet is like trusting the other side in a bitcoin transaction. Calling him a bookie is like calling a bitcoin recipient a merchant. It's p2p, just two anonymous dudes. I don't like any sort of entity that has to build up trust and reputation, because that makes them a big target for the government. It also makes it much harder to do these bets. You can just go out and trade, you have to find entities you trust.

The original proposal tries to avoid trust issues. What's wrong with it?


Title: Re: [RFC] Betcoin
Post by: just_someguy on June 26, 2011, 09:11:22 PM
Quote
I dunno, to me trusting the other side in the bet is like trusting the other side in a bitcoin transaction. Calling him a bookie is like calling a bitcoin recipient a merchant. It's p2p, just two anonymous dudes. I don't like any sort of entity that has to build up trust and reputation, because that makes them a big target for the government. It also makes it much harder to do these bets. You can just go out and trade, you have to find entities you trust.

The original proposal tries to avoid trust issues. What's wrong with it?

The biggest problem is figuring out what a valid trade is. Using pure block chain activity to determine what is going on will be extremely unreliable.
There is nothing stopping people from trading with themselves to make it appear like any price and volume they want.
If you could make intrade bets at any price and volume without risk by trading with yourself then it would not be a very reliable indicator.
It would be akin to placing a bet that there would be at least x transactions on the bitcoin network on a given day. Anyone can push that number as high as they want.
Also, since the binary event will be decided without real world measurements the person with the most money can force the outcome to whatever they want it to be.

Prediction markets work because at the end of the day an arbiter will make a final call on whether the event did or did not occur.
If there is no arbiter of the event then you are just in a competition to see who can most effectively game the system.





Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 26, 2011, 09:48:06 PM
The biggest problem is figuring out what a valid trade is. Using pure block chain activity to determine what is going on will be extremely unreliable.

There is nothing stopping people from trading with themselves to make it appear like any price and volume they want.
If you could make intrade bets at any price and volume without risk by trading with yourself then it would not be a very reliable indicator.

It would be akin to placing a bet that there would be at least x transactions on the bitcoin network on a given day. Anyone can push that number as high as they want.

How is this different than trying to manipulate the MtGox price by trading with yourself? When you make a bid, you're automatically matched with the best offer, not any offer you want. You've now made that bet and you're on the hook for it to someone else. Also, there are transaction fees. This may not have been explained properly in the original post, but making bids and offers firm and matching them correctly is important.

Also, since the binary event will be decided without real world measurements the person with the most money can force the outcome to whatever they want it to be.

Prediction markets work because at the end of the day an arbiter will make a final call on whether the event did or did not occur.
If there is no arbiter of the event then you are just in a competition to see who can most effectively game the system.

There is no person with the most money. They're going up against the entire market. Even the world's most powerful governments get p0wned by the market when they try that. There's reason to believe that since everyone has an external event to rally around and synchronize to, that's where the market will head, and anybody who tries to game it will get crushed, because they're going against the only thing that signals the market. Whether this will work in practice is an open question, but I think it's too early to dismiss it.


Title: Re: [RFC] Betcoin
Post by: Michiko on June 26, 2011, 10:06:46 PM

How is this different than trying to manipulate the MtGox price by trading with yourself? When you make a bid, you're automatically matched with the best offer, not any offer you want. You've now made that bet and you're on the hook for it to someone else. Also, there are transaction fees. This may not have been explained properly in the original post, but making bids and offers firm and matching them correctly is important.

Also, since the binary event will be decided without real world measurements the person with the most money can force the outcome to whatever they want it to be.

Prediction markets work because at the end of the day an arbiter will make a final call on whether the event did or did not occur.
If there is no arbiter of the event then you are just in a competition to see who can most effectively game the system.

There is no person with the most money. They're going up against the entire market. Even the world's most powerful governments get p0wned by the market when they try that. There's reason to believe that since everyone has an external event to rally around and synchronize to, that's where the market will head, and anybody who tries to game it will get crushed, because they're going against the only thing that signals the market. Whether this will work in practice is an open question, but I think it's too early to dismiss it.

Mt Gox does not offer really illiquid markets. Is the final closing price of your local college swimming team competition really of interest to enough participants to create a deep, 'non-movable' market? You might have won according to your local newspaper, but someone's bot has gathered sufficient trades (maybe with itself) to make a gain after paying fees? That would according to your rules not even be illegal or wrong, if I understood you correctly?








Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 26, 2011, 10:59:20 PM
Mt Gox does not offer really illiquid markets. Is the final closing price of your local college swimming team competition really of interest to enough participants to create a deep, 'non-movable' market? You might have won according to your local newspaper, but someone's bot has gathered sufficient trades (maybe with itself) to make a gain after paying fees? That would according to your rules not even be illegal or wrong, if I understood you correctly?

That's the interesting thing about this stuff. Illegal and wrong become irrelevant, because there's only a priori enforcement. If you can do it, it's ok.

Yes, a lot of the thinking here concerns massive liquid markets with healthy doses of speculators. I'm not sure it would be a good fit for small local bets. But it might work anyway. There's not a lot of money on the table, so is it worth going to great lengths and using sophisticated techniques to try and game it? If there's a sophisticated cheater, why wouldn't there be a sophisticated speculator going up against him?

You can't trade with yourself without going through the whole market first. If you're much bigger than the market, I suppose you could manipulate it, but who knows, maybe there will be speculators who specialize in making easy pickings on these small local bets by gathering online data about them and going against the cheaters. If you were a speculator with a bunch of capital, and you observed all these local bets going wrong, wouldn't you want to get in on the action?

In general, I'm really more interested in the big markets, because those are the ones that are choked by regulation today.


Title: Re: [RFC] Betcoin
Post by: Michiko on June 27, 2011, 02:53:26 PM
That's the interesting thing about this stuff. Illegal and wrong become irrelevant, because there's only a priori enforcement. If you can do it, it's ok.

Yes, a lot of the thinking here concerns massive liquid markets with healthy doses of speculators. I'm not sure it would be a good fit for small local bets. But it might work anyway. There's not a lot of money on the table, so is it worth going to great lengths and using sophisticated techniques to try and game it? If there's a sophisticated cheater, why wouldn't there be a sophisticated speculator going up against him?

You can't trade with yourself without going through the whole market first. If you're much bigger than the market, I suppose you could manipulate it, but who knows, maybe there will be speculators who specialize in making easy pickings on these small local bets by gathering online data about them and going against the cheaters. If you were a speculator with a bunch of capital, and you observed all these local bets going wrong, wouldn't you want to get in on the action?

In general, I'm really more interested in the big markets, because those are the ones that are choked by regulation today.


I don't necessarily agree with you here. Conceptually I'd prefer to treat all prediction markets the same whenever possible, giving up somehow artificial classifications. Also, I don't suscribe to that liquid  or large (not deep) markets suffer more from regulation or avoid tinkering if you sit on Digital payoffs. As an example, market making on something like basis spread swaptions might currently be harder than getting matched for a popular horse race on Betfair - still the former quite possible is of more interest to you and  already subject to more regulation.

But to gently move the subject away from storing bets in the Bitcoin block chain - how can an anonymous exchange or escrow agent for conditional transactions perform margining or offsetting? I haven't been able to come up with a clear concept and  I'm not sure how to interpret earlier suggestions (could be in the context of the separated oracle and escrow set-up)?

Most traditional financial exchanges and OTC deals offer some kind of margining or collateralisation. That's not only good for counterparty risk but also helps you fund the bet throughout the life. How can that be dealt with in an anonymous setup, simply running huge offset positions until maturity? I can't even say how the simpler set-up sport betting exchanges take would work: they offer only bets with pre-known maximum loss/win. Then the bettor has to fully fund upfront that maximum liability. The mitigation is that they allow offsetting: you could enter an exactly offsetting bet  a different stakes and they'd recognise you've reduced or removed exposure to the outcome and release your funds prematurely. Both systems - margining and offsetting - seem to rely on knowing the customer - how can that be done for anonymouse exchanges?

(I've mostly unsuccessfully tried around with chains of bets on bets; basically synthesizing Futures by construction sequences of forwards with wide initial margins rewarding the non-breaker, but that creates all kinds of additional problems)

Too many aspects around anonymity/non-regulation and transactions I don't understand, and too much daytime distractions. Please share share more of your thoughts around match making on exchanges and preventing timing issues (prevent double spending by double-signing with trusted 3rd party?), multi-node conditional transaction escrow, advantages/disadvantages of multi- versus single- entity market data fixing etc. I guess you guys have a lot more thoughts on things needed to create a proper prediction market, apart from scripting in the block chain!


Title: Re: [RFC] Betcoin
Post by: ben-abuya on June 27, 2011, 09:00:24 PM
I don't necessarily agree with you here. Conceptually I'd prefer to treat all prediction markets the same whenever possible, giving up somehow artificial classifications. Also, I don't suscribe to that liquid  or large (not deep) markets suffer more from regulation or avoid tinkering if you sit on Digital payoffs. As an example, market making on something like basis spread swaptions might currently be harder than getting matched for a popular horse race on Betfair - still the former quite possible is of more interest to you and  already subject to more regulation.

Yeah, I agree that all prediction markets should be provided for, but they don't all have to work well with every system. You could have betcoin for bets that work well with it, oracle betting for others, whatever works. And as I said, it's possible that less liquid bets will do fine on betcoin.

But to gently move the subject away from storing bets in the Bitcoin block chain - how can an anonymous exchange or escrow agent for conditional transactions perform margining or offsetting? I haven't been able to come up with a clear concept and  I'm not sure how to interpret earlier suggestions (could be in the context of the separated oracle and escrow set-up)?

My suggestion was to escrow the full value-at-risk into the trade. Of course that means that the contract must define a clear trading range. The way I see it is you're entering into a binding contract with the other side and the system has to guarantee payment. The only way to do that is to escrow the full amount. You want margin? Convince someone that you know what you're doing and get a loan. Or maybe another market will open up for that.

Most traditional financial exchanges and OTC deals offer some kind of margining or collateralisation. That's not only good for counterparty risk but also helps you fund the bet throughout the life. How can that be dealt with in an anonymous setup, simply running huge offset positions until maturity? I can't even say how the simpler set-up sport betting exchanges take would work: they offer only bets with pre-known maximum loss/win. Then the bettor has to fully fund upfront that maximum liability. The mitigation is that they allow offsetting: you could enter an exactly offsetting bet  a different stakes and they'd recognise you've reduced or removed exposure to the outcome and release your funds prematurely. Both systems - margining and offsetting - seem to rely on knowing the customer - how can that be done for anonymouse exchanges?

Offsetting bets is an interesting question. Clearly it would be beneficial for the system to be able to reconcile offset bets on the same account. I'm not sure if that's possible though, since the contracts would be different and the system would have no way of knowing if the two contracts really do offset each other at all. Again, if you can convince others, or another market, that you have offset bets maybe they'll front you some cash. Maybe there'd be a bet about how closely two other bets are correlated.

Too many aspects around anonymity/non-regulation and transactions I don't understand, and too much daytime distractions. Please share share more of your thoughts around match making on exchanges and preventing timing issues (prevent double spending by double-signing with trusted 3rd party?), multi-node conditional transaction escrow, advantages/disadvantages of multi- versus single- entity market data fixing etc. I guess you guys have a lot more thoughts on things needed to create a proper prediction market, apart from scripting in the block chain!

Bitcoin's greatest achievement is preventing double spending in a p2p system. Unless you know of a better way, might as well copy it. Bitcoin addresses timing issues partly by slowing things down. A block every 10 minutes is pretty slow. I think we can slow down prediction markets too. Prediction markets are made for hedging, not for day trading, so you don't necessarily need millisecond trade updates. Ordering identical-value bids and offers that go into a pool can be done randomly to ensure fairness and prevent gaming.


Title: Re: [RFC] Betcoin
Post by: Michiko on June 28, 2011, 12:17:58 PM
ben-abuya - your time to think through these issues and share your ideas with the forum is much appreciated. I find your earlier exchanges in this thread with dacoinminster etc. very enlightning, In my opinion more of these types of 'visions' are required. It looks like rather sooner than later the first prediction market or Futures exchanges etc. annonunced on the forum will hit beta. Without thinking the bigger picture I fear we end up with 'Betfair Bitcoin edition', or 'BTC settled CME Futures' etc. and that would really be a shame, given all this potential right now!

Hopefully you take my continue nagging below in that spirit, hope people on this forum find some more time to explain their ideas.

I personally would love an open market system without accounts, without building reputation or trust (on the user side), without unreasonable regulation by unsuitable regulatory bodies, and most of all without all the time somebody telling what is best for me. Technologically, with the arrival of Bitcoin and all these ideas here, there seems to be quite a bit of progress going on.



[...] The way I see it is you're entering into a binding contract with the other side and the system has to guarantee payment. The only way to do that is to escrow the full amount. You want margin? Convince someone that you know what you're doing and get a loan.
[,,,]
Offsetting bets is an interesting question. Clearly it would be beneficial for the system to be able to reconcile offset bets on the same account. I'm not sure if that's possible though, since the contracts would be different and the system would have no way of knowing if the two contracts really do offset each other at all.

For me margining/offsetting/netting is key to prediction markets in general. There's really no distinction between a hedger with 'legitimate interest' and the 'bad' speculators/investors/day traders just selling to gain. Most hedgers will take both sides over time, in most cases fire-n-forget static hedging is impossible. Also, without the liquidity provided by participants other than hold-to-maturity participants most markets will struggle badly. Markets where you cannot get out before maturity won't attract deep volume. Why forgo additional liquidity if there could be a (technological) solution to have it both ways?

The topic of integrating conditional-transaction settlement in the blockchain has found lots of interest but also a lot of resistance here. I'd love to learn more about ideas how to allow anonymous offsetting or margining. Surely somebody has thought of it?

My take for offsetting would be that maybe you could prove to the conditional transaction settler (who admittedly is then not the blockchain itself) via revealing access to recieving addresses that you will gain a guaranteed pay-off regardless of the outcome, say of long/short positions in identical bets or deals? Then they could release portions of the funds  to the recipients addresses prematurely.

And for margining, if you continue your thoughts about self-settling transactions in the blockchain: in a liquid market you could probably enter into forwards on forwards of ... of the actual deal? And each forward you would give a wide but finite initial margin built into the transaction. The side breaking the chain would automatically lose the remainder of its wide margin to the opponent, who then hopefully can close out in the liquid market.

Anyway, this are just crude and broken fragments. I really need the some of the smart people who discussed earlier in this thread  to come forward and explain things clearly for the benefit of my tired and slow brain...please.


Bitcoin's greatest achievement is preventing double spending in a p2p system. Unless you know of a better way, might as well copy it. Bitcoin addresses timing issues partly by slowing things down. A block every 10 minutes is pretty slow. I think we can slow down prediction markets too. Prediction markets are made for hedging, not for day trading, so you don't necessarily need millisecond trade updates. Ordering identical-value bids and offers that go into a pool can be done randomly to ensure fairness and prevent gaming.

On the same note, I cannot see slowing down a market being a good thing. Somebody trying to make a market on a slow prediction platform will be taken apart by bots arbitraging out on traditional markets I guess, reducing liquidity and increasing bid-ask spreads needed in the first place? I think everybody profits from fast markets - the ones who like it fast can use it, the ones who don't care about speed can trade at any slower speed they want. Isn't that win-win?

The problem is not in the match-making bit of the system (I will try to write a more legible post later today to explain what I understand the 4 core components of a traditional prediction markets are). That can be made arbitrarily fast without Bitcoin confirmations. But as the guy running the exchange how do you guarantee your client that the match that hit his bid will follow through (maybe some kind of double-spending problem in Bitcoin language?) By the time it becomes clear the other one - who doesn't have a fixed account with the exchange - didn't deliver a confirmed transaction the first guy is pissed off because he is now unhedged and the market has moved or whatever his problem now is. You probably don't want to end up absorbing the loss, and you cannot ban the offender because you don't require them to register with you. Waiting for blockchain confirmation is probably fine if you can hold off shipping that flat screen TV, but I don't think it will fly for exchanges?

I think there could be simpler solutions to this particular subproblems, there were loads of discussion long time ago (Snack Vending machine problem),  but maybe you don't need the nuclear option of an upfront escrow or similar techniques. Generally, I like to understand better how one could leverage of the possibilities offered by the existing Bitcoin we have now. I fully understand the resistance people have against changing it without need or without clearly thinking it through. If there is a half-way solution leaving core Bitcoin alone I already would be perfectly happy.