To simulate the properties of an output-based system, funds are going to be locked with a m-of-m multi-signature script, based on a key from the seller and a new and unique key from an oracle. The oracle will allow only one single signing operation to ensure no tokens from the locked destination can be double-spent.
This use-case describes the process of creating a 2-of-2 multi-signature script destination.
- Swap client
- User-goal
- Seller
- Oracle
- The seller configured the system's settings to connect to a running Bitcoin or Omni Core RPC server
- The seller configured the system's settings to connect to a running oracle server
- The seller requests to generate a new lock-destination
- The seller provides a public key
- The system requests a new public key from the oracle
- The oracle generates and returns new and unique key-pair (UC-Oracle-1)
- The system sorts both keys
- The system creates a 2-of-2 multi-signature script, based on the sorted public keys
- The system returns the oracle's public key as
identifier
, and thedestination
, consisting ofaddress
,pubkeys
,redeemScript
,reqSigs
andtype
2a. The seller doesn't provide a public key:
- The system generates a new public key for the seller
- The use-case continues at 3
- The oracle generated a new and unique key-pair
- The system generated a 2-of-2 multisig script based on the seller's and oracle's public keys
- Alternatively it is thinkable to support more than one public key, e.g. to allow 3-of-3, 4-of-4 etc., and to leverage multiple oracles