# Minting & Decrypting flows

## Minting & Decrypting flows

{% hint style="info" %}
The following schemas and descriptions mention the Secret NFT as an example. Nevertheless, those schemas as also valuable for the Capsule NFT as the concept behind the two flows is the same for both of them.
{% endhint %}

### Minting a Secret NFT

<figure><img src="/files/gC8fUUsmbxsOpRoGGYux" alt=""><figcaption></figcaption></figure>

#### Custom and destructured mint flow

* How to generate the Secret key
  * PGP Key Pair creation
  * Secret Shamir Shares generation
* How to prepare Secret NFT assets
  * Off-Chain Metadata: Secret NFT metadata, Secret Media Metadata
  * Secret file encryption
  * Ternoa IPFS Client
* How to mint a Secret NFT on-chain using Ternoa-JS: injecting a Signer account
* How to prepare payloads for TEE enclaves
  * Temporary signer account creation
  * Payload formatting
* How to store shares on TEE enclaves
  * Enclave health status
  * Post request

## Decrypting a Secret NFT

<figure><img src="/files/c6vjfS2eqYLlqTpHQPqx" alt=""><figcaption></figcaption></figure>

#### Custom and destructured decryption flow

* How to retrieve Secret NFT assets
  * Ternoa IPFS Client
* How to prepare payloads for TEE enclaves
  * Enclave health status
  * Payload formatting
  * Get request
* How to retrieve Secret Key
  * Shares combined
* How to decrypt the secret


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ternoa.network/build-1/javascript/privacy-protocols/tee-privacy-and-encryption/minting-and-decrypting-flows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
