Making P2P Great Again, Episode III: Prediction Markets

Apr 5, 2017 · 4 min read

Today we are introducing P2P prediction markets. They are powered by simple smart contracts that any regular user can understand and create, similar to smart contracts behind bound payments that we launched in Episode I and Episode II.

Take this example. You want to be paid if the price of Bitcoin exceeds 1200 USD within the next 7 days. You may want this either because you bet on this event, or you want to hedge against the risk that the price goes that high. Someone else wants to be paid in case of the opposite outcome, i.e. the price of Bitcoin never breaks over 1200 USD during the next 7 days.

You start a chat with your counterpart in Byteball wallet, learn his Byteball address,

and design a binary option contract:

Under the contract, total 1 GB is locked. You contribute 0.1 GB, the peer contributes 0.9 GB. The entire amount can be spent either by you, if a price oracle posts the price greater than 1200 at least once, or by the peer, if this never happens during the contract term, 7 days. If the price exceeds 1200, you don’t have to wait for expiry of the 7-day period, you can sweep the entire contract amount immediately.

The price oracle is a Byteball node that collects price data from public sources and periodically posts it to the Byteball database. The parties are free to select any oracle that they trust to post accurate data.

One such oracle is already running, it takes cryptocurrency exchange rates from the largest crypto exchanges and foreign exchange rates from Yahoo Finance and posts the data roughly every 10 minutes. The address of the oracle is JPQKPRI5FMTQRJF4ZZMYZYDQVRD55OTC, you can see an example of its data feed on Byteball transaction explorer. The oracle posts only top 100 crypto coins. If a coin drops out of the top 100, it also drops out of the feed.

Having such a large array of price data allows you to bet on (or hedge against) any movement of any coin.

A user on a Telegram group was looking to short a hard-pumped coin

Now you can short any coin without owning it, simply by betting that its price goes below certain level. Being a binary option, this contract also limits your loss (you can’t lose more than you paid) and includes an implicit take-profit (no risks after the price breaks the set level).

Bet on any event, hedge against risk of any event

The above is just the first working example of a contract that depends on the outcome of a future event. As more oracles are added that bring real-world events into Byteball, contracts can be easily designed around these events. Here are a few examples:

  • Sports events. Bet on the outcome of sports events, without bookmakers, completely peer-to-peer.
  • Weather events. Hedge against extreme weather conditions that potentially affect your business or well-being. For instance, wind speed above certain level, high temperatures for many days in a row, lack of snowfall at a ski resort (I wish I had this kind of insurance in January 2016!).
  • Flight delays. Get paid if your flight is delayed by more than 30 minutes.
  • Political events. Hedge against risks that elections will be won by a candidate who is likely to bring instability.
  • Insanity events. Hedge against the risk of Bitcoin fork.

All that is required to make such contracts real, is oracles that evidence the corresponding events. And since they are smart, such contracts are enforced by the math underlying the Byteball platform, there is no chance that any party is unable to meet its obligations.

The beauty of these contracts is that they can be created between two equal peers, without using any centralized intermediaries, without using big and complex broker-smart-contracts (which are common on Ethereum), and with complete clarity for both parties about what they are doing. And this is what makes P2P smart contracts great.


A distributed ledger without middlemen

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store