Skip to content

microchipgnu/open-secret

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Open Secret

image

YouTube Demo

Open Secret allows you to chat with NEAR Social accounts. We allow users to mint dynamic NFTs that control that reference on-chain private metadata. By owning an NFT, you are able to attach encrypted pieces of data and then give access to other accounts to decrypt this data.

NEAR Protocol: Handling Private Data

Storing Private Data in Tokens

To mint a token that contains encrypted private data, the following steps are proposed:

  1. Encryption: Used a library such as NEAR JavaScript Encryption Box to encrypt the data before minting the token.

  2. Key Management: Implemented smart contract functionality to manage encryption keys.

    • The contract allows adding or removing keys associated with the current owner of the token, enabling them to encrypt and decrypt the data.

As a bonus we thought of adding ability for tokens to carry proof elements (using ZK), such as links to data stored on Arweave, to ensure data integrity and authenticity.

Giving access to Private Data

Minting and Storing Private Data Process

The following process allows for the secure minting and transferring of private data through NFTs:

  1. Minter's Actions:

    • The Minter (M) encrypts the data using their keypair (KP1) and includes a reference to this encrypted data (ED1) within the NFT, possibly pointing to an Arweave storage location.
    • When giving access to specific private data bits, they owner needs to decrypt and encrypt again with the viewer's public key.
    • Optionally, the minter may include Zero-Knowledge proofs (e.g., ZK-SNARKs) to validate certain claims about the data, like confirming it matches an Arweave hash pattern through regex verification or that the content was not changed (sha-256).

To Do

  • [] Indexer (subgraph?)
  • [] Dashboard
  • [] Marketplace
  • [] Cont
  • Use-cases
    • [] Chat