Privacy protection social friend circle implementation method based on encryption technology
By adopting encryption technology and decentralized storage solutions in blockchain social networks, combined with Lens Protocol and two-layer encryption processes, the performance bottlenecks and privacy leakage problems of blockchain social networks in data processing and privacy protection are solved, and the performance bottlenecks and privacy leakage problems of blockchain social networks are achieved. Efficient and secure data transmission and storage.
Patent Information
- Application Number
- CN202411877138.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-01-14
AI Technical Summary
Blockchain social networks face performance bottlenecks and privacy leaks when processing large amounts of data, especially when transactions are frequent or data is huge, network latency and high transaction fees affect user experience. At the same time, decentralized storage solutions are in storage costs and data. There are shortcomings in persistence and access speed, and the transparency and immutability of encryption technology lead to privacy leakage.
Using the privacy protection social circle of friends based on encryption technology, through the identity authentication mechanism and double-layer encryption process of Lens Protocol, log in using MetaMask or other wallet applications, generate a fixed encryption key to encrypt the identity and post content, and then Storage on the blockchain, using RSA asymmetric algorithm and AES keys for encryption, combined with IPFS and Graph databases to achieve decentralized storage and query.
It significantly improves data security and system efficiency, reduces performance losses in the encryption and decryption process, ensures secure transmission and storage of data, enhances access control and security of user data, and improves real-time and ability of data processing. Extensibility.
Smart Images

Figure CN119312405A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a method for implementing a privacy-protected social circle of friends based on encryption technology. Background Art
[0002] Blockchain social networks use decentralized technology to protect user privacy and data control. Through blockchain technology, social platforms no longer rely on centralized servers, and user data is stored in decentralized networks, usually using decentralized storage solutions such as IPFS.
[0003] Although there are many blockchain social networks now, there are still some problems. First, the decentralized nature causes the platform to face performance bottlenecks when processing large amounts of data, especially when transactions are frequent or the amount of data is huge, network delays and high transaction fees will affect the user experience. Secondly, although decentralized storage solutions solve the problem of centralized data storage, there are still problems in storage costs, data persistence, and access speed. In addition, although the encryption technology of blockchain can protect data, the completely transparent and tamper-proof characteristics can still lead to privacy leaks, especially in the case of public transaction records and user interaction history.
[0004] Therefore, there is an urgent need to improve this shortcoming. The present invention studies and improves the existing technology and its shortcomings, and provides a method for implementing a privacy-protected social circle of friends based on encryption technology. Summary of the invention
[0005] The purpose of the present invention is to provide a method for implementing a privacy-preserving social circle of friends based on encryption technology to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above purpose, the present invention provides the following technical solution: a method for implementing a privacy-protected social circle of friends based on encryption technology, comprising the following steps: S1. Login stage: Users log in to the system through MetaMask or other wallet applications, and obtain an on-chain identity after logging in. The system uses the Lens Protocol (a decentralized social protocol that aims to provide users with a secure, verifiable and user-controlled identity authentication system. Its core components include Profile NFTs, which not only represent the user's digital identity, but also contain rich information such as the user's social graph, achievements and reputation) identity authentication mechanism to help users manage their identities and permissions; S2, Release Phase: S21. Before logging into the web application, the user uses the wallet account to sign specific information. Through the signing process, a fixed encryption key is generated. This key will be used for subsequent identity key encryption and post content encryption to ensure the security of the information; S22, the system uses the RSA asymmetric algorithm to generate the identity public key and identity secret key; S23. Use the fixed encryption key generated in S21 to symmetrically encrypt the identity key, and upload the encrypted identity key and identity public key to the blockchain to complete the registration, so that the user's identity information is securely stored on the blockchain; S24, the user posts on the browser client, which can be text, pictures, videos, audio and other contents. Specific operation: the user inputs the content, and the system converts it into a standardized format (including text, pictures, videos, audio, etc.); S25. Before the content is released, the system will perform a double-layer encryption process; S26. Publish the hash value of the post content and its related metadata (such as publishing time, author information, etc.) to the blockchain, and link IPFS to the chain so that users can find and access the post content stored on IPFS through the records on the blockchain; S3, subgraph stage: S31. After the user publishes the content, the smart contract will trigger an event, and the subgraph will monitor the PostPublished event; S32, the subgraph will extract the data in the event (such as IPFS hash, profileId, access rights, etc.) and create a new Post entity record; S33. Save the Post entity to the Graph database for subsequent query; S34. For metadata uploaded to IPFS, the subgraph will obtain metadata fields based on IPFS CID to build and store these entities for subsequent fast queries; S4, browsing stage: S41. After the user logs in, the system will obtain the content list from the subgraph (Graph database) according to the user's permissions; S42, the subgraph filters the content according to the user identity and circle permissions, and only returns the content that meets the user permissions; S43. First, the user logs in, signs the specific information, and generates a fixed encryption key; S44, the user uses the fixed encryption key to decrypt the ciphertext identity key on the chain; S45, using the plaintext identity key decrypted by the user to decrypt the encrypted AES key stored in the content metadata, thereby obtaining the AES key; S46. Use the AES key to decrypt the content items one by one, obtain plaintext data and display it on the user interface.
[0007] Furthermore, in step S1, the user logs in to the system through the wallet's private key, mnemonics, or association with other social accounts, and after successful login, the system guides the user to generate or bind an on-chain identity, and the on-chain identity exists in the form of an encrypted address or NFT.
[0008] Furthermore, in step S1, the application of Lens Protocol's identity authentication mechanism in identity and rights management is as follows: User identity verification: Through Lens Protocol, users can mint their own Profile NFT (ProfileNFT is a unique identifier of the user on the chain, which contains the user's identity information or metadata related to it) as an on-chain identity, that is, create and own a unique Profile NFT, which serves as the user's digital ID card and is authenticated in the system. The verification process involves signature verification of the NFT to ensure the authenticity of the NFT and the accuracy of the user's identity. Permission management: Based on the user's Profile NFT and its additional information (such as social graph, reputation, etc.), the system assigns corresponding permissions to the user. For example, users with high reputation or belonging to a specific community may be granted higher access rights or special functions; Identity data update and synchronization: Lens Protocol allows users to update their Profile NFT and related information at any time, and the system synchronizes these updates in real time to keep the user's identity data up to date, which helps ensure that the authority allocation in the system is always based on the user's latest identity information; Cross-platform identity authentication: Lens Protocol’s identity authentication mechanism is cross-platform compatible, allowing users to use the same Profile NFT for identity authentication on multiple platforms, which provides great convenience for users and also helps build a more interconnected digital ecosystem.
[0009] Furthermore, in step S21, the specific information refers to a special string derived from the current account, which contains the user's account information, timestamp, etc., to ensure the uniqueness and non-tamperability of the signature.
[0010] Furthermore, in step S22, the identity public key is used to encrypt the AES key of the post content, and the identity key is symmetrically encrypted with the fixed encryption key generated in S21 and then uploaded to the chain.
[0011] Furthermore, in step S25, the double-layer encryption process is specifically as follows: Generate a random AES key to encrypt the post content metadata (including title, cover, page description, etc.); The AES key is encrypted using the identity public key and the encrypted AES key is uploaded to IPFS along with the content.
[0012] Furthermore, in step S31, the PostPublished event is pre-defined by the smart contract and contains key information related to the published content, including the IPFS hash value of the content, the publisher's profileId, and the access rights to the content.
[0013] Furthermore, in step S31, the subgraph is part of the Graph protocol, which allows developers to build and query a graph database based on blockchain events, and its function is to monitor all events occurring on the blockchain, especially events related to smart contracts.
[0014] Furthermore, in step S33, in the Graph database, the Post entity establishes a relationship with other entities (such as users, comments, likes, etc.) to form a social network graph. At the same time, the system can use the query language (such as GraphQL) provided by the Graph protocol to query and retrieve the above entity records.
[0015] The present invention provides a method for implementing a privacy-protected social circle of friends based on encryption technology, which has the following beneficial effects: The present invention proposes an innovative encryption and data processing scheme, the core advantage of which is that it significantly improves the security of data and the efficiency of the system through non-traditional encryption technology and a maximized decentralization strategy, which not only meets the current society's dual needs for data security and efficiency, but also lays a solid foundation for future digital life. First, it pays more attention to the balance between efficiency and security in design. Through encryption methods different from traditional ones, it effectively reduces the performance loss in the encryption and decryption process, so that the system can process data at a faster speed. Specifically, it optimizes the encryption algorithm and reduces unnecessary computing overhead, thereby greatly reducing the impact of the encryption and decryption process on system performance while ensuring data security. This not only improves the real-time performance of data processing, but also provides the possibility for the secure transmission and storage of large-scale data. Second, it adopts a decentralized design concept, through the maximum program decentralization, it ensures that only authorized users can access the user's data, and enhances the security of user data. At the same time, decentralization also promotes the efficient use and sharing of data, because users can more flexibly control the access rights and usage of data without sacrificing data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1A schematic diagram of the steps of a method for implementing a privacy-protected social circle of friends based on encryption technology according to the present invention; Figure 2 A schematic diagram of the publishing phase of a method for implementing a privacy-protected social circle of friends based on encryption technology according to the present invention; Figure 3 A schematic diagram of the subgraph phase flow of a method for implementing a privacy-protected social circle of friends based on encryption technology of the present invention; Figure 4 The present invention is a flowchart of the browsing phase of a method for implementing a privacy-preserving social circle of friends based on encryption technology. DETAILED DESCRIPTION
[0017] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0018] like Figure 1-Figure 4 As shown, a method for implementing a privacy-preserving social circle of friends based on encryption technology includes the following steps: S1. Login stage: The user logs in to the system through MetaMask or other wallet applications, specifically through the wallet's private key, mnemonics, or association with other social accounts. After a successful login, the system guides the user to generate or bind an on-chain identity, which exists in the form of an encrypted address or NFT. The system uses the Lens Protocol (a decentralized social protocol that aims to provide users with a secure, verifiable and user-controlled identity authentication system. Its core components include Profile NFTs, which not only represent the user's digital identity, but also contain rich information such as the user's social graph, achievements and reputation) authentication mechanism to help users manage their identities and permissions; the application of Lens Protocol's authentication mechanism in identity and permission management is as follows: User identity verification: Through Lens Protocol, users can mint their own Profile NFT (ProfileNFT is a unique identifier of the user on the chain, which contains the user's identity information or metadata related to it) as an on-chain identity, that is, create and own a unique Profile NFT, which serves as the user's digital ID card and is authenticated in the system. The verification process involves signature verification of the NFT to ensure the authenticity of the NFT and the accuracy of the user's identity. Permission management: Based on the user's Profile NFT and its additional information (such as social graph, reputation, etc.), the system assigns corresponding permissions to the user. For example, users with high reputation or belonging to a specific community may be granted higher access rights or special functions; Identity data update and synchronization: Lens Protocol allows users to update their Profile NFT and related information at any time, and the system synchronizes these updates in real time to keep the user's identity data up to date, which helps ensure that the authority allocation in the system is always based on the user's latest identity information; Cross-platform identity authentication: Lens Protocol’s identity authentication mechanism is cross-platform compatible, allowing users to use the same Profile NFT for identity authentication on multiple platforms, which provides great convenience for users and also helps build a more interconnected digital ecosystem; S2, Release Phase: S21. Generation of signature and encryption key before user login: Before logging into the web application, the user will first use his wallet account to sign specific information. The specific information here refers to a special string derived from the current account, which contains the user's account information, timestamp, etc., to ensure the uniqueness and immutability of the signature.
[0019] Through the signing process, the system will generate a fixed encryption key. This key will be used for subsequent identity key encryption and post content encryption to ensure the security of information.
[0020] S22. The system generates an identity public key and an identity secret key: The system uses the RSA asymmetric algorithm to generate a pair of identity public key and identity secret key. The RSA algorithm (public key encryption algorithm) allows users to encrypt with a public key, and only users holding the corresponding private key can decrypt.
[0021] The identity public key will be used to encrypt the AES key of the post content, while the identity key will be symmetrically encrypted using the fixed encryption key generated by S21 and then uploaded to the chain.
[0022] S23. Encryption and uploading of identity keys: The system symmetrically encrypts the identity key using the fixed encryption key generated by S21. This encryption method ensures the security of the identity key, and it cannot be easily decrypted even if it is intercepted during network transmission.
[0023] The encrypted identity key and public key are uploaded to the blockchain together to complete the registration process. In this way, the user's identity information is securely stored on the blockchain and can be verified and queried at any time.
[0024] S24. User posts on the browser client: The user enters the content of the post to be published in the browser client, which can be text, pictures, videos, audio, etc. The system will convert the content entered by the user into a standardized format to ensure the readability and parseability of the content.
[0025] S25. Double-layer encryption process of post content: Before the content is released, the system will perform a double-layer encryption process to ensure the security of the content.
[0026] First, a random number generator is used to generate a random AES key (AES is a symmetric encryption algorithm that provides efficient data encryption and decryption capabilities) to encrypt the metadata of the post content (such as title, cover, description, etc.).
[0027] Then, the AES key is encrypted using the identity public key generated by S21. In this way, even if the AES key is intercepted during transmission, it cannot be decrypted by a user who does not have the corresponding private key.
[0028] Finally, the encrypted AES key is uploaded to IPFS (InterPlanetary File System, a distributed file system for storing and retrieving files) along with the post content.
[0029] S26, hash value, metadata and IPFS link on-chain: The system calculates a hash value of the post content, which is a unique and immutable identifier used to verify the integrity and authenticity of the content.
[0030] The hash value and its related metadata (such as publishing time, author information, etc.) are published on the blockchain. In this way, any modification to the post content will be recorded by the blockchain, ensuring the traceability and non-tamperability of the content.
[0031] At the same time, the IPFS link is also put on the chain so that users can find and access the post content stored on IPFS through the records on the blockchain.
[0032] S3, subgraph stage: S31. Smart contract triggering event: When a user publishes content on the system, the underlying smart contract will recognize this behavior and trigger the PostPublished event. This event is pre-defined by the smart contract and is used to automatically execute under certain conditions (such as successful content publishing). The PostPublished event contains key information related to the published content, such as the IPFS hash value of the content, the publisher's profileId (which may be an on-chain identity such as an encrypted address or NFT ID), and access rights to the content.
[0033] At the same time, the component subgraph listens to all events that occur on the blockchain, especially those related to smart contracts. Subgraph is part of the Graph protocol, which allows developers to build and query graph databases based on blockchain events.
[0034] S32, subgraph monitors events and extracts data: When the subgraph listens to the PostPublished event, it extracts key data from the event, such as IPFS hash value, profileId, and access rights, etc. These data are the basis for building subsequent entity records.
[0035] The subgraph creates a new Post entity record based on the extracted data. This entity record contains all the necessary information to uniquely identify and query the published content in the Graph database.
[0036] S33. Save the Post entity to the Graph database: Once a Post entity record is created, it will be saved in a Graph database (a database specifically used to store graph-structured data, which allows efficient querying and traversal of relationships between data). In a Graph database, a Post entity can establish relationships with other entities (such as users, comments, likes, etc.) to form a complete social network graph.
[0037] After saving the Post entity to the Graph database, the system can use the query language provided by the Graph protocol (such as GraphQL) to efficiently query and retrieve these entity records.
[0038] S34. Process metadata on IPFS and build entities: For metadata uploaded to IPFS (such as the title, description, cover image, etc. of the post), the subgraph obtains these metadata fields based on the content identifier (CID) of IPFS, parses these metadata fields, and builds and stores new entity records (such as Metadata entities) based on them. These entity records are associated with the Post entity and provide additional information about the published content.
[0039] By storing metadata in the Graph database, the system can quickly query and display this information to users without having to retrieve it from IPFS every time.
[0040] S4, browsing stage: S41. User logs in and obtains content list: The user logs in to the system through an authentication mechanism (such as a password, biometrics, or a blockchain wallet private key). After successful login, the system retrieves a list of content that the user has access to from the subgraph (Graph database) based on the user's identity information and preset permission rules.
[0041] S42. Obtain and filter content from the sub-graph according to user permissions: The subgraph filters content based on the user's identity (such as user ID, role, etc.) and circle permissions (such as the community or group to which the user belongs), and only returns content that meets the user's permissions.
[0042] S43. First, the user logs in, signs the specific information, and generates a fixed encryption key; S44, the user uses the fixed encryption key to decrypt the ciphertext identity key on the chain; S45, using the plaintext identity key decrypted by the user to decrypt the encrypted AES key stored in the content metadata, thereby obtaining the AES key; S46. Use the AES key to decrypt the content items one by one, obtain plaintext data and display it on the user interface.
[0043] The embodiments of the present invention are given for the purpose of illustration and description, and are not intended to be exhaustive or to limit the invention to the disclosed forms. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific uses.
Claims
1. A method for implementing a privacy-protected social circle of friends based on encryption technology, characterized in that: The following steps are involved: S1. Login stage: Users log in to the system through MetaMask or other wallet applications, and obtain an on-chain identity after logging in. The system uses the Lens Protocol's identity authentication mechanism to help users manage their identities and permissions; S2, Release Phase: S21. Before logging into the web program, the user signs specific information using the wallet account to generate a fixed encryption key; S22, the system uses the RSA asymmetric algorithm to generate the identity public key and identity secret key; S23. Use the fixed encryption key generated in S21 to symmetrically encrypt the identity key, and upload the encrypted identity key and identity public key to the chain to complete the registration; S24. The user posts a message on the browser client. The content of the message may include but is not limited to text, pictures, videos, and audio. Specific operations: the user inputs the content, and the system converts it into a standardized format; S25. Before the content is released, the system will perform a double-layer encryption process; S26. Publish the hash value of the post content and its related metadata to the blockchain, and link the IPFS to the chain; S3, subgraph stage: S31. After the user publishes the content, the smart contract will trigger an event, and the subgraph will monitor the PostPublished event; S32, the subgraph will extract the data in the event and create a new Post entity record; S33, save the Post entity to the Graph database; S34. For metadata uploaded to IPFS, the subgraph obtains metadata fields based on IPFS CID to build and store these entities.
2. According to claim 1, a method for implementing a privacy-protected social circle of friends based on encryption technology is characterized in that: Also includes the steps: S4, browsing stage: S41. After the user logs in, the system will obtain the content list from the sub-map according to the user's authority; S42, the subgraph filters the content according to the user identity and circle permissions, and only returns the content that meets the user permissions; S43. First, the user logs in, signs the specific information, and generates a fixed encryption key; S44, the user uses the fixed encryption key to decrypt the ciphertext identity key on the chain; S45, using the plaintext identity key decrypted by the user to decrypt the encrypted AES key stored in the content metadata, thereby obtaining the AES key; S46. Use the AES key to decrypt the content items one by one, obtain plaintext data and display it on the user interface.
3. According to the method of claim 1, the method is characterized in that: In step S1, the user specifically logs in to the system through the wallet's private key, mnemonics, or association with other social accounts. After successful login, the system guides the user to generate or bind an on-chain identity, and the on-chain identity exists in the form of an encrypted address or NFT.
4. According to the method for implementing a privacy-protected social circle of friends based on encryption technology as described in claim 1, it is characterized in that: In step S1, the application of Lens Protocol's identity authentication mechanism in identity and rights management is as follows: User authentication: Through Lens Protocol, users can create and own a unique Profile NFT, which serves as the user’s digital ID card for authentication in the system; Permission management: Based on the user's Profile NFT and its additional information, the system assigns corresponding permissions to the user; Identity data update and synchronization: Lens Protocol allows users to update their Profile NFT and related information at any time, and the system synchronizes these updates in real time to keep the user's identity data up to date; Cross-platform identity authentication: Lens Protocol’s identity authentication mechanism is cross-platform compatible, allowing users to use the same Profile NFT for identity authentication on multiple platforms.
5. According to the method of claim 1, the method is characterized in that: In step S21, the specific information refers to a special string derived from the current account, including the user's account information and timestamp.
6. According to the method of claim 1, the method is characterized in that: In step S22, the identity public key is used to encrypt the AES key of the post content, and the identity key is symmetrically encrypted with the fixed encryption key generated in S21 and then uploaded to the chain.
7. According to the method of claim 1, the method is characterized in that: In step S25, the double-layer encryption process is specifically as follows: Generate a random AES key for encrypting post content metadata; The AES key is encrypted using the identity public key and the encrypted AES key is uploaded to IPFS along with the content.
8. According to the method of claim 1, the method is characterized in that: In step S31, the PostPublished event is pre-defined by the smart contract and contains key information related to the published content, including the IPFS hash value of the content, the publisher's profileId, and the access rights to the content.
9. According to the method of claim 1, the method is characterized in that: In step S31, the subgraph is part of the Graph protocol, which allows developers to build and query a graph database based on blockchain events. Its function is to monitor all events occurring on the blockchain, especially those related to smart contracts.
10. The method for implementing a privacy-protected social circle of friends based on encryption technology according to claim 1, characterized in that: In step S33, in the Graph database, the Post entity establishes a relationship with other entities to form a social network graph. At the same time, the system can use the query language provided by the Graph protocol to query and retrieve the above entity records.
Citation Information
Patent Citations
Decentralized anonymous identity authentication method based on smart contract non-homogeneous token
CN117997554A
Electronic medical record cross-domain sharing method based on alliance chain and proxy re-encryption
CN118353707A
Method, apparatus, and computer-readable medium for secured multi-lateral data exchange over a computer network
US20210304200A1
Digital identity system and methods
WO2024221057A1