# NFT WORFKLOW
## NoChain
## CREATE NFT
### 0 - Bob buy CAPS
### 1 - Bob want to mint a NFT and define content details : name, description, media and secret media
### 2 - Service create a JSON from previous details. A key(K0) is generated and that key is used for crypt the secret media.
### 3 - Service upload both of medias to a DEX hosting
### 4 - Service upload K0 to NoChain Server
### 5 - Service create the NFT on Blockchain and define Bob as Creator and Owner.
## SELL NFT
### 0 - Bob buy CAPS
### 1 - Bob choose NFT and QTY he want to sell
### 2 - Bob define price and list his NFT on MarketPlace
### 3 - NFT are freeze on user wallet
## BUY NFT
### 0 - Alice buy CAPS
### 1 - Alice choose 1 NFT from MarketPlace and buy
### 1 - Alice generate asymetric keys for that NFT (Kprivate Kpublic)
https://github.com/amitaymolko/react-native-rsa-native
### 2 - Alice sign NFT + Kpublic and ask for K0
### 3 - NoChain check if Alice if sign is validated and if Alice is NFT onwer.
### 4 - Nochain crypt K0 using Kpublic and return to Alice
### 4 - Alice can decypt KO and able to check the Secret file.
## NOCHAIN
Node application on Enclave using Asylo.
### Database
schema
`{
id:int,
k0:string
}`
INSERT
Only marketplace is autorized to insert into enclave.
insert into Enclave where id=1,k0='ccccccccc'
GET
We cannot get function
UPDATE
If required conditions are validated, update Key
update enclave set k0='11111111' where id = 1;