CN109767220B - Block chain based transaction method and block chain based transaction system - Google Patents
Block chain based transaction method and block chain based transaction system Download PDFInfo
- Publication number
- CN109767220B CN109767220B CN201910036060.1A CN201910036060A CN109767220B CN 109767220 B CN109767220 B CN 109767220B CN 201910036060 A CN201910036060 A CN 201910036060A CN 109767220 B CN109767220 B CN 109767220B
- Authority
- CN
- China
- Prior art keywords
- node
- transaction
- key
- block chain
- blockchain
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000012795 verification Methods 0.000 claims abstract description 59
- 238000004891 communication Methods 0.000 claims abstract description 15
- 238000004422 calculation algorithm Methods 0.000 claims description 17
- 238000004364 calculation method Methods 0.000 claims description 11
- 230000000977 initiatory effect Effects 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 abstract description 7
- 238000011161 development Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000009412 basement excavation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention belongs to the technical field of block chains, and relates to a block chain-based transaction method and a block chain-based transaction system. The method comprises the following steps: each node uses a private key to sign a block chain identifier and a public key thereof and then broadcasts the block chain identifier and the public key thereof to the block chain; a certain transaction node initiates a transaction, calculates the hash value of the transaction by adopting a secret key, and broadcasts a transaction message and the primary hash value to a block chain after being signed by using a private key of the transaction message and the primary hash value; other nodes adopt the shared session key of the transaction node to calculate the hash value of the transaction again, verify whether the primary hash value is the same as the secondary hash value, and broadcast the verification result to the block chain after using the private key signature of the other nodes; and the accounting node counts the accumulated quantity of the passing or not of the verification result within the preset time threshold range of the transaction initiated by the transaction node, and establishes a consensus mechanism for the passed accumulated quantity according to the verification result. The method can reduce the communication burden of the block chain and the size of the block, and greatly improve the transmission efficiency of the block chain.
Description
Technical Field
The invention belongs to the technical field of block chains, and particularly relates to a block chain-based transaction method and a block chain-based transaction system.
Background
The basic idea of a Blockchain (Blockchain) is: by establishing a group of public accounts on the Internet, all users in the network can jointly keep accounts and check accounts on the accounts, so that the authenticity and the non-tamper-resistance of the information are ensured. As the name suggests, the 'block' chain is because the structure of storing data is that a chain is formed by 'storage blocks' on a network, and each block contains all information exchange data in the network within a certain time. Over time, the chain grows. A blockchain is essentially a decentralized database. In a narrow sense, the blockchain is a distributed account book which is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence and is guaranteed in a cryptographic mode and cannot be tampered and forged. Broadly speaking, the blockchain technique is a completely new distributed infrastructure and computing paradigm that utilizes blockchain data structures to verify and store data, utilizes distributed node consensus algorithms to generate and update data, cryptographically secure data transmission and access, and utilizes intelligent contracts composed of automated script code to program and manipulate data.
Currently, the block chain generally contends for accounting right through mining by miners, which is the fairest way at present. Miners are rewarded for obtaining ore excavation and continuously invest resources to excavate the ore, and although the mechanism ensures the safety and the continuous development of a block chain to a certain extent, the resources invested by spacious workers are more and more, and the investment income ratio of a large amount of energy is lower and lower. Moreover, the method of competing for the billing right with a great amount of effort increases the communication burden of the block chain and the size of the block due to the long length of the public key and the signature of the current block chain, and greatly reduces the transmission efficiency of the block chain.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a block chain based transaction method and a block chain based transaction system, which can reduce the communication burden of the block chain and the size of the block, and greatly improve the transmission efficiency of the block chain.
The technical scheme adopted for solving the technical problem of the invention is the block chain-based transaction method, which comprises the following steps:
each node uses a private key of each node to sign a block chain identifier and a public key of each node and broadcasts the block chain identifier and the public key to the block chain;
a certain transaction node initiates a transaction, calculates the hash value of the transaction by adopting a secret key, and broadcasts a transaction message and the primary hash value to the block chain after being signed by using a private key of the transaction message and the primary hash value;
other nodes adopt the shared session key of the transaction node to calculate the hash value of the transaction again, verify whether the primary hash value is the same as the secondary hash value, and broadcast the verification result to the block chain after using the private key signature of the other nodes;
and the accounting node counts the accumulated quantity of whether the verification result passes or not within the preset time threshold range of the transaction initiated by the transaction node, and establishes a consensus mechanism for the passed accumulated quantity according to the verification result.
Preferably, before a transaction node initiates a transaction, the method further comprises the steps of:
any pair of nodes in the block chain carries out key exchange in a non-block chain network mode, and a shared session key between the pair of nodes is established and is limited only between the pair of nodes;
the method comprises the following steps:
a first node sends a communication request with a second node in the block chain, and a public key of the second node is used for encryption to obtain a first handshake key;
broadcasting a broadcast message including a blockchain identification of the second node, a source identification, a blockchain identification and a public key of a non-blockchain of the first node, and the first handshake key to the blockchain, the broadcast message being signed using a private key of the first node;
the second node receives the broadcast message of the first node, and sends a second handshake key encrypted by using the public key of the first node to the first node through the corresponding non-blockchain network according to the source identifier of the non-blockchain of the first node;
the first node receives the second handshake key in a non-blockchain network mode, and decrypts the second handshake key by adopting a private key of the first node;
the second node receives the first handshake key in a block chain network mode, and decrypts the first handshake key by adopting a private key of the second node;
the first node obtains a first session key between the first node and the second node and limited between the pair of nodes according to the second handshake key and a predetermined algorithm;
and the second node obtains a second session key between the first node and the second node and limited to the pair of nodes according to the first handshake key and a predetermined algorithm.
Preferably, the source identifier of the non-blockchain includes at least one of a mobile phone number of a terminal corresponding to the first node, an IP address in an INTERNET network, and a mailbox address;
correspondingly, the modes of the non-blockchain network include a mode of sending short messages or dialing voice calls through a mobile switching network, a mode of sending short messages or dialing voice calls through an IP address P2P, and a mode of sending an electronic mailbox address through a mailbox address.
Preferably, in the step of initiating a transaction at a transaction node, calculating the hash value of the transaction using the key,
the transaction node calculates the hash value of the transaction by adopting the shared session key of the transaction node and other nodes;
or, the transaction node calculates the hash value of the transaction by adopting a randomly generated key.
Preferably, the step of establishing a consensus mechanism for the passing accumulated number according to the verification result includes:
when the verification result is that the passing accumulated number reaches a preset consensus threshold value proportion, recording the transaction message and all verification passing messages within the preset time threshold value range in a block chain account book;
otherwise, the transaction message is refused to be recorded in the blockchain account book.
A transaction system based on a block chain comprises a broadcasting module, a transaction calculating module, a transaction verifying module and a consensus establishing module, wherein:
the broadcast module is configured to allow each node to broadcast its own block chain identifier and public key to the block chain after signing with its own private key;
the transaction calculation module is configured to be used for a certain transaction node to initiate a transaction, calculate the hash value of the transaction by adopting a secret key, and broadcast the transaction message and the initial hash value to the block chain through the broadcast module after using the private key signature of the transaction message and the initial hash value;
the transaction verification module is configured to enable other nodes to calculate the hash value of the transaction again by adopting a shared session key of the transaction node, verify whether the primary hash value is the same as the secondary hash value, and broadcast a verification result to the block chain through the broadcasting module after the verification result is signed by using a private key of the verification result;
the consensus establishing module is configured to count the accumulated number of passing or not of the verification result by the accounting node within a preset time threshold range of the transaction initiated by the transaction node, and establish a consensus mechanism for the passed accumulated number according to the verification result.
Preferably, the session key sharing system further comprises a shared session key establishing module, wherein the shared session key establishing module comprises a first encryption unit, a second encryption unit, a first decryption unit, a second decryption unit, a first session encryption unit, and a second session encryption unit, and wherein:
the first encryption unit is configured to obtain a first handshake key by using public key encryption of a second node when a first node sends a communication request with the second node in the block chain;
the broadcast module is configured to broadcast a broadcast message including the blockchain identifier of the second node, the source identifier, the blockchain identifier, the public key and the first handshake key of the non-blockchain of the first node to the blockchain, wherein the broadcast message is signed by using the private key of the first node;
the second encryption unit is configured to send, to the first node, a second handshake key encrypted by using the public key of the first node through the corresponding non-blockchain network according to the source identifier of the non-blockchain of the first node after the second node receives the broadcast message of the first node;
the first decryption unit is configured to decrypt the second handshake key by using a private key of the first node after the first node receives the second handshake key in the non-blockchain network manner;
the second decryption unit is configured to decrypt the first handshake key by using a private key of the second node after the second node receives the first handshake key in the blockchain network manner;
the first session encryption unit is configured to enable the first node to obtain a first session key between the first node and the second node and limited to the pair of nodes according to a predefined algorithm and according to the second handshake key;
and the second session encryption unit is configured to enable the second node to obtain a second session key between the first node and the second node and limited to the pair of nodes according to a predefined algorithm according to the first handshake key.
Preferably, the source identifier of the non-blockchain includes at least one of a mobile phone number of a terminal corresponding to the first node, an IP address in an INTERNET network, and a mailbox address;
correspondingly, the modes of the non-blockchain network include a mode of sending short messages or dialing voice calls through a mobile switching network, a mode of sending short messages or dialing voice calls through an IP address P2P, and a mode of sending an electronic mailbox address through a mailbox address.
Preferably, in the transaction calculation module,
the transaction node calculates the hash value of the transaction by adopting the shared session key of the transaction node and other nodes;
or, the transaction node calculates the hash value of the transaction by adopting a randomly generated key.
Preferably, in the consensus establishing module,
when the verification result is that the passing accumulated number reaches a preset consensus threshold value proportion, recording the transaction message and all verification passing messages within the preset time threshold value range in a block chain account book;
otherwise, the transaction message is refused to be recorded in the blockchain account book.
The invention has the beneficial effects that:
the block chain-based transaction method and the block chain-based transaction system provided by the invention establish a new block chain consensus mechanism, avoid the problem that in the prior art, the block chain public key and the signature length are too long, which can increase the communication burden of the network and the size of the block, and cause that each node of the block chain needs a large amount of storage space for real-time synchronization block chain accounts, can greatly improve the transmission efficiency of the block chain, and reduce the storage space of each node of the block chain; moreover, a one-to-one corresponding session key is achieved by a non-block chain network such as a mobile switching network, so that the security is higher, the benefits of both transaction parties are guaranteed, and the block chain development is promoted.
Drawings
Fig. 1 is a flowchart of a block chain based transaction method according to embodiment 1 of the present invention;
fig. 2 is a block diagram of a block chain-based transaction system according to embodiment 1 of the present invention;
fig. 3 is a flowchart of a blockchain-based transaction method according to embodiment 2 of the present invention;
fig. 4 is a detailed flowchart of step S2) in fig. 3;
fig. 5 is a block diagram of a block chain-based transaction system according to embodiment 2 of the present invention;
fig. 6 is a detailed block diagram of the shared session key establishment module in fig. 5;
in the drawings, wherein:
1-a broadcast module;
2-a transaction calculation module;
3-a transaction verification module;
4-consensus establishing module;
5-shared session key establishment module; 51-a first encryption unit; 52-a second encryption unit; 53-first decryption unit; 54-a second decryption unit; 55-a first session cryptographic unit; 56-second session cryptographic unit.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the following describes the block chain based transaction method and the block chain based transaction system in detail with reference to the accompanying drawings and the detailed description.
Example 1:
as shown in fig. 1, the block chain-based transaction method provided in this embodiment includes the following steps:
step S1): each node uses a private key to sign a block chain identifier and a public key thereof and then broadcasts the block chain identifier and the public key thereof to the block chain;
step S2): a certain transaction node initiates a transaction, calculates the hash value of the transaction by adopting a secret key (the hash value obtained by the primary calculation, namely the primary hash value), and broadcasts a transaction message and the primary hash value to a block chain after using a private key signature of the transaction message and the primary hash value;
step S3): other nodes adopt the shared session key of the transaction node to calculate the hash value of the transaction again (the hash value obtained by calculation again, namely the secondary hash value), verify whether the primary hash value is the same as the secondary hash value, and broadcast the verification result to the block chain after using the private key signature of the other nodes;
step S4): and the accounting node counts the accumulated quantity of the passing or not of the verification result within the preset time threshold range of the transaction initiated by the transaction node, and establishes a consensus mechanism for the passed accumulated quantity according to the verification result. .
Correspondingly, this embodiment further provides a transaction system based on a block chain, as shown in fig. 2, the system includes a broadcasting module 1, a transaction calculating module 2, a transaction verifying module 3, and a consensus establishing module 4, where:
the broadcast module 1 is configured to allow each node to broadcast a block chain identifier and a public key of the node to the block chain after signing by using a private key of the node;
the transaction calculation module 2 is configured to be used for a certain transaction node to initiate a transaction, calculate the hash value of the transaction by adopting a secret key, and broadcast the transaction message and the primary hash value to the block chain through the broadcast module 1 after using the private key signature of the transaction message and the primary hash value;
the transaction verification module 3 is configured to enable other nodes to calculate the hash value of the transaction again by adopting a shared session key of the transaction node, verify whether the primary hash value is the same as the secondary hash value, and broadcast the verification result to the block chain through the broadcast module 1 after the verification result is signed by using a private key of the other nodes;
and the consensus establishing module 4 is configured to count the accumulated number of passing or not of the verification result by the accounting node within the preset time threshold range of the transaction initiated by the transaction node, and establish a consensus mechanism for the passed accumulated number according to the verification result.
The embodiment provides a transaction method based on a block chain and a transaction system based on the block chain, a new block chain consensus mechanism is established, the current situation that in the prior art, a large amount of storage space is needed for real-time synchronization block chain accounts of each node of the block chain due to the fact that the length of a public key and a signature of the block chain is too long and the communication burden of a network and the size of a block are increased is avoided, the transmission efficiency of the block chain can be greatly improved, the storage space of each node of the block chain is reduced, and the block chain development is promoted.
Example 2:
for a new node that has just joined a blockchain or a node that has not established a shared session password with other nodes, this embodiment provides a transaction method based on a blockchain, as shown in fig. 3, where the method includes the following steps:
step S1): each node uses its own private key to sign its own blockchain identifier and public key and then broadcasts them to the blockchain.
In the step, when a new first node A is added into the block chain, the node locally generates a public key and a private key pair of the node, broadcasts the block chain identification and the public key of the node to the block chain by adopting a mode of sending broadcast messages, and the broadcast messages are broadcasted after being signed by the private key of the new node.
Step S2): any pair of nodes in the blockchain performs key exchange in a mode of a non-blockchain network, and establishes a shared session key between the pair of nodes and is limited to the pair of nodes.
In this step, when any pair of nodes in the blockchain, such as a first node a and a second node B, the first node a and the second node B have a communication need, the first node a and the second node B perform key exchange through a mobile switching network or in an offline or offline manner, that is, each two nodes have a pair of session keys which are kept secret from the outside and only shared between the first node a and the second node B.
As shown in fig. 4, any pair of nodes in the blockchain performs key exchange in a non-blockchain network manner, and the specific steps of establishing the shared session key between the pair of nodes and limited to the pair of nodes are as follows:
step S21): the first node sends a communication request with the second node in the block chain, and the public key of the second node is used for encryption to obtain a first handshake key.
In this step, the public KEY of the second node B may be obtained by the first node a querying the blockchain account that is synchronized and stored in real time inside itself, and the first node a uses the first handshake KEY-a encrypted by the public KEY of the second node B.
Step S22): broadcasting a broadcast message comprising the blockchain identification of the second node, the source identification of the non-blockchain of the first node, the blockchain identification and the public key, and the first handshake key to the blockchain, wherein the broadcast message is signed by using the private key of the first node.
Preferably, the source identifier of the non-blockchain includes at least one of a mobile phone number of the terminal corresponding to the first node, an IP address in an INTERNET network, and a mailbox address; accordingly, the non-blockchain network includes a short message or voice call through a mobile switching network, an IP address P2P, and an e-mail address through a mail address.
In this step, the first node a sends a broadcast message for making a communication request with the second node B in the blockchain, where the broadcast message includes a blockchain identifier of the second node B, a mobile phone number of a terminal corresponding to the first node a (or an IP address, a mailbox address, etc. of the first node a in the INTERNET network), the blockchain identifier and a public KEY of the first node a, and a first handshake KEY-a encrypted by using the public KEY of the second node B, and the broadcast message is signed by using a private KEY of the first node a and then broadcast.
Step S23): and the second node receives the broadcast message of the first node, and sends a second handshake key encrypted by using the public key of the first node to the first node through a corresponding non-block chain network according to the source identification of the non-block chain of the first node.
In this step, the second node B receives the broadcast message of the first node a, and sends the second handshake KEY-B encrypted by using the public KEY of the first node a to the first node a according to the way that the mobile phone number of the terminal corresponding to the first node a sends a short message or dials a voice call in the mobile switching network (or sends the second handshake KEY-B to the first node a by using the public KEY of the first node a to encrypt and then send an email address or an IP address P2P).
Step S24): and the first node receives the second handshake key in a non-blockchain network mode, and decrypts the second handshake key by adopting a private key of the first node.
In the step, the first node a receives the second handshake KEY-B encrypted by the public KEY of the first node a through a non-blockchain network, and decrypts the second handshake KEY-B encrypted by the public KEY of the first node a by using the private KEY of the first node a. The one-to-one corresponding session key is achieved through a non-block chain network mode such as a mobile switching network, the security is higher, and the benefits of both transaction parties are guaranteed.
Step S25): and the second node receives the first handshake key in a block chain network mode and decrypts the first handshake key by adopting a private key of the second node.
In this step, similarly, after receiving the first handshake KEY, the second node B decrypts the first handshake KEY-a encrypted by using its own public KEY using its own private KEY.
Step S26): and the first node obtains a first session key between the first node and the second node and limited between the pair of nodes according to the second handshake key and a predetermined algorithm.
Step S27): and the second node obtains a second session key between the first node and the second node and limited between the pair of nodes according to a predetermined algorithm and the first handshake key.
Step S26), step S27) are performed at two nodes, respectively, and the order is not limited. Step S26) and step S27), the first node A and the second node B respectively calculate according to the KEY-A and the KEY-B according to a predetermined algorithm to obtain the shared session KEY KEY-AB or KEY-BA of the first node A and the second node B. The first session key from the first node a to the second node B and the second session key from the second node B to the first node a have directionality, which is usually different. The predetermined algorithm may be, for example, a hash calculation, and is not limited herein.
Step S3): and a certain transaction node initiates a transaction, calculates the hash value of the transaction by adopting a secret key, and broadcasts the transaction message and the primary hash value to the block chain after using the private key signature of the transaction message and the primary hash value.
In this step, the transaction node calculates the hash value of the transaction by using the shared session key of the transaction node and other nodes. The first node A initiates a transaction to the second node B, the first node A calculates the hash value of the transaction by adopting a hash algorithm with a key, the hash algorithm with the key is that the first node A calculates a series of hash values of the transaction by using respective shared keys between the first node A and other nodes in the block chain, the node A broadcasts a transaction message and all the hash values to the block chain together, and the broadcast message is broadcasted after being signed by using a private key of the first node A. Wherein, the total number of the hash values is the total number of the current nodes of the block chain minus 1.
It should be understood that the first node a does not necessarily need to select an inherent KEY-a for calculating the hash value of the transaction message, and the KEY may be randomly generated each time, and the hash value of the transaction may be calculated by using the randomly generated KEY, so that the security and the anti-hacking performance of the communication and the transaction are stronger.
Step S4): and other nodes adopt the shared session key of the transaction node to calculate the hash value of the transaction again, verify whether the primary hash value is the same as the secondary hash value, and broadcast the verification result to the block chain after using the private key signature of the other nodes.
In this step, after receiving the broadcast message sent by the first node a, the other nodes in the blockchain (i.e., the verification node C) recalculate the hash value of the transaction by using their own shared key with the first node a. And if the calculated hash value is the same as the hash value in the received broadcast information, the verification is passed. The verification node C uses the private key of the verification node C to sign and then broadcasts the broadcast message passing the verification into the block chain.
Step S5): and the accounting node counts the accumulated quantity of the passing or not of the verification result within the preset time threshold range of the transaction initiated by the transaction node, and establishes a consensus mechanism for the passed accumulated quantity according to the verification result.
Preferably, when the consensus mechanism is established for the accumulated number of passes according to the verification result: when the verification result is that the passing accumulated number reaches the preset consensus threshold value proportion, recording the transaction message and all verification passing messages within the preset time threshold value range in the block chain account book; otherwise, the transaction message is refused to be recorded in the blockchain account book.
In this step, the accounting node accumulates the number of the verified messages within a preset time threshold range after the first node a sends the broadcast message of the transaction, and when the transaction verification number reaches a preset consensus threshold ratio, generates a new block of the transaction, that is, the block chain agrees on the generation of a new block to be generated containing the transaction. The accounting node records the original message and all validated pass messages within a time threshold range relating to the transaction in the blockchain ledger.
Correspondingly, this embodiment further provides a transaction system based on a block chain, as shown in fig. 5, the system includes a broadcasting module 1, a shared session key establishing module 5, a transaction calculating module 2, a transaction verifying module 3, and a consensus establishing module 4, where:
the broadcast module 1 is configured to allow each node to broadcast a block chain identifier and a public key of the node to the block chain after signing by using a private key of the node;
a shared session key establishing module 5 configured to perform key exchange for any pair of nodes in the blockchain in a non-blockchain network manner, and establish a shared session key between the pair of nodes and limited to the pair of nodes;
the transaction calculation module 2 is configured to be used for a certain transaction node to initiate a transaction, calculate the hash value of the transaction by adopting a secret key, and broadcast the transaction message and the primary hash value to the block chain through the broadcast module 1 after using the private key signature of the transaction message and the primary hash value;
the transaction verification module 3 is configured to enable other nodes to calculate the hash value of the transaction again by adopting a shared session key of the transaction node, verify whether the primary hash value is the same as the secondary hash value, and broadcast the verification result to the block chain through the broadcast module 1 after the verification result is signed by using a private key of the other nodes;
and the consensus establishing module 4 is configured to count the accumulated number of passing or not of the verification result by the accounting node within the preset time threshold range of the transaction initiated by the transaction node, and establish a consensus mechanism for the passed accumulated number according to the verification result.
Preferably, in the transaction calculation module 2, the transaction node calculates the hash value of the transaction by using the shared session key of the transaction node and other nodes; or, the transaction node calculates the hash value of the transaction by using a randomly generated key.
In the consensus establishing module 4, when the verification result is that the passing accumulated number reaches the preset consensus threshold value proportion, recording the transaction message and all the passing verification messages in the preset time threshold value range in the block chain account book; otherwise, the transaction message is refused to be recorded in the blockchain account book.
As shown in fig. 6, the shared session key establishment module 5 includes a first encryption unit 51, a second encryption unit 52, a first decryption unit 53, a second decryption unit 54, a first session encryption unit 55, and a second session encryption unit 56, wherein:
a first encryption unit 51, configured to obtain a first handshake key by using public key encryption of a second node when a first node sends a communication request with the second node in a blockchain;
the broadcast module 1 is configured to broadcast a broadcast message including a blockchain identifier of a second node, a source identifier, a blockchain identifier, a public key and a first handshake key of a non-blockchain of a first node to a blockchain, wherein the broadcast message is signed by using a private key of the first node;
a second encryption unit 52, configured to, after the second node receives the broadcast message of the first node, send a second handshake key encrypted by using the public key of the first node to the first node through a corresponding non-blockchain network according to the source identifier of the non-blockchain of the first node;
the first decryption unit 53 is configured to decrypt the second handshake key by using its own private key after the first node receives the second handshake key in a non-blockchain network manner;
the second decryption unit 54 is configured to decrypt the first handshake key by using its own private key after the second node receives the first handshake key in the blockchain network manner;
a first session encryption unit 55, configured to allow the first node to obtain a first session key between the first node and the second node and limited to the pair of nodes according to a predefined algorithm based on the second handshake key;
and a second session encryption unit 56 configured to allow the second node to obtain a second session key between the first node and the second node and limited to the pair of nodes according to a predefined algorithm based on the first handshake key.
The source identifier of the non-block chain comprises at least one of a mobile phone number of a terminal corresponding to the first node, an IP address in an Internet network and a mailbox address;
accordingly, the non-blockchain network includes a short message or voice call through a mobile switching network, an IP address P2P, and an e-mail address through a mail address.
The block chain-based transaction method and the block chain-based transaction system provided by this embodiment establish a new block chain consensus mechanism, avoid the problem that in the prior art, a large amount of storage space is required for real-time synchronization of block chain accounts at each node of a block chain due to an increase in communication burden and block size of a network due to too long block chain public key and signature length, and can greatly improve the transmission efficiency of the block chain and reduce the storage space of each node of the block chain; moreover, a one-to-one corresponding session key is achieved by a non-block chain network such as a mobile switching network, so that the security is higher, the benefits of both transaction parties are guaranteed, and the block chain development is promoted.
It will be understood that the above embodiments are merely exemplary embodiments taken to illustrate the principles of the present invention, which is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.
Claims (8)
1. A transaction method based on a blockchain is characterized by comprising the following steps:
each node uses a private key of each node to sign a block chain identifier and a public key of each node and broadcasts the block chain identifier and the public key to the block chain;
a certain transaction node initiates a transaction, calculates the hash value of the transaction by adopting a secret key, and broadcasts a transaction message and the primary hash value to the block chain after being signed by using a private key of the transaction message and the primary hash value;
other nodes adopt the shared session key of the transaction node to calculate the hash value of the transaction again, verify whether the primary hash value is the same as the secondary hash value, and broadcast the verification result to the block chain after using the private key signature of the other nodes;
accounting nodes count the accumulated quantity of whether the verification result passes or not within the preset time threshold range of initiating the transaction by the transaction nodes, and establish a consensus mechanism for the passed accumulated quantity according to the verification result;
before a transaction node initiates a transaction, the method further comprises the following steps: any pair of nodes in the block chain carries out key exchange in a non-block chain network mode, and a shared session key between the pair of nodes is established and is limited only between the pair of nodes; the method comprises the following steps:
a first node sends a communication request with a second node in the block chain, and a public key of the second node is used for encryption to obtain a first handshake key;
broadcasting a broadcast message including a blockchain identification of the second node, a source identification, a blockchain identification and a public key of a non-blockchain of the first node, and the first handshake key to the blockchain, the broadcast message being signed using a private key of the first node;
the second node receives the broadcast message of the first node, and sends a second handshake key encrypted by using the public key of the first node to the first node through the corresponding non-blockchain network according to the source identifier of the non-blockchain of the first node;
the first node receives the second handshake key in a non-blockchain network mode, and decrypts the second handshake key by adopting a private key of the first node;
the second node receives the first handshake key in a block chain network mode, and decrypts the first handshake key by adopting a private key of the second node;
the first node obtains a first session key between the first node and the second node and limited between the pair of nodes according to the second handshake key and a predetermined algorithm;
and the second node obtains a second session key between the first node and the second node and limited to the pair of nodes according to the first handshake key and a predetermined algorithm.
2. The blockchain-based transaction method according to claim 1, wherein the source identifier of the non-blockchain includes at least one of a mobile phone number of a terminal corresponding to the first node, an IP address in an INTERNET network, and a mailbox address;
correspondingly, the modes of the non-blockchain network include a mode of sending short messages or dialing voice calls through a mobile switching network, a mode of sending short messages or dialing voice calls through an IP address P2P, and a mode of sending an electronic mailbox address through a mailbox address.
3. The blockchain-based transaction method of claim 1, wherein in the step of initiating a transaction at a transaction node, calculating the hash value of the transaction using the key,
the transaction node calculates the hash value of the transaction by adopting the shared session key of the transaction node and other nodes;
or, the transaction node calculates the hash value of the transaction by adopting a randomly generated key.
4. The blockchain-based transaction method according to claim 1, wherein the step of establishing a consensus mechanism for the passing accumulated number according to the verification result comprises:
when the verification result is that the passing accumulated number reaches a preset consensus threshold value proportion, recording the transaction message and all verification passing messages within the preset time threshold value range in a block chain account book;
otherwise, the transaction message is refused to be recorded in the blockchain account book.
5. A transaction system based on a block chain is characterized by comprising a broadcasting module, a transaction calculating module, a transaction verifying module, a consensus establishing module and a shared session key establishing module, wherein:
the broadcast module is configured to allow each node to broadcast its own block chain identifier and public key to the block chain after signing with its own private key;
the transaction calculation module is configured to be used for a certain transaction node to initiate a transaction, calculate the hash value of the transaction by adopting a secret key, and broadcast the transaction message and the initial hash value to the block chain through the broadcast module after using the private key signature of the transaction message and the initial hash value;
the transaction verification module is configured to enable other nodes to calculate the hash value of the transaction again by adopting a shared session key of the transaction node, verify whether the primary hash value is the same as the secondary hash value, and broadcast a verification result to the block chain through the broadcasting module after the verification result is signed by using a private key of the verification result;
the consensus establishing module is configured to count the accumulated number of passing or not of the verification result by the accounting node within a preset time threshold range of initiating the transaction by the transaction node, and establish a consensus mechanism for the passed accumulated number according to the verification result;
the shared session key establishing module comprises a first encryption unit, a second encryption unit, a first decryption unit, a second decryption unit, a first session cipher unit and a second session cipher unit, wherein:
the first encryption unit is configured to obtain a first handshake key by using public key encryption of a second node when a first node sends a communication request with the second node in the block chain;
the broadcast module is configured to broadcast a broadcast message including the blockchain identifier of the second node, the source identifier, the blockchain identifier, the public key and the first handshake key of the non-blockchain of the first node to the blockchain, wherein the broadcast message is signed by using the private key of the first node;
the second encryption unit is configured to send, to the first node, a second handshake key encrypted by using the public key of the first node through the corresponding non-blockchain network according to the source identifier of the non-blockchain of the first node after the second node receives the broadcast message of the first node;
the first decryption unit is configured to decrypt the second handshake key by using a private key of the first node after the first node receives the second handshake key in the non-blockchain network manner;
the second decryption unit is configured to decrypt the first handshake key by using a private key of the second node after the second node receives the first handshake key in the blockchain network manner;
the first session encryption unit is configured to enable the first node to obtain a first session key between the first node and the second node and limited to the pair of nodes according to a predefined algorithm and according to the second handshake key;
and the second session encryption unit is configured to enable the second node to obtain a second session key between the first node and the second node and limited to the pair of nodes according to a predefined algorithm according to the first handshake key.
6. The blockchain-based transaction system according to claim 5, wherein the source identifier of the non-blockchain includes at least one of a mobile phone number of a terminal corresponding to the first node, an IP address in an INTERNET network, and a mailbox address;
correspondingly, the modes of the non-blockchain network include a mode of sending short messages or dialing voice calls through a mobile switching network, a mode of sending short messages or dialing voice calls through an IP address P2P, and a mode of sending an electronic mailbox address through a mailbox address.
7. The blockchain-based transaction system of claim 5, wherein, in the transaction calculation module,
the transaction node calculates the hash value of the transaction by adopting the shared session key of the transaction node and other nodes;
or, the transaction node calculates the hash value of the transaction by adopting a randomly generated key.
8. The blockchain-based transaction system of claim 5, wherein, in the consensus establishing module,
when the verification result is that the passing accumulated number reaches a preset consensus threshold value proportion, recording the transaction message and all verification passing messages within the preset time threshold value range in a block chain account book;
otherwise, the transaction message is refused to be recorded in the blockchain account book.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910036060.1A CN109767220B (en) | 2019-01-15 | 2019-01-15 | Block chain based transaction method and block chain based transaction system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910036060.1A CN109767220B (en) | 2019-01-15 | 2019-01-15 | Block chain based transaction method and block chain based transaction system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109767220A CN109767220A (en) | 2019-05-17 |
CN109767220B true CN109767220B (en) | 2021-02-19 |
Family
ID=66454065
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910036060.1A Active CN109767220B (en) | 2019-01-15 | 2019-01-15 | Block chain based transaction method and block chain based transaction system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109767220B (en) |
Families Citing this family (31)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109919771B (en) * | 2019-03-18 | 2020-04-10 | 徐雪松 | Industrial internet transaction device applying hierarchical block chain technology |
CN110138558B (en) * | 2019-05-30 | 2021-09-10 | 全链通有限公司 | Transmission method and device of session key and computer-readable storage medium |
CN110176994A (en) * | 2019-05-30 | 2019-08-27 | 全链通有限公司 | Session cipher key distributing method, equipment and storage medium based on alliance's block chain |
CN110213045A (en) * | 2019-05-30 | 2019-09-06 | 全链通有限公司 | Transmission method, equipment and the computer readable storage medium of session key |
CN110213264A (en) * | 2019-05-30 | 2019-09-06 | 全链通有限公司 | Auth method, equipment and storage medium based on alliance's block chain |
CN110213263B (en) * | 2019-05-30 | 2021-10-22 | 全链通有限公司 | Identity authentication method, equipment and storage medium based on alliance block chain |
CN110430066B (en) * | 2019-07-15 | 2021-07-06 | 杭州复杂美科技有限公司 | Method, apparatus and storage medium for reducing repeated broadcasting of blockchain transactions |
CN110430067A (en) * | 2019-07-15 | 2019-11-08 | 杭州复杂美科技有限公司 | For reducing method and system, equipment and the storage medium of block repeated broadcast |
CN110443610A (en) * | 2019-07-15 | 2019-11-12 | 杭州复杂美科技有限公司 | For reducing method and system, equipment and the storage medium of trading group repeated broadcast |
CN110944004B (en) * | 2019-09-12 | 2021-09-10 | 腾讯科技(深圳)有限公司 | Data processing method, device, storage medium and equipment in block chain network |
CN110650097B (en) * | 2019-09-20 | 2022-05-31 | 腾讯科技(深圳)有限公司 | Data broadcasting method and device and computer readable storage medium |
CN111327669A (en) * | 2019-10-30 | 2020-06-23 | 谢卓鹏 | Decentralized block chain solution method |
CN112926972B (en) * | 2019-12-05 | 2024-04-09 | 中移物联网有限公司 | Information processing method based on block chain, block chain system and terminal |
CN113128999B (en) * | 2019-12-31 | 2024-04-12 | 航天信息股份有限公司 | Block chain privacy protection method and device |
CN111371785A (en) * | 2020-03-02 | 2020-07-03 | 杭州溪塔科技有限公司 | Block chain privacy transaction method and device and electronic equipment |
CN111414428B (en) * | 2020-04-24 | 2023-06-02 | 远光软件股份有限公司 | Data merging and counteracting method based on block chain |
CN111598558B (en) * | 2020-05-13 | 2023-08-22 | 中国联合网络通信集团有限公司 | Billing method, billing node server and payer node server |
CN111709053B (en) * | 2020-06-11 | 2024-04-05 | 中国工商银行股份有限公司 | Operation method and operation device based on loose coupling transaction network |
CN112073179B (en) * | 2020-07-21 | 2024-05-17 | 杜晓楠 | Method for replacing node session key in blockchain system, computer readable medium and blockchain system |
CN112102078B (en) * | 2020-08-07 | 2024-05-21 | 柳州市蓝海数链科技有限公司 | Block chain consensus calculation method, device, computer equipment and storage medium |
CN112398653B (en) * | 2020-10-23 | 2022-12-06 | 陕西医链区块链集团有限公司 | Block chain consensus verification method |
CN114666344A (en) * | 2020-12-22 | 2022-06-24 | 北京八分量信息科技有限公司 | Verification method of block chain |
CN112311544B (en) * | 2020-12-31 | 2021-03-16 | 飞天诚信科技股份有限公司 | Method and system for communication between server and authenticator |
CN113034135A (en) * | 2021-02-08 | 2021-06-25 | 中国工商银行股份有限公司 | Block chain-based information processing method, apparatus, device, medium, and product |
CN113127894B (en) * | 2021-03-03 | 2022-09-30 | 合肥工业大学 | Public opinion propagation model-based cryptocurrency network data propagation method and system |
CN112989392B (en) * | 2021-04-19 | 2022-08-30 | 河北科技大学 | Battlefield situation perception method, system and terminal equipment |
CN113240248A (en) * | 2021-04-25 | 2021-08-10 | 上海和数软件有限公司 | Enterprise electric energy method and system based on block chain |
CN113610526A (en) * | 2021-08-24 | 2021-11-05 | 上海点融信息科技有限责任公司 | Data trust method and device, electronic equipment and storage medium |
CN113822675A (en) * | 2021-09-29 | 2021-12-21 | 平安银行股份有限公司 | Block chain based message processing method, device, equipment and storage medium |
CN113904854B (en) * | 2021-10-13 | 2024-01-02 | 筹远(上海)信息科技有限公司 | Block chain data encryption method and device based on quotient algorithm |
CN113781048B (en) * | 2021-11-15 | 2022-02-22 | 环球数科集团有限公司 | Transaction information verification and settlement method based on block chain |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106385319A (en) * | 2016-09-29 | 2017-02-08 | 江苏通付盾科技有限公司 | Verification method for information in block chain network and verification system thereof |
CN108650227A (en) * | 2018-03-30 | 2018-10-12 | 苏州科达科技股份有限公司 | Handshake method based on datagram secure transfer protocol and system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8209537B2 (en) * | 2004-03-30 | 2012-06-26 | Hewlett-Packard Development Company, L.P. | Secure information distribution between nodes (network devices) |
CN109039997B (en) * | 2017-06-12 | 2021-08-20 | 北京金山云网络技术有限公司 | Secret key obtaining method, device and system |
CN108366059A (en) * | 2018-02-07 | 2018-08-03 | 迈普通信技术股份有限公司 | Communication negotiation method, responder device and initiator device |
CN108880789B (en) * | 2018-05-23 | 2021-06-15 | 众安信息技术服务有限公司 | Hardware product anti-counterfeiting tracing method, node equipment and system |
CN108989022B (en) * | 2018-06-08 | 2021-11-09 | 中国科学院计算技术研究所 | Intelligent object shared key establishment method and system based on block chain |
-
2019
- 2019-01-15 CN CN201910036060.1A patent/CN109767220B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106385319A (en) * | 2016-09-29 | 2017-02-08 | 江苏通付盾科技有限公司 | Verification method for information in block chain network and verification system thereof |
CN108650227A (en) * | 2018-03-30 | 2018-10-12 | 苏州科达科技股份有限公司 | Handshake method based on datagram secure transfer protocol and system |
Also Published As
Publication number | Publication date |
---|---|
CN109767220A (en) | 2019-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109767220B (en) | Block chain based transaction method and block chain based transaction system | |
US11050563B2 (en) | Method of exchanging keys by smart contract implemented on a blockchain | |
Hwang et al. | A self-encryption mechanism for authentication of roaming and teleconference services | |
EP2437469B1 (en) | Method and apparatus for establishing a security association | |
CN101969638B (en) | Method for protecting international mobile subscriber identity (IMSI) in mobile communication | |
GB2384402A (en) | Secure data transmission links | |
CN101399660B (en) | Method and device for negotiating group cipher | |
JP2005515701A6 (en) | Data transmission link | |
JP2002532985A (en) | Improved subscriber authentication protocol | |
JP2005515701A (en) | Data transmission link | |
CN112187450B (en) | Method, device, equipment and storage medium for key management communication | |
Gong | Efficient network authentication protocols: Lower bounds and optimal implementations | |
CN113254972A (en) | Information security management method based on block chain | |
Van Aubel et al. | Non-repudiation and End-to-End security for electric-vehicle charging | |
CN112152808B (en) | Multi-party collaborative digital signature method based on SM2 algorithm | |
CN114615006A (en) | Edge layer data security protection method and system for power distribution Internet of things and storage medium | |
CN111709053B (en) | Operation method and operation device based on loose coupling transaction network | |
CN114765546B (en) | End-to-end hard encryption method, system, encryption equipment and key management server | |
CN112054905B (en) | Secure communication method and system of mobile terminal | |
Suraci et al. | An RSA-based algorithm for secure D2D-aided multicast delivery of multimedia services | |
CN113300841B (en) | Identity-based collaborative signature method and system | |
CN114785488A (en) | Anti-quantum-computation mobile communication method and communication system | |
CN116681515A (en) | Financing guarantee settlement method and system based on blockchain | |
Choudhary et al. | Edge computing based An Efficient Lightweight authentication protocol for Smart Grid communication | |
Barnickel et al. | Security and Privacy for WLAN Roaming with per-connection Tariff Negotiation |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |