Atomic Secrets Exchange



Summary:

The Atomic Secrets Exchange is a proposed solution to the problem of atomically locking two Lightning transactions in a protocol for placing bets. The issue arises when one of the two transactions is created before the other, resulting in a one-sided bet and making it risky to take part in the protocol. The proposed solution requires both parties to know a secret initially only known by the other party, ensuring that the transactions are bound to time out or be voluntarily canceled even after the oracle has spoken. This makes them safe to be locked in any order. The solution involves atomically exchanging two secrets instead of locking two transactions. Alice locks in a Lightning tx to Bob that requires Bob to know sa and sb, and reveal at least sb to Alice. Bob then locks in a Lightning tx back to Alice that requires Alice to know sa and reveal sa to Bob, which must time out sooner than the first tx. Alice redeems the second tx, revealing sa to Bob, and Bob redeems the first tx, revealing sb to Alice. Bob can 'split the atom' by not redeeming the first tx but receives a penalty for this that roughly equals the tx amount, moving his incentives towards honest behavior. The correct order of time-outs for the three transactions is Locking in the bet txes, Locking in the secrets exchange txes, Time-out of the secrets exchange txes, Publication by the oracle, and Time-out of the bet txes. The elliptic curve magic involves calculating P=p*G, Q=q*G, SA=sa*G, and SB=sb*G, with Bob needing to know SA to verify the value of PP_x0 and to generate PP_x1. Similarly, Alice has to know SB to generate PP_x0.


Updated on: 2023-06-02T20:58:03.424883+00:00