Decentralized Exchange of USDC to PSL Performed by Masternodes on Pastel Network
It's difficult for users to buy PSL now-- they can only buy it on bitcoin.com, which has a verification procedure which is slow, annoying, invasive, and excludes a lot of countries.

The most convenient way of all for users to buy PSL (other than using something like PayPal or ApplePay, which are totally centralized) would be if there was a section in the wallet where you could arrange to directly purchase PSL in return for a stablecoin like USDC, which can be purchased easily on Coinbase and Binance.

The way it would work is that the user's wallet would broadcast a message to the list of Masternodes (this is available from the node software) that the user is interested in converting X amount of USDC into PSL, and would specify the PSL address where they would like the converted coins to be sent (or, vice-versa, that they want to convert PSL into USDC, and they would supply the USDC address they want the USDC coins sent to). 

Each Masternode would be configured at the option of the Masternode Operator (who is under no obligation to do so-- this is totally optional and disabled by default) to participate in this process. In order to do so, the Masternode operator would specify either a set price to convert PSL to USDC and back, or could select some discount or premium to the average price on coinmarketcap.com or bitcoin.com (for example, if the price of PSL on bitcoin.com is currently $0.0035 per PSL, the Masternode could select, say, a 10% premium; that is, they would be willing to sell PSL for $0.00385 per PSL (a 10% mark-up). Alternatively, they could offer to buy PSL from the user at a 10% discount to the exchange price in return for USDC.

To avoid gaming the system, not all Masternodes will be included in the process at all times. Using the sorting system for rank-ordering the Masternodes (used to allocate the mining block rewards to the Masternodes), the 10% top-ranked Masternodes for any given block would be the “designated traders” during that block period. 

There are two scenarios we have to deal with:

  1. The user is completely new to the system and doesn’t have any PSL, and wants to acquire some.
  1. The user has used the system already or somehow has access to PSL coins in a wallet (e.g., perhaps the PSL coins were airdropped to the user for free).

In scenario 2), the user will already have created a PastelID that identifies them securely on the network. But in the first scenario, the user will not yet have the 1,000 PSL that are required to create a PastelID ticket and have it written to the blockchain. However, the user can still generate a PastelID key-pair, even if this is not yet written it to the Pastel blockchain. Instead, the user can wait until they have received the PSL and then write the PastelID ticket, making sure to use the same PastelID that they specified ahead of time. For “new” users that do not yet have an active PastelID, their first transaction will be limited to 1,000.1 PSL (i.e., just enough to create a PastelID including transaction fees). 

Now, suppose 15 Masternodes are selected for a given block to handle these trades, and that 9 of these have elected to participate in this PSL conversion system. Each of these 9 Masternode would respond to the user’s message with a message describing how many PSL the Masternode would be willing to trade for the specified amount of USDC in the user’s message (and vice versa if the user is converting from PSL to USDC), as well as the address that the Masternode would like the user to send the coins to (say, a USDC address if the user is trying to purchase PSL).

The user’s wallet software would then show all these offers from the 9 Masternodes, sorted from cheapest to most expensive, and the interface would clearly highlight the cheapest option to the user. The wallet interface could display next to each offer what % better or worse it is than the average price over the last 24 hours for PSL based on coinmarketcap.com. The user could then put a checkmark next to the suggested Masternode (and maybe also type the word “accept” as an added precaution) to submit the trade ticket. The trade ticket would contain the following information:

  1. The direction of the trade (e.g., PSL to USDC, or USDC to PSL).
  1. The amount of PSL/USDC paid by the user.
  1. The address that the user should send the PSL/USDC to.
  1. The amount of PSL/USDC paid by the Masternode.
  1. The address that the Masternode should send the PSL/USDC to.

All of the above should then be signed by the user’s PastelID (even if this has not yet been registered with a PastelID ticket on the blockchain) and sent back to the Masternode, who will review it and then sign it with the Masternode’s PastelID. Finally, the Masternode will write this PSL/USDC trade ticket to the blockchain.

Once this happens, all the other Masternode and regular node will be able to see this information. The user will then have 5 blocks in which to send the USDC or PSL to the address in the trade ticket. Once the coins arrive at the correct address and have been confirmed by at least 5 blocks, the Masternode will then have 5 blocks in which to send the corresponding amount of USDC or PSL as described in the trade ticket to the correct address. All nodes will be able to monitor both the PSL address and USDC address in question to verify that the trade has been executed correctly.

If the trade has been done correctly, everyone wins, and both the user’s and the Masternodes reputation scores (which are linked to a PastelID) might increase by a couple points. If either side fails to do what is required of them, we have the following scenarios:

  1. The user never sends the required USDC to the address specified by the Masternode (or PSL if they are trying to sell). In this case, the Masternode does nothing, and hasn’t lost anything significant. However, the user has wasted network resources on the useless trade ticket. As a result, that user’s IP is banned for a certain amount of time, and the associated PastelID has a reduction in reputation points. When that number is below a certain level, the user is barred from participating until they start with a new PastelID, which then has its reputation reset back to zero. 
  1. The user send the coins to the Masternode’s supplied USDC or PSL address, but the Masternode never responds within the 5-block limit to send the right number of coins to the user’s supplied address. Importantly, every node in the network will be able to observe that this is the case and thus know which Masternode is at fault. To correct for this situation, there are 3 steps:
  1. First, the guilty Masternode’s reputation score declines significantly, which prevents the Masternode from participating in another coin conversion trade for the next 1,000 blocks. 
  1. Then, the guilty Masternode would be also penalized by not being allowed to receive their share of the Masternode rewards for the next 100 blocks. The lost income from this would exceed the gains from cheating the user, making this a bad economic strategy for the Masternode.
  1. Finally, just penalizing the Masternode doesn’t help the user, who has still been cheated out of USDC. In order to make up for this, all Masternodes will have the option of participating in the Trade Recovery Fund. For Masternodes that voluntarily participate in this program,  they will each designate a certain PSL address for these purposes (their “Compensation Address”) and fund it with some amount of coins, say 10,000 PSL. Coins to compensate cheated users will only ever be deducted from this compensation address, and once the address is empty, the Masternode must reload it or will cease to be a participant in the Trade Recovery Fund. In the event of a dishonest Masternode cheating a user, all of the other Masternodes who participate in the Trade Recovery Fund will divide the amount in question evenly between them and send that amount of coin to the user’s designated address. 

As an illustration , suppose the user was supposed to receive 25,000 PSL at their designated address within 5 blocks but never received it; if there were 37 Masternodes participating in the Trade Recovery Fund, each of them would then send 25,000/37 = 676 PSL (rounding up) to that address to make the user “whole”. From the user’s perspective, the trade worked out OK even though it was slightly late and the coins came in pieces from different Masternodes instead of a single payment from the selected Masternode in the trade ticket. Effectively, as the guilty Masternode is excluded from some amount of future block rewards, all of the other Masternodes would get proportionately more, thus offsetting some or all of their losses from the Trade Recovery Fund. 

Basically, this system turns every Masternode into a Changelly type service. In fact, it’s even better, because it’s a group of decentralized Changelly services that are all competing on price to trade with users, with a built-in mechanism for penalizing dishonesty and for making users whole if they are hurt by dishonest Masternodes.