I originally wrote about how my Aggeus Market protocol works here, but I think I did a bad job and it's a bit confusing. In this document, I'd like to provide a (hopefully) more accessible description of how it works.
Fundamentally, Aggeus Market is based on the expectation that an oracle will reveal a secret Y if some possible future event happens (e.g. Atlanta wins an upcoming soccer game), and a secret N if that event does not happen (e.g. Atlanta does not win). Based on that expectation, suppose someone decides that they think the secret Y is 80% likely to be revealed, and they are willing to bet 10k sats on this outcome.
Aggeus Market allows them to do this in such a way that, if they are wrong, they lose 80% of their money (i.e. they lose 8k sats), but if they are right, they get their money back plus an extra 20% (i.e. plus 2k sats). These numbers are only an example, users can set them to whatever values they want.
The thing that's new about this protocol is that I found a way to represent these predictions directly on bitcoin as tradeable smart contracts, such that users can buy and sell these contracts non-interactively. Using a technique similar to DLCs, these contracts can represent predictions about any future event (e.g. the price of bitcoin, or the outcome of a sporting event, etc.), but my technique is more flexible than DLCs in this respect: you can exit your position by non-interactively selling it in a marketplace (you just list it for sale and come back later to see if anyone bought it), and others can enter a position by non-interactively buying it in that marketplace so long as someone who already entered it lists it for sale.
Now, I'm about to tell you how I do this, but before I do, I want to say this: I think my protocol fixes some problems with DLCs, which all stem from the fact that DLCs require users to know who their counterparty is when they make their contract. In DLC markets, offers typically take the form "Party A can take the money if Party A is right, otherwise Party B can take the money," and both parties need to be known in advance so that their pubkeys can be inserted into the smart contract.
As a result, in DLC markets, you can't just put an offer out into the world and come back later to see if you made any money. You have to announce what you want to do in your contract -- which seems perfectly reasonable, I don't mind that part -- and after someone sees/accepts your offer, you have the following problems: (1) you must both be online at the same time (2) then can you set up the smart contract (3) then you have to fund the contract simultaneously (4) once the contract is funded, it's hard to "sell" your position to other interested people -- both sides are typically "locked in" til the market resolves.
I think I figured out how to solve almost all of those problems and do so in a "bitcoin native" way. My protocol lets you create your offer without knowing who your ultimate counterparty will be. Instead, you work with a coordinator, who acts as a kind of non-custodial proxy for anyone who might wish to accept your offer later. Once you make your offer, you can go offline. After someone sees/accepts your offer, (1) they can do the rest without your further interaction -- i.e. you don't need to be online at the same time (2) the contract is already created, your counterparty is just buying it (3) your contract is already funded, so they just use their own funds to pay you for it, i.e. to buy it (4) the protocol works by selling your contract, i.e. your position. As a result, almost every trader gets their payout immediately, even while they are offline, and does not have to wait til the market resolves. Certain people, however, whom I call market makers, do have to wait til the market resolves.
The Aggeus Market protocol requires a coordinator, and his role is to act as a proxy between two counterparties in the prediction market, without having custody of either party's money. To explain this, let us suppose a user Kelly wants to create an offer where she bets 10k sats on outcome Y with a confidence level of 70%. This means, when the market resolves, Kelly should get 13k sats in total if someone accepts her offer and she ends up being right, but only 3k sats back if someone accepts her offer and she ends up being wrong. That is, Kelly should gain 30% if she is right (3k additional sats on top of her original 10k stake) and lose 70% if she is wrong (7k sats out of her original 10k stake).
To accomplish this, Kelly -- the market maker -- picks an Oracle who has announced an intention to reveal a secret Y or a secret N representing two possible outcomes of some future event. The market maker (Kelly) picks the outcome she thinks is 70% likely (in our example) and deposits 10k sats into a smart contract whose terms I will shortly explain, and she signs a transaction that allows the coordinator to change its state in a manner that I will also shortly explain. For now, that's all that happens: Kelly deposited some money into a smart contract, signed a transaction, shared her signature with the coordinator, and she is done. She may go offline, and come back online later to see if she made any money (i.e. to see if someone bought her contract).
What happens next is, the coordinator waits for someone to come along who wants to accept Kelly's offer. If he finds someone, he (the coordinator) uses Kelly's signature to broadcast a new transaction, already signed by Kelly, and this new transaction has two outputs: Kelly receives 3k sats, funded by the coordinator, and Kelly's 10k sats go into a second smart contract representing a new state. This second smart contract says that if the secret picked by the market maker gets revealed, the market maker (Kelly) may withdraw the 10k sats. This is what should happen if Kelly is right, because she staked 10k sats on her claim, with 70% confidence, i.e. she hoped to make 30% more than she staked, so she gets back her original 10k sats in addition to the 3k she was already sent.
If the secret picked by Kelly does not get revealed, but the other secret gets revealed instead, the coordinator may broadcast a transaction taking the 10k sats for himself. This is what should happen if Kelly was wrong, because she staked 10k sats on her claim, with 70% confidence, and she was wrong, so she loses 7k sats (i.e. she loses 70% of her money -- she only gets to keep the 3k sats she got earlier, and loses 10k sats).
Another possible outcome is this: perhaps the coordinator never finds someone who wants to accept Kelly's offer. If that happens, he simply never moves her money into the second smart contract, and the first smart contract allows her to take her money back 1 day after the market resolves. This is enforced via a timelock. So if Kelly's offer is unattractive to the market, she just gets her money back; no harm, no foul.
Once I've set up the smart contract this way, there are two additional considerations: (1) If the coordinator finds someone who wants to take this bet, how does he serve as a proxy between this new person and Kelly? (2) How can the new person sell their position non-interactively once they've purchased the market maker's contract?
The answer to the first question is: once the coordinator finds someone who wants to take the market maker's bet, I have the coordinator make the same bet with the new person. I will explain how I do so in a couple of paragraphs, but for now, let's call the new person John. At a high level, what we want to happen is this: if the market maker is 70% confident in outcome Y, the coordinator should fund a smart contract with John with 10k sats (just like Mary's contract with the coordinator), except in this contract, the coordinator adopts 70% confidence in outcome Y, and John should somehow send the coordinator 3k sats.
That way, if the Oracle ends up revealing Y, Kelly gets to keep the 3k sats the coordinator sent her earlier as well as the 10k sats she put in her contract, and the coordinator gets to keep the 3k sats sent to him by John as well as the 10k sats the coordinator put into that contract; whereas, if the Oracle ends up revealing N, Kelly loses 7k sats to the coordinator (because she keeps the 3k sats he sent her, but loses 10k sats of her own money to him), and the coordinator loses 7k sats to John (because he keeps John's 3k sats, but loses 10k of his own money to John). It's a wash for the coordinator either way, which means he is purely a proxy between Kelly and John. John is Kelly's "real" counterparty, but she did not have to interact with him, or even know him in advance!
Now, a couple of paragraphs ago, I said I would explain how the coordinator makes the same bet with John as he already has with Kelly (only with the roles reversed). How I do that is this: the original smart contract says, if outcome Y is revealed, the 10k sats in the smart contract go to Kelly, but if outcome N is revealed, the 10k sats go to the coordinator. The new "copy" of this smart contract is the same, except the coordinator puts 10k sats in it instead of Kelly, and the roles are reversed. That is, the new contract says, the coordinator gets all 10k sats if Y is revealed, and John gets all 10k sats if N is revealed, as long as a second condition is true, which will be explained in a moment.
The new contract might sound like a bad deal for the coordinator, at first blush. He puts 10k sats into it, and the "best" outcome for him is that he gets his own money back, whereas there is a decent chance he does not get it back, namely, if John wins. But that's not really true; you see, I did not mention what the "second condition" is. It's not enough for John to learn the secret N, which he is betting on; the "second condition" is that John can only withdraw the money from his contract if he also learns a secret -- a preimage -- that is currently known only to the coordinator. How does John learn this secret? He "purchases it" from the coordinator by paying him an amount of money on the lightning network.
How much money? The amount varies depending on the contract, but it's always the same amount the coordinator pays to the market maker if he moves her contract into the second stage. So, in our example, if Kelly is correct, she gets to keep the 3k sats the coordinator is about to send to her; therefore, the coordinator charges John 3k sats via lightning, and John cannot enter the contract without paying it, because knowing the preimage -- knowing the secret -- is a condition for him to withdraw his winnings. So if John wants to enter the contract, he has to pay that cost, and that means the most he can win is 7k sats, not 10k. John is effectively buying into "the other side" of Kelly's contract for 3k sats, so that he has a chance of winning 10k sats if Kelly is wrong, for a gain of 7k sats. And that is good because Kelly was 70% confident, so she ought to lose 70% of her money (7k sats) if she is wrong.
So now the question is, given that the coordinator is putting 10k sats into this new contract, but only getting 3k sats from John, why would he do this? The answer is, because it sets everything right: if the coordinator "loses" in this contract, he only loses 7k sats (since he put in 10k and got 3k from John), and that is the same amount he will "gain" in his contract with Kelly: he is about to send 3k to Kelly when he moves her money into the new state, and if Kelly is wrong (i.e. if N is revealed instead of Y), the coordinator gets 10k "out" of that contract, for a gain of 7k -- which matches the amount he loses in the new contract.
And that is how the coordinator acts as a proxy between the market maker and their real counterparty, i.e. between Kelly and John. Importantly, Kelly does not need to come back online once John agrees to buy her contract, because Kelly already signed her contract with the coordinator and already staked her funds. The coordinator just has to broadcast the transaction that funds the bitcoin address encoding the second state of his contract with Kelly, which he does if he finds a counterparty for her (John) and gets the right amount of money to cover his payment to Kelly (which John pays him via LN).
If the coordinator doesn't find a counterparty for Kelly, he just leaves Kelly's money alone, so that Kelly can withdraw it once the market resolves, per the terms of the first state of her smart contract with the coordinator. But if the coordinator does find a counterparty for Kelly, and the counterparty pays, then and only then is it in the coordinator's best interest to move Kelly's money into the second state, because if the coordinator does not do so at that point, and N is revealed (in our example), he may lose money in his contract with John without getting reimbursed from his contract with Kelly. It is also not in his interest to move Kelly's money into the second state before finding a counterparty for Kelly, because then he may lose money to Kelly without getting reimbursed from his contract with John. So the coordinator's interests are aligned only when he acts as a pure proxy.
Now, apart from the question of how proxying works, there was a second question: how can John sell his position non-interactively once he has purchased the market maker's contract? The answer is: John's smart contract has a "multisig" clause, and if he wants to list his position for sale at a new price (or the same price he bought it for), he uses that clause to create a signature (which he shares with the coordinator) that is only valid for a transaction where the coordinator sends John the sale price, while taking the remainder for himself. For example, if John wants to sell his position for 4k sats, his signature allows the coordinator to take 6k sats from the smart contract for himself as long as he sends 4k sats to John.
At this point, you might wonder, isn't that a terrible idea for John? He's potentially got 10k sats coming to him from that address, and if he signs it away for 4k sats, it is always in the best interest of the coordinator to take it, right? After all, it's a guaranteed 6k sats, whereas right now he is not guaranteed anything from this contract. The answer is, the coordinator does not yet have any reason to broadcast the transaction signed by John, because if he did, two things would happen: (1) he would only get 6k sats out of the original 10k that he himself put in the smart contract, meaning he would be giving the other 4k sats to John for free (2) he would be setting himself up for a potential further loss, because he is still on the hook in his corresponding contract with the market maker (Kelly), and if that bet goes the wrong way, he will lose money with no guarantee of a reimbursement here.
So now that you've read that, you might ask: why did John sign that transaction if the coordinator has no interest in broadcasting it? And the answer is, he may "get" an interest, in the following manner: once John has signed a transaction that lets the coordinator "off the hook" for 4k sats, he has signaled that, regardless of how much money he paid via LN to acquire this position, John is now willing to give his position up as long as the coordinator is willing to give him 4k sats. Which means, if the coordinator can find someone willing to pay 4k sats to get into the same position, he (the coordinator) won't lose any money. So he can start looking for someone willing to take John's position, and advertise it as "for sale" for 4k sats.
Now let's suppose someone named Tommy comes along and is looking to "get in the game" on this prediction market. He sees John's position "for sale" for 4k sats. What can Tommy gain by buying it? Well, John's position says that if N is revealed, John gets 10k sats. Does Tommy think that position is worth 4k sats (except substituting himself for John)? Maybe he does! It might even be more attractive to him than making his own offer, because if he makes his own offer, it may be that no one will come along to take it; whereas this offer is available right now with no waiting.
If Tommy decides to buy John's position, he tells the coordinator he wants to do this, and the coordinator sets up the same contract with Tommy that he currently has with John: the coordinator puts 10k sats in it, and the contract says, the coordinator gets all of the money if Y is revealed, and Tommy gets all of the money if N is revealed, as long as he knows the preimage to a lightning invoice which, if paid, gives the coordinator 4k sats.
Once the smart contract is set up and funded by the coordinator, Tommy can pay the coordinator 4k sats via lightning, thus learning the preimage, and now, if N is revealed, he gets 10k sats, for a profit of 6k sats. The coordinator, meanwhile, now has an incentive to "let John go:" if he does not, and N is revealed, he loses money -- he loses 10k sats to both John and Tommy, for a 20k loss total, but only gains 10k sats from his contract with Kelly. So his incentive is to broadcast the transaction John signed, thus giving John his 4k sats. This makes it so the coordinator is no longer "on the hook" for potentially paying John any money, and it's also notable that John did not have to be online for this, as he already signed the transaction. When he comes back, he'll just see that he exited his position and his balance grew by 4k sats, just as he hoped for. In fact, since he purchased his position for 3k sats, and sold it for 4k sats, he made money! Hopefully Tommy can make money too, either by selling his 4k sat position for a higher price to someone else, or perhaps by waiting til the market resolves, whereupon, if N is revealed, he will make 10k sats.
Voila! This is a bitcoin native market with all the properties I wanted: you can post an offer, go offline, and come back later to see if you made any money. The coordinator acts as your proxy, finding people who may want to take your offer and automating everything if he finds someone. The smart contract can be fulfilled without your further interaction, as your counterparty simply accepts your terms and sends you money through the coordinator, who acts as a non-custodial proxy.
Your counterparty can do this even while you are offline; whether you're the market maker or just someone who buys into positions and resells them, you get paid as soon as someone accepts your offer, because you already signed a transaction that allows the coordinator to pay you and proxy your contract to a new user. You just come back online later to the happy sight of more self-custodial bitcoin than you had before.
Meanwhile, the coordinator never has custody of anyone's funds, and the protocol allows for anyone who buys a contract to resell it to anyone interested, even at a new price, without needing to interact with them. And all of these features work natively on bitcoin. I am very excited about this and look forward to explaining it further if anyone has any questions.