How does the Gateway work?
First of all, it is not a decentralized gateway yet, which means that XCP-Gateway.io is there as the middleman automatically swapping your tokens.
WXCP is a asset issued on the WAVES chain, which has a supply of 2,615,179 WXCP.
It has one more WXCP minted than there should be, since a 1 WXCP issuance was needed to make it a not ‘reissuable’ token and so no more WXCP can be minted.
All WXCP has been pre-issued and get send when an exchange from XCP to WXCP is requested.
The process of exchanging
An exchange request is created on the database by the customer who decides what to exchange on the homepage.
Furthermore, the recipient address is saved, so the system knows where to send the tokens to.
At this point a new XCP / Bitcoin or WAVES Address is generated and set as a deposit address in the database.
The system now listens to this deposit address and waits for a confirmed deposit of XCP or WXCP.
When this deposit happened, a set fee is deducted from the amount and the final amount of WXCP gets send by the system to the receiver and the exchange request closes.
In the end all coins/tokens get sweeped back to one cold address.