# Basic NFT Marketplace Architecture - Alvaro
## Diagram

## Components
Taken from [NFT Marketplace Definition. Glossary](https://docs.google.com/document/d/1WcANxCzoVSM9kdDc3sB5IIUXNXnp5qL-A7ZMjNswiig/edit#heading=h.e7r42kdgzksn).
### Actors
* Producer (Content Creator/Artist)
* Service Provider
* Seller (Producer Delegate/Distributor/Reseller)
* Buyer/Consumer (Cards Collector/NFT “Investor”/Music Lover/Entrepreneur)
* Marketplace Owner (Entrepreneur/Developer)
* Moderator (Owner Delegate/Market Manager)
* Sponsor (Curator/Verifier/Patron)
### Notions
* Artefact (e.g. Artwork) - a result of the producer craftship
* mapped to the Collectible
* NFT/Asset - a digital representation of an artefact
* Agreement - any arrangement or understanding between two or more parties in numerical form about their rights and responsibilities for the Marketplace relationships
* Negotiation - is the process of exchanging relevant information to reach an agreement. Happens off-chain
* Settlement - is the final step in the process of negotiation to reach an agreement. Happens on-chain
## User Stories
Taken from [Mkp Engine Strategy](https://docs.google.com/document/d/1nIeEuqWDVjaIwftXPsU6rDzqTM4S8XMM5irW8D3cYxs/edit?pli=1).
### Epic 1
Create an NFT-Release-v1.
#### US-01
##### B2C
As an artefact producer I want to be able to create an NFT asset representing my artefact, so that I can monetize my work.
###### How?
Through the UI and then the NFT Factory smart contract, an specific artefact can be mapped to a new NFT. (Mint NFT).
##### B2B
As a software developer I want to be able to develop an application mechanism where producers of my business vertical are able to share their work on an open marketplace.
###### How?
The developer should deploy the NFTFactory SC (and so be the owner), this will be the entry point for producers to the system.
#### US-02
##### B2C
As an artefact producer I want to be able to upload an image to the IPFS via an NFT Marketplace application, so that I can add the result of my work to an open marketplace.
##### How?
The UI would connect with an API (rif-upload-service) that can upload an image to IPFS and provide the hash that will be referenced in the new NFT asset.
##### B2B
As a software developer I want to have a unified, easy-to-use developer interface (SDK, API) to upload an image to the IPFS, so that I can programmatically save and manage files in the decentralized way
###### How?
The developer need to have its own instance of rif-upload-service
#### US-03
##### B2C
As an artefact producer I want to be able to provide a name and description to my digital asset via an NFT Marketplace application, so that I can communicate to other marketplace actors in succinct and detailed ways what is the result of my work.
###### How?
When minting the NFT. Include name (req) and description (optional) as part of the NFTFactory SC create asset function.
##### B2B
As a software developer I want to have a unified, easy-to-use developer interface to set a name and description for a digital asset, so that I can programmatically set and change these properties
###### How?
SC interaction.
#### US-04
##### B2C
As an artefact producer I want to be able to set how many copies of the result of my work I want to add, so that I can customize the supply based on my economy or other incentives.
###### How?
Include supply as part of the NFT creation process.
##### B2B
As a software developer I want to have a unified, easy-to-use developer interface to set a number of identical digital assets I’m going to create, so that I can programmatically define it for each specific artefact.
###### How?
SC interaction.
### Epic 2
List an NFT for sale - Release v1
### US-05
#### B2C
As a digital item seller I want to be able to select a sale method during the sale listing process, so that I can list an item via an NFT Marketplace application using the most convenient and profitable approach to me.
##### How?
NFTMarketplace will have 2 options for listing items for sale. Auction and fixed price.
The indexer would listen to events, save them in a DB and provide an endpoint to be easily accesible through the UI.
#### B2B
As a software developer I want to be able to choose between different sale methods via a unified, easy-to-use developer interface, so that I can customize the sale behaviour depending on the users needs.
##### How?
SC interaction.
### US-06
#### B2C
As a digital item seller I want to list an item for sale using a simple fixed price mechanism via an NFT Marketplace application, so that I can sale my work based on the price I set.
##### How?
UI should provide a way to list an NFT that will end up calling NFTMarketplace SC - sale as fixed price.
#### B2B
As a software developer I want to have a unified, easy-to-use simple fixed price API, so that I can use this interface to programmatically set digital items for sale based on the price my users set.
##### How?
SC interaction.
###### Req1 - Be able to change price
- add setPrice function in NFTMarketplace SC
- only for fixed price items
- only callable by owner of the item
- only when item.status === onsale
###### Req2 - Be able to cancel anytime
- add cancelSaleItem function
- only callable by owner of the item
- only when item.status === onsale
### US-07
#### B2C
As a digital item seller I want to list an item for sale using a highest-bidder auction (English Auction) via an NFT Marketplace application, so that I can sale my work based on the open market price.
##### How?
The UI would call createBid(...) function in NFT Marketplace SC.
#### B2B
As a software developer I want to have a unified, easy-to-use English Auction API, so that I can use this interface to programmatically sell digital items based on the open market price.
##### How?
SC interaction - placeBid(...)
_Should we set minimum addition to current bid to place a new bid?_
###### Req1 - Be able to set minimum price
- Add minimum price
- only callable by the owner of the artefact, while status == onsale
###### Req2 - Customize allowance to cancel
###### Req3 - Be able to set expiration date
- only callable by the owner of the artefact, while status == onsale