← index

Off Chain DLC Ticketing Systems

An archive of delvingbitcoin.org · view original topic →

conduition · #1 ·

Hey plebs. I recently had an idea which I believe enables simple off-chain participation in discreet log contracts (DLCs).

I wrote about it on the dlc-dev mailing list here.

The email above describes the protocol in more detail, but the TLDR is:

The benefits:

I’m creating this thread for two reasons:

  1. I want to know whether I’m insane, and if this is indeed possible. Can anyone spot a bug?
  2. What use cases can you think of where this concept could be best applied?

(Small aside, I did make one error in my email to the dlc-dev list. I said that the market maker is the one who encrypts the signatures. In fact, the players must be the ones to encrypt their own partial signatures before sending them to the market maker, otherwise collusion is possible)

David A. Harding · #2 ·

I think the major efficiency gains that this depends on requires that each participant be a member of the multisig (so the contract is trustless) and then also be available after all tickets have been settled in order to sign a non-contracted payment back to the market maker. The more signers that are required, and the more time that passes between setup and teardown, the less likely it is that all signers will be available, requiring all of the individual outcome transactions to go on chain.

To support the above claim, here’s how I understand your proposal:

I’m not sure I fully understood your idea, so please let me know if I missed something.

conduition · #3 · · in reply to #2

Thanks for the questions @harding. If you’d like to understand the protocol in more detail, i think you’d find my original email to the dlc-dev mailing list helpful: [dlc-dev] Off-Chain DLC Market Maker

I think that should clear up most of your confusion, but let me try to answer a few things directly:

I think the major efficiency gains that this depends on requires that each participant be a member of the multisig (so the contract is trustless) and then also be available after all tickets have been settled in order to sign a non-contracted payment back to the market maker.

Only the DLC winners would need to be online and available to sell the on-chain contract TXO back to the market maker.

Once the DLC oracle publishes the outcome signature, the winners of the DLC can prove they have sole custody of the contract output. If they cooperate during that time, the winners can sell the whole contract back to the market maker, in exchange for off-chain payments therefrom.

The trick is in using multiple stages of transactions, not just a single n-of-n multisig address.

I think a diagram might be helpful to visualize the TX flow. This diagram shows a contract with 3 players, Alice, Bob and Carol, plus a market maker. I added ‘split’ transactions (not described in my original email) to enable the ‘all winners cooperate’ path.

Mathcha diagram link

This diagram uses adaptor signatures and PTLCs, but you could easily swap that logic for hashlocks instead.

The maker then sells tickets to Alice and Bob over LN. I think this likely requires PTLCs given that DLCs are working with signatures. If you have more details on how that would work, I’d appreciate them.

Alice wins. Her winning ticket is an output that can be spent by her unilaterally after a certain delay,

Tickets are actually just preimages - or scalars depending on the implementation. In the above diagram, i represent them as locking conditions with T_A, T_B, and T_C. The ticket locking conditions are one stage after the DLC oracle signature is needed, and i’m assuming the players all learn the outcome signature directly from the oracle for free (no PTLC needed).

You’re correct about the winner being able to unilaterally spend her winnings output after a delay. But to spend this output, the winner needs her ticket secret/preimage. Without it, after a longer timelock, the output returns to the control of the market maker, via \text{TX}_{\text{reclaim}}.

In the meantime, Alice and Bob have bought and settled 99 other tickets with the maker in the same way.

I think the protocol you’re picturing diverged from mine beyond this point. Each player can only buy one ticket per DLC. The purchase of the ticket secret grants the player access to a specific set of payouts, contingent on the outcome signed by the oracle.

Also the protocol as i’ve described is only for a single DLC contract; i haven’t yet considered how this might be applied to multiple DLCs.