SBT Privacy Module
The module leverages Semantic SBT and Lit Protocol to enable privacy-preserving data sharing, with users being able to share their private data with addresses meeting certain conditions.
In this mechanism, Lit Protocol is used to encrypt and decrypt data. Afterwards, arweave will store the encrypted data, encrypted key, and conditions for data sharing. Then, Semantic SBT will be used to store the hash pointing to arweave and define the conditions for data sharing.
The conditions for data sharing can be defined as:
EOA addresses
Users with certain NFT collections
Users with certain SBTs
Users owning a certain amount of a specified ERC20 token.
The process for sharing private data
Encryption
The private data awaiting sharing should be encrypted via Lit Protocol. The result (accessCondition、encryptedSymmetricKey、encryptedObject) should then be sealed as the "encryptMetaData" and uploaded to a storage layer (like arweave), generating a address for the "encryptMetaData".
The encryptMetaData has a following format:
Minting a privacy-preserving SBT
A PrivacySemanticSBT contract is built based on the Semantic SBT specification. We are to mint a privacy-preserving SBT, with its RDF object as the address on arweave/ipfs.
How to call the method of the SemanticSBTPrivacy contract:
A complete RDF example is provided as follows:
The construct of the encryptedObject:
Prefix: [Privacy]
web3 storage layer, e.g: ar:// or ipfs://
web3 hash for the storage
example of an encryptedObject:
Decryption
Users who want to decrypt the private data should obtain the "encryptMetaData" from SBT's object. By calling LitProtocol's Decryption process, they can decrypt the data and obtain the object in plain-text.
Access Control Conditions Types
Different conditions can be set to control users' access to private data.
User holds an NFT in a collection
Users owning certain NFT collections can decrypt the private data.
User holds an SBT in a collection
Users owning certain SBT collections can decrypt the private data.
User owns a specific wallet address
Users owning certain addresses can decrypt the private data.
User holds at least XX ERC20 Token
Users owning a certain amount of a specified ERC20 token can decrypt the private data.
Using boolean operations (AND + OR) for any of the above
The above conditions can be compounded using AND, OR operations.
Last updated