How its done
Emblem Vault Component Interactions
Emblem Vault Services Documentation
The Emblem Vault Services is a decentralized application (dApp) that allows users to create, mint, transfer, claim, and access encrypted data vaults on the blockchain. The service interacts with various components, including the User, Metamask, Serverless functions, DKG, Signer, and smart contracts such as EmblemVault_Contract, Claimed_Contract, VaultHandler_Contract, and Coval_Contract.
This documentation covers the following services:
Create
Mint
Transfer
Claim
Get Keys
1. Create Service
The Create Service allows users to create a new encrypted data vault on the blockchain.
Components
User
Metamask
Serverless
DKG (Distributed key generation service)
Signer
EmblemVault_Contract
Claimed_Contract
Database
Interactions
Sign Request: The User sends a sign request to Metamask to authenticate their identity.
Create Vault Request: The User sends a request to create a new vault to the Serverless functions.
ID Minted Before?: The Serverless functions check with the EmblemVault_Contract if the requested vault ID has been minted before.
ID Claimed Before?: The Serverless functions check with the Claimed_Contract if the requested vault ID has been claimed before.
DKG Signature: The Serverless functions create a signature using the Signer.
Get Vault Encryption Key: The Serverless functions request the vault encryption key from DKG.
Store Encrypted Vault Data: The Serverless functions store the encrypted vault data in the Database.
2. Mint Service
The Mint Service allows users to mint a new vault on the blockchain.
Components
User
Metamask
Serverless
Signer
EmblemVault_Contract
VaultHandler_Contract
Coval_Contract
Database
Interactions
Sign Request: The User sends a sign request to Metamask to authenticate their identity.
Mint Vault Request: The User sends a request to mint a new vault to the Serverless functions.
Get Vault Data: The Serverless functions retrieve the vault data from the Database.
ID Minted Before?: The Serverless functions check with the EmblemVault_Contract if the requested vault ID has been minted before.
ID Claimed Before?: The Serverless functions check with the Coval_Contract if the requested vault ID has been claimed before.
Mint Signature: The Serverless functions create a mint signature using the Signer.
Deliver Mint Signature: The Serverless functions deliver the mint signature to the User.
Approve Vaulting: The User approves the vaulting process with the EmblemVault_Contract.
Approve Spending Coval: The User approves the spending of Coval tokens with the Coval_Contract.
Mint Vault: The User sends a request to mint the vault using the VaultHandler_Contract, which then executes the
buyWithSignature
function.
3. Transfer Service
The Transfer Service allows users to transfer ownership of a vault on the blockchain.
Components
User
Metamask
EmblemVault_Contract
Interactions
Sign Request: The User sends a sign request to Metamask to authenticate their identity.
Transfer Vault: The User sends a request to transfer the vault's ownership using the EmblemVault_Contract, which then executes the
safeTransferFrom
function
4. Claim Service
The Claim Service allows users to claim a vault on the blockchain.
Components
User
Metamask
EmblemVault_Contract
VaultHandler_Contract
Claimed_Contract
Interactions
Signature Request: The User sends a signature request to Metamask to authenticate their identity.
Claim Vault Request: The User sends a request to claim a vault using the VaultHandler_Contract.
Mark Claimed: The VaultHandler_Contract marks the vault as claimed in the Claimed_Contract.
Burn: The VaultHandler_Contract burns the claimed vault token from the EmblemVault_Contract.
5. Get Keys Service
The Get Keys Service allows users to retrieve the keys to access their claimed vaults.
Components
User
Metamask
Claimed_Contract
Database
Serverless
DKG
Signer
Interactions
Signature Request: The User sends a signature request to Metamask to authenticate their identity.
Get Keys: The User sends a request to retrieve the keys using the Serverless functions.
Get Vault Data: The Serverless functions retrieve the vault data from the Database.
Claimed and By User from Signature?: The Serverless functions check with the Claimed_Contract if the vault has been claimed by the user corresponding to the provided signature.
Get Auth JWT: The Serverless functions create an authentication JWT using the Signer.
Give JWT to user: The Serverless functions deliver the JWT to the User.
Auth DKG with JWT: The User requests authentication with the JWT using DKG.
Get Keys from cluster: The User retrieves the keys to access their claimed vault using the DKG_Cluster.
In summary, the Emblem Vault Services is a decentralized application that enables users to create, mint, transfer, claim, and access encrypted data vaults on the blockchain. It uses a combination of smart contracts, authentication methods, and serverless functions to ensure the security and privacy of the user's data.
Last updated