ternoa-js icon indicating copy to clipboard operation
ternoa-js copied to clipboard

Epic: Secret NFTs 🔐

Open ipapandinas opened this issue 2 years ago • 0 comments

This issue specifies the design choices took for the Secret NFTs pallet implementation in the SDK. Feel free to comment on certain misunderstandings and new suggestions are warm welcomed.

The 2 main sections are:

Minting

Flow

		graph TD;
		A[Init API]-->B;
	  B[Create Keyring]-->F;
	  B-->W;
	  
	  C[Create PGP Key Pair] -- public PGP Key -->D;
	  C -- secret PGP Key --> V;
	  D[Encrypt Secret] --> E;
	  E[IPFS upload: Secret + Public PGP Key] --> F;
	  F[On Chain: Mint Secret NFT] --> W;
	  
	  V[Generate SSS] --> W;
	  W[Format Payload: Data + Signature] --> Y;
	  X[Get Enclaves] --> Y[SGX Upload];
	  
	  
	  style A fill:#fff,stroke:#333,color: #000,stroke-dasharray: 5,stroke-width:2px
	  style B fill:#fff,stroke:#333,color: #000,stroke-dasharray: 5,stroke-width:2px

Sub tasks

  • #123 @Victor-Salomon
  • #124 @dhammani
  • #125 @ipapandinas

Viewing

Flow

		graph TD;
		Z[Init API]-->Y;
	  Y[Create Keyring]-->X;
	  X[SGX get: SSS]-->W;
	  W[Construct PGP Private Key] --> F;
	  
	  V[NFT ID] --> X
	  V --> C
	  
	  C[Chain storage get: Secret Offchain Data] -- IPFS hash --> D;
	  D[IPFS get: Secret Metadata] -- IPFS hash --> E;
	  E[IPFS get: Encrypted Secret File] --> F;
	  F[Decrypt Secret File]
	  
	  
	  style Z fill:#fff,stroke:#333,color: #000,stroke-dasharray: 5,stroke-width:2px
	  style Y fill:#fff,stroke:#333,color: #000,stroke-dasharray: 5,stroke-width:2px
	  style V fill:#fff,stroke:#333,color: #000,stroke-dasharray: 5,stroke-width:2px

Sub tasks

  • #127 @dhammani

Production ready

  • #135 @dhammani
  • #134 @ipapandinas
  • #143 @ipapandinas
  • #136 (optionnal - TBD)

Notes

Lifecycle states

Secret NFTs will have the following lifecycle associated with them: Pending Mint -> Minted -> Burned.

Glossary:

  • TEE: Trusted Execution Environment
  • SGX: Intel Software Guard Extensions
  • DEK: Data Encryption Key
  • SSS: Shamir Secret Sharing
  • PGP: Pretty Good Privacy (encryption program)

References

ipapandinas avatar Oct 27 '22 13:10 ipapandinas