Marketplace Specs
The Adosia Marketplace
A user will have the ability to create a sale, update a sale, complete a sale, remove a sale, and transfer a completed sale into the printing pool contract. Each sale in the marketplace is completely determined by the datum which is embedded into the transaction as a JSON file. This marketplace is designed to handle ADA for NFT style sales. NFT to NFT sales will require additional datum fields that account for policy and the asset name.
Datum Values
The format for the datum is simple but expressive. The unique ID is used here to attempt to guarantee a unique datum hash. It is not required as we will force a single script UTxO but it may be useful in the future for additional state information.
Seller's PubKey Hash
Item Price In Lovelace
Unique ID (Optional)
The additional fields that can be added are the amount, policy ID, and asset name. This would be a great way to check singleton values when completing an NFT to NFT sale. If we need something for bundles and singletons then we can use the value representation but that may be unnecessarily complex for the MVP.
Creating A Sale
A user will pick a price and select their NFT(s) to be placed into a sale state. The new sale will only be viewable once the transaction has been submitted to the blockchain. If we had direct memory pool access then we could show the transaction status in a meaningful way.
This endpoint is the entry into the smart contract. Improperly created sales with nonexistent or invalid pubkey hashes will have their NFT(s) locked into the contract. Proper datum values are off-chain dependent.
Update A Sale
A user who has an NFT(s) inside the sale state can update the price information by sending the NFT(s) back into the smart contract with a new datum file. Proper datum values are validated on-chain along with the transaction. The only user that can update the sale datum is the wallet defined inside the datum.
Complete A Sale / Transfer For Printing
A user can complete a sale and choose to send the NFT(s) into the printing state or send the NFT(s) back to their wallet. A sale can only be completed if the seller is paid the amount defined in the datum and the NFT(s) continue to the chosen destination. The buyer will pay the smart contract fee but if required we can place an option inside the contract to allow the seller or the buyer to pay for the fee.
Remove A Sale
A user who has an NFT(s) inside the sale state can remove the NFT(s) by sending the NFT(s) back to the original seller defined in the datum. The only user that can perform this action is the same pubkey hash defined in the datum.
Cost Estimation
Entering the SC is going to be a regular transaction fee. The updating and removing endpoints should cost about the same but less than completing a sale. The required validation inside the complete or transfer endpoints causes it to be the most expensive.
Last updated