Decentralized trading of artwork on the Pastel Network is designed to be secure and to not require any trust between buyers, sellers, and Masternodes. The entire process is controlled through the use of 3 different kind of trade tickets which are written to the blockchain and which can be verified by all nodes on the network.
There are 3 tickets required for an artwork trade:
{
"pastelID": "", //PastelID of the art owner - either 1) an original artist; or 2) a previous buyer,
//should be the same in either 1) art activation ticket or 2) trade ticket
"art_txid": "", //txid with either 1) art activation ticket or 2) trade ticket in it
"asked_price": "",
"valid_after": "",
"valid_before": "",
...
}
Sale tickets have the following restrictions:
{
"pastelID": "", //PastelID of the buyer
"sell_txid": "", //txid with sale ticket
"price": "",
}
Buy tickets have the following restrictions:
Only one buy ticket can be active for each sale ticket; once a valid buy ticket has been submitted, the sale ticket is “locked up” for a period of time.
If the buy ticket is not “confirmed” by a corresponding trade ticket, then it automaticaly expires after some time has passed (approximately 6 hours as measured in number of blocks.
{
"pastelID": "", //PastelID of the buyer
"sell_txid": "", //txid with sale ticket
"buy_txid": "", //txid with buy ticket
"art_txid": "", //txid with either 1) art activation ticket or 2) trade ticket in it
"price": "",
}
Trade tickets have the following restriction:
The cNode (the core code that powers the wallet API) creates the sale ticket transaction. The transaction includes the ticket itself as well as a ticket fee (2% of asking price) that is sent to an unspendable address, burning the coins.
The seller validates the transaction by checking that:
If the sake ticket transaction is valid, then the cNode sends it to the network to be included into the blockchain in the next block. After some pre-defined number of confirmations for the sell ticket, buyers can act upon it by submitting a buy ticket.
cNode creates transaction; the transaction includes the buy ticket and the ticket fee (1% of the offered price) which is sent to an unspendable PSL address, burning those coins.
The buyer’s wallet then validates the transaction by checking that:
If the transaction is valid, cNode sends it to the network to be included into the blockchain in the next block.
The buyer’s cNode creates the transaction, which includes the trade ticket itelf, the coins sent to the sellers’s PSL address that corresponds to the seller’s PastelID, and the default ticket fee (1,000 PSL, but reducing over time as the mining difficulty scales up) to an unspendable address as a spam prevention measure.
The buyer’s cNode validates the transaction by checking that:
After the trade ticket is accepted into the blockchain, the buyer’s wallet can request the actual image file from the network.
The 3 kinds of trade tickets are referenced by the network using the following identifiers:
Sale Ticket:
Main Key - artTnxId:copyNumber; for example “71841f1c4e0fbc55535e696cbac107af1e4c9d25d96071570287387588d2be5b:0”
Multi-value Key 1 - PastelID
Multi-value Key 2 - artTnxId (art transaction id): txid of either the art activation ticket or trade ticket
Buy Ticket:
Main Key - sellTicketTnxId
Multi-value Key 1 - PastelID
Trade Ticket:
Main Key - sellTicketTnxId
Secondary Key - buyTicketTnxId
Multi-value Key 1 - PastelID
Multi-value Key 2 - artTnxId (art transaction id): txid of either - art activation ticket or trade ticket