SIP: 11 Layer: Core Title: Coin Exchange Offer Author: Brian BurrellComments-Summary: No comments yet. Comments-URI: https://github.com/neonatura/shioncoin/doc/standards/Comments:sip11.wiki Status: Final Type: Standards Track Created: 2019-01-27 License: PD
This functionality is currently only compatible with the exchange of SHC coins with the ShionCoin Alternate Colored Block-Chain coins.
An offer extended transaction will expire after 24 minutes.
A new offer is published on the block-chain using a OP_EXT_NEW operative. The new offer will include a associated number of SHC coins, the color hash of the alt-blockchain coins being converted, the rate of the conversion, and the SHC value range that would be accepted. An additional "Offer Operation Fee" is also required.
A secondary party may then perform a OP_EXT_ACTIVATE operative in order to accept the offer. The OP_EXT_ACTIVATE extended transaction is sent to a null address (OP_RETURN), and a seperate transaction is created on the colored alternate block-chain whereby the value of the color coins in sent to one-self for holding.
The original party can perform a OP_EXT_GENERATE against an accept offer in order to complete the exchange. When this occurs, a transaction is sent on the ShionCoin blockchain with a IF-ELSE script. This conditional script will send coins to the acceptee if a pre-determined transaction hash exists on the colored block-chain, and otherwise will return the coins once the generate offer transaction has expired.
The OP_EXT_GENERATE script is composed of the following;
The "offer_hash" is the hash of the OP_EXT_GENERATE's offer structure, the "alt_hash" is the tx hash on the colored alt-chain which sends coins from the acceptee to the originator, the "color_hash" is the hash representing the color of the alt-chain, the "dest_addr" is the acceptee's coin address on the ShionCoin block-chain, the "wait_time" is the time before the generate transaction expires, and the "return_addr" is the originator's own address.
The node which originated the acceptee's OP_EXT_ACTIVATE offer transaction will automatically send the colored alt-coin funds to the originator, once a OP_EXT_GENERATE is processed, using pre-determined TX contents. The hash for this TX is included as part of the activate offer transaction.
The original sender or the acceptee can cancel the exchange using a OP_EXT_REMOVE transaction. This can be used by the originator or acceptee before a OP_EXT_GENERATE transaction is published, or after a set of transactions has expired due to inaction.