CN115834591A - Block chain based message transmission method and related equipment - Google Patents

Block chain based message transmission method and related equipment Download PDF

Info

Publication number
CN115834591A
CN115834591A CN202111080488.XA CN202111080488A CN115834591A CN 115834591 A CN115834591 A CN 115834591A CN 202111080488 A CN202111080488 A CN 202111080488A CN 115834591 A CN115834591 A CN 115834591A
Authority
CN
China
Prior art keywords
message
receiver
contract
address
sender
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111080488.XA
Other languages
Chinese (zh)
Inventor
莫洋
梁作栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tenpay Payment Technology Co Ltd
Original Assignee
Tenpay Payment Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tenpay Payment Technology Co Ltd filed Critical Tenpay Payment Technology Co Ltd
Priority to CN202111080488.XA priority Critical patent/CN115834591A/en
Publication of CN115834591A publication Critical patent/CN115834591A/en
Pending legal-status Critical Current

Links

Images

Abstract

The disclosure provides a block chain-based message transmission method and related equipment, and belongs to the technical field of block chains. The method is executed by a node device in a blockchain system, wherein the node device is in communication connection with a sender client node and a receiver client node; message contracts are deployed in the blockchain system. The method comprises the following steps: acquiring a first message transmission request sent by a sender through a sender client node, wherein the first message transmission request carries a first message to be sent to a receiver and an address of the receiver on a receiver chain in a block chain system; and calling a message contract according to the receiver chain address carried in the first message transfer request, and sending a first notification message to the receiver client node so as to transfer the first message from the sender to the receiver. By the scheme provided by the embodiment of the disclosure, decentralized and trusted message passing service is realized.

Description

Block chain based message transmission method and related equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method for message delivery based on blockchain, a node device in a blockchain system, a computer-readable storage medium, an electronic device, and a computer program product.
Background
In the message transmission scheme in the related art, the third party system cannot guarantee that the delivery of the message can be completed certainly and the sent message is not forged or falsified, that is, the safety and privacy problems of the sender and the receiver of the message cannot be guaranteed, because the third party system needs to rely on the service of the third party for storage and forwarding.
Disclosure of Invention
Embodiments of the present disclosure provide a block chain-based message delivery method, a node device in a block chain system, a computer-readable storage medium, an electronic device, and a computer program product, which can implement decentralized and trusted message delivery services, complete message delivery without relying on a third-party service, and implement data security and privacy during message transmission.
The embodiment of the disclosure provides a message delivery method based on a blockchain, which is executed by a node device in a blockchain system, wherein the node device is in communication connection with a sender client node and a receiver client node; and message contracts are deployed in the blockchain system. Wherein the method comprises the following steps: acquiring a first message transmission request sent by a sender through a client node of the sender, wherein the first message transmission request carries a first message to be sent to a receiver and a receiver chain address of the receiver in the blockchain system; and calling the message contract according to the receiver chain address carried in the first message transmission request, and sending a first notification message to the receiver client node so as to transmit the first message from the sender to the receiver.
The embodiment of the disclosure provides a node device in a block chain system, wherein the node device is in communication connection with a sender client node and a receiver client node; and message contracts are deployed in the blockchain system. Wherein the node device includes: a first message delivery request obtaining unit, configured to obtain a first message delivery request sent by a sender through a client node of the sender, where the first message delivery request carries a first message to be sent to a receiver and a receiver chain address of the receiver in the blockchain system; a first notification message sending unit, configured to invoke the message contract according to the receiver chain address carried in the first message delivery request, and send a first notification message to the receiver client node, so as to deliver the first message from the sender to the receiver.
The disclosed embodiments provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the blockchain based messaging method as in the above embodiments.
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 that, when executed by at least one processor, causes the at least one processor to implement the blockchain based messaging method as in the above embodiments.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations of the embodiments described above.
In the technical solutions provided in some embodiments of the present disclosure, on one hand, a block chain is used to implement decentralized messaging service, when a sender and a receiver transmit a message, the sender does not need to rely on a third party messaging service, and at the same time, the block chain technology is used to implement messaging service, which can prevent the message from being forged or tampered in the transmission process, thereby implementing data security of the message and protecting privacy of the data; on the other hand, by deploying the message contract in the blockchain system, when the node device in the blockchain system acquires a first message transfer request sent by a sender through a client node of the sender, a first notification message can be sent to a client node of a receiver corresponding to the receiver according to a chain address of the receiver in the blockchain system, which is carried in the first message transfer request, by calling the message contract, so that the first message carried in the first message transfer request can be transferred from the sender to the receiver, wherein the message contract is one of intelligent contracts deployed in the blockchain system, that is, the automatic transfer of the message is realized by using the intelligent contract in the blockchain technology, and when a new first message is received, the receiver can be notified in time, so that the first message is transferred to the receiver in time, and no missing occurs.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 is a block chain network architecture diagram according to an embodiment of the disclosure.
Fig. 2 is a schematic structural diagram of a block according to an embodiment of the disclosure.
Fig. 3 schematically shows a flow chart of a blockchain based messaging method according to an embodiment of the present disclosure.
Fig. 4 schematically illustrates a system architecture diagram of a blockchain-based messaging method according to an embodiment of the present disclosure.
Fig. 5 schematically shows a schematic diagram of a blockchain based messaging method according to another embodiment of the present disclosure.
Fig. 6 schematically illustrates an application scenario diagram of a block chain based messaging method according to an embodiment of the present disclosure.
Fig. 7 schematically illustrates a block diagram of a node device in a blockchain system according to an embodiment of the present disclosure.
FIG. 8 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
The described features, structures, or characteristics of the disclosure may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The drawings are merely schematic illustrations of the present disclosure, in which the same reference numerals denote the same or similar parts, and thus, a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in at least one hardware module or integrated circuit, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and steps, nor do they necessarily have to be performed in the order described. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
In this specification, the terms "a", "an", "the", "said" and "at least one" are used to indicate the presence of at least one element/component/etc.; the terms "comprising," "including," and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.; the terms "first," "second," and "third," etc. are used merely as labels, and are not limiting as to the number of their objects.
The block chain (block chain or block chain) in the embodiment of the disclosure is a distributed account book, and is a technical scheme for collectively maintaining a reliable database in a decentralized and trust-removing manner. Wherein the blockchain network/blockchain system is a network of computing nodes for managing, updating and maintaining one or more blockchain structures. The blockchain network may include a public blockchain network (referred to as a public chain for short), a private blockchain network (referred to as a private chain for short), or a federation blockchain network (referred to as a federation chain for short). The corresponding block chain network can be selected according to the actual application scenario.
Any node in the public chain is open to anyone, and each person can participate in the blockchain to perform calculation, and anyone can download and obtain the data (all accounts) of the complete blockchain.
In some block chain application scenarios, it is not desirable that anyone can participate in the system, and can view all data, and only permitted nodes can participate and view all data, and this block chain structure is called a private chain.
Since the industry and application needing to be kept secret do not need the public chain to be publicly transparent, the alliance chain is produced, the alliance chain is limited to alliance members, and all or part of functions are opened for the members, so that the read-write authority and the accounting rule on the alliance chain are 'privately customized' according to the alliance rule.
The alliance chain only aims at members of a specific certain group and limited third parties, a plurality of preselected nodes are designated as accounting nodes/consensus nodes inside the alliance chain, generation of each block is determined by all the preselected nodes, access nodes of other third parties can participate in transactions but do not ask about accounting processes, and other third parties can carry out limited inquiry through an Application Programming Interface (API) opened by the alliance chain. Generally, a federation chain is applicable to a B2B (Business-to-Business) scenario, such as trading, settlement, or clearing between enterprises. For example, multiple financial institutions may connect together their respective blockchain networks to form a federated network, thereby facilitating data interfacing and collaboration with one another.
To achieve better performance, the federation chain places certain requirements on the configuration and network environment of the consensus or authentication node. With the admission mechanism, the transaction performance can be improved more easily, and problems caused by the participants with uneven participation can be avoided. The processing speed of the alliance chain is higher than that of the public chain, because the number and the identity of the nodes are well defined, a relatively loose consensus mechanism can be used, and therefore the processing speed of data is greatly improved compared with that of the public chain.
Embodiments of the present disclosure are described in detail with reference to federation chains in embodiments of the present disclosure. However, it is contemplated that the disclosed embodiments may be implemented in any suitable blockchain network.
Based on the above description, the embodiments of the present disclosure provide a block chain based message delivery method, where the block chain based message delivery method may be implemented based on a federation chain technology, and a federation chain underlying platform may include processing modules such as user management, basic service, intelligent contract, and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and the identity information management comprises public and private key generation maintenance (account management), key management, user real identity and alliance chain address corresponding relation maintenance (authority management) and the like.
The blockchain technology, as a specific implementation of the distributed ledger, is gradually becoming the preferred way to store data and transaction data in various fields by virtue of its natural advantages of storing and managing data.
A blockchain network/blockchain system is a distributed system that can be formed by connecting a plurality of nodes/node devices (any form of computing device in an access network, such as a server and a terminal device) through a network communication form.
The following detailed description of exemplary embodiments of the disclosure refers to the accompanying drawings.
Fig. 1 is a schematic diagram of an alternative architecture of a blockchain network/blockchain system according to an embodiment of the present disclosure. The block chain network/block chain system comprises a plurality of nodes/node devices, a Peer-To-Peer (P2P) network is formed among the nodes/node devices, and the P2P Protocol is an application layer Protocol operating on a Transmission Control Protocol (TCP). In a blockchain network, any machine, such as a server, a terminal device, may join to become a node/node device, which includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.
Referring to the functions of each node/node device in the blockchain network shown in fig. 1, the related functions include:
1) Routing, a basic function that the node/node device has for supporting communication between the nodes/node devices.
The node/node device may have the following functions in addition to the routing function:
2) And the Block chain comprises a series of blocks (blocks) which are mutually connected according to the generated chronological order, new blocks cannot be removed once being added into the Block chain, and the blocks record the record data submitted by nodes/node equipment in the Block chain network.
3) The application is used for being deployed in a block chain, realizing specific services according to actual service requirements, recording data related to the realization functions to form recorded data, carrying a digital signature in the recorded data to represent a source of task data, and sending the recorded data to other nodes/node devices in the block chain network, so that the other nodes/node devices add the recorded data to a temporary block when the source and integrity of the recorded data are verified successfully.
For example, the services implemented by the application include:
3.1 Wallet) for providing transaction functions of virtual resources, including initiating transaction, i.e. sending transaction records of current transaction to other nodes/node devices in the blockchain network, and storing the record data of transaction in a temporary block of the blockchain as a response for confirming that the transaction is valid after the other nodes/node devices are successfully verified.
3.2 Shared account book) for providing functions of operations such as storage, query and modification of account data, sending record data of the operations on the account data to other nodes/node devices in the block chain network, storing the record data in a temporary block as a response for acknowledging that the account data is valid after the other nodes/node devices verify that the record data is valid, and also sending confirmation to the node/node device initiating the operations.
3.3 Intelligent contracts, computerized agreements) that can enforce the terms of a contract, implemented by code deployed on a shared ledger for execution when certain conditions are met, for completing automated transactions according to actual business requirement code, e.g. querying the logistic status of goods purchased by a buyer, transferring virtual resources of the buyer to the address of a merchant after the buyer signs for goods; of course, smart contracts are not limited to executing contracts for trading, but may also execute contracts that process received information. An intelligent contract is a computer protocol intended to propagate, validate or execute contracts in an informational manner. Smart contracts allow trusted transactions to be conducted without third parties, which transactions are traceable and irreversible.
4) And the consensus is used for solving and ensuring the consistency and correctness of each transaction or data on all accounting nodes. The consensus mechanism of the blockchain is the way to determine that a certain consensus is achieved and that the consensus is maintained. The consensus mechanism of the block chain enables the block chain to still cooperate and complete the operation efficiently in a large scale without depending on centralized organization. As shown in fig. 1, the node with the consensus function is called an accounting node/consensus node.
Referring to fig. 2, after the target block (including the first target block, the second target block, and the third target block) is written into the distributed book of the blockchain network, it may be any block in fig. 2, for example, any one of block 1, block 2, and block 3. Fig. 2 is an optional schematic diagram of a Block Structure (Block Structure) provided in the embodiment of the present disclosure, where the Block information of each Block may include a hash value of a data record stored in the Block (hash value of the Block) and a hash value of a previous Block, and the blocks are connected by the hash value to form a Block chain. The block may include information such as a time stamp at the time of block generation. A blockchain, which is essentially a decentralized database, is a string of data blocks associated using cryptography, each data block containing relevant information for verifying the validity of the information (anti-counterfeiting) and generating the next block.
Each block includes a block header and a block body, the block body contains the transactions included in the block, and the block body maintains a root hash value obtained by calculating all the transactions through a merkle tree.
Thus, the block chain is a series of word records (also called blocks) that are cryptographically connected and protected. Each chunk contains the cryptographic hash of the previous chunk, the corresponding timestamp, and transaction data (which may be represented by a hash value calculated using the merkel tree algorithm), such that the contents of the chunk have tamper-resistant characteristics. The distributed account book concatenated by the block chain technology can effectively record the transaction by multiple parties such as two parties, and can permanently check the transaction.
Fig. 3 schematically shows a flow chart of a blockchain based messaging method according to an embodiment of the present disclosure. The method provided in the embodiment of fig. 3 may be performed by a node device in a blockchain system, such as any one of the nodes/node devices in fig. 1. The node device may be communicatively coupled with the sender client node and the receiver client node.
In the embodiment of the present disclosure, the sender client node may be any electronic device (e.g., a server and/or a terminal) outside the blockchain system, and may perform bidirectional communication with the blockchain system, and the sender may interact with the blockchain system through the sender client node to implement sending of a message. The receiving side client node can be any electronic device outside the blockchain system, and can perform bidirectional communication with the blockchain system, and the receiving side can interact with the blockchain system through the receiving side client node to receive the message.
In the embodiment of the present disclosure, the sender and/or the receiver of the message may be any object, such as an individual, an enterprise, an organization, and the like, which is not limited by the present disclosure, as long as a user with a messaging requirement can implement messaging through the blockchain system. In the following example, enterprise a is the sender of the message and enterprise B is the receiver of the message, and the client node used by enterprise a to communicate with the blockchain system is referred to as the sender client node and the client node used by enterprise B to communicate with the blockchain system is referred to as the receiver client node. In some embodiments, the sending client node and the receiving client node may also be nodes/node devices in a blockchain system, which is not limited by this disclosure.
It is to be understood that the receiver of the message may be one or more, that is, the message may be delivered to one or more receivers at the same time, and in the following description, one receiver is taken as an example for illustration, but the disclosure is not limited thereto.
In the embodiment of the disclosure, a message contract may be deployed in the blockchain system. The message contract, which is an intelligent contract for implementing message delivery between a sender and a receiver, and the address identity contract, which is an intelligent contract for storing and querying a mapping relationship between a receiver identity of a receiver and its receiver chain address in a blockchain system and a mapping relationship between a sender identity of a sender and its sender chain address in the blockchain system, are both intelligent contracts.
As shown in fig. 3, the method provided by the embodiment of the present disclosure may include the following steps.
In step S310, a first message delivery request sent by a sender through the sender client node is obtained, where the first message delivery request carries a first message to be sent to a receiver and a receiver chain address of the receiver in the blockchain system.
In an exemplary embodiment, the node device may be further communicatively connected with a message contract generation node for deploying the message contract into the blockchain system.
In the embodiment of the present disclosure, the node device in the blockchain system may further communicate with a message contract generating node, where the message contract generating node may be any electronic device outside the blockchain system, and may be configured to deploy the generated message contract into the blockchain system. The message contract generating node may be the same as or different from the sender client node and the receiver client node, which is not limited in this disclosure.
In an exemplary embodiment, the method may further include: receiving a transaction request for deploying the message contract sent by the message contract generating node; generating a proposal block for deploying the message contract according to the transaction request for deploying the message contract; consensus is conducted on a proposal block where the message contract is deployed; and determining that the proposal block consensus for deploying the message contract passes, and deploying the message contract into the blockchain system.
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 is a Consensus algorithm combining PoS (Proof of interest), VRF (Verifiable Random Function) and BFT, OCE (Ontology Consensus Engine), and so on.
The VBFT and PBFT consensus algorithm is exemplified below, but the present disclosure is not limited thereto.
A complete consensus process of a PBFT-based block chain network and a VBFT-based Ontology block chain is divided into a proposal phase (proposal), a pre-vote phase (also called endorsement phase, endorse) and a pre-commit phase (commit).
In the embodiment of the disclosure, node devices in a block chain system include a master node and other consensus nodes except the master node in each round of consensus process, in each round of complete consensus process, when any node device in the block chain system receives a transaction request for deploying a message contract, the node device broadcasts the transaction request to other node devices in the block chain system, the master node in the round packages and deploys a proposal block of the message contract in a proposal phase and proposes the broadcast, after the other consensus nodes receive the proposal block for deploying the message contract, each consensus node receives 2f +1 (f is an integer greater than or equal to 0 and satisfies | R | =3f 3, that is, a total of f +1 nodes in the block chain system, which is used for illustration only, and can be determined according to an adopted consensus algorithm, for example, a value can also be half or more than half of the number of nodes R | in the block chain system, and after the proposal block of the message contract is deployed, the proposal block is submitted and submitted; after each consensus node receives 2f +1 pre-submissions for the proposal block deploying the message contract in the pre-submission stage, the proposal block deploying the message contract is settled (namely, stored on the block chain) and the next consensus is started, so that the message contract is deployed into the block chain system.
In an example embodiment, the node apparatus may be further communicatively connected with an address identity contract generation node, which may be used to deploy address identity contracts into the blockchain system; the address identity contract may comprise a mapping between an address of the recipient on a recipient chain in the blockchain system and a recipient identity of the recipient. In other embodiments, the address identity contract may also include a mapping between the sender's address on the sender chain in the blockchain system and the sender's sender identity.
In this embodiment of the present disclosure, the node device in the blockchain system may further communicate with an address identity contract generating node, where the address identity contract generating node may be any electronic device outside the blockchain system, and may be configured to deploy the generated address identity contract into the blockchain system. The address identity contract generating node may be the same as or different from the sender client node, the receiver client node, and the message contract generating node, which is not limited in this disclosure.
In an exemplary embodiment, the method may further include: receiving a transaction request for deploying the address identity contract sent by the address identity contract generating node; generating a proposal block for deploying the address identity contract according to the transaction request for deploying the address identity contract; consensus is made on proposal blocks deploying the address identity contract; determining that a proposal block consensus for deploying the address identity contract passes, and deploying the address identity contract into the blockchain system.
In the embodiment of the disclosure, in each round of complete consensus process, when any node device in the block chain system receives a transaction request of a deployment address identity contract, the transaction request is broadcasted to other node devices in the block chain system, the master node in the round packages and proposes the proposal blocks of the deployment address identity contract in a proposal stage, the other consensus nodes perform pre-voting on the proposal blocks of the deployment address identity contract after receiving the proposal blocks, and after each consensus node receives 2f +1 pre-votes for the proposal blocks of the deployment address identity contract in a pre-voting stage, the pre-submission message for the proposal blocks of the deployment address identity contract is broadcasted and enters a pre-submission stage; after each consensus node receives 2f +1 pre-submissions of the proposal block for deploying the address identity contract in the pre-submission stage, the proposal block for deploying the address identity contract is subjected to settlement (namely, stored on the block chain) and the next consensus is started, so that the address identity contract is deployed into the block chain system.
In an exemplary embodiment, the method may further include: receiving a first registration request sent by the receiver through the receiver client node, where the first registration request may carry the receiver identity identifier and the message contract identifier of the message contract; calling the message contract to generate the receiver chain address corresponding to the receiver identity according to the receiver identity and the message contract identity carried in the first registration request; and sending the receiver identity and the receiver 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 receiver identity and the receiver chain address.
In the embodiment of the present disclosure, the identity of the receiver may adopt any identification information that can uniquely distinguish the receiver, and the identity of the sender may adopt any identification information that can uniquely distinguish the sender, for example, if the receiver and the sender are both enterprises, both the identity of the receiver and the identity of the sender may be names of the enterprises, so the address identity contract may also be referred to as an address name contract at this time. In other embodiments, if both the receiver and the sender are individuals, both the receiver identification and the sender identification may be any one or more of names, mobile phone numbers, identification numbers, and the like of the individuals, which is not limited in this disclosure.
In the embodiment of the disclosure, the receiver may send a first registration request to an arbitrary node device in the blockchain system through the receiver client node to request to register the receiver in the message contract, and therefore, the first registration request may carry the receiver identity and the message contract identity of the message contract. The message contract identifier may be identification information that can uniquely distinguish a message contract from other intelligent contracts deployed in the blockchain system, and may be, for example, a contract account address of the message contract in the blockchain system, or a contract file storage path of the message contract, or a unique identifier generated when the message contract is generated, which is not limited by the present disclosure.
When any node device receives the first registration request, the first registration request may be broadcast to other node devices in the blockchain system to perform consensus on the first registration request, after the consensus passes, a block containing the first registration request is added to the blockchain, and then a message contract matched with the block is called according to the message contract identifier contained in the block to generate a corresponding receiver on-chain address for the receiver identity identifier, that is, an account address of the receiver in the blockchain system.
In other embodiments, the method may further comprise: receiving a second registration request sent by the sender through the sender client node, wherein 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 sender chain address corresponding to the sender identity according to the sender identity and the message contract identity carried in the second registration request.
In the embodiment 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 that the sender be registered in the message contract, and therefore, the second registration request may carry the sender identity and the message contract identity of the message contract. When any node device receives the second registration request, the second registration request may be broadcast to other node devices in the blockchain system to perform consensus on the second registration request, after the consensus passes, a block containing the second registration request is added to the blockchain, and then a message contract matched with the block is called according to the message contract identifier contained in the block to generate a corresponding sender on-chain address for the sender id, that is, an account address of the sender in the blockchain system.
In the embodiment of the present disclosure, the triggering time and the processing time sequence of the first registration request and the second registration request are not limited, and the first registration request and the second registration request may be executed in parallel, or the first registration request may be executed first and then the second registration request may be executed; or, the second registration request is executed first, and then the first registration request is executed.
In this embodiment, the node device may transmit the receiver identity, the receiver chain address generated by the receiver identity, the sender identity, and the sender chain address generated by the sender identity to an address identity contract generation node, for example, the address identity contract generation node may subscribe to a message issued by a certain node device, and when a new chain address (which may be the receiver chain address or the sender chain address) is detected to be generated in the node device, a notification message is automatically pushed to the address identity contract generation node to notify the new chain address and an identity (such as the receiver identity or the sender identity) corresponding to the new chain address, and the address identity contract may generate an address identity according to a mapping relationship between the receiver identity and the receiver chain address and a mapping relationship between the sender identity and the sender chain address, and the receiver identity, the receiver chain address, the sender identity and the sender chain address are stored in association in the address identity contract, and the sender chain address are deployed in the block chain system, so that each node device in the block chain system stores the receiver identity, the receiver chain address, the sender chain address identity, the sender chain address contract, the sender chain address identity, the sender chain address and the sender chain address on the receiver chain address.
In other embodiments, the address identity contract may include a trigger condition and an executed operation, for example, the trigger condition is set that a new generation of an on-chain address is detected in the node device, and the executed operation is to automatically store the newly generated on-chain address in association with an identity thereof when the new generation of the on-chain address is detected. After the address identity contract is set, the address identity contract is firstly deployed to each node device in the block chain system, and when the node device detects that a new on-chain address is generated, the address identity contract is automatically called to trigger the storage of the new on-chain address and the identity thereof in the address identity contract.
In an exemplary embodiment, the method may further include: acquiring a first query request sent by the sender through the sender client node, wherein the first query request carries the identity of the receiver; calling the address identity contract according to the receiver identity carried in the first query request, and acquiring the receiver chain address according to the mapping relation between the receiver chain address and the receiver identity in the address identity contract; and returning the receiver chain address to the sender client node so that the sender client node constructs the first message delivery request according to the receiver chain address.
In an exemplary embodiment, the first messaging request may also carry a sender-side on-chain address of the sender in the blockchain system.
In the embodiment of the present disclosure, when a sender prepares to send a message (referred to as a first message for distinguishing from other messages) to a receiver, the sender may send a first query request to any node device through a sender client node, where it should be noted that, when the sender client node detects a send request for sending a first message, the send request for the first message includes the first message to be sent, a sender chain address, and a receiver identity, and the first query request is automatically triggered to be generated. After receiving the first query request, the node device may broadcast the first query request to other node devices, perform consensus on the first query request, add a block containing the first query request to a block chain after the first query request consensus passes, call an address identity contract, query and acquire a receiver chain address matched with the block according to the receiver identity contained in the block, return the receiver chain address to the sender client node, construct a first message delivery request together with a first message carried in a request for sending the first message and the sender chain address, and send the first message delivery request to any node device in the block chain system.
In other embodiments, when the sending client node detects a sending request for sending a first message, the sending request for sending the first message includes the first message to be sent, a sender identity and a receiver identity, and the first query request and the second query request may be automatically triggered and generated. The second query request is used for querying the sender chain address corresponding to the sender identity. After receiving the second query request, any node device may broadcast the second query request to other node devices, perform consensus on the second query request, add a block containing the second query request to the blockchain after the second query request consensus passes, call an address identity contract, query and acquire a sender on-chain address matched with the block according to the sender identity contained in the block, return the sender on-chain address to the sender client node, construct a first message transfer request together with the first message, the sender on-chain address, and the receiver on-chain address, and send the first message transfer request to any node device in the blockchain system.
In the embodiment of the present disclosure, in the process of constructing the first message delivery request, the manner of acquiring the address on the chain of the receiver (which may also include the address on the chain of the sender) is not limited to the above-mentioned address identity contract manner, and in other embodiments, the manner of a Public Key Infrastructure (PKI) may also be adopted for implementation. For example, a database server may be in communication connection with the blockchain system, obtain a receiver identity and a receiver chain address generated by invoking a message contract in the node device, and a sender identity and a sender chain address generated by invoking a message contract in the node device, store the receiver identity and the receiver chain address, and the sender identity and the sender chain address in a centralized database in an associated manner, when a sender needs to send a first message, send an inquiry request to the centralized database, where the inquiry request carries the receiver identity (and may also include the sender identity) to inquire and obtain the receiver chain address (and may also include the sender chain address), return to the sender client node, construct a first message delivery request together with the first message, the sender chain address, and the receiver chain address, and send the first message delivery request to any node device in the blockchain system.
Any node device receives the first message transmission request, and can broadcast the first message transmission request to other node devices to perform consensus on the first message transmission request, and if the first message transmission request passes the consensus, a block containing the first message transmission request is added to the block chain. The message contract is then invoked to process the first messaging request contained in the block.
In an exemplary embodiment, the method may further include: calling the message contract and creating a contract message queue; calling the message contract to create a receiver message receiving queue corresponding to the receiver chain address; and receiving a first message subscription request sent by the receiver through the receiver client node.
In the embodiment of the present disclosure, after a message contract is successfully deployed into a block chain system, a contract message queue may be maintained by the message contract, where the contract message queue may be used to store entity data of a message (including a first message and a following second message) that is sent and/or received by invoking the contract message, and taking the first message as an example, the entity data of the first message may include entity content of the first message, for example, if the first message is a current mail to be sent, a header (title) of the current mail to be sent and content (body) of the mail may be included, and a sender on-chain address of a sender of the current mail to be sent, a receiver on-chain address of a receiver, a first message identifier allocated to the first message, and the like may also be included.
In an exemplary embodiment, invoking the message contract to create a recipient message receive queue corresponding to an address on the recipient chain may include: receiving a first registration request sent by the receiver through the receiver client node, wherein the first registration request carries the receiver identity identifier and the message contract identifier of the message contract; calling the message contract to generate the receiver chain address corresponding to the receiver identity according to the receiver identity and the message contract identity carried in the first registration request; and creating the receiver message receiving queue corresponding to the address on the receiver chain.
In an exemplary embodiment, the method may further include: and calling the message contract to create a receiver message sending queue corresponding to the receiver chain address, wherein the receiver message sending queue is used for storing a second message identifier of a second message sent by the receiver, and the contract message queue is also used for associating the second message identifier, the target chain address for receiving the second message, the receiver chain address and the second message.
In the embodiment of the present disclosure, in the process of registering a receiver in a message contract, after a receiver chain address is allocated to the receiver, a receiver message receiving queue may be created for the receiver chain address, and a receiver message sending queue may also be created, where the receiver message receiving queue may be used to store a message identifier (for example, may include the first message identifier) of a message (for example, may include the first message) received by the receiver from any sender; the receiver messaging queue may be used to store a message identification (which may include, for example, a second message identification) of a message (which may include, for example, a second message) sent by a receiver to any other receiver, i.e., when in fact the receiver becomes the sender. The second message may be one or more, which is not limited by this disclosure.
In the embodiment of the present disclosure, the destination on-chain address may be an on-chain address of any sender that sends the second message to the receiver.
In an exemplary embodiment, the method may further include: receiving a second registration request sent by the sender through the sender client node, wherein the second registration request carries the sender identity identifier and the message contract identifier of the message contract; calling the message contract to generate the sender chain address corresponding to the sender identity according to the sender identity and the message contract identity carried in the second registration request; and creating a sending party message sending queue corresponding to the address on the sending party chain.
In the embodiment of the disclosure, in the process of registering a sender to a message contract, after a sender is allocated with a sender on-chain address, a sender message receiving queue can be created for the sender on-chain address, and a sender message sending queue can also be created, wherein the sender message receiving queue can be used for storing a message identifier of a message received by the sender from any receiver, namely the sender actually becomes the receiver; the sender messaging queue may be configured to store a message identification (e.g., may include a first message identification) of a message (e.g., may include a first message) sent by the sender to any recipient. The first message may be one or more, which is not limited by this disclosure.
In an exemplary embodiment, the method may further include: and adding the first message identification to the sending side message sending queue.
In the embodiment of the present disclosure, when the first message identifier is added to the tail of the message receiving queue of the receiving party, the first message identifier may also be added to the tail of the message sending queue of the sending party, that is, it is used to record that the first message is sent from the sending party to the receiving party.
In the disclosed embodiment, a contract message queue, a sending party message receiving queue, a sending party message sending queue, a receiving party message receiving queue and a receiving party message sending queue are created simultaneously through a message contract, the contract message queue is used for storing relevant entity data of messages sent and/or received through the message contract, the sending party message receiving queue is used for storing message Identifications (ID) of the messages received by the sending party, the sending party message sending queue is used for storing the message identifications of the messages sent by the sending party, the receiving party message receiving queue is used for storing the message identifications of the messages received by the receiving party, and the receiving party message sending queue is used for storing the message identifications of the messages sent by the receiving party; on the other hand, global message identifiers can be distributed to all messages stored in a contract message queue through contract messages, the message identifiers of all the messages and corresponding related entity data are stored in the contract message queue in a related mode, the message identifiers of the messages are stored in a sending message receiving queue, a sending message sending queue, a receiving message receiving queue and a receiving message, namely the message identifiers are used as indexes, when the related entity data of the messages need to be accessed, the related entity data of the corresponding messages in the contract message queue can be matched through the message identifiers, and the accuracy of message transmission is guaranteed.
However, the present disclosure is not limited to this, in other embodiments, the message contract may also store the message identifiers of the messages and their related entity data in the sending side message receiving queue, the sending side message sending queue, the receiving side message receiving queue, and the receiving side message sending queue without maintaining the contract message queue, and directly access the related entity data in the corresponding queues during the access, for example, the sending side may access the related entity data of the messages received by the sending side stored in the sending side message receiving queue and the related entity data of the messages sent by the sending side stored in the sending side message sending queue by using the sending side chain address. At this time, a global message identifier of each message can be generated through a message contract, that is, the message identifier of each message is unique in the blockchain system regardless of which queue it is stored in. The local message identifier may also be generated by the message contract of the message in each sending-side message receiving queue, the local message identifier is generated for the message in each sending-side message sending queue, the local message identifier is generated for the message in each receiving-side message receiving queue, and the local message identifier is generated for the message in each receiving-side message sending queue, for example, the sending-side message sending queue stores the message identifier 1, and the receiving-side message sending queue may also store the message identifier 1, because at this time, the two messages with the same message identifier can be distinguished by the sending-side chain address and the receiving-side chain address.
In the embodiment of the present disclosure, the node device may further receive a first message subscription request sent by the receiver through the receiver client node, so that the first message subscription request is used for the receiver client node to subscribe to the notification message (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, the node device triggers sending of a corresponding notification message to the receiver client node device to inform the receiver that it receives the new message from the sender.
In step S320, the message contract is invoked according to the receiver chain address carried in the first message delivery request, and a first notification message is sent to the receiver client node, so as to deliver the first message from the sender to the receiver.
In an exemplary embodiment, invoking the message contract according to the receiver on-chain address carried in the first messaging request, and sending a first notification message to the receiver client node so as to deliver the first message from the sender to the receiver may include: calling the message contract according to the receiver chain address carried in the first message transmission request to generate a first message identifier of the first message; storing the first message identification, the sender on-chain address, the receiver on-chain address and the first message association into the contract message queue by using the message contract; adding, by the message contract, the first message identification to the recipient message receive queue; responding to the first message subscription request, and when detecting that the first message identifier is newly added in the message receiving queue of the receiving party, sending the first notification message to the client node of the receiving party, wherein the first notification message carries the first message identifier; and acquiring the first message and the receiver chain address from the contract message queue according to the first message identifier, and sending the first message to the receiver client node according to the receiver chain address.
In this embodiment of the disclosure, the first notification message may carry a first message identifier, and after the receiving-side client node obtains the first notification message, if it is desired to access the first message, the first notification message may trigger sending a first access request to the node device, where the first access request carries the first message identifier and a receiving-side chain address, and the node device that receives the first access request may find, according to the receiving-side chain address, that the first message identifier exists in a receiving-side message receiving queue corresponding to the receiving-side chain address, and then obtain the first message from a contract message queue according to the first message identifier, and return the first message to the receiving-side client node, so as to implement transmission of the first message. In other embodiments, the first message may also be carried directly in the first notification message for transmission to the recipient client node.
In an exemplary embodiment, the first messaging request may further include a sender on-chain address of the sender in the blockchain system. Wherein the method may further comprise: calling the message contract to create a black and white list storage space of the receiver corresponding to the address on the chain of the receiver; receiving black and white list information of the receiver sent by the receiver through the client node of the receiver; and calling the message contract, and storing the black and white list information of the receiver into the black and white list storage space of the receiver.
In the embodiment of the present disclosure, in the process of creating the receiving side message receiving queue and the receiving side message sending queue by invoking the message contract, a receiving side blacklist storage space may be further created to store receiving side blacklist information, where the receiving side blacklist information may include receiving side blacklist information and/or receiving side whitelist information, and the receiving side blacklist information refers to sending side information that the receiving side rejects receiving, such as a sending side identity and/or a sending side chain address that rejects receiving. The white list information of the receiver refers to the information of the sender that the receiver allows to receive, such as the identification of the sender and/or the address on the sender chain that the receiver allows to receive.
In the embodiment of the present disclosure, in the process of creating the sender message receiving queue and the sender message sending queue by invoking the message contract, a sender blacklist storage space may also be created to store sender blacklist information, where the sender blacklist information may include sender blacklist information and/or sender white list information, and the sender blacklist information refers to other sender information that the sender rejects receiving, such as other sender identity identifiers and/or sender chain addresses that reject receiving. Sender white list information refers to other sender information that the sender is allowed to receive, such as other sender identities and/or sender on-chain addresses that are allowed to receive.
In an exemplary embodiment, invoking the message contract according to the receiver chain address carried in the first messaging request, and sending a first notification message to the receiver client node may include: calling the message contract according to the sender chain address carried in the first message transmission request, and judging whether the sender chain address is in the black-and-white list information of the receiver; and if the address on the sender chain is not in the receiver blacklist information in the receiver blacklist and whitelist information or the address on the sender chain is in the receiver whitelist information in the receiver blacklist and whitelist information, sending the first notification message to the receiver client node.
In the embodiment of the disclosure, when the receiver blacklist information exists, if the address on the sender chain is determined to be in the receiver blacklist information, the operation is ended, the first message identifier is not generated, and the first message is not transmitted to the receiver; and when the white list information of the receiver exists, if the address on the chain of the sender is judged not to be in the white list information of the receiver, ending the operation, generating no first message identification and transmitting the first message to the receiver. If the receiver blacklist information and the receiver white list information exist at the same time, if the address on the sender chain is in the receiver blacklist information and is not in the receiver white list information, the operation is ended, the first message identifier cannot be generated, and the first message cannot be transmitted to the receiver.
It should be noted that, when determining whether the address on the sender chain is in the black-and-white list information of the receiver, if the sender identity that the receiver rejects receiving and the sender identity that the receiver allows receiving are stored in the black-and-white list information of the receiver, the address identity contract may be invoked to query and obtain the corresponding address on the sender chain for determination. On the contrary, if the receiver blacklist information stores the sender chain address refused to be received by the receiver and the sender chain address allowed to be received, the address identity contract can be called to inquire to obtain the corresponding sender identity so as to judge whether the sender identity is in the receiver blacklist information or not.
In an exemplary embodiment, the method may further include: receiving a first message access request sent by the receiver through the receiver client node, wherein the first message access request carries the receiver chain address; responding to the first message access request, calling the message contract, and accessing the message sending queue of the receiving party and the message receiving queue of the receiving party according to the address on the chain of the receiving party; accessing the second message in the contract message queue according to the second message identifier in the receiver message sending queue, and accessing the first message in the contract message queue according to the first message identifier in the receiver message receiving queue.
In other embodiments, the method may further comprise: receiving a second message access request sent by the sender through the sender client node, wherein the second message access request carries the sender chain address; responding to the second message access request, calling the message contract, and accessing the message sending queue of the sending party and the message receiving queue of the sending party according to the address on the chain of the sending party; and accessing the corresponding message in the contract message queue according to the message identifier in the message sending queue of the sender, and accessing the corresponding message in the contract message queue according to the message identifier in the message receiving queue of the sender.
In the embodiment of the disclosure, the access authority of the message can be formulated through the message contract, namely, only the sending party message sending queue and the sending party message receiving queue of the sending party can be accessed according to the sending party chain address, and the related entity data corresponding to the messages sent and received by the sending party which are actually maintained in the contract message queue has the access authority but cannot directly access the contract message queue; similarly, only the base-party message sending queue and the base-party message receiving queue of the base party can be accessed according to the link address of the receiver, and related entity data corresponding to messages sent and received by the base party and actually maintained in the contract message queue has access authority but cannot directly access the contract message queue, so that the privacy security of the related entity data of the messages of different senders and receivers is realized.
On one hand, the block chain based message transmission method provided by the embodiment of the disclosure realizes decentralized message transmission service by using the block chain, and when a message is transmitted between a sender and a receiver, the message transmission service does not need to depend on a third party any more; on the other hand, by deploying the message contract in the blockchain system, when the node device in the blockchain system acquires a first message transfer request sent by a sender through a client node of the sender, a first notification message can be sent to a client node of a receiver corresponding to the receiver according to a chain address of the receiver in the blockchain system, which is carried in the first message transfer request, by calling the message contract, so that the first message carried in the first message transfer request can be transferred from the sender to the receiver, wherein the message contract is one of intelligent contracts deployed in the blockchain system, that is, the automatic transfer of the message is realized by using the intelligent contract in the blockchain technology, and when a new first message is received, the receiver can be notified in time, so that the first message is transferred to the receiver in time, and no missing occurs.
Fig. 4 schematically shows a system architecture diagram of a blockchain-based messaging method according to an embodiment of the present disclosure.
As shown in fig. 4, it is assumed that node devices in the blockchain system 401 may include a first node device 4011 and a second node device 4012. Each of the first node apparatus 4011 and the second node apparatus 4012 may be one or more.
The message contract generating node 402, the address identity contract generating node 403, the sender client node 404, and the receiver client node 405 may each be communicatively connected to the blockchain system 401.
The sender client node 404 is for example communicatively connected to a first node device 4011 and the receiver client node 405 is for example communicatively connected to a second node device 4011, and it is assumed that the message contract generating node 402 and the address identity contract generating node 403 are both communicatively connected to the first node device 4011.
Fig. 5 schematically shows a schematic diagram of a blockchain based messaging method according to another embodiment of the present disclosure. As shown in fig. 5, the method provided by the embodiment of the present disclosure may include the following steps.
In step S501, a message contract is deployed in the blockchain system, and a contract message queue is created.
For example, the message contract generating node 402 in the embodiment of fig. 4 may be used to send a transaction request for deploying the message contract to the first node device 4011 in the blockchain system 401, and assuming that the first node device 4011 is the master node of the 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 perform 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 into the blockchain system. The specific deployment process can refer to the contents of the above embodiments.
In step S502, a first registration request sent by a receiver client node is received, where the first registration request carries a receiver identity identifier and a message contract identifier.
In step S503, the message contract is invoked to generate a receiver chain address corresponding to the receiver id.
For example, as shown in fig. 4, the receiver client node 405 sends a first registration request to the second node device 4012, and the second node device 4012 may broadcast the first registration request to each first node device 4011 to perform consensus on the first registration request, and after the consensus passes, invoke a message contract to generate a receiver chain address corresponding to the receiver identity.
In step S504, a second registration request sent by the sending client node is received, where the second registration request carries the sending identity identifier and the message contract identifier.
In step S505, a message contract is invoked to generate a sender chain address corresponding to the sender id.
For example, as shown in fig. 4, the sender client node 404 sends a second registration request to the first node device 4011, and the first node device 4011 may broadcast the second registration request to each second node device 4012 to perform consensus on the second registration request, and after the consensus is passed, invoke a message contract to generate a sender chain address corresponding to the sender id.
In step S506, an address identity contract is deployed in the blockchain system.
For example, the address identity contract generation node 403 in the embodiment of fig. 4 may be used to send a transaction request for deploying an address identity contract to the first node device 4011 in the blockchain system 401, and assuming that the first node device 4011 is a master node of the 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 perform consensus on the proposal block for deploying the address identity contract, determines that the proposal block for deploying the address identity contract passes the consensus, and deploys the address identity contract into the blockchain system. The specific deployment process can refer to the contents of the above embodiments.
In step S507, a receiving side message receiving queue, a receiving side message sending queue, and a receiving side black-and-white list storage space corresponding to the address on the receiving side chain are created.
After the message contract is called to create the address on the receiver chain, a receiver message receiving queue, a receiver message sending queue and a receiver black-and-white list storage space corresponding to the address on the receiver chain may be created, and the specific process may refer to the description of the above embodiment.
In step S508, a sending side message receiving queue, a sending side message sending queue and a sending side black and white list storage space corresponding to the addresses on the sending side chain are created.
After the message contract is called to create the address on the sender chain, a sender message receiving queue, a sender message sending queue, and a sender black-and-white list storage space corresponding to the address on the sender chain may be created, and the specific process may refer to the description of the above embodiment.
In step S509, a first message subscription request sent by the recipient client node is received.
For example, the second node device 4012 in the embodiment of fig. 4 receives a first subscription request sent by the recipient client node 405, so as to subscribe to a first notification message sent by the second node device 4012, where the first notification message is used to notify the recipient client node 405 that a new first message is received in a recipient message receiving queue in the second node device 4012.
In step S510, a first message delivery request sent by the sender client node is obtained, where the first message delivery request carries a first message, an address on the receiver chain and an address on the sender chain, and the address on the receiver chain is obtained by querying an address identity contract.
The details of the above embodiments may be referred to how to obtain the recipient chain address by querying the address identity contract.
In step S511, if the sender-side link address is not in the recipient blacklist information or in the recipient whitelist information, a message contract is invoked to generate a first message identifier of the first message.
For example, the first node device 4011 in the embodiment of fig. 4 receives a first message delivery request sent by the sender client node 404, and the first node device 4011 broadcasts the first message delivery request to each of the second node devices 4012 to perform consensus on the first message delivery request, and after the consensus is passed, may determine whether an address on the sender chain is in the recipient blacklist information and/or the recipient whitelist information.
In step S512, the first message identifier, the sender on-chain address, the receiver on-chain address, and the first message association are stored in a contract message queue.
In step S513, the first message identification is added to the receiver message reception queue and the first message identification is added to the sender message transmission queue.
In step S514, in response to the first message subscription request, when detecting that the first message identifier is newly added to the receiving queue of the receiving party message, a first notification message is sent to the receiving party client node.
In step S515, the first message and the receiver-side chain address are obtained from the contract message queue according to the first message identifier, and the first message is sent to the receiver-side client node according to the receiver-side chain address.
The method provided by the embodiment of the present disclosure is illustrated below with reference to fig. 6, but the present disclosure is not limited thereto. In other embodiments, the messages communicated in embodiments of the present disclosure may be any type of messages such as chat messages in instant messaging, contracts in business collaboration, and the like.
In a traditional enterprise mailbox scheme, a third-party mailbox service is required to be used for storing and forwarding, a mailbox system cannot guarantee that mail delivery can be completed certainly, meanwhile, sent mail information cannot be forged or tampered, and certain challenges exist in safety and privacy.
Fig. 6 schematically illustrates an application scenario diagram of a block chain based messaging method according to an embodiment of the present disclosure.
In the embodiment of fig. 6, taking the sent message as an example of a mail, the message contract may be referred to as a message mailbox contract 600, that is, an intelligent contract for implementing delivery services of messages of this type of mail, and taking the receiving party and the sending party as different enterprises and taking names of the enterprises as identification labels as examples, the address identification contract may be referred to as an address name contract 700, and the message identification of each message may be referred to as a mail identification (mail-id) of the corresponding mail.
The embodiment of fig. 6 provides an enterprise message mailbox scheme based on a block chain intelligent contract, that is, multiple parties of an enterprise co-establish a federation chain, and deploy a message mailbox contract 600, that is, messages or mails between enterprises can be safely and efficiently delivered by means of the block chain, access rights and data security of different messages or mails can be realized by means of the message mailbox contract 600, and meanwhile, the delivered messages or mails are guaranteed to be real and not to be tampered.
It will be appreciated that enterprise a and enterprise B do not require the generation of one node device on the federation chain, so long as enterprise a or enterprise B can connect to the federation chain.
As shown in fig. 6, the message delivery method provided by the embodiment of the present disclosure relies on a message mailbox contract 600 and an address name contract 700, where the address name contract 700 is mainly used to record a mapping relationship between an on-chain address of an associated enterprise and an identity (e.g., name) of the enterprise, for example, the address name contract may be deployed on each node device in a federation chain, or may be implemented in an off-chain PKI manner, and a centralized database may also be constructed, for example, a third party organization stores a correspondence relationship between the name of the enterprise and the on-chain address.
The message mailbox contract 600 mainly includes a messaging mail group and a contract message queue (which may also be referred to as a message mail queue in the embodiment of fig. 6, and is mainly used for storing mail entity data of each mail). Where the message mail group is assigned by on-chain enterprises registered in message mailbox contract 600, each registered enterprise having an on-chain address identifier, a black/white on-chain address list for the corresponding enterprise may be maintained in the message mail group indicating senders that are allowed to receive or reject received messages.
For example, address a is transmitted to each device node, and a message mail group that allocates an independent memory space as address a is registered. Meanwhile, a message sending queue and a message receiving queue are respectively maintained, mail-ids (i.e. message identifiers in the embodiment of fig. 6 may be referred to as mail identifiers) are maintained in the message mail queue, the message sending queue and the message receiving queue according to sending or receiving time sequence, and data of actual message mail entities, i.e. related entities of mails, are stored in the message mail queue of the message mailbox contract 600 and are mapped and maintained through indexes (e.g. mail-ids).
The mail-ids in the embodiment of FIG. 6 are global, i.e., each mail-id in the message mail queue, the message sending queue, and the message receiving queue of the message mailbox contract 600 is unique, and may be generated, for example, by the time of sending or receiving.
Assuming that the message mail box contract 600 and the address name contract 700 have been deployed in a blockchain system, a contract message queue 610 is maintained in the message information contract 600, and a mapping between the address a of business a and the name xxxx1 of business a, and a mapping between the address B of business B and the name xxx2 of business B have been maintained in the address name contract 700.
Assuming that an enterprise A sends a mail to an enterprise B, the on-chain address of the enterprise A at the moment is the on-chain address of a sender, the on-chain address of the enterprise B is the on-chain address of a receiver, the name xxxx1 of the enterprise A is a sender identity, the name xxxx2 of the enterprise B is a receiver identity, a blacklist/whitelist storage space allocated for the enterprise A is called a sender blacklist and whitelist storage space, blacklist information refused to be received by the enterprise A and/or white list information allowed to be received by the enterprise A, the blacklist information refused to be received by the enterprise A is called sender blacklist information, and white list information allowed to be received by the enterprise A is called sender white list information; the blacklist and white list storage space allocated for the enterprise B is called as a receiver blacklist and white list storage space, the blacklist information which is refused to be received by the enterprise B and/or the white list information which is allowed to be received by the enterprise B, which are stored in the blacklist and white list storage space allocated for the enterprise B, is called as receiver blacklist and white list information, the blacklist information which is refused to be received by the enterprise B is called as receiver blacklist information, and the white list information which is allowed to be received by the enterprise B is called as receiver white list information. And the client node that enterprise a uses to communicatively connect to the blockchain system is referred to as the sender client node, and the client node that enterprise B uses to communicatively connect to the blockchain system is referred to as the receiver client node.
The message mailbox contract 600 may be configured to allocate an independent storage space 620 for enterprise a according to an address on a link of enterprise a, store the address a, a message sending queue 622 (when enterprise a sends a mail, the message sending queue 622 may be referred to as a sending-side message sending queue), a message receiving queue 623 (when enterprise a sends a mail, the message receiving queue 623 may be referred to as a sending-side message receiving queue), and further allocate a black-and-white list storage space 621 (when enterprise a sends a mail, the black-and-white list storage space 621 may be referred to as a sending-side black-and-white list storage space) to store black-and-white list information of a sending side.
The message mailbox contract 600 may further be configured to allocate an independent storage space 630 for the enterprise B according to the address of the enterprise B on the chain, store the address B, the message sending queue 632 (when the enterprise B receives the mail, the message sending queue 632 may be referred to as a recipient message sending queue), the message receiving queue 633 (when the enterprise B receives the mail, the message receiving queue 633 may be referred to as a recipient message receiving queue), and further allocate a black and white list storage space 631 (when the enterprise B receives the mail, the black and white list storage space 631 may be referred to as a recipient black and white list storage space) to store the recipient black and white list information.
It will be appreciated that when enterprise a receives mail, the send message (send) queue 622 may be referred to as a recipient message send queue, the receive message (from) queue 623 may be referred to as a recipient message receive queue, the blacklist and whitelist storage space 621 may be referred to as a recipient blacklist and whitelist storage space, and the corresponding stored blacklist and/or whitelist information that enterprise a has denied receipt and/or allowed receipt is referred to as recipient blacklist and whitelist information, and the client node that enterprise a uses to communicatively connect to the blockchain system is referred to as a recipient client node. When enterprise B sends mail, message sending queue 632 may be referred to as a sending side message sending queue, message receiving queue 633 may be referred to as a sending side message receiving queue, blacklist and white list storage space 631 may be referred to as a sending side blacklist and white list storage space, blacklist and/or white list information which is stored and refused to receive and/or allowed to receive by enterprise B is referred to as sending side blacklist and white list information, and a client node which enterprise B uses for communication connection to the blockchain system is referred to as a sending side client node.
In the embodiment of fig. 6, it is assumed that enterprise a has previously sent 3 mails whose mail-ids are assumed to be 1, 2, and 3, respectively, through the message mailbox contract 600, and therefore, the mail-id 1 of mail 1, the mail-id 2 of mail 2, and the mail-id 3 of mail 3 are stored in the sending-side message sending queue 622 in order of sending time. Correspondingly, the contract message queue 610 stores the related entity data of mail 1, mail 2 and mail 3 in order.
As shown in fig. 6, assuming that current enterprise a desires to send a new mail (which may also be referred to as a message mail) to enterprise B, enterprise B is first queried for its on-chain address B by address name contract 700 and then sent the message mail by message mailbox contract 600. The message mailbox contract 600 may create a message mail entity (i.e., related entity data) in a message mail queue, such as from address a, sent to address b, titled "test" (test), and mail content "hello", and assign a mail-id of 4, while recording the mail-id =4 at the end of the message send queue 622 for address a. The mail-id =4 is recorded at the tail of the message reception queue 633 of the address b. The corresponding business B of address B is then notified of the message event in the form of a message event on the chain, for example by sending a first notification message.
After that, it is assumed that the enterprise a receives 4 mails in turn via the message mailbox contract 600, the mail-ids of the 4 mails are assumed to be 5, 6, 7 and 8, respectively, and therefore, the mail-id 5 of the mail 5, the mail-id 6 of the mail 6, the mail-id 7 of the mail 7 and the mail-id 8 of the mail 8 are stored in the sender message receiving queue 623. Correspondingly, message mail entities of mail 5, mail 6, mail 7, and mail 8 are created in the message mail queue.
After that, assuming that the enterprise B has sent the mail 9 again through the message contract 600, the mail-id =9 is recorded at the tail of the message sending queue 632 of the address B, and correspondingly, the message mail entity of the mail 9 is created in the message mail queue.
In the embodiment of fig. 6, it is assumed that mails received or sent through the message mailbox contract 600 are all stored in the same message mail queue, but the present disclosure is not limited thereto, and in other embodiments, the message mailbox contract may configure different message mail queues for different addresses on a chain, store message mail entities of the same address on the chain into the same message mail queue, and may establish a mapping relationship between each message mail queue and a message receiving queue and a message sending queue of the corresponding address on the chain. In other embodiments, the message mail entity may also be directly stored in the message receiving queue and the message sending queue corresponding to the on-chain address, which is not limited by the present disclosure.
In the embodiment of fig. 6, the access authority of the message mail may also be formulated through a message mailbox contract, that is, an address on a chain only can access a message sending queue and a message receiving queue of the chain, and has an access authority to a message mail entity corresponding to a mail-id actually maintained in the message mail queue, but cannot directly access the message mail queue of the message mailbox contract, thereby ensuring privacy security of message mail data of different enterprises.
The method provided by the embodiment of the disclosure is a message mailbox scheme based on a block chain intelligent contract, the block chain and a message mailbox between enterprises are combined together, decentralized and trusted message mailbox service is realized through an address name contract and a message mailbox intelligent contract without depending on mailbox service of a third party, and the method is realized through a block chain technology, for example, an enterprise B can subscribe a message of a certain node device on the chain, such as a second node device, and when the second node device detects that a mail is sent to the enterprise B, a first notification message is sent to a client node corresponding to the enterprise B to notify the enterprise B, so that the mail delivery can be completed. In addition, because the transaction data on the chain needs signature verification, the authenticity and the non-falsification of message delivery among enterprises can be ensured, and the privacy and safety problem of the enterprise message data is solved through a certain strategy.
Fig. 7 schematically illustrates a block diagram of a node device in a blockchain system according to an embodiment of the present disclosure. The node device in the embodiment of fig. 7 may be communicatively coupled to a sender client node and a receiver client node. A message contract may be deployed in a blockchain system. As shown in fig. 7, a node apparatus 700 in a blockchain system may include: a first messaging request acquisition unit 710 and a first notification message transmission unit 720.
The first message delivery request obtaining unit 710 may be configured to obtain a first message delivery request sent by a sender through the sender client node, where the first message delivery request carries a first message to be sent to a receiver and a receiver chain address of the receiver in the blockchain system.
The first notification message sending unit 720 may be configured to invoke the message contract according to the receiver chain address carried in the first message delivery request, and send a first notification message to the receiver client node, so as to deliver the first message from the sender to the receiver.
On one hand, the node device in the blockchain system provided by the embodiment of the disclosure realizes decentralized message delivery service by using the blockchain, and when a sender and a receiver deliver a message, the message delivery service does not need to depend on the message delivery service of a third party any more, and meanwhile, the message delivery service is realized by using the blockchain technology, so that the message can be prevented from being forged or tampered in the delivery process, thereby realizing the data security of the message and protecting the privacy of the data; on the other hand, by deploying the message contract in the blockchain system, when the node device in the blockchain system acquires a first message transfer request sent by a sender through a client node of the sender, a first notification message can be sent to a client node of a receiver corresponding to the receiver according to a chain address of the receiver in the blockchain system, which is carried in the first message transfer request, by calling the message contract, so that the first message carried in the first message transfer request can be transferred from the sender to the receiver, wherein the message contract is one of intelligent contracts deployed in the blockchain system, that is, the automatic transfer of the message is realized by using the intelligent contract in the blockchain technology, and when a new first message is received, the receiver can be notified in time, so that the first message is transferred to the receiver in time, and no missing occurs.
In an exemplary embodiment, the first messaging request may also carry a sender-side on-chain address of the sender in the blockchain system. The node device 700 in the blockchain system may further include: a contract message queue creating unit, which can be used to invoke the message contract and create a contract message queue; a receiving party message receiving queue creating unit, configured to invoke the message contract, and create a receiving party message receiving queue corresponding to the address on the receiving party chain; the first message subscription request receiving unit may be configured to receive a first message subscription request sent by the receiver through the receiver client node.
The first notification message sending unit 720 may include: a first message identifier generating unit, configured to invoke the message contract according to the receiver chain address carried in the first message delivery request, and generate a first message identifier of the first message; a first message information entity content storage unit operable to store the first message identifier, the sender-side chain address, the receiver-side chain address, and the first message association into the contract message queue using the message contract; a first message identifier adding unit of the receiving side message receiving queue, configured to add the first message identifier to the receiving side message receiving queue through the message contract; a first notification message delivery unit, configured to respond to the first message subscription request, and when it is detected that the first message identifier is newly added to the receiving-side message receiving queue, send the first notification message to the receiving-side client node, where the first notification message carries the first message identifier; the first message sending unit may be configured to obtain the first message and the receiver-side chain address from the contract message queue according to the first message identifier, and send the first message to the receiver-side client node according to the receiver-side chain address.
In an exemplary embodiment, the receiving-side message reception queue creating unit may include: a first registration request receiving unit, configured to receive a first registration request sent by the receiver through the receiver client node, where the first registration request carries the receiver identity identifier and the message contract identifier of the message contract; a receiver chain address generating unit, configured to invoke the message contract to generate the receiver chain address corresponding to the receiver identity identifier according to the receiver identity identifier and the message contract identifier carried in the first registration request; and the receiving-side message receiving queue creating unit may be configured to create the receiving-side message receiving queue corresponding to the address on the receiving-side chain.
In an exemplary embodiment, the node apparatus 700 in the blockchain system may further include: a second registration request receiving unit, configured to receive a second registration request sent by the sender through the sender client node, where the second registration request carries the sender identity identifier and a message contract identifier of the message contract; a sender chain address generating unit, configured to invoke the message contract to generate a sender chain address corresponding to the sender identity according to the sender identity and the message contract identity carried in the second registration request; a sending party message sending queue creating unit, configured to create a sending party message sending queue corresponding to the address on the sending party chain; the sending side message sending queue first message identifier adding unit may be configured to add the first message identifier to the sending side message sending queue.
In an exemplary embodiment, the node apparatus 700 in the blockchain system may further include: a receiving-side message sending queue creating unit, configured to invoke the message contract, and create a receiving-side message sending queue corresponding to the receiving-side chain address, where the receiving-side message sending queue is used to store a second message identifier of a second message sent by the receiving side, and the contract message queue is further used to store the second message identifier, a target-side chain address for receiving the second message, the receiving-side chain address, and the second message in an associated manner; a first message access request receiving unit, configured to receive a first message access request sent by the receiver through the receiver client node, where the first message access request carries the receiver chain address; a receiving side sending and receiving queue access unit, configured to respond to the first message access request, invoke the message contract, and access the receiving side message sending queue and the receiving side message receiving queue according to the receiving side chain address; the receiving-side receiving-sending message access unit may be configured to access the second message in the contract message queue according to the second message identifier in the receiving-side message sending queue, and access the first message in the contract message queue according to the first message identifier in the receiving-side message receiving queue.
In an exemplary embodiment, the first messaging request may further include a sender on-chain address of the sender in the blockchain system. The node device 700 in the blockchain system may further include: a receiving party black and white list storage space creating unit, configured to invoke the message contract, and create a receiving party black and white list storage space corresponding to the address on the receiving party chain; the receiving unit of black and white list information of the receiving party, can be used for receiving the black and white list information of the receiving party that the said receiving party sends through the customer end node of the said receiving party; the receiver blacklist information storage unit may be configured to invoke the message contract, and store the receiver blacklist and whitelist information to the receiver blacklist and whitelist storage space.
The first notification message sending unit 720 may include: a black-and-white list determining unit, configured to call the message contract according to the sender chain address carried in the first message delivery request, and determine whether the sender chain address is in the black-and-white list information of the receiver; the first notification message determining unit may be configured to send the first notification message to the receiver client node if the sender chain address is not in the receiver blacklist information in the receiver blacklist and whitelist information or the sender chain address is in the receiver whitelist information in the receiver blacklist and whitelist information.
In an exemplary embodiment, the node device may be further communicatively connected with a message contract generation node, which may be used to deploy the message contract into the blockchain system. The node device 700 in the blockchain system may further include: a message contract transaction request receiving unit, configured to receive a transaction request for deploying the message contract sent by the message contract generating node; a deployed message contract proposal block generation unit, configured to generate a proposal block for deploying the message contract according to a transaction request for deploying the message contract; a message contract proposal block consensus deployment unit, which is used for consensus on the proposal blocks for deploying the message contract; and the message contract deployment unit can be used for determining that a proposal block for deploying the message contract passes through, and deploying the message contract into the blockchain system.
In an exemplary embodiment, the node device may be further communicatively connected with an address identity contract generation node, which may be used to deploy address identity contracts into the blockchain system.
The address identity contract may comprise a mapping between an address of the receiver on a chain of receivers in the blockchain system and a receiver identity of the receiver.
The node device 700 in the blockchain system may further include: a deployed address identity contract transaction request receiving unit, configured to receive a transaction request for deploying an address identity contract sent by the address identity contract generation node; a deployed address identity contract proposal block generation unit, configured to generate a proposal block for deploying the address identity contract according to a transaction request for deploying the address identity contract; the deployment address identity contract proposal block consensus unit can be used for carrying out consensus on the proposal blocks for deploying the address identity contracts; the address identity contract deployment unit may be configured to determine that a proposed block consensus for deploying the address identity contract passes, and deploy the address identity contract into the blockchain system.
In an exemplary embodiment, the node apparatus 700 in the blockchain system may further include: a first registration request receiving unit, configured to receive a first registration request sent by the receiver through the receiver client node, where the first registration request carries the receiver identity identifier and the message contract identifier of the message contract; a receiver chain address generating unit, configured to invoke the message contract to generate the receiver chain address corresponding to the receiver identity identifier according to the receiver identity identifier and the message contract identifier carried in the first registration request; the receiver chain address sending unit may be configured to send the receiver identity identifier and the receiver chain address thereof to the address identity contract generating node, so that the address identity contract generating node generates the address identity contract according to the receiver identity identifier and the receiver chain address thereof.
In an exemplary embodiment, the node apparatus 700 in the blockchain system may further include: a first query request obtaining unit, configured to obtain a first query request sent by the sender through the sender client node, where the first query request carries the identity of the receiver; a receiver chain address obtaining unit, configured to invoke the address identity contract according to the receiver identity identifier carried in the first query request, and obtain the receiver chain address according to a mapping relationship between the receiver chain address and the receiver identity identifier in the address identity contract; and the receiver chain address returning unit may be configured to return the receiver chain address to the sender client node, so that the sender client node constructs the first message delivery request according to the receiver chain address.
Other contents of the node device in the blockchain system of the embodiment of the present disclosure may refer to the above-described embodiments.
It should be noted that although in the above detailed description several units of the device for action execution are mentioned, this division is not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, in accordance with embodiments of the present disclosure. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Referring now to FIG. 8, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present application. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
Referring to fig. 8, an electronic device provided in an embodiment of the present disclosure may include: a processor 801, a communication interface 802, a memory 803, and a communication bus 804.
Wherein the processor 801, the communication interface 802 and the memory 803 communicate with each other via a communication bus 804.
Alternatively, 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 programs. The memory 803 is used to store programs. The program may comprise a computer program comprising computer operating instructions. Wherein, can include in the procedure: and (5) a program of the video client.
The processor 801 may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement embodiments of the present disclosure.
The memory 803 may include a Random Access Memory (RAM) memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
Among them, the procedure can be specifically used for: acquiring a first message transmission request sent by a sender through a client node of the sender, wherein the first message transmission request carries a first message to be sent to a receiver and an address of the receiver on a receiver chain in the blockchain system; and calling the message contract according to the receiver chain address carried in the first message transmission request, and sending a first notification message to the receiver client node so as to transmit the first message from the sender to the receiver.
It is to be understood that any number of elements in the drawings of the present disclosure are by way of example and not by way of limitation, and that any nomenclature is used for distinction only, and not by way of limitation.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. A blockchain based messaging method, the method being performed by a node device in a blockchain system, the node device being communicatively connected to a sender client node and a receiver client node; deploying a message contract in the blockchain system; wherein the method comprises the following steps:
acquiring a first message transmission request sent by a sender through a client node of the sender, wherein the first message transmission request carries a first message to be sent to a receiver and a receiver chain address of the receiver in the blockchain system;
and calling the message contract according to the receiver chain address carried in the first message transmission request, and sending a first notification message to the receiver client node so as to transmit the first message from the sender to the receiver.
2. The method of claim 1, wherein the first messaging request further carries a sender-on-chain address of the sender in the blockchain system; wherein the method further comprises:
calling the message contract and creating a contract message queue;
calling the message contract to create a receiver message receiving queue corresponding to the receiver chain address;
receiving a first message subscription request sent by the receiver through the receiver client node;
wherein, invoking the message contract according to the receiver chain address carried in the first message transmission request, and sending a first notification message to the receiver client node so as to transmit the first message from the sender to the receiver, includes:
calling the message contract according to the receiver chain address carried in the first message transmission request to generate a first message identifier of the first message;
storing the first message identification, the sender on-chain address, the receiver on-chain address and the first message association into the contract message queue by using the message contract;
adding, by the message contract, the first message identification to the recipient message receive queue;
responding to the first message subscription request, and when detecting that the first message identifier is newly added in the message receiving queue of the receiving party, sending the first notification message to the client node of the receiving party, wherein the first notification message carries the first message identifier;
and acquiring the first message and the receiver chain address from the contract message queue according to the first message identifier, and sending the first message to the receiver client node according to the receiver chain address.
3. The method of claim 2, wherein invoking the message contract to create a recipient message receive queue corresponding to the recipient on-chain address comprises:
receiving a first registration request sent by the receiver through the receiver client node, wherein the first registration request carries the receiver identity identifier and the message contract identifier of the message contract;
calling the message contract to generate the receiver chain address corresponding to the receiver identity according to the receiver identity and the message contract identity carried in the first registration request;
and creating the receiver message receiving queue corresponding to the address on the receiver chain.
4. The method of claim 2, further comprising:
receiving a second registration request sent by the sender through the sender client node, wherein the second registration request carries the sender identity identifier and the message contract identifier of the message contract;
calling the message contract to generate the sender chain address corresponding to the sender identity according to the sender identity and the message contract identity carried in the second registration request;
creating a sender message sending queue corresponding to the address on the sender chain;
and adding the first message identification to the sending side message sending queue.
5. The method of claim 2, further comprising:
calling the message contract, and creating a receiver message sending queue corresponding to the receiver chain address, wherein the receiver message sending queue is used for storing a second message identifier of a second message sent by the receiver, and the contract message queue is also used for associating and storing the second message identifier, a target chain address for receiving the second message, the receiver chain address and the second message;
receiving a first message access request sent by the receiver through the receiver client node, wherein the first message access request carries the receiver chain address;
responding to the first message access request, calling the message contract, and accessing the message sending queue of the receiving party and the message receiving queue of the receiving party according to the address on the chain of the receiving party;
accessing the second message in the contract message queue according to the second message identifier in the receiver message sending queue, and accessing the first message in the contract message queue according to the first message identifier in the receiver message receiving queue.
6. The method of claim 1, wherein the first messaging request further comprises a sender-side chain address of the sender in the blockchain system; wherein the method further comprises:
calling the message contract to create a black and white list storage space of the receiver corresponding to the address on the chain of the receiver;
receiving black and white list information of the receiver sent by the receiver through the client node of the receiver;
calling the message contract, and storing the black and white list information of the receiver into a black and white list storage space of the receiver;
the step of invoking the message contract according to the receiver chain address carried in the first message transmission request and sending a first notification message to the receiver client node includes:
calling the message contract according to the sender chain address carried in the first message transmission request, and judging whether the sender chain address is in the black-and-white list information of the receiver;
and if the sender chain address is not in the receiver blacklist information or the sender chain address is in the receiver whitelist information in the receiver blacklist information, sending the first notification message to the receiver client node.
7. The method of claim 1, wherein the node device is further communicatively coupled with a message contract generation node for deploying the message contract into the blockchain system; wherein the method further comprises:
receiving a transaction request for deploying the message contract sent by the message contract generating node;
generating a proposal block for deploying the message contract according to the transaction request for deploying the message contract;
consensus is conducted on a proposal block where the message contract is deployed;
and determining that the proposal block consensus for deploying the message contract passes, and deploying the message contract into the blockchain system.
8. The method of claim 1, wherein the node device is further communicatively coupled with an address identity contract generation node for deploying address identity contracts into the blockchain system;
the address identity contract comprises a mapping relation between an address of the receiver on a receiver chain in the blockchain system and a receiver identity of the receiver;
wherein the method further comprises:
receiving a transaction request for deploying the address identity contract sent by the address identity contract generating node;
generating a proposal block for deploying the address identity contract according to the transaction request for deploying the address identity contract;
consensus is made on proposal blocks deploying the address identity contract;
determining that a proposal block consensus for deploying the address identity contract passes, and deploying the address identity contract into the blockchain system.
9. The method of claim 8, further comprising:
receiving a first registration request sent by the receiver through the receiver client node, wherein the first registration request carries the receiver identity identifier and the message contract identifier of the message contract;
calling the message contract to generate the receiver chain address corresponding to the receiver identity according to the receiver identity and the message contract identity carried in the first registration request;
and sending the receiver identity and the receiver 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 receiver identity and the receiver chain address.
10. The method of claim 8, further comprising:
acquiring a first query request sent by the sender through the sender client node, wherein the first query request carries the identity of the receiver;
calling the address identity contract according to the receiver identity carried in the first query request, and acquiring the receiver chain address according to the mapping relation between the receiver chain address and the receiver identity in the address identity contract;
and returning the receiver chain address to the sender client node so that the sender client node constructs the first message delivery request according to the receiver chain address.
11. A node device in a blockchain system, the node device communicatively coupled to a sender client node and a receiver client node; deploying a message contract in the blockchain system; wherein the node device includes:
a first message delivery request obtaining unit, configured to obtain a first message delivery request sent by a sender through a client node of the sender, where the first message delivery request carries a first message to be sent to a receiver and a receiver chain address of the receiver in the blockchain system;
a first notification message sending unit, configured to invoke the message contract according to the receiver chain address carried in the first message delivery request, and send a first notification message to the receiver client node, so as to deliver the first message from the sender to the receiver.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 10.
13. An electronic device, comprising:
at least one processor;
a storage device configured to store at least one program that, when executed by the at least one processor, causes the at least one processor to implement the method of any one of claims 1 to 10.
14. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 10 when executed by a processor.
CN202111080488.XA 2021-09-15 2021-09-15 Block chain based message transmission method and related equipment Pending CN115834591A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111080488.XA CN115834591A (en) 2021-09-15 2021-09-15 Block chain based message transmission method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111080488.XA CN115834591A (en) 2021-09-15 2021-09-15 Block chain based message transmission method and related equipment

Publications (1)

Publication Number Publication Date
CN115834591A true CN115834591A (en) 2023-03-21

Family

ID=85514941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111080488.XA Pending CN115834591A (en) 2021-09-15 2021-09-15 Block chain based message transmission method and related equipment

Country Status (1)

Country Link
CN (1) CN115834591A (en)

Similar Documents

Publication Publication Date Title
CN110443704B (en) Method and device for sending resources in cross-link mode
CN112287029B (en) Block chain multi-chain cross-chain system and implementation mechanism thereof
CN110430162B (en) Method and device for sending authenticable message in cross-link mode
CN110311790B (en) Method and device for sending authenticable message in cross-link mode
US20200259804A1 (en) Manicoding for communication verification
CN110839029B (en) Micro-service registration method and device
CN101447999B (en) Security exchange system and realization method thereof
CN110430235B (en) Method, apparatus, storage medium and computing device for cross-chain transmission of authenticatable messages
WO2020088074A1 (en) Privacy transaction method and apparatus based on blockchain, and application method and apparatus therefor
CN113328997B (en) Alliance chain crossing system and method
CN112001663B (en) Material donation data processing method based on block chain and related equipment
CN112804358B (en) Method and device for transferring data in cross-link mode based on relay equipment network
CN113255014B (en) Data processing method based on block chain and related equipment
CN111260348A (en) Fair payment system based on intelligent contract in Internet of vehicles and working method thereof
CN110417742B (en) Method, device and storage medium for cross-link sending, transferring and receiving authenticable message
CN115618429B (en) Product full life cycle management system based on parallel block chain
CN115941282A (en) NFT-based block chain cross-chain interaction system and method
CN115834591A (en) Block chain based message transmission method and related equipment
Ferrer-Gomila et al. Optimistic protocol for certified electronic mail with verifiable TTP
KR102137269B1 (en) Communication system and method between blockchains
JP6548904B2 (en) Method of generating certified electronic contract by telecommunications company customer
KR20200091997A (en) Electronic voting and survey system using block chain
WO2023134282A1 (en) Blockchain-based data processing method and apparatus, device, storage medium and program product
CN115601032A (en) Method, device and system for transferring object rights and business terminal
CN117294753A (en) Block chain-based data processing method, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40083842

Country of ref document: HK