SBT Privacy Module
Last updated
Last updated
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 private data awaiting sharing should be encrypted via . 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:
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:
Different conditions can be set to control users' access to private data.
Users owning certain NFT collections can decrypt the private data.
Users owning certain SBT collections can decrypt the private data.
Users owning certain addresses can decrypt the private data.
Users owning a certain amount of a specified ERC20 token can decrypt the private data.
The above conditions can be compounded using AND, OR operations.
Users who want to decrypt the private data should obtain the "encryptMetaData" from SBT's object. By calling , they can decrypt the data and obtain the object in plain-text.