Blockchain-based Message Passing Method and Related Devices
By deploying message contracts in the blockchain system and using smart contracts to achieve decentralized messaging, the security and privacy issues caused by relying on third-party services in the existing technology are solved, and trusted message delivery for data security and privacy protection is realized.
Patent Information
- Application Number
- CN202111080488.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-15
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-09-15
AI Technical Summary
The messaging solutions in the prior art rely on third-party services and cannot guarantee the delivery, security and privacy of messages, and there is a risk of forgery and tampering.
Using blockchain technology, by deploying message contracts in the blockchain system, decentralized messaging services are realized, and smart contracts are used to automatically deliver messages to ensure data security and privacy.
Decentralized trusted message delivery is realized to prevent messages from being forged or tampered, ensure timely delivery of messages and protect data privacy.
Smart Images

Figure CN115834591B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and in particular, to a blockchain-based message passing method, a node device in a blockchain system, a computer-readable storage medium, an electronic device, and a computer program product. Background Art
[0002] In the message passing solutions in the related art, it is necessary to rely on a third-party service for storage and forwarding. The third-party system cannot guarantee that the message delivery can be completed, and at the same time, it cannot guarantee that the sent message has not been forged or tampered with. That is, the security and privacy of the message sender and receiver cannot be guaranteed. Summary of the Invention
[0003] Embodiments of the present disclosure provide a blockchain-based message passing method, a node device in a blockchain system, a computer-readable storage medium, an electronic device, and a computer program product, which can implement a decentralized and trustworthy message passing service, complete the message passing without relying on a third-party service, and at the same time can achieve data security and privacy during the message sending process.
[0004] Embodiments of the present disclosure provide a blockchain-based message passing method, which is executed by a node device in a blockchain system, and the node device is communicatively connected to a sender client node and a receiver client node; a message contract is deployed in the blockchain system. Wherein, the method includes: obtaining a first message passing request sent by the sender through the sender client node, the first message passing request carrying a first message to be sent to the receiver and the receiver's on-chain address in the blockchain system; according to the receiver's on-chain address carried in the first message passing request, calling the message contract to send a first notification message to the receiver client node, so as to transfer the first message from the sender to the receiver.
[0005] Embodiments of the present disclosure provide a node device in a blockchain system, the node device is communicatively connected to a sender client node and a receiver client node; a message contract is deployed in the blockchain system. Wherein, the node device includes: a first message passing request obtaining unit, configured to obtain a first message passing request sent by the sender through the sender client node, the first message passing request carrying a first message to be sent to the receiver and the receiver's on-chain address in the blockchain system; a first notification message sending unit, configured to call the message contract according to the receiver's on-chain address carried in the first message passing request, and send a first notification message to the receiver client node, so as to transfer the first message from the sender to the receiver.
[0006] An embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method for blockchain-based message passing in the above embodiment is implemented.
[0007] An embodiment of the present disclosure provides an electronic device, including: at least one processor; a storage device configured to store at least one program. When the at least one program is executed by the at least one processor, the at least one processor implements the method for blockchain-based message passing in the above embodiment.
[0008] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various alternative implementations of the above embodiment.
[0009] In the technical solutions provided by some embodiments of the present disclosure, on the one hand, a decentralized message passing service is implemented by using a blockchain. When passing messages between a sender and a receiver, there is no longer a need to rely on a third-party message passing service. At the same time, by using blockchain technology to implement the message passing service, it is possible to prevent messages from being forged or tampered with during the transmission process, thereby realizing the data security of the messages and protecting the privacy of the data. On the other hand, by deploying a message contract in the blockchain system, when a node device in the blockchain system obtains a first message passing request sent by the sender through the sender client node, the message contract can be called, and according to the receiver's on-chain address in the blockchain system carried in the first message passing request, a first notification message can be sent to the corresponding receiver client node of the receiver, so that the first message carried in the first message passing request can be transmitted from the sender to the receiver. The message contract is a type of smart contract deployed in the blockchain system, that is, the automatic transmission of messages is realized by using smart contracts in blockchain technology. When a new first message is received, the receiver can be notified in time, and the first message can be transmitted to the receiver in time without missed reception.
[0010] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings here are incorporated into and form a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0012] Figure 1 It is a schematic diagram of the architecture of a blockchain network provided by an embodiment of the present disclosure.
[0013] Figure 2 It is a schematic diagram of the structure of a block provided by an embodiment of the present disclosure.
[0014] Figure 3 Schematically shows a flowchart of a blockchain-based message passing method according to an embodiment of the present disclosure.
[0015] Figure 4 Schematically shows a schematic diagram of the system architecture of a blockchain-based message passing method according to an embodiment of the present disclosure.
[0016] Figure 5 Schematically shows a schematic diagram of a blockchain-based message passing method according to another embodiment of the present disclosure.
[0017] Figure 6 Schematically shows a schematic diagram of the application scenario of a blockchain-based message passing method according to an embodiment of the present disclosure.
[0018] Figure 7 Schematically shows a block diagram of a node device in a blockchain system according to an embodiment of the present disclosure.
[0019] Figure 8 Shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. Detailed implementation manners
[0020] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. Like reference numerals in the figures denote like or similar parts, and thus their repeated description will be omitted.
[0021] The features, structures, or characteristics described in this disclosure may be combined in one or more embodiments in any suitable manner. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of this disclosure. However, those skilled in the art will realize that one or more of the specific details may be omitted in practicing the technical solutions of this disclosure, or other methods, components, devices, steps, etc. may be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of this disclosure.
[0022] The accompanying drawings are only schematic illustrations of this disclosure, where the same reference numerals in the drawings represent the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings do not necessarily have to correspond to physically or logically independent entities. These functional entities may be implemented in software form, or in at least one hardware module or integrated circuit, or in different networks and / or processor devices and / or microcontroller devices.
[0023] The flowcharts shown in the accompanying drawings are only exemplary illustrations, not necessarily including all the contents and steps, nor necessarily executed in the described order. For example, some steps can be decomposed, while some steps can be combined or partially combined, so the actual execution order may change according to the actual situation.
[0024] In this specification, the terms "a", "an", "the", "said", and "at least one" are used to indicate the existence of at least one element / component / etc.; the terms "comprising", "including", and "having" are used to mean an open inclusion and refer to the existence of additional elements / components / etc. in addition to the listed elements / components / etc.; the terms "first", "second", "third", etc. are only used as labels and are not a limitation on the quantity of their objects.
[0025] The blockchain (blockchain or block chain) in the embodiments of this disclosure is a distributed ledger, a technical solution for collectively maintaining a reliable database in a decentralized and trustless manner. Among them, a blockchain network / blockchain system is a network of computing nodes for managing, updating, and maintaining one or more blockchain structures. A blockchain network may include a public blockchain network (abbreviated as public chain), a private blockchain network (abbreviated as private chain), or a consortium blockchain network (abbreviated as consortium chain). The corresponding blockchain network can be selected according to the actual application scenario.
[0026] Among them, any node in the public chain is open to anyone, and everyone can participate in the calculation of this blockchain, and anyone can download and obtain the complete blockchain data (all ledgers).
[0027] In some application scenarios of blockchain, it is not desirable for anyone to participate in the system and view all data. Only authorized nodes can participate and view all data. This type of blockchain structure is called a private chain.
[0028] Since industries and applications that require confidentiality do not need the open and transparent features of public chains, consortium chains emerged. Consortium chains are limited to consortium members. Because they are only open to members for all or some functions, the read / write permissions and accounting rules on consortium chains are "privately customized" according to consortium rules.
[0029] Consortium chains are only for members of a specific group and limited third parties. Multiple preselected nodes are designated internally as accounting nodes / consensus nodes. The generation of each block is jointly determined by all preselected nodes. Access nodes of other third parties can participate in transactions but do not interfere with the accounting process. Other third parties can perform limited queries through the APIs (Application Programming Interfaces) opened by the consortium chain. Generally speaking, consortium chains are applicable to B2B (Business-to-Business) scenarios such as transactions, settlements, or clearances between institutions. For example, multiple financial institutions connect their respective blockchain networks together to form a consortium-like network, facilitating mutual data docking and collaboration.
[0030] To obtain better performance, consortium chains have certain requirements for the configuration of consensus or verification nodes and the network environment. With an access mechanism, it is easier to improve transaction performance and avoid some problems caused by uneven participants. Consortium chains are faster in processing speed than public chains because the number and identities of nodes are already specified, so relatively loose consensus mechanisms can be used, and thus the data processing speed will be greatly improved compared to public chains.
[0031] In the embodiments of the present disclosure, the embodiments of the present disclosure are described in detail with reference to consortium chains. However, it can be expected that the embodiments of the present disclosure can be implemented in any suitable blockchain network.
[0032] Based on the above description, the embodiments of the present disclosure provide a blockchain-based message passing method. The blockchain-based message passing method can be implemented based on consortium chain technology. The underlying platform of the consortium chain can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the management of the identity information of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and maintaining the correspondence between the real identity of the user and the consortium chain address (permission management), etc.
[0033] As a specific implementation of the distributed ledger, blockchain technology has gradually become the preferred way to store and trade data in various fields due to its natural advantages in storing and managing data.
[0034] A blockchain network / blockchain system is a distributed system, which can be formed by connecting multiple nodes / node devices (any form of computing device accessing the network, such as servers and terminal devices) through network communication.
[0035] The following will describe the exemplary embodiments of the present disclosure in detail with reference to the accompanying drawings.
[0036] See Figure 1 , which is an optional schematic architecture diagram of the blockchain network / blockchain system provided by the embodiments of the present disclosure. The blockchain network / blockchain system includes multiple nodes / node devices, and a peer-to-peer (P2P) network is formed between the nodes / node devices. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In the blockchain network, any machine such as a server or a terminal device can join and become a node / node device, and the node / node device includes a hardware layer, an intermediate layer, an operating system layer, and an application layer. <L
[0037] See Figure 1 The functions of each node / node device in the blockchain network shown involve the following functions:
[0038] 1) Routing, a basic function of the node / node device, used to support communication between node / node devices.
[0039] In addition to the routing function, the node / node device may also have the following functions:
[0040] 2) Blockchain, including a series of blocks that are sequentially connected in the order of generation. Once a new block is added to the blockchain, it will not be removed again. The block records the record data submitted by the nodes / node devices in the blockchain network.
[0041] 3) Application, which is used to be deployed in the blockchain, implements specific services according to actual business needs, records the data related to the implemented functions to form record data, carries a digital signature in the record data to indicate the source of the task data, and sends the record data to other nodes / node devices in the blockchain network. When other nodes / node devices successfully verify the source and integrity of the record data, the record data is added to the temporary block.
[0042] For example, the services implemented by the application include:
[0043] 3.1) Wallet, which is used to provide the function of conducting transactions of virtual resources, including initiating a transaction, that is, sending the transaction record of the current transaction to other nodes / node devices in the blockchain network. After successful verification by other nodes / node devices, as a response to acknowledging the validity of the transaction, the record data of the transaction is stored in the temporary block of the blockchain.
[0044] 3.2) Shared ledger, which is used to provide functions such as storage, query, and modification of account data. The record data of the operations on the account data is sent to other nodes / node devices in the blockchain network. After successful verification by other nodes / node devices, as a response to acknowledging the validity of the account data, the record data is stored in the temporary block, and confirmation can also be sent to the node / node device that initiated the operation.
[0045] 3.3) Smart contract, a computerized protocol that can execute the terms of a certain contract, implemented by code deployed on the shared ledger for execution when certain conditions are met. According to actual business requirements, the code is used to complete automated transactions, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's virtual resources to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information. A smart contract is a computer protocol designed to spread, verify, or execute a contract in an information-based manner. Smart contracts allow for trusted transactions without a third party, and these transactions are traceable and irreversible.
[0046] 4) Consensus, which is used to solve and ensure the consistency and correctness of each transaction or data on all accounting nodes. The consensus mechanism of the blockchain is the way to determine and maintain a certain consensus. The consensus mechanism of the blockchain enables it to operate efficiently in large-scale collaboration without relying on a centralized organization. As Figure 1 shown, the nodes with the consensus function are called accounting nodes / consensus nodes.
[0047] See Figure 2 After the target block (including the first target block, the second target block, and the third target block) is written into the distributed ledger of the blockchain network, it can be Figure 2 any block in, for example, any one of block 1, block 2, and block 3. Figure 2It is an optional schematic diagram of the block structure provided by an embodiment of the present disclosure. The block information of each block may include the hash value of the data record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected through the hash value to form a blockchain. In addition, the block may also include information such as the timestamp when the block is generated. A blockchain is essentially a decentralized database, a series of data blocks generated by using cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.
[0048] Among them, each block includes a block header and a block body. The block body contains the transactions included in this block, and the block body maintains the root hash value obtained by calculating all transactions through the merkle tree.
[0049] From this, it can be known that a blockchain is a series of text records (also known as blocks) concatenated and protected by cryptography. Each block contains the cryptographic hash of the previous block, the corresponding timestamp, and transaction data (represented by the hash value that can be calculated by the merkle tree algorithm). Such a design makes the block content have the characteristic of being difficult to tamper with. The distributed ledger concatenated by blockchain technology can enable multiple parties, such as two parties, to effectively record transactions and can permanently verify these transactions.
[0050] Figure 3 The flowchart of the message passing method based on blockchain according to an embodiment of the present disclosure is schematically shown. Figure 3 The method provided by the embodiment can be executed by a node device in the blockchain system, such as Figure 1 any one of the nodes / node devices. The node device can communicate with the sender client node and the receiver client node.
[0051] In the embodiment of the present disclosure, the sender client node can be any electronic device outside the blockchain system (such as a server and / or a terminal), and can communicate with the blockchain system bidirectionally. The sender can interact with the blockchain system through the sender client node to send a message. The receiver client node can be any electronic device outside the blockchain system and can communicate with the blockchain system bidirectionally. The receiver can interact with the blockchain system through the receiver client node to receive a message.
[0052] In the embodiments of the present disclosure, the sender and / or the receiver of the message can be any object, such as an individual, an enterprise, an organization, a unit, an institution, etc. The present disclosure does not make any limitation in this regard. As long as the user with the need for message transmission can implement message transmission through this blockchain system. In the following illustrative examples, taking enterprise A as the sender of the message and enterprise B as the receiver of the message, the client node used by enterprise A to communicate with the blockchain system is called the sender client node, and the client node used by enterprise B to communicate with the blockchain system is called the receiver client node. In some embodiments, the sender client node and the receiver client node can also be nodes / node devices in the blockchain system. The present disclosure does not make any limitation in this regard.
[0053] It can be understood that the receiver of the message can be one or more, that is, the message can be transmitted to one or more receivers at the same time. In the following illustrative examples, an example with one receiver is given for illustration, but the present disclosure is not limited thereto.
[0054] In the embodiments of the present disclosure, a message contract can be deployed in the blockchain system. The message contract and the address identity contract mentioned below both belong to smart contracts. The message contract is a smart contract used to implement message transmission between the sender and the receiver. The address identity contract is a smart contract used to store and query the mapping relationship between the receiver identity identifier of the receiver and its receiver chain address in the blockchain system, and the mapping relationship between the sender identity identifier of the sender and its sender chain address in the blockchain system.
[0055] As Figure 3 shown, the method provided by the embodiments of the present disclosure can include the following steps.
[0056] In step S310, obtain a first message transmission request sent by the sender through the sender client node. The first message transmission request carries a first message to be sent to the receiver and the receiver chain address of the receiver in the blockchain system.
[0057] In an exemplary embodiment, the node device can also be communicatively connected to a message contract generation node, and the message contract generation node is used to deploy the message contract to the blockchain system.
[0058] In the embodiments of the present disclosure, the node device in the blockchain system can also communicate with a message contract generation node. The message contract generation node can be any external electronic device of the blockchain system and can be used to deploy the generated message contract to the blockchain system. The message contract generation node can be the same as or different from the sender client node and the receiver client node. The present disclosure does not make any limitation in this regard.
[0059] In an exemplary embodiment, the method may further include: receiving a transaction request for deploying the message contract sent by the message contract generation node; generating a proposal block for deploying the message contract according to the transaction request for deploying the message contract; performing consensus on the proposal block for deploying the message contract; determining that the proposal block for deploying the message contract passes the consensus, and deploying the message contract to the blockchain system.
[0060] The consensus process of the blockchain system is implemented based on a consensus algorithm, which may include but is not limited to: BFT (Byzantine Fault Tolerance) algorithm, PBFT (Practical Byzantine Fault Tolerance) algorithm, VBFT (a hybrid algorithm that combines PoS (Proof of Stake), VRF (Verifiable Random Function) and BFT, and is the consensus algorithm of OCE (Ontology Consensus Engine)), and so on.
[0061] Taking the VBFT and PBFT consensus algorithms as examples for illustration below, but the present disclosure is not limited thereto.
[0062] In a blockchain network based on PBFT and an Ontology blockchain based on VBFT, a complete round of consensus process is divided into a proposal stage, a pre-vote stage (which can also be called an endorsement stage), and a pre-commit stage.
[0063] In the embodiments of the present disclosure, the node devices in the blockchain system include the primary node in each round of consensus process and other consensus nodes except the primary node. In each complete round of consensus process, when any node device in the blockchain system receives a transaction request for deploying a message contract, it broadcasts the request to other node devices in the blockchain system. The primary node in that round packages a proposal block for deploying the message contract and proposes and broadcasts it in the proposal stage. After receiving the proposal block for deploying the message contract, other consensus nodes conduct pre-votes on it. After each consensus node receives 2f + 1 (where f is an integer greater than or equal to 0 and satisfies |R| = 3f + 1, that is, there are 3f + 1 nodes in the blockchain system, which is only used for illustration here and can be determined according to the consensus algorithm adopted. For example, it can also take a value of half or more than half of the number of nodes |R| in the blockchain system) pre-votes for the proposal block for deploying the message contract, it broadcasts a pre-commit message for the proposal block for deploying the message contract and enters the pre-commit stage. After each consensus node receives 2f + 1 pre-commits for the proposal block for deploying the message contract in the pre-commit stage, it posts the proposal block for deploying the message block (that is, stores it on the blockchain) and starts the next round of consensus, thereby realizing the deployment of the message contract to the blockchain system.
[0064] In an exemplary embodiment, the node device may also be communicatively connected to an address identity contract generation node, and the address identity contract generation node may be used to deploy an address identity contract to the blockchain system; the address identity contract may include a mapping relationship between the recipient's on-chain address in the blockchain system and the recipient's identity identifier. In other embodiments, the address identity contract may also include a mapping relationship between the sender's on-chain address in the blockchain system and the sender's identity identifier.
[0065] In the embodiments of the present disclosure, the node devices in the blockchain system may also communicate with an address identity contract generation node, and the address identity contract generation node may be any electronic device outside the blockchain system and may be used to deploy the generated address identity contract to the blockchain system. The address identity contract generation node may be the same as or different from the sender client node, the recipient client node, and the message contract generation node, and the present disclosure does not limit this.
[0066] In an exemplary embodiment, the method may further include: receiving a transaction request for deploying an address identity contract sent by the address identity contract generation node; generating a proposal block for deploying the address identity contract according to the transaction request for deploying the address identity contract; conducting consensus on the proposal block for deploying the address identity contract; determining that the consensus on the proposal block for deploying the address identity contract is passed, and deploying the address identity contract to the blockchain system.
[0067] In the embodiments of the present disclosure, in each complete round of the consensus process, when any node device in the blockchain system receives a transaction request for deploying an address identity contract, it broadcasts the request to other node devices in the blockchain system. The primary node of this round packages the proposal block for the address identity contract in the proposal stage and proposes and broadcasts it. After other consensus nodes receive it, they conduct pre-voting on the proposal block for the address identity contract. After each consensus node receives 2f + 1 pre-votes for the proposal block for the address identity contract in the pre-voting stage, it broadcasts a pre-commit message for the proposal block for the address identity contract and enters the pre-commit stage; after each consensus node receives 2f + 1 pre-commits for the proposal block for the address identity contract in the pre-commit stage, it posts the proposal block for the address identity contract (i.e., stores it on the blockchain) and starts the next round of consensus, thereby realizing the deployment of the address identity contract to the blockchain system.
[0068] In an exemplary embodiment, the method may further include: receiving a first registration request sent by the recipient through the recipient client node, where the first registration request may carry the recipient identity identifier and the message contract identifier of the message contract; according to the recipient identity identifier and the message contract identifier carried in the first registration request, calling the message contract to generate the recipient's on-chain address corresponding to the recipient identity identifier; and sending the recipient identity identifier and its recipient's on-chain address to the address identity contract generation node, so that the address identity contract generation node generates the address identity contract according to the recipient identity identifier and its recipient's on-chain address.
[0069] In the embodiments of the present disclosure, the recipient identity identifier may adopt any identification information that can uniquely distinguish the recipient, and the sender identity identifier may adopt any identification information that can uniquely distinguish the sender. For example, if both the recipient and the sender are enterprises, the recipient identity identifier and the sender identity identifier may both be the names of the enterprises. Therefore, the address identity contract can also be called an address name contract at this time. In other embodiments, if both the recipient and the sender are individuals, the recipient identity identifier and the sender identity identifier may, for example, be any one or more of the individual's name, mobile phone number, ID card number, etc. The present disclosure does not make any limitations in this regard.
[0070] In the embodiments of the present disclosure, the recipient may send a first registration request to any node device in the blockchain system through the recipient client node to request registering the recipient into the message contract. Therefore, the first registration request may carry the recipient identity identifier and the message contract identifier of the message contract. The message contract identifier may be identification information that can uniquely distinguish the message contract from other smart contracts deployed in the blockchain system. For example, it may be the contract account address of the message contract in the blockchain system, or the contract file storage path of the message contract, or a unique identifier generated when the message contract is generated. The present disclosure does not limit this.
[0071] When any node device receives the first registration request, it may broadcast the first registration request to other node devices in the blockchain system to conduct a consensus on the first registration request. After the consensus is passed, the block containing the first registration request is added to the blockchain, and then the message contract matching the message contract identifier contained in the block is called to generate a corresponding on-chain address for the recipient identity identifier, that is, the account address of the recipient in the blockchain system.
[0072] In other embodiments, the method may further include: receiving a second registration request sent by the sender through the sender client node, where the second registration request carries the sender identity identifier and the message contract identifier of the message contract; and calling the message contract to generate the on-chain address corresponding to the sender identity identifier according to the sender identity identifier and the message contract identifier carried in the second registration request.
[0073] In the embodiments of the present disclosure, the sender may send a second registration request to any node device in the blockchain system through the sender client node to request registering the sender into the message contract. Therefore, the second registration request may carry the sender identity identifier and the message contract identifier of the message contract. When any node device receives the second registration request, it may broadcast the second registration request to other node devices in the blockchain system to conduct a consensus on the second registration request. After the consensus is passed, the block containing the second registration request is added to the blockchain, and then the message contract matching the message contract identifier contained in the block is called to generate a corresponding on-chain address for the sender identity identifier, that is, the account address of the sender in the blockchain system.
[0074] In the embodiments of the present disclosure, the trigger time and the processing time sequence of the first registration request and the second registration request are not limited. The two may be executed in parallel, or the first registration request may be executed first and then the second registration request; or, the second registration request may be executed first and then the first registration request.
[0075] In the embodiments of the present disclosure, a node device may transmit the recipient identity identifier, the recipient on-chain address generated thereby, the sender identity identifier, and the sender on-chain address generated thereby to an address identity contract generation node. For example, the address identity contract generation node may subscribe to messages published by a certain node device. When a new on-chain address (which may be a recipient on-chain address or a sender on-chain address) is detected in the node device, a notification message is automatically pushed to the address identity contract generation node to inform the new on-chain address and its corresponding identity identifier (such as a recipient identity identifier or a sender identity identifier). Based on this, the address identity contract may, according to the mapping relationship between the recipient identity identifier and the recipient on-chain address, and the mapping relationship between the sender identity identifier and the sender on-chain address, associatively store the recipient identity identifier and the recipient on-chain address, as well as the sender identity identifier and the sender on-chain address in the address identity contract, generate an address identity contract, and deploy the generated address identity contract to the blockchain system, so that each node device in the blockchain system stores the recipient identity identifier and the recipient on-chain address, as well as the sender identity identifier and the sender on-chain address.
[0076] In other embodiments, the address identity contract may include a trigger condition and an operation to be executed. For example, the trigger condition is set to detect the generation of a new on-chain address in a node device, and the operation to be executed is to automatically associate and store the newly generated on-chain address with its identity identifier when the generation of a new on-chain address is detected. After the address identity contract is set up, it is first deployed to each node device in the blockchain system. When a new on-chain address is detected in a node device, the address identity contract will be automatically called, triggering the storage of the new on-chain address and its identity identifier in the address identity contract.
[0077] In an exemplary embodiment, the method may further include: obtaining a first query request sent by the sender through the sender client node, where the first query request carries the recipient identity identifier; calling the address identity contract according to the recipient identity identifier carried in the first query request, and obtaining the recipient on-chain address according to the mapping relationship between the recipient on-chain address and the recipient identity identifier in the address identity contract; returning the recipient on-chain address to the sender client node, so that the sender client node can construct a first message transfer request according to the recipient on-chain address.
[0078] In an exemplary embodiment, the first message transfer request may further carry the sender on-chain address of the sender in the blockchain system.
[0079] In the embodiments of the present disclosure, when the sender is ready to send a message (referred to as the first message for distinction from other messages) to the receiver, the sender can send a first query request to any node device through the sender client node. It should be noted that when the sender client node detects a sending request for the first message, the sending request for the first message includes the first message to be sent, the sender's on-chain address, and the receiver's identity identifier, and the generation of the first query request is automatically triggered. After receiving the first query request, the node device can broadcast it to other node devices, conduct consensus on the first query request, and after the first query request passes the consensus, add the block containing the first query request to the blockchain, call the address identity contract, query and obtain the receiver's on-chain address that matches the receiver's identity identifier contained in the block, return the receiver's on-chain address to the sender client node, and construct a first message transfer request together with the first message and the sender's on-chain address carried in the sending request for the first message, and send the first message transfer request to any node device in the blockchain system.
[0080] In other embodiments, when the sender client node detects a sending request for the first message, the sending request for the first message includes the first message to be sent, the sender's identity identifier, and the receiver's identity identifier, and the generation of the above-mentioned first query request and a second query request can be automatically triggered. The second query request is used to query the sender's on-chain address corresponding to the sender's identity identifier. After receiving the second query request, any node device can broadcast it to other node devices, conduct consensus on the second query request, and after the second query request passes the consensus, add the block containing the second query request to the blockchain, call the address identity contract, query and obtain the sender's on-chain address that matches the sender's identity identifier contained in the block, return the sender's on-chain address to the sender client node, and construct a first message transfer request together with the first message, the sender's on-chain address, and the receiver's on-chain address, and send the first message transfer request to any node device in the blockchain system.
[0081] In the embodiments of the present disclosure, in the process of constructing the first message transfer request, the method of obtaining the recipient's on-chain address (which may also include the sender's on-chain address) is not limited to the address identity contract method provided above. In other embodiments, it may also be implemented by using an off-chain PKI (Public Key Infrastructure). For example, there may be a database server communicatively connected to the blockchain system to obtain the recipient's identity identifier and the recipient's on-chain address generated by invoking the message contract in the node device, as well as the sender's identity identifier and the sender's on-chain address generated by invoking the message contract in the node device. The recipient's identity identifier and the recipient's on-chain address, as well as the sender's identity identifier and the sender's on-chain address, are associated and stored in a centralized database. When the sender needs to send the first message, a query request can be sent to the centralized database. The query request carries the recipient's identity identifier (which may also include the sender's identity identifier) to query and obtain the recipient's on-chain address (which may also include the sender's on-chain address), and then it is returned to the sender client node. Together with the first message, the sender's on-chain address, and the recipient's on-chain address, a first message transfer request is constructed and sent to any node device in the blockchain system.
[0082] After any node device receives the first message transfer request, it can broadcast the first message transfer request to other node devices for consensus on the first message transfer request. If the first message transfer request passes the consensus, a block containing the first message transfer request is added to the blockchain. Then, the message contract is invoked to process the first message transfer request included in the block.
[0083] In an exemplary embodiment, the method may further include: invoking the message contract to create a contract message queue; invoking the message contract to create a recipient message receiving queue corresponding to the recipient's on-chain address; and receiving a first message subscription request sent by the recipient through the recipient client node.
[0084] In the embodiments of the present disclosure, after the message contract is successfully deployed to the blockchain system, a contract message queue can be maintained through the message contract. The contract message queue can be used to store the relevant entity data of the messages (including the first message and the second message below) sent and / or received by invoking the contract message. Taking the first message as an example, the relevant entity data of the first message may include the entity content of the first message. For example, if the first message is a currently to-be-sent email, it may include the title and the body of the currently to-be-sent email, and may also include the sender's on-chain address of the sender of the currently to-be-sent email, the recipient's on-chain address of the recipient, and the first message identifier assigned to the first message, etc.
[0085] In an exemplary embodiment, calling the message contract to create a recipient message receiving queue corresponding to the recipient's on-chain address may include: receiving a first registration request sent by the recipient through the recipient client node, where the first registration request carries the recipient identity identifier and the message contract identifier of the message contract; according to the recipient identity identifier and the message contract identifier carried in the first registration request, calling the message contract to generate the recipient's on-chain address corresponding to the recipient identity identifier; creating the recipient message receiving queue corresponding to the recipient's on-chain address.
[0086] In an exemplary embodiment, the method may further include: calling the message contract to create a recipient message sending queue corresponding to the recipient's on-chain address, where the recipient message sending queue is used to store the second message identifier of the second message sent by the recipient, and the contract message queue is further used to associatively store the second message identifier, the on-chain address of the target party receiving the second message, the recipient's on-chain address, and the second message.
[0087] In an embodiment of the present disclosure, during the process of registering a recipient to the message contract, after assigning an on-chain address to the recipient, a recipient message receiving queue can be created for the recipient's on-chain address, and a recipient message sending queue can also be created. The recipient message receiving queue can be used to store the message identifiers (such as the first message identifier) of the messages received by the recipient from any sender (for example, it may include the above-mentioned first message); the recipient message sending queue can be used to store the message identifiers (such as the second message identifier) of the messages sent by the recipient to any other recipient (for example, it may include the second message), that is, at this time, the recipient actually becomes a sender. The second message can be one or more, and the present disclosure does not limit this.
[0088] In an embodiment of the present disclosure, the on-chain address of the target party can be the on-chain address of any sender who sends the second message to the recipient.
[0089] In an exemplary embodiment, the method may further include: receiving a second registration request sent by the sender through the sender client node, where the second registration request carries the sender identity identifier and the message contract identifier of the message contract; according to the sender identity identifier and the message contract identifier carried in the second registration request, calling the message contract to generate the sender's on-chain address corresponding to the sender identity identifier; creating the sender message sending queue corresponding to the sender's on-chain address.
[0090] In the embodiments of the present disclosure, during the process of registering a sender to a message contract, after an on-chain address of the sender is assigned to the sender, a sender message receiving queue can be created for the on-chain address of the sender, and a sender message sending queue can also be created. The sender message receiving queue can be used to store the message identifiers of the messages received by the sender from any recipient, that is, at this time the sender actually becomes a recipient; the sender message sending queue can be used to store the message identifiers (such as the first message identifier) of the messages sent by the sender to any recipient. The first message can be one or more, and the present disclosure does not limit this.
[0091] In an exemplary embodiment, the method may further include: adding the first message identifier to the sender message sending queue.
[0092] In the embodiments of the present disclosure, when adding the first message identifier to the end of the recipient message receiving queue, the first message identifier can also be added to the end of the sender message sending queue, that is, used to record that the first message is sent from the sender to the recipient.
[0093] In the embodiments of the present disclosure, a contract message queue, a sender message receiving queue, a sender message sending queue, a recipient message receiving queue, and a recipient message sending queue are simultaneously created through a message contract. The contract message queue is used to store the relevant entity data of the messages sent and / or received through the message contract. At the same time, the sender message receiving queue is used to store the message identifiers (identity, ID) of the messages received by the sender, the sender message sending queue is used to store the message identifiers of the messages sent by the sender, the recipient message receiving queue is used to store the message identifiers of the messages received by the recipient, and the recipient message sending queue is used to store the message identifiers of the messages sent by the recipient. On the one hand, since the relevant entity data of all sent and / or received messages only needs to be stored once in the contract message queue and does not need to be stored twice in the sender message receiving queue and the recipient message sending queue, or the sender message sending queue and the recipient message receiving queue. Usually, the data volume of the relevant entity data is larger than that of the message identifier. Therefore, the storage volume of data can be reduced, and the storage space of each node device can be saved. On the other hand, a global message identifier can also be assigned to each message stored in the contract message queue through the contract message, and the message identifier and its corresponding relevant entity data of each message are associated and stored in the contract message queue. The message identifiers are stored in the sender message receiving queue, the sender message sending queue, the recipient message receiving queue, and the recipient message. That is, using the message identifier as an index, when it is necessary to access the relevant entity data of the message, the corresponding relevant entity data of the message in the contract message queue can be matched through the message identifier, ensuring the accuracy of message transmission.
[0094] However, the present disclosure is not limited thereto. In other embodiments, the message contract may not need to maintain the contract message queue. Instead, the message identifier and its related entity data of the message may be stored in the sender message receiving queue, the sender message sending queue, the receiver message receiving queue, and the receiver message sending queue. When accessing, the relevant entity data in the corresponding queue can be directly accessed. For example, the sender can use the sender's on-chain address to access the relevant entity data of the messages received by the sender stored in the sender message receiving queue and the relevant entity data of the messages sent by the sender stored in the sender message sending queue. At this time, a global message identifier for each message can be generated through the message contract, that is, the message identifier of each message in the blockchain system is unique, regardless of which queue it is stored in. It is also possible to generate a local message identifier for the messages in each sender message receiving queue, generate a local message identifier for the messages in each sender message sending queue, generate a local message identifier for the messages in each receiver message receiving queue, and generate a local message identifier for the messages in each receiver message sending queue. For example, the message identifier 1 is stored in the sender message sending queue, and the message identifier 1 can also be stored in the receiver message sending queue because at this time, the messages with the same message identifier can be distinguished by the sender's on-chain address and the receiver's on-chain address.
[0095] In the embodiments of the present disclosure, the node device may also receive a first message subscription request sent by the receiver through the receiver client node, for the receiver client node to subscribe to the notification messages (including the first notification message) pushed by the node device. That is, when the node device detects a new message (including the first message) to be sent to the receiver, it triggers the sending of the corresponding notification message to the receiver client node device to inform the receiver that it has received a new message from the sender.
[0096] In step S320, according to the receiver's on-chain address carried in the first message transfer request, the message contract is called to send a first notification message to the receiver client node, so as to transfer the first message from the sender to the receiver.
[0097] In an exemplary embodiment, according to the recipient's on-chain address carried in the first message transfer request, invoking the message contract to send a first notification message to the recipient client node, so as to transfer the first message from the sender to the recipient, may include: according to the recipient's on-chain address carried in the first message transfer request, invoking the message contract to generate a first message identifier of the first message; using the message contract to associatively store the first message identifier, the sender's on-chain address, the recipient's on-chain address, and the first message into the contract message queue; through the message contract, adding the first message identifier to the recipient message reception queue; in response to the first message subscription request, when it is detected that the first message identifier is newly added to the recipient message reception queue, sending the first notification message to the recipient client node, the first notification message carrying the first message identifier; obtaining the first message and the recipient's on-chain address from the contract message queue according to the first message identifier, and sending the first message to the recipient client node according to the recipient's on-chain address.
[0098] In an embodiment of the present disclosure, the first notification message may carry a first message identifier. After the recipient client node obtains the first notification message, if it wishes to access the first message, it may trigger sending a first access request to the node device. The first access request carries the first message identifier and the recipient's on-chain address. The node device that receives the first access request may, according to the recipient's on-chain address, find that the first message identifier exists in the recipient message reception queue corresponding to the recipient's on-chain address, and then obtain the first message from the contract message queue according to the first message identifier, and return the first message to the recipient client node to implement the transfer of the first message. In other embodiments, the first message may also be directly carried in the first notification message and sent to the recipient client node.
[0099] In an exemplary embodiment, the first message transfer request may further include the sender's on-chain address in the blockchain system. Wherein, the method may further include: invoking the message contract to create a recipient black and white list storage space corresponding to the recipient's on-chain address; receiving the recipient black and white list information sent by the recipient through the recipient client node; invoking the message contract to store the recipient black and white list information into the recipient black and white list storage space.
[0100] In the embodiments of the present disclosure, during the process of calling the message contract to create a recipient message receiving queue and a recipient message sending queue, a recipient black and white list storage space can also be created to store recipient black and white list information. The recipient blacklist information can include recipient blacklist information and / or recipient whitelist information. The recipient blacklist information refers to the sender information that the recipient refuses to receive, such as the sender identity identifier and / or the sender's on-chain address that is refused to receive. The recipient whitelist information refers to the sender information that the recipient allows to receive, such as the sender identity identifier and / or the sender's on-chain address that is allowed to receive.
[0101] In the embodiments of the present disclosure, during the process of calling the message contract to create a sender message receiving queue and a sender message sending queue, a sender black and white list storage space can also be created to store sender black and white list information. The sender blacklist information can include sender blacklist information and / or sender whitelist information. The sender blacklist information refers to the other sender information that the sender refuses to receive, such as the other sender identity identifier and / or the sender's on-chain address that is refused to receive. The sender whitelist information refers to the other sender information that the sender allows to receive, such as the other sender identity identifier and / or the sender's on-chain address that is allowed to receive.
[0102] In an exemplary embodiment, according to the recipient's on-chain address carried in the first message transfer request, calling the message contract to send a first notification message to the recipient client node may include: according to the sender's on-chain address carried in the first message transfer request, calling the message contract to determine whether the sender's on-chain address is in the recipient black and white list information; if the sender's on-chain address is not in the recipient blacklist information in the recipient black and white list information, or the sender's on-chain address is in the recipient whitelist information in the recipient black and white list information, then send the first notification message to the recipient client node.
[0103] In the embodiments of the present disclosure, when there is recipient blacklist information, if it is determined that the sender's on-chain address is in the recipient blacklist information, this operation will end, the first message identifier will not be generated, and the first message will not be transferred to the recipient; when there is recipient whitelist information, if it is determined that the sender's on-chain address is not in the recipient whitelist information, this operation will end, the first message identifier will not be generated, and the first message will not be transferred to the recipient. If there is both recipient blacklist information and recipient whitelist information, if the sender's on-chain address is in the recipient blacklist information and not in the recipient whitelist information, this operation will end, the first message identifier will not be generated, and the first message will not be transferred to the recipient.
[0104] It should be noted that when determining whether the sender's on-chain address is in the recipient's black and white list information, if the recipient's blacklist information stores the sender identity identifiers that the recipient refuses to receive and the sender identity identifiers that are allowed to be received, the corresponding sender's on-chain address can be obtained by calling the address identity contract for judgment. On the contrary, if the recipient's blacklist information stores the sender's on-chain addresses that the recipient refuses to receive and the sender's on-chain addresses that are allowed to be received, the corresponding sender identity identifier can be obtained by calling the address identity contract for judging whether the sender identity identifier is in the recipient's black and white list information.
[0105] In an exemplary embodiment, the method may further include: receiving a first message access request sent by the recipient through the recipient client node, where the first message access request carries the recipient's on-chain address; in response to the first message access request, calling the message contract, and accessing the recipient's message sending queue and the recipient's message receiving queue according to the recipient's on-chain address; accessing the second message in the contract message queue according to the second message identifier in the recipient's message sending queue, and accessing the first message in the contract message queue according to the first message identifier in the recipient's message receiving queue.
[0106] In other embodiments, the method may further include: receiving a second message access request sent by the sender through the sender client node, where the second message access request carries the sender's on-chain address; in response to the second message access request, calling the message contract, and accessing the sender's message sending queue and the sender's message receiving queue according to the sender's on-chain address; accessing the corresponding message in the contract message queue according to the message identifier in the sender's message sending queue, and accessing the corresponding message in the contract message queue according to the message identifier in the sender's message receiving queue.
[0107] In the embodiments of the present disclosure, the access permissions of messages can also be defined through the message contract, that is, only the sender's own message sending queue and message receiving queue can be accessed according to the sender's on-chain address, and the relevant entity data corresponding to the messages actually sent and received by the sender in the contract message queue can be accessed, but the contract message queue cannot be directly accessed; similarly, only the recipient's own message sending queue and message receiving queue can be accessed according to the recipient's on-chain address, and the relevant entity data corresponding to the messages actually sent and received by the recipient in the contract message queue can be accessed, but the contract message queue cannot be directly accessed, so as to realize the privacy and security of the relevant entity data of the messages of different senders and recipients.
[0108] The message passing method based on blockchain provided by the embodiments of the present disclosure, on the one hand, utilizes blockchain to implement a decentralized message passing service. When messages are passed between the sender and the receiver, there is no longer a need to rely on a third-party message passing service. At the same time, using blockchain technology to implement the message passing service can prevent messages from being forged or tampered with during the transmission process, thereby realizing the data security of messages and protecting the privacy of data. On the other hand, by deploying a message contract in the blockchain system, when a node device in the blockchain system obtains a first message passing request sent by the sender through the sender client node, it can call the message contract and, according to the receiver's on-chain address in the blockchain system carried in the first message passing request, send a first notification message to the corresponding receiver client node of the receiver, so as to be able to transfer the first message carried in the first message passing request from the sender to the receiver. The message contract is a type of smart contract deployed in the blockchain system, that is, the automatic transfer of messages is realized using smart contracts in blockchain technology. When a new first message is received, the receiver can be notified in a timely manner, realizing the timely transfer of the first message to the receiver without missing any messages.
[0109] Figure 4 Schematically shows a schematic diagram of the system architecture of the message passing method based on blockchain according to an embodiment of the present disclosure.
[0110] As Figure 4 shown, it is assumed that the node devices in the blockchain system 401 may include a first node device 40,11 and a second node device 4012. The first node device 4011 and the second node device 4012 may each be one or more.
[0111] The message contract generation node 402, the address identity contract generation node 403, the sender client node 404, and the receiver client node 405 may all be communicatively connected to the blockchain system 401.
[0112] The sender client node 404 is communicatively connected to the first node device 4011, for example, and the receiver client node 405 is communicatively connected to the second node device 4011, for example. It is assumed that both the message contract generation node 402 and the address identity contract generation node 403 are communicatively connected to the first node device 4011.
[0113] Figure 5 Schematically shows a schematic diagram of the message passing method based on blockchain according to another embodiment of the present disclosure. As Figure 5 shown, the method provided by the embodiments of the present disclosure may include the following steps.
[0114] In step S501, a message contract is deployed in the blockchain system to create a contract message queue.
[0115] For example, it can utilize Figure 4 In the embodiment, the message contract generation node 402 sends a transaction request for deploying the message contract to the first node device 4011 in the blockchain system 401. Assuming that the first node device 4011 is the primary node for this round, the first node device 4011 generates a proposal block for deploying the message contract, and the first node device 4011 broadcasts the proposal block for deploying the message contract to each second node device 4012 to conduct consensus on the proposal block for deploying the message contract, determines that the proposal block for deploying the message contract passes the consensus, and deploys the message contract to the blockchain system. The specific deployment process can refer to the content of the above embodiment.
[0116] In step S502, receive a first registration request sent by the recipient client node. The first registration request carries the recipient identity identifier and the message contract identifier.
[0117] In step S503, call the message contract to generate the recipient on-chain address corresponding to the recipient identity identifier.
[0118] For example, as Figure 4 shown, the recipient client node 405 sends a first registration request to the second node device 4012. The second node device 4012 can broadcast the first registration request to each first node device 4011 to conduct consensus on the first registration request. After the consensus passes, call the message contract to generate the recipient on-chain address corresponding to the recipient identity identifier.
[0119] In step S504, receive a second registration request sent by the sender client node. The second registration request carries the sender identity identifier and the message contract identifier.
[0120] In step S505, call the message contract to generate the sender on-chain address corresponding to the sender identity identifier.
[0121] For example, as Figure 4 shown, the sender client node 404 sends a second registration request to the first node device 4011. The first node device 4011 can broadcast the second registration request to each second node device 4012 to conduct consensus on the second registration request. After the consensus passes, call the message contract to generate the sender on-chain address corresponding to the sender identity identifier.
[0122] In step S506, deploy the address identity contract in the blockchain system.
[0123] For example, it can utilize Figure 4In the embodiment, the address identity contract generation node 403 sends a transaction request for deploying an address identity contract to the first node device 4011 in the blockchain system 401. Assuming that the first node device 4011 is the primary node in this round, the first node device 4011 generates a proposal block for deploying the address identity contract, and the first node device 4011 broadcasts the proposal block for deploying the address identity contract to each second node device 4012 to conduct consensus on the proposal block for deploying the address identity contract. After determining that the proposal block for deploying the address identity contract passes the consensus, the address identity contract is deployed to the blockchain system. The specific deployment process can refer to the content of the above embodiment.
[0124] In step S507, a recipient message receiving queue, a recipient message sending queue, and a recipient black and white list storage space corresponding to the recipient's on-chain address are created.
[0125] After calling the message contract to create the recipient's on-chain address, a recipient message receiving queue, a recipient message sending queue, and a recipient black and white list storage space corresponding to the recipient's on-chain address can be created. The specific process can refer to the description of the above embodiment.
[0126] In step S508, a sender message receiving queue, a sender message sending queue, and a sender black and white list storage space corresponding to the sender's on-chain address are created.
[0127] After calling the message contract to create the sender's on-chain address, a sender message receiving queue, a sender message sending queue, and a sender black and white list storage space corresponding to the sender's on-chain address can be created. The specific process can refer to the description of the above embodiment.
[0128] In step S509, a first message subscription request sent by the recipient client node is received.
[0129] For example, Figure 4 In the embodiment, the second node device 4012 receives a first subscription request sent by the recipient client node 405 for subscribing to a first notification message sent by the second node device 4012. The first notification message is used to notify the recipient client node 405 that a new first message has been received in the recipient message receiving queue in the second node device 4012.
[0130] In step S510, a first message transfer request sent by the sender client node is obtained. The first message transfer request carries a first message, a recipient on-chain address, and a sender on-chain address. The recipient on-chain address is obtained by querying the address identity contract.
[0131] Specifically, how to obtain the recipient on-chain address by querying the address identity contract can refer to the content of the above embodiment.
[0132] In step S511, if the sender's on-chain address is not in the recipient's blacklist information or is in the recipient's whitelist information, the message contract is called to generate a first message identifier for the first message.
[0133] For example, Figure 4 In the first node device 4011 in the embodiment, a first message transfer request sent by the sender client node 404 is received. The first node device 4011 broadcasts the first message transfer request to each second node device 4012 to perform consensus on the first message transfer request. After the consensus is passed, it can be determined whether the sender's on-chain address is in the recipient's blacklist information and / or the recipient's whitelist information.
[0134] In step S512, the first message identifier, the sender's on-chain address, the recipient's on-chain address, and the first message are associated and stored in the contract message queue.
[0135] In step S513, the first message identifier is added to the recipient's message receiving queue, and the first message identifier is added to the sender's message sending queue.
[0136] In step S514, in response to the first message subscription request, when it is detected that a new first message identifier is added to the recipient's message receiving queue, a first notification message is sent to the recipient client node.
[0137] In step S515, the first message and the recipient's on-chain address are obtained from the contract message queue according to the first message identifier, and the first message is sent to the recipient client node according to the recipient's on-chain address.
[0138] The following combines Figure 6 The method provided in the embodiments of the present disclosure will be illustrated by examples, but the present disclosure is not limited thereto. In other embodiments, the messages transmitted in the embodiments of the present disclosure can be any type of messages such as chat messages in instant messaging, contracts in business cooperation, etc.
[0139] In the traditional enterprise email solution, it is necessary to rely on a third-party email service for storage and forwarding. The email system cannot guarantee that the email delivery can be completed, and at the same time, it cannot guarantee that the sent email information has not been forged or tampered with, and there are certain challenges in terms of security and privacy.
[0140] Figure 6 Schematically shows a schematic diagram of an application scenario of a blockchain-based message transfer method according to an embodiment of the present disclosure.
[0141] Figure 6In the embodiment, taking the sent message as an email as an example, the message contract can be called the message mailbox contract 600, that is, the smart contract for implementing the delivery service of messages of this type of email. Taking the recipient and the sender as different enterprises and the names of the enterprises as the identity identifiers as an example, the address identity contract can be called the address name contract 700, and the message identifier of each message can be called the email identifier (mail-id) of the corresponding email.
[0142] Figure 6 The embodiment proposes an enterprise message mailbox solution based on blockchain smart contracts, that is, multiple enterprises jointly build a consortium chain and deploy the message mailbox contract 600, so that the messages or emails between enterprises can be delivered safely and efficiently with the help of the blockchain. The access rights and data security of different messages or emails can also be realized through the message mailbox contract 600, while ensuring the authenticity and immutability of the delivered messages or emails.
[0143] It can be understood that enterprise A and enterprise B do not require generating a node device on the consortium chain, as long as enterprise A or enterprise B can connect to the consortium chain.
[0144] Such as Figure 6 As shown, the message delivery method provided by the embodiment of the present disclosure depends on the message mailbox contract 600 and the address name contract 700. The address name contract 700 is mainly used to record the mapping relationship between the on-chain addresses of associated enterprises and the identities (such as names) of the enterprises. For example, the address name contract can be deployed on each node device of the consortium chain, or can be implemented in the off-chain PKI manner, that is, a centralized database can also be constructed. For example, a third-party institution stores the correspondence between the names of enterprises and the on-chain addresses.
[0145] The message mailbox contract 600 mainly includes a message / email sending and receiving group and a contract message queue ( Figure 6 which can also be called the message / email queue in the embodiment, and is mainly used to store the email entity data of each email). The message / email group is registered and allocated by the on-chain enterprises in the message mailbox contract 600. Each registered enterprise has an on-chain address identifier. The message / email group can maintain the black / white on-chain address list of the corresponding enterprise, indicating the senders of messages that are allowed or refused to be received.
[0146] For example, sending addressA to each device node, registering and allocating an independent storage space as the message / email group of addressA. At the same time, each maintains a message sending queue and a message receiving queue. The message / email queue, the message sending queue, and the message receiving queue maintain the mail-id in the order of sending or receiving time (that is, Figure 6The message identifier in the embodiment can be referred to as the mail identifier. The actual message mail entity, i.e., the relevant entity data of the mail, is stored in the message mail queue of the message mailbox contract 600 and is maintained through indexing (such as mail-id).
[0147] Figure 6 The mail-id in the embodiment is global, that is, each mail-id in the message mail queue, message sending queue, and message receiving queue of the message mailbox contract 600 is unique. For example, it can be incremented and generated according to the sending or receiving time.
[0148] Assume that the message mailbox contract 600 and the address name contract 700 have been deployed in the blockchain system. A contract message queue 610 is maintained in the message information contract 600. In the address name contract 700, it is assumed that the mapping relationship between the on-chain address addressA of enterprise A and the name xxxx1 of enterprise A, and the mapping relationship between the on-chain address addressB of enterprise B and the name xxx2 of enterprise B have been maintained.
[0149] Here, assume that enterprise A sends an email to enterprise B. Then, the on-chain address of enterprise A at this time is the sender on-chain address, the on-chain address of enterprise B is the recipient on-chain address, the name xxxx1 of enterprise A is the sender identity identifier, and the name xxx2 of enterprise B is the recipient identity identifier. The black / white list storage space allocated to enterprise A is called the sender black / white list storage space. The blacklist information and / or whitelist information that enterprise A refuses to receive and is stored in the black / white list storage space allocated to enterprise A is called the sender black / white list information. The blacklist information that enterprise A refuses to receive is called the sender blacklist information, and the whitelist information that enterprise A allows to receive is called the sender whitelist information. The black / white list storage space allocated to enterprise B is called the recipient black / white list storage space. The blacklist information and / or whitelist information that enterprise B refuses to receive and is stored in the black / white list storage space allocated to enterprise B is called the recipient black / white list information. The blacklist information that enterprise B refuses to receive is called the recipient blacklist information, and the whitelist information that enterprise B allows to receive is called the recipient whitelist information. And the client node used by enterprise A to communicate with the blockchain system is called the sender client node, and the client node used by enterprise B to communicate with the blockchain system is called the recipient client node.
[0150] The message mailbox contract 600 can be used to allocate an independent storage space 620 for enterprise A based on the on-chain address addressA of enterprise A. In this independent storage space 620, addressA, a message sending queue 622 (which can be called the sender message sending queue when enterprise A sends an email), and a message receiving queue 623 (which can be called the sender message receiving queue when enterprise A sends an email) are stored. An independent black and white list storage space 621 (which can be called the sender black and white list storage space when enterprise A sends an email) can also be allocated to store sender black and white list information.
[0151] The message mailbox contract 600 can also be used to allocate an independent storage space 630 for enterprise B based on the on-chain address addressB of enterprise B. In this independent storage space 630, addressB, a message sending queue 632 (which can be called the receiver message sending queue when enterprise B receives an email), and a message receiving queue 633 (which can be called the receiver message receiving queue when enterprise B receives an email) are stored. An independent black and white list storage space 631 (which can be called the receiver black and white list storage space when enterprise B receives an email) can also be allocated to store receiver black and white list information.
[0152] It can be understood that when enterprise A receives an email, the message sending (send) queue 622 can be called the receiver message sending queue, the message receiving (from) queue 623 can be called the receiver message receiving queue, the black and white list storage space 621 can be called the receiver black and white list storage space, the corresponding black and white list information stored by enterprise A for rejecting and / or allowing reception is called receiver black and white list information, and the client node used by enterprise A to communicate with the blockchain system is called the receiver client node. When enterprise B sends an email, the message sending queue 632 can be called the sender message sending queue, the message receiving queue 633 can be called the sender message receiving queue, the black and white list storage space 631 can be called the sender black and white list storage space, the corresponding black and white list information stored by enterprise B for rejecting and / or allowing reception is called sender black and white list information, and the client node used by enterprise B to communicate with the blockchain system is called the sender client node.
[0153] Figure 6In the embodiment, it is assumed that enterprise A has previously sent 3 emails through the message mailbox contract 600. The mail-ids of these 3 emails are assumed to be 1, 2, and 3 respectively. Therefore, the mail-id 1 of email 1, the mail-id 2 of email 2, and the mail-id 3 of email 3 are stored in the sender message sending queue 622 in the order of sending time. Correspondingly, the relevant entity data of emails 1, 2, and 3 are stored in the contract message queue 610 in sequence.
[0154] As Figure 6 shown, it is assumed that current enterprise A expects to send a new email (which can also be called a message email) to enterprise B. First, query the on-chain address addressB of enterprise B through the address name contract 700, and then send the message email through the message mailbox contract 600. The message mailbox contract 600 can create a message email entity (i.e., relevant entity data) in the message email queue, such as from addressA, sent to addressB, with the title "test" and the email content "hello", and assign the mail-id as 4. At the same time, record this mail-id = 4 at the end of the column of the message sending queue 622 of addressA. Record this mail-id = 4 at the end of the message receiving queue 633 of addressB. Then notify the corresponding enterprise B of addressB in the form of an on-chain message event, for example, by sending a first notification message.
[0155] After that, it is assumed that enterprise A has successively received 4 emails through the message mailbox contract 600. The mail-ids of these 4 emails are assumed to be 5, 6, 7, and 8 respectively. Therefore, the mail-id 5 of email 5, the mail-id 6 of email 6, the mail-id 7 of email 7, and the mail-id 8 of email 8 are stored in the sender message receiving queue 623. Correspondingly, message email entities of emails 5, 6, 7, and 8 are created in the message email queue.
[0156] After that, it is assumed that enterprise B has sent email 9 through the message information contract 600. Record this mail-id = 9 at the end of the message sending queue 632 of addressB. Correspondingly, a message email entity of email 9 is created in the message email queue.
[0157] Figure 6In the embodiment, it is assumed that the emails received or sent through the message mailbox contract 600 are all stored in the same message mail queue. However, the present disclosure is not limited thereto. In other embodiments, the message mailbox contract may also configure different message mail queues for different on-chain addresses, store the message mail entities of the same on-chain address in the same message mail queue, and a mapping relationship can be established between each message mail queue and the message receiving queue and message sending queue of the corresponding on-chain address. In some other embodiments, the message mail entities may also be directly stored in the message receiving queue and message sending queue of the corresponding on-chain address, and the present disclosure does not limit this.
[0158] Figure 6 In the embodiment, the access rights of the message mail can also be specified through the message mailbox contract, that is, the on-chain address can only access its own message sending queue and message receiving queue, and has access rights to the message mail entities corresponding to the mail-id actually maintained in the message mail queue, but cannot directly access the message mail queue of the message mailbox contract, thereby ensuring the privacy and security of the message mail data of different enterprises.
[0159] The method provided by the embodiment of the present disclosure is a message mailbox solution based on blockchain smart contracts, which combines blockchain with the message mailbox between enterprises, and realizes a decentralized and trustworthy message mailbox service through the address name contract and the message mailbox smart contract, without relying on a third-party mailbox service, and is realized through blockchain technology. For example, enterprise B can subscribe to the messages of a certain node device on the chain, such as the second node device. When the second node device detects that there is an email sent to enterprise B, it sends a first notification message to the client node corresponding to enterprise B to notify enterprise B, so that the email delivery can be completed. In addition, since the transaction data on the chain needs to be signed and verified, the authenticity and immutability of the message delivery between enterprises can be guaranteed, and at the same time, the privacy and security problems of enterprise message data are solved through certain strategies.
[0160] Figure 7 Schematically shows a block diagram of a node device in a blockchain system according to an embodiment of the present disclosure. Figure 7 The node device in the embodiment can be communicatively connected to the sender client node and the receiver client node. A message contract can be deployed in the blockchain system. As Figure 7 shown, the node device 700 in the blockchain system can include: a first message transfer request acquisition unit 710 and a first notification message sending unit 720.
[0161] The first message transfer request acquisition unit 710 can be used to acquire a first message transfer request sent by a sender through the sender client node. The first message transfer request carries a first message to be sent to a receiver and the receiver's on-chain address in the blockchain system.
[0162] The first notification message sending unit 720 can be used to call the message contract according to the receiver's on-chain address carried in the first message transfer request, and send a first notification message to the receiver client node, so as to transfer the first message from the sender to the receiver.
[0163] For the node device in the blockchain system provided by the embodiments of the present disclosure, on the one hand, it uses the blockchain to implement a decentralized message transfer service. When transferring messages between the sender and the receiver, there is no longer a need to rely on a third-party message transfer service. At the same time, using blockchain technology to implement the message transfer service can prevent messages from being forged or tampered with during the transfer process, thereby realizing the data security of the messages and protecting the privacy of the data. On the other hand, by deploying a message contract in the blockchain system, when the node device in the blockchain system acquires a first message transfer request sent by the sender through the sender client node, it can call the message contract and, according to the receiver's on-chain address carried in the first message transfer request, send a first notification message to the corresponding receiver client node of the receiver, so as to be able to transfer the first message carried in the first message transfer request from the sender to the receiver. The message contract is a type of smart contract deployed in the blockchain system, that is, the automatic transfer of messages is realized using smart contracts in blockchain technology. When a new first message is received, the receiver can be notified in a timely manner, realizing the timely transfer of the first message to the receiver without missed reception.
[0164] In an exemplary embodiment, the first message transfer request may further carry the sender's on-chain address in the blockchain system. Wherein, the node device 700 in the blockchain system may further include: a contract message queue creation unit, which can be used to call the message contract to create a contract message queue; a receiver message receiving queue creation unit, which can be used to call the message contract to create a receiver message receiving queue corresponding to the receiver's on-chain address; and a first message subscription request receiving unit, which can be used to receive a first message subscription request sent by the receiver through the receiver client node.
[0165] Among them, the first notification message sending unit 720 may include: a first message identifier generating unit, which can be used to call the message contract according to the recipient's on-chain address carried in the first message transfer request to generate a first message identifier of the first message; a first message information entity content storage unit, which can be used to use the message contract to associate and store the first message identifier, the sender's on-chain address, the recipient's on-chain address, and the first message in the contract message queue; a first message identifier adding unit for the recipient's message receiving queue, which can be used to add the first message identifier to the recipient's message receiving queue through the message contract; a first notification message transfer unit, which can be used to respond to the first message subscription request, and when it detects that the first message identifier is newly added to the recipient's message receiving queue, send the first notification message to the recipient client node, where the first notification message carries the first message identifier; a first message sending unit, which can be used to obtain the first message and the recipient's on-chain address from the contract message queue according to the first message identifier, and send the first message to the recipient client node according to the recipient's on-chain address.
[0166] In an exemplary embodiment, the recipient's message receiving queue creating unit may include: a first registration request receiving unit, which can be used to receive a first registration request sent by the recipient through the recipient client node, where the first registration request carries the recipient's identity identifier and the message contract identifier of the message contract; a recipient's on-chain address generating unit, which can be used to call the message contract to generate the recipient's on-chain address corresponding to the recipient's identity identifier according to the recipient's identity identifier and the message contract identifier carried in the first registration request; a recipient's message receiving queue creating unit, which can be used to create the recipient's message receiving queue corresponding to the recipient's on-chain address.
[0167] In an exemplary embodiment, the node device 700 in the blockchain system may further include: a second registration request receiving unit, which can be used to receive a second registration request sent by the sender through the sender client node, where the second registration request carries the sender's identity identifier and the message contract identifier of the message contract; a sender's on-chain address generating unit, which can be used to call the message contract to generate the sender's on-chain address corresponding to the sender's identity identifier according to the sender's identity identifier and the message contract identifier carried in the second registration request; a sender's message sending queue creating unit, which can be used to create a sender's message sending queue corresponding to the sender's on-chain address; a first message identifier adding unit for the sender's message sending queue, which can be used to add the first message identifier to the sender's message sending queue.
[0168] In an exemplary embodiment, the node device 700 in the blockchain system may further include: a recipient message sending queue creation unit, which can be used to call the message contract to create a recipient message sending queue corresponding to the recipient's on-chain address. The recipient message sending queue is used to store the second message identifiers of the second messages sent by the recipient. The contract message queue is also used to associatively store the second message identifiers, the on-chain addresses of the target parties that receive the second messages, the recipient's on-chain address, and the second messages; a first message access request receiving unit, which can be used to receive a first message access request sent by the recipient through the recipient client node. The first message access request carries the recipient's on-chain address; a recipient sending and receiving queue access unit, which can be used to respond to the first message access request, call the message contract, and access the recipient message sending queue and the recipient message receiving queue according to the recipient's on-chain address; a recipient receiving and sending message access unit, which can be used to access the second messages in the contract message queue according to the second message identifiers in the recipient message sending queue, and access the first messages in the contract message queue according to the first message identifiers in the recipient message receiving queue.
[0169] In an exemplary embodiment, the first message transfer request may further include the sender's on-chain address in the blockchain system. Among them, the node device 700 in the blockchain system may further include: a recipient black and white list storage space creation unit, which can be used to call the message contract to create a recipient black and white list storage space corresponding to the recipient's on-chain address; a recipient black and white list information receiving unit, which can be used to receive the recipient black and white list information sent by the recipient through the recipient client node; a recipient blacklist information storage unit, which can be used to call the message contract to store the recipient black and white list information in the recipient black and white list storage space.
[0170] Among them, the first notification message sending unit 720 may include: a black and white list judgment unit, which can be used to call the message contract according to the sender's on-chain address carried in the first message transfer request to judge whether the sender's on-chain address is in the recipient black and white list information; a first notification message determination unit, which can be used to send the first notification message to the recipient client node if the sender's on-chain address is not in the recipient blacklist information in the recipient black and white list information, or the sender's on-chain address is in the recipient whitelist information in the recipient black and white list information.
[0171] In an exemplary embodiment, the node device may further be communicatively connected to a message contract generation node, and the message contract generation node may be configured to deploy the message contract to the blockchain system. Among them, the node device 700 in the blockchain system may further include: a deployment message contract transaction request receiving unit, configured to receive a transaction request for deploying the message contract sent by the message contract generation node; a deployment message contract proposal block generation unit, configured to generate a proposal block for deploying the message contract according to the transaction request for deploying the message contract; a deployment message contract proposal block consensus unit, configured to perform consensus on the proposal block for deploying the message contract; and a message contract deployment unit, configured to determine that the proposal block for deploying the message contract passes the consensus and deploy the message contract to the blockchain system.
[0172] In an exemplary embodiment, the node device may further be communicatively connected to an address identity contract generation node, and the address identity contract generation node may be configured to deploy an address identity contract to the blockchain system.
[0173] The address identity contract may include a mapping relationship between the recipient's on-chain address in the blockchain system and the recipient's identity identifier.
[0174] Among them, the node device 700 in the blockchain system may further include: a deployment address identity contract transaction request receiving unit, configured to receive a transaction request for deploying the address identity contract sent by the address identity contract generation node; a deployment address identity contract proposal block generation unit, configured to generate a proposal block for deploying the address identity contract according to the transaction request for deploying the address identity contract; a deployment address identity contract proposal block consensus unit, configured to perform consensus on the proposal block for deploying the address identity contract; and an address identity contract deployment unit, configured to determine that the proposal block for deploying the address identity contract passes the consensus and deploy the address identity contract to the blockchain system.
[0175] In an exemplary embodiment, the node device 700 in the blockchain system may further include: a first registration request receiving unit, which may be configured to receive a first registration request sent by the recipient through the recipient client node, where the first registration request carries the recipient identity identifier and the message contract identifier of the message contract; a recipient on-chain address generating unit, which may be configured to call the message contract according to the recipient identity identifier and the message contract identifier carried in the first registration request to generate the recipient on-chain address corresponding to the recipient identity identifier; and a recipient on-chain address sending unit, which may be configured to send the recipient identity identifier and its recipient on-chain address to the address identity contract generation node, so that the address identity contract generation node generates the address identity contract according to the recipient identity identifier and its recipient on-chain address.
[0176] In an exemplary embodiment, the node device 700 in the blockchain system may further include: a first query request obtaining unit, which may be configured to obtain a first query request sent by the sender through the sender client node, where the first query request carries the recipient identity identifier; a recipient on-chain address obtaining unit, which may be configured to call the address identity contract according to the recipient identity identifier carried in the first query request, and obtain the recipient on-chain address according to the mapping relationship between the recipient on-chain address and the recipient identity identifier in the address identity contract; and a recipient on-chain address returning unit, which may be configured to return the recipient on-chain address to the sender client node, so that the sender client node constructs the first message transfer request according to the recipient on-chain address.
[0177] Other contents of the node device in the blockchain system of the embodiments of the present disclosure may refer to the above embodiments.
[0178] It should be noted that although several units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more of the above-described units may be embodied in one unit. Conversely, the features and functions of one unit described above may be further divided and embodied by multiple units.
[0179] Next, refer to Figure 8 , which shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present application. Figure 8 The shown electronic device is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.
[0180] Refer to Figure 8, the electronic device provided by the embodiments of the present disclosure may include: a processor 801, a communication interface 802, a memory 803, and a communication bus 804.
[0181] Among them, the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0182] Optionally, the communication interface 802 may be an interface of a communication module, such as an interface of a GSM (Global System for Mobile communications) module. The processor 801 is used to execute a program. The memory 803 is used to store a program. The program may include a computer program, and the computer program includes computer operation instructions. Among them, the program may include: a program of a video client.
[0183] The processor 801 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present disclosure.
[0184] The memory 803 may include a high-speed RAM (random access memory) memory, and may also include a non-volatile memory, such as at least one disk memory.
[0185] Among them, the program may be specifically used to: obtain a first message transfer request sent by the sender through the sender client node, where the first message transfer request carries a first message to be sent to the receiver and the on-chain address of the receiver in the blockchain system; according to the on-chain address of the receiver carried in the first message transfer request, call the message contract and send a first notification message to the receiver client node, so as to transfer the first message from the sender to the receiver.
[0186] It should be understood that any number of elements in the drawings of the present disclosure is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0187] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0188] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A message passing method based on blockchain, characterized in that, The method is executed by a node device in a blockchain system, and the node device is communicatively connected to a sender client node and a receiver client node; A message contract is deployed in the blockchain system; wherein, the method includes: Obtain a first message transfer request sent by the sender through the sender client node, where the first message transfer request carries a first message to be sent to the receiver and the receiver's on-chain address in the blockchain system; According to the receiver's on-chain address carried in the first message transfer request, call the message contract to generate a first message identifier for the first message; through the message contract, add the first message identifier to the receiver message queue; in response to a first message subscription request sent by the receiver, when it is detected that the first message identifier is newly added to the receiver message receiving queue, send a first notification message to the receiver client node, where the first notification message carries the first message identifier; transfer the first message from the sender to the receiver according to the first message identifier.
2. The method according to claim 1, wherein The first message transfer request further carries the sender's on-chain address in the blockchain system; wherein, the method further includes: Call the message contract to create a contract message queue; Call the message contract to create a receiver message receiving queue corresponding to the receiver's on-chain address; Receive a first message subscription request sent by the receiver through the receiver client node; Wherein, transferring the first message from the sender to the receiver according to the first message identifier includes: Use the message contract to associatively store the first message identifier, the sender's on-chain address, the receiver's on-chain address, and the first message in the contract message queue; Obtain the first message and the receiver's on-chain address from the contract message queue according to the first message identifier, and send the first message to the receiver client node according to the receiver's on-chain address.
3. The method according to claim 2, characterized in that, Calling the message contract to create a receiver message receiving queue corresponding to the receiver's on-chain address includes: Receive a first registration request sent by the receiver through the receiver client node, where the first registration request carries the receiver's identity identifier and the message contract identifier of the message contract; According to the receiver's identity identifier and the message contract identifier carried in the first registration request, call the message contract to generate the receiver's on-chain address corresponding to the receiver's identity identifier; Create the receiver message receiving queue corresponding to the receiver's on-chain address.
4. The method according to claim 2, wherein Further includes: Receive a second registration request sent by the sender through the sender client node, where the second registration request carries the sender's identity identifier and the message contract identifier of the message contract; According to the sender's identity identifier and the message contract identifier carried in the second registration request, call the message contract to generate the sender's on-chain address corresponding to the sender's identity identifier; Create a sender message sending queue corresponding to the sender's on-chain address; Add the first message identifier to the sender message sending queue.
5. The method according to claim 2, characterized in that, It further includes: Invoke the message contract to create a recipient message sending queue corresponding to the recipient's on-chain address. The second message identifier of the second message sent by the recipient is stored in the recipient message sending queue, and the contract message queue is also used to associatively store the second message identifier, the on-chain address of the target party that receives the second message, the recipient's on-chain address, and the second message; Receive a first message access request sent by the recipient through the recipient client node, where the first message access request carries the recipient's on-chain address; In response to the first message access request, invoke the message contract to access the recipient message sending queue and the recipient message receiving queue according to the recipient's on-chain address; Access the second message in the contract message queue according to the second message identifier in the recipient message sending queue, and access the first message in the contract message queue according to the first message identifier in the recipient message receiving queue.
6. The method according to claim 1, characterized in that, The first message transfer request further includes the sender's on-chain address in the blockchain system; wherein, the method further includes: Invoke the message contract to create a recipient black and white list storage space corresponding to the recipient's on-chain address; Receive the recipient black and white list information sent by the recipient through the recipient client node; Invoke the message contract to store the recipient black and white list information in the recipient black and white list storage space; Among them, sending the first notification message to the recipient client node includes: According to the sender's on-chain address carried in the first message transfer request, invoke the message contract to determine whether the sender's on-chain address is in the recipient black and white list information; If the sender's on-chain address is not in the recipient blacklist information in the recipient black and white list information, or the sender's on-chain address is in the recipient whitelist information in the recipient black and white list information, then send the first notification message to the recipient client node.
7. The method according to claim 1, wherein The node device is also communicatively connected to a message contract generation node, and the message contract generation node is used to deploy the message contract to the blockchain system; wherein, the method further includes: Receive a transaction request for deploying the message contract sent by the message contract generation node; Generate a proposal block for deploying the message contract according to the transaction request for deploying the message contract; Conduct consensus on the proposal block for deploying the message contract; Determine that the proposal block for deploying the message contract passes the consensus, and deploy the message contract to the blockchain system.
8. The method according to claim 1, characterized in that, The node device is also communicatively connected to an address identity contract generation node, and the address identity contract generation node is used to deploy an address identity contract to the blockchain system; The address identity contract includes the mapping relationship between the recipient's on-chain address in the blockchain system and the recipient's recipient identity identifier; Among them, the method further includes: Receive a transaction request for deploying an address identity contract sent by the address identity contract generation node; Generate a proposal block for deploying the address identity contract according to the transaction request for deploying the address identity contract; Conduct consensus on the proposal block for deploying the address identity contract; Determine that the proposal block for deploying the address identity contract passes the consensus, and deploy the address identity contract to the blockchain system.
9. The method according to claim 8, characterized in that, Further include: Receive a first registration request sent by the recipient through the recipient client node, where the first registration request carries the recipient identity identifier and the message contract identifier of the message contract; According to the recipient identity identifier and the message contract identifier carried in the first registration request, call the message contract to generate the recipient's on-chain address corresponding to the recipient identity identifier; Send the recipient identity identifier and its on-chain address to the address identity contract generation node, so that the address identity contract generation node generates the address identity contract according to the recipient identity identifier and its on-chain address.
10. The method according to claim 8, wherein Further include: Obtain a first query request sent by the sender through the sender client node, where the first query request carries the recipient identity identifier; According to the recipient identity identifier carried in the first query request, call the address identity contract, and obtain the recipient's on-chain address according to the mapping relationship between the recipient's on-chain address and the recipient identity identifier in the address identity contract; Return the recipient's on-chain address to the sender client node, so that the sender client node constructs the first message transfer request according to the recipient's on-chain address.
11. A node device in a blockchain system, characterized in that, The node device is communicatively connected to the sender client node and the recipient client node; a message contract is deployed in the blockchain system; wherein, the node device executes the method according to claim 1, and the node device includes: A first message transfer request acquisition unit, configured to acquire a first message transfer request sent by the sender through the sender client node, where the first message transfer request carries a first message to be sent to the recipient and the recipient's on-chain address in the blockchain system; A first notification message sending unit, configured to call the message contract according to the recipient's on-chain address carried in the first message transfer request, and send a first notification message to the recipient client node, so as to transfer the first message from the sender to the recipient.
12. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and when the program is executed by a processor, it implements the method according to any one of claims 1 to 10.
13. An electronic device, characterized in that, Include: At least one processor; A storage device configured to store at least one program, and when the at least one program is executed by the at least one processor, the at least one processor is caused to implement the method according to any one of claims 1 to 10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Digital currency payment method, system, device and storage medium
CN111105220A
Blockchain enabled service request system
US20200372501A1