CN112053153A - Endorsement signature data storage method and device, electronic equipment and readable storage medium - Google Patents

Endorsement signature data storage method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112053153A
CN112053153A CN202010880161.XA CN202010880161A CN112053153A CN 112053153 A CN112053153 A CN 112053153A CN 202010880161 A CN202010880161 A CN 202010880161A CN 112053153 A CN112053153 A CN 112053153A
Authority
CN
China
Prior art keywords
endorsement
signature data
endorsement signature
node
transaction
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
CN202010880161.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.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp 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 China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202010880161.XA priority Critical patent/CN112053153A/en
Publication of CN112053153A publication Critical patent/CN112053153A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing

Abstract

The embodiment of the application provides an endorsement signature data storage method and device, electronic equipment and a readable storage medium. The method comprises the following steps: sending the transaction request to an endorsement node, and receiving an endorsement signature result returned after the endorsement node carries out endorsement signature on the transaction request; and when the received endorsement signature result meets a preset endorsement strategy, sending the endorsement signature data to the endorsement storage node so that the endorsement storage node stores the endorsement signature data. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.

Description

Endorsement signature data storage method and device, electronic equipment and readable storage medium
Technical Field
The application relates to the technical field of block chains, in particular to an endorsement signature data storage method and device, an electronic device and a readable storage medium.
Background
In blockchains, nodes typically determine whether a transaction is properly endorsed through an endorsement policy. The endorsement policy indicates which organizations or nodes in the blockchain network sign a transaction generated by a given intelligent contract so that the transaction is declared valid. The node initiating the transaction needs to collect enough endorsement signatures according to the policy required by the transaction, and then broadcast, agree and uplink the transaction along with the endorsement signatures.
The endorsement signature data is stored in the blockchain system as part of the transaction data, i.e. by all nodes in the blockchain. In some endorsement strategies, endorsement nodes for endorsement signature are numerous, and the data volume of endorsement signature data is large, so that the storage burden of a block chain system is increased. In addition, some nodes or organizations not involved in the transaction may also store endorsement signature data of the transaction, which also causes a storage burden of the blockchain system.
Disclosure of Invention
The present application aims to solve at least one of the above technical drawbacks. The technical scheme adopted by the application is as follows:
in a first aspect, an embodiment of the present application provides an endorsement signature data storage method, where the method includes:
sending the transaction request to an endorsement node, and receiving an endorsement signature result returned after the endorsement node carries out endorsement signature on the transaction request;
and when the received endorsement signature result meets a preset endorsement strategy, sending the endorsement signature data to the endorsement storage node so that the endorsement storage node stores the endorsement signature data.
Optionally, the endorsement signature data comprises any one of:
endorsement signature results;
endorsement signature results and endorsement policies.
Optionally, the method further includes:
generating a characteristic value of endorsement signature data;
and replacing endorsement signature data in the transaction data of the transaction request with the characteristic value, and broadcasting the transaction data in the blockchain.
Optionally, generating the feature value of the endorsement signature data includes:
and carrying out Hash calculation on the endorsement signature data based on a preset Hash algorithm to obtain a characteristic value.
Optionally, before broadcasting the transaction data within the blockchain, the method further comprises:
and adding the address information of the endorsement storage node corresponding to the endorsement signature data to the transaction data.
In a second aspect, an embodiment of the present application provides another endorsement signature data storage method, where the method includes:
when any endorsement storage node receives endorsement signature data sent by a corresponding transaction initiating node, generating a characteristic value of the endorsement signature data;
and storing the characteristic value and the endorsement signature data in association.
Optionally, the method further includes:
and synchronizing the characteristic value and the endorsement signature data in all endorsement storage nodes except any endorsement storage node in the block chain so that all endorsement storage nodes store the characteristic value and the endorsement signature data in an associated manner.
Optionally, the method further includes:
and when an acquisition request for endorsement signature data is received, returning the endorsement signature data corresponding to the acquisition request.
Optionally, determining endorsement signature data corresponding to the acquisition request includes:
and inquiring endorsement signature data corresponding to the acquisition request based on the characteristic value corresponding to the endorsement signature data carried in the acquisition request.
In a third aspect, an embodiment of the present application provides an endorsement signature data storage apparatus, including:
the endorsement signature result collection module is used for sending the transaction request to the endorsement node and receiving an endorsement signature result returned after the endorsement node carries out endorsement signature on the transaction request;
and the endorsement signature data sending module is used for sending the endorsement signature data to the endorsement storage node when the received endorsement signature result meets a preset endorsement strategy so as to enable the endorsement storage node to store the endorsement signature data.
Optionally, the endorsement signature data comprises any one of:
endorsement signature results;
endorsement signature results and endorsement policies.
Optionally, the apparatus further includes a transaction data broadcasting module, configured to:
generating a characteristic value of endorsement signature data;
and replacing endorsement signature data in the transaction data of the transaction request with the characteristic value, and broadcasting the transaction data in the blockchain.
Optionally, when the transaction data broadcasting module generates the feature value of the endorsement signature data, the transaction data broadcasting module is specifically configured to:
and carrying out Hash calculation on the endorsement signature data based on a preset Hash algorithm to obtain a characteristic value.
Optionally, the apparatus further includes an address information adding module, configured to:
before the transaction data is broadcasted in the blockchain, address information of the endorsement storage node corresponding to the endorsement signature data is added to the transaction data.
In a fourth aspect, an embodiment of the present application provides another endorsement signature data storage apparatus, including:
the characteristic value generating module is used for generating the characteristic value of the endorsement signature data when any endorsement storage node receives the endorsement signature data sent by the corresponding transaction initiating node;
and the endorsement signature data storage module is used for storing the characteristic value and the endorsement signature data in a correlation mode.
Optionally, the apparatus further comprises:
and the data synchronization module is used for synchronizing the characteristic value and the endorsement signature data in all endorsement storage nodes except any endorsement storage node in the block chain, so that all endorsement storage nodes store the characteristic value and the endorsement signature data in an associated manner.
Optionally, the apparatus further comprises:
and the endorsement signature data returning module is used for returning the endorsement signature data corresponding to the acquisition request when the acquisition request of the endorsement signature data is received.
Optionally, when determining the endorsement signature data corresponding to the acquisition request, the endorsement signature data returning module is specifically configured to:
and inquiring endorsement signature data corresponding to the acquisition request based on the characteristic value corresponding to the endorsement signature data carried in the acquisition request.
In a fifth aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;
a memory for storing operating instructions;
a processor, configured to execute the endorsement signature data storage method as shown in any implementation manner of the first aspect or any implementation manner of the second aspect of the present application by calling an operation instruction.
In a sixth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the endorsement signature data storage method shown in any implementation manner of the first aspect or any implementation manner of the second aspect of the present application.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
according to the scheme provided by the embodiment of the application, after the transaction request is sent to the endorsement node, the endorsement signature result of the endorsement node on the transaction request is received, and when the received endorsement signature result meets the preset endorsement strategy, the endorsement signature data is sent to the endorsement storage node, so that the endorsement storage node stores the endorsement signature data. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a method for storing endorsement signature data according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another endorsement signature data storage method according to an embodiment of the present application;
FIG. 3 is a block chain completion transaction flow diagram according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an endorsement signature data storage device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another endorsement signature data storage device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 shows a schematic flow diagram of a method for storing endorsement signature data provided in an embodiment of the present application, and as shown in fig. 1, the method mainly includes:
step S110: sending the transaction request to an endorsement node, and receiving an endorsement signature result returned after the endorsement node carries out endorsement signature on the transaction request;
step S120: and when the received endorsement signature result meets a preset endorsement strategy, sending the endorsement signature data to the endorsement storage node so that the endorsement storage node stores the endorsement signature data.
In this embodiment of the application, a transaction initiating node in a blockchain may receive a transaction request sent by a client, and as an example, a specific form of the transaction request may be as shown in table 1:
TABLE 1
Figure BDA0002653882240000061
The payload is an encoding of specific contents of the transaction, and thus, the transaction contents can be analyzed. signature is the signature of the transaction initiator on the payload, and all transactions need to verify the validity of the initiator signature before parsing the payload. Specific endorsement policies may be included in the transaction request. The transaction initiator formulates an endorsement policy according to the business logic of the transaction, such as: all nodes may be designated to be signed, or some nodes may be designated to be signed. And (3) endorsement node aggregation: a set of endorsement nodes that can endorse signatures specified in a transaction policy.
And after receiving the transaction request, the transaction initiating node can verify the signature, and if the verification is passed, the transaction initiating node broadcasts the transaction request to the endorsement node. After receiving the transaction request, each endorsement node can verify the transaction request and perform endorsement signature after the verification is passed. And the endorsement node returns the endorsement signature result to the transaction initiating node.
And the transaction initiating node collects endorsement signature results returned by each endorsement node and determines whether the collected endorsement signature results meet an endorsement strategy. For example, if the endorsement policy specifies that all endorsement nodes need to be signed, it should be determined whether endorsement signature results of all endorsement nodes are collected. For another example, endorsement nodes of a part specified in the endorsement policy all need to be signed, and whether endorsement signature results of the specified endorsement nodes are collected or not is determined.
When the collected endorsement signature result meets the endorsement strategy, the transaction initiating node can send the endorsement signature data to the endorsement storage node, the endorsement storage node can store the endorsement signature data, and other nodes can request the endorsement storage node for the endorsement signature data when needing to use the endorsement signature data, without storing the endorsement signature data. In actual use, the node can select whether to store the endorsement signature data according to the use requirement of the node.
In particular, the endorsement signature data may be the endorsement signature result or the endorsement signature result and the endorsement policy.
According to the method provided by the embodiment of the application, after the transaction request is sent to the endorsement node, the endorsement signature result of the endorsement node on the transaction request is received, and when the received endorsement signature result meets the preset endorsement strategy, the endorsement signature data is sent to the endorsement storage node, so that the endorsement storage node stores the endorsement signature data. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.
In an optional manner of the embodiment of the present application, the method further includes:
generating a characteristic value of endorsement signature data;
and replacing endorsement signature data in the transaction data of the transaction request with the characteristic value, and broadcasting the transaction data in the blockchain.
In the embodiment of the application, the characteristic value of the endorsement signature data can be generated, and the signature data in the transaction data is replaced by the characteristic value, so that the problem that the data volume of the transaction data is large when the endorsement signature data is directly added into the transaction data is avoided.
As an example, in the prior art, the specific form of the transaction data of the transaction request may be as shown in table 2:
TABLE 2
Figure BDA0002653882240000071
Wherein, the endorsement signature set is a set of endorsement signature results. Endorsement signature a1, endorsement signature a2, endorsement signature b1, and endorsement signature b2 are specific endorsement signatures.
After replacing the endorsement signature data in the transaction data with the feature value, the specific form of the transaction data may be as shown in table 3:
TABLE 3
Figure BDA0002653882240000081
Wherein, the endorsement feature value is the feature value generated based on the endorsement signature result. Feature value m1, i.e., a feature value generated based on endorsement signature a1 and endorsement signature a 2. Feature value m2, i.e., a feature value generated based on endorsement signature b1 and endorsement signature b 2.
In the embodiment of the application, the endorsement signature result may have a large data size, and the characteristic value may be generated for the endorsement signature result, and the endorsement signature result in the transaction data is replaced with the characteristic value. Since the endorsement policy also occupies a space, in practical use, the characteristic value can be generated based on the endorsement signature result and the endorsement policy together, and the endorsement signature result and the endorsement policy in the transaction data are replaced by the characteristic value. By the mode, the endorsement signature data can be compressed, and the occupation of storage space is reduced.
In an optional manner of the embodiment of the present application, generating a feature value of endorsement signature data includes:
and carrying out Hash calculation on the endorsement signature data based on a preset Hash algorithm to obtain a characteristic value.
In the embodiment of the application, hash calculation can be performed on endorsement signature data based on a preset hash algorithm to obtain a hash value. The hash value is used as a feature value, so that the data volume of the transaction data can be reduced.
In an optional manner of this embodiment of the present application, before broadcasting the transaction data in the blockchain, the method further includes:
and adding the address information of the endorsement storage node corresponding to the endorsement signature data to the transaction data.
In the embodiment of the application, the address of the endorsement storage node can be attached to the transaction of the transaction request, so that the efficiency of acquiring the endorsement signature data is improved. In particular, an endorsement storage node address field may be added to the transaction data, which may be a node identification or a network address of the node.
Fig. 2 shows a schematic flow diagram of another endorsement signature data storage method provided in an embodiment of the present application, where the method is applied to any endorsement storage node in a block chain, and as shown in fig. 2, the method mainly includes:
step S210: when endorsement signature data sent by a corresponding transaction initiating node is received, generating a characteristic value of the endorsement signature data;
step S220: and storing the characteristic value and the endorsement signature data in association.
In the embodiment of the application, after the endorsement node in the block chain receives the endorsement signature data sent by the transaction initiating node, hash calculation can be performed on the endorsement signature data based on the hash algorithm to obtain the characteristic value, and the characteristic value and the endorsement signature data are stored in an associated manner.
In actual use, the endorsement signature data sent by the transaction initiating node may include transaction ID information, and the endorsement storage node may establish a dual index according to the transaction ID information and the feature value. So that other nodes can query the complete endorsement signature data according to the transaction ID information and the characteristic value.
As an example, the specific form of endorsement signature data store may be as shown in table 4:
TABLE 4
Index 1 Index 2 Endorsement signature data
Transaction ID for transaction 1 Characteristic value n1 { endorsement signature c1, endorsement signature c2, endorsement signature c3}
The endorsement signature digest or the transaction ID in the storage node is stored to query the complete endorsement signature data.
In actual use, the endorsement storage node can verify the validity of the endorsement signature result before storing the endorsement signature data, and store the endorsement signature data after confirming that the endorsement signature result is valid.
The characteristic value and the endorsement signature data are stored in the endorsement storage nodes in the block chain in an associated mode, so that all the nodes are prevented from storing the endorsement signature data. In the transaction data of the transaction request, the endorsement signature data can be compressed into a characteristic value, so that the storage pressure on a blockchain system is reduced, and other nodes can directly acquire the endorsement signature data from the endorsement storage node when the complete endorsement signature data is required to be used.
According to the method provided by the embodiment of the application, the endorsement storage node can generate the characteristic value of the endorsement signature data when receiving the endorsement signature data sent by the corresponding transaction initiating node, and stores the characteristic value and the endorsement signature data in a correlation mode. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.
In an optional manner of the embodiment of the present application, the method further includes:
and synchronizing the characteristic value and the endorsement signature data in all endorsement storage nodes except any endorsement storage node in the block chain so that all endorsement storage nodes store the characteristic value and the endorsement signature data in an associated manner.
In the embodiment of the application, a plurality of endorsement storage nodes can be deployed in the block chain, and endorsement signature data and characteristic values can be synchronized in the plurality of endorsement storage nodes, so that all endorsement storage nodes store the characteristic values and the endorsement signature data in an associated manner.
In an optional manner of the embodiment of the present application, the method further includes:
and when an acquisition request for endorsement signature data is received, returning the endorsement signature data corresponding to the acquisition request.
In the embodiment of the application, when an acquisition request of endorsement signature data sent by other nodes is received, corresponding endorsement signature data can be returned.
In an optional manner of the embodiment of the present application, determining endorsement signature data corresponding to the acquisition request includes:
and inquiring endorsement signature data corresponding to the acquisition request based on the characteristic value corresponding to the endorsement signature data carried in the acquisition request.
In the embodiment of the application, the obtaining request may carry a characteristic value corresponding to the endorsement signature data, and the endorsement signature data may be queried based on the characteristic value. In actual use, if the endorsement storage node also uses the transaction ID information for indexing, the acquisition request may also carry the transaction ID information to query the endorsement signature data.
Fig. 3 is a flow chart illustrating a block chain completion transaction provided in an embodiment of the present application, which is described in detail as follows:
(1) the node 1, namely the transaction initiating node, sends a transaction request to the node 1 by the client.
(2) And after receiving the transaction request, the node 1 verifies the signature of the initiator by using the public key of the client, if the verification fails, the node returns prompt information to the client, and if the verification passes, the transaction continues.
(3) Node 1 broadcasts transaction requests to endorsement node 1, endorsement node 2, and endorsement node 3.
(4) The endorsement node set receives the transaction request, signs after verifying the transaction, and the signing process is as follows:
common parameters: g is the base point of the elliptic curve and P is the order of the elliptic curve.
Inputting: private key dA and transaction content payload
And (3) calculating: a. generating a random number k;
b. calculating P ═ k × G;
c. taking an x coordinate value R of P;
d、S=k-1(hash(payload)+dA*R)modp
and (3) outputting: (R, S), wherein R, S are each 256-bit long numbers.
Endorsement signature results of each endorsement node are as follows:
endorsement signature a1 { (R1, S1), public key 1 of endorsement node 1}
Endorsement signature a2 { (R2, S2), public key 2 of endorsement node 2}
Endorsement signature a3 { (R3, S3), public key 3 of endorsement node 3}
Each endorsement node feeds back the calculated endorsement signature a1, endorsement signature a2 and endorsement signature a3 to node 1.
(5) If the endorsement strategy 1 specifies that the endorsement signature results of three endorsement nodes, namely an endorsement node 1, an endorsement node 2, an endorsement node 3 and the like, need to be received, when the node 1 collects the endorsement signature results of the three endorsement nodes, namely the endorsement node 1, the endorsement node 2, the endorsement node 3 and the like, the correct endorsement of the current transaction is indicated; when the node 1 does not collect endorsement signature results of three endorsement nodes, namely the endorsement node 1, the endorsement node 2, the endorsement node 3 and the like, the current transaction is abandoned.
(6) After the current transaction is endorsed correctly, node 1 will endorse the signature data information: { transaction ID information ID1, endorsement signature a1, endorsement signature a2 and endorsement signature a3}, sending to an endorsement storage node, and calculating a characteristic value n by the storage node according to all endorsement signature results:
n-hash (endorsement signature a1, endorsement signature a2, endorsement signature a3)
After the eigenvalue n is calculated, an index may be built based on the eigenvalue n and the transaction ID. Meanwhile, endorsement signature data information can be obtained among endorsement storage nodes in the whole network: { transaction ID information ID1, endorsement signature a1, endorsement signature a2, endorsement signature a3} performs data synchronization by gossip protocol.
(7) And the node 1 compresses all endorsement signature results into a characteristic value m:
m-hash (endorsement signature a1, endorsement signature a2, endorsement signature a 3).
Wherein m and n are feature values obtained by different nodes performing hash operation on endorsement signature data according to the same hash algorithm, and are actually equal.
After the endorsement signature result is compressed successfully, the node 1 may replace the endorsement signature data in the transaction data with the characteristic value thereof, and package and send the replaced transaction data to the consensus node.
(8) The consensus node sequences the transaction data of the transaction request, creates a block uplink, and then broadcasts the block uplink all over the network.
(9) The node 2 acquires the latest block, and analyzes the latest block to obtain a transaction 1, wherein the transaction data of the transaction 1 comprises: the method comprises the steps of verifying whether signature of an initiator on the payload is legal or not, prompting that the transaction is invalid if the signature of the initiator on the payload is illegal, returning prompt information to a client, and continuing the transaction if the signature of the initiator on the payload is legal.
(10) And the node 2 acquires endorsement signature data from the endorsement storage node according to the characteristic value.
(11) And the node 2 verifies whether the acquired endorsement signature data is correct, namely m2 is calculated to be hash (a1, a2 and a3), whether m2 is consistent with m is judged, and if the m2 is consistent with m, the endorsement signature data is determined to be correct.
(12) And the node 2 verifies whether the endorsement signature result set accords with the endorsement strategy, and if so, the node continues to verify the endorsement signature result.
(13) Node 2 verifies endorsement signature a1, endorsement signature a2 and endorsement signature a3, and the calculation process is as follows:
and calculating P by using R, S and the public key, judging whether the finally calculated P and R are equal, and if so, signing by:
common parameters: g is a preset generation point of the elliptic curve
Inputting: the signature result (R, S) and Qa are the public key and transaction data payload corresponding to the signature private key
And (3) calculating: P-S-1 hash (payload) G + S-1R Qa
And (3) outputting: and whether P is equal to R or not, and if so, the verification is passed.
(14) And verifying the legality of the transaction content (whether the balance is sufficient, whether the transfer amount is satisfied, and the like), and if the verification is successful, the accounting node accounts.
As an example, when 100 nodes participate in endorsement, the situations before and after compressing endorsement signature data are compared as follows:
(1) the client sends the transaction request to the transaction initiating node, and the specific form of the transaction content is shown in table 5:
TABLE 5
Figure BDA0002653882240000131
In table 5, endorsement policy 2 requires endorsement node 1, endorsement node 2, … …, and 100 endorsement nodes in total provide endorsement signature results.
(2) The transaction initiating node receives the transaction request, verifies the signature of the initiator, and broadcasts the transaction request to 100 designated endorsement nodes after the verification is passed, wherein the specific form of the broadcasted transaction data is shown in table 6:
TABLE 6
Figure BDA0002653882240000132
Signing after the endorsement node set receives the transaction request respectively, wherein the endorsement signature result of each endorsement node is as follows:
{ (R1, S1), public key 1 of endorsement node 1},
{ (R2, S2), public key 2 of endorsement node 2},
{……},
{ (R100, S100), public key 100 of endorsement node 100}
Each endorsement node feeds back the calculated endorsement signature result to the transaction initiating node, wherein ID2 is the ID information of the transaction, and the specific form of the collected endorsement signature result is shown in table 7:
TABLE 7
Figure BDA0002653882240000141
(3) The node receives an endorsement signature result set of the endorsement node, and the endorsement signature result set is as follows:
{ ((R1, S1), public key 1 of endorsement node 1), ((R2, S2), public key 2 of endorsement node 2), … …, ((R100, S100), public key 100 of endorsement node 100) }
R, S are each 256-bit numbers according to the signature algorithm described above. The public key is a point of an elliptic curve, generally 512 bits in length, and can be compressed into a number of 256 bits in length when stored, and similarly, P is represented by R. Thus, the total space occupied by the endorsement signature result set is:
Rlt=(256+256+256)*100=76800bit=9600Byte=9.375KB
(4) the transaction initiating node compresses the signature result set to generate a characteristic value:
m1 ═ hash (((R1, S1), public key 1 of endorsement node 1), ((R2, S2), public key 2 of endorsement node 2), … …, ((R100, S100), public key 100 of endorsement node 100)).
The resulting endorsement signature m1 is 256 bits in size according to a hash function.
Therefore, comparing the endorsement signature data before and after compression, the compression ratio is the ratio of the size of the file after compression to the size before compression, and therefore the compression ratio is:
Comrate=256/76800=0.333333%
based on the same principle as the method shown in fig. 1, fig. 4 shows a schematic structural diagram of an endorsement signature data storage device provided in an embodiment of the present application, and as shown in fig. 4, the endorsement signature data storage device 30 may include:
the endorsement signature result collection module 310 is configured to send the transaction request to the endorsement node, and receive an endorsement signature result returned after the endorsement node performs an endorsement signature on the transaction request;
and the endorsement signature data sending module 320 is configured to send the endorsement signature data to the endorsement storage node when the received endorsement signature result meets a preset endorsement policy, so that the endorsement storage node stores the endorsement signature data.
According to the scheme provided by the embodiment of the application, after the transaction request is sent to the endorsement node, the endorsement signature result of the endorsement node on the transaction request is received, and when the received endorsement signature result meets the preset endorsement strategy, the endorsement signature data is sent to the endorsement storage node, so that the endorsement storage node stores the endorsement signature data. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.
Optionally, the endorsement signature data comprises any one of:
endorsement signature results;
endorsement signature results and endorsement policies.
Optionally, the apparatus further includes a transaction data broadcasting module, configured to:
generating a characteristic value of endorsement signature data;
and replacing endorsement signature data in the transaction data of the transaction request with the characteristic value, and broadcasting the transaction data in the blockchain.
Optionally, when the transaction data broadcasting module generates the feature value of the endorsement signature data, the transaction data broadcasting module is specifically configured to:
and carrying out Hash calculation on the endorsement signature data based on a preset Hash algorithm to obtain a characteristic value.
Optionally, the apparatus further includes an address information adding module, configured to:
before the transaction data is broadcasted in the blockchain, address information of the endorsement storage node corresponding to the endorsement signature data is added to the transaction data.
It is understood that the above modules of the endorsement signature data storage apparatus in the present embodiment have functions of implementing corresponding steps of the endorsement signature data storage method in the embodiment shown in fig. 1. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the endorsement signature data storage device, reference may be specifically made to the corresponding description of the endorsement signature data storage method in the embodiment shown in fig. 1, and details are not described here again.
Based on the same principle as the method shown in fig. 2, fig. 5 shows a schematic structural diagram of another endorsement signature data storage device provided in an embodiment of the present application, where the endorsement signature data storage device is deployed in any endorsement storage node in a blockchain, and as shown in fig. 5, the endorsement signature data storage device 40 may include:
the characteristic value generation module 410 is configured to generate a characteristic value of endorsement signature data when receiving endorsement signature data sent by a corresponding transaction initiating node;
and an endorsement signature data storage module 420, configured to store the feature value in association with the endorsement signature data.
According to the device provided by the embodiment of the application, the endorsement storage node can generate the characteristic value of the endorsement signature data when receiving the endorsement signature data sent by the corresponding transaction initiating node, and stores the characteristic value and the endorsement signature data in a correlation mode. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.
Optionally, the apparatus further comprises:
and the data synchronization module is used for synchronizing the characteristic value and the endorsement signature data in all endorsement storage nodes except any endorsement storage node in the block chain, so that all endorsement storage nodes store the characteristic value and the endorsement signature data in an associated manner.
Optionally, the apparatus further comprises:
and the endorsement signature data returning module is used for returning the endorsement signature data corresponding to the acquisition request when the acquisition request of the endorsement signature data is received.
Optionally, when determining the endorsement signature data corresponding to the acquisition request, the endorsement signature data returning module is specifically configured to:
and inquiring endorsement signature data corresponding to the acquisition request based on the characteristic value corresponding to the endorsement signature data carried in the acquisition request.
It is understood that the above modules of the endorsement signature data storage apparatus in the present embodiment have functions of implementing corresponding steps of the endorsement signature data storage method in the embodiment shown in fig. 2. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the endorsement signature data storage device, reference may be specifically made to the corresponding description of the endorsement signature data storage method in the embodiment shown in fig. 2, and details are not described here again.
The embodiment of the application provides an electronic device, which comprises a processor and a memory;
a memory for storing operating instructions;
and the processor is used for executing the endorsement signature data storage method provided by any embodiment of the application by calling the operation instruction.
As an example, fig. 6 shows a schematic structural diagram of an electronic device to which an embodiment of the present application is applicable, and as shown in fig. 6, the electronic device 2000 includes: a processor 2001 and a memory 2003. Wherein the processor 2001 is coupled to a memory 2003, such as via a bus 2002. Optionally, the electronic device 2000 may also include a transceiver 2004. It should be noted that the transceiver 2004 is not limited to one in practical applications, and the structure of the electronic device 2000 is not limited to the embodiment of the present application.
The processor 2001 is applied to the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 2004 may include a receiver and a transmitter, and the transceiver 2004 is applied to the embodiments of the present application to implement the functions of the electronic device of the embodiments of the present application to communicate with other devices when executed.
The Processor 2001 may be a CPU (Central Processing Unit), general Processor, DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 2001 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like.
Bus 2002 may include a path that conveys information between the aforementioned components. The bus 2002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 2002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
The Memory 2003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
Optionally, the memory 2003 is used for storing application program code for performing the disclosed aspects, and is controlled in execution by the processor 2001. The processor 2001 is configured to execute the application program code stored in the memory 2003 to implement the endorsement signature data storage method provided in any embodiment of the present application.
The electronic device provided by the embodiment of the application is applicable to any embodiment of the method, and is not described herein again.
Compared with the prior art, the electronic equipment receives the endorsement signature result of the endorsement node on the transaction request after the transaction request is sent to the endorsement node, and sends the endorsement signature data to the endorsement storage node when the received endorsement signature result meets the preset endorsement strategy, so that the endorsement storage node stores the endorsement signature data. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.
The embodiment of the application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method for storing endorsement signature data shown in the above method embodiment is implemented.
The computer-readable storage medium provided in the embodiments of the present application is applicable to any of the embodiments of the foregoing method, and is not described herein again.
Compared with the prior art, the embodiment of the application provides a computer-readable storage medium, after a transaction request is sent to an endorsement node, an endorsement signature result of the endorsement node on the transaction request is received, and when the received endorsement signature result meets a preset endorsement strategy, endorsement signature data are sent to an endorsement storage node, so that the endorsement storage node stores the endorsement signature data. Based on the scheme, endorsement signature data can be stored in endorsement storage nodes in a block chain in a centralized manner, a basis is provided for block chain nodes needing to use the endorsement signature data to acquire the endorsement signature data from the endorsement storage nodes, the endorsement signature data is not stored in all the nodes in the block chain, the storage burden of a block chain system is reduced, and some nodes not involved in transaction can select not to store the endorsement signature data, so that the storage burden of the block chain system is avoided.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (13)

1. An endorsement signature data storage method, comprising:
sending a transaction request to an endorsement node, and receiving an endorsement signature result returned after the endorsement node carries out endorsement signature on the transaction request;
and when the received endorsement signature result meets a preset endorsement strategy, sending the endorsement signature data to an endorsement storage node so that the endorsement storage node stores the endorsement signature data.
2. The method of claim 1, wherein the endorsement signature data comprises any one of:
endorsement signature results;
endorsement signature results and the endorsement policy.
3. The method of claim 1, further comprising:
generating a characteristic value of the endorsement signature data;
and replacing the endorsement signature data in the transaction data of the transaction request with the characteristic value, and broadcasting the transaction data in a block chain.
4. The method of claim 3, wherein generating the characteristic value of the endorsement signature data comprises:
and carrying out Hash calculation on the endorsement signature data based on a preset Hash algorithm to obtain a characteristic value.
5. The method of any of claims 1-4, wherein prior to broadcasting the transaction data within a blockchain, the method further comprises:
and adding address information of an endorsement storage node corresponding to the endorsement signature data to the transaction data.
6. An endorsement signature data storage method is applied to any endorsement storage node in a block chain, and comprises the following steps:
when endorsement signature data sent by a corresponding transaction initiating node is received, generating a characteristic value of the endorsement signature data;
and storing the characteristic value and the endorsement signature data in a correlation mode.
7. The method of claim 6, further comprising:
and synchronizing the characteristic value and the endorsement signature data in all endorsement storage nodes except any endorsement storage node in the block chain, so that all endorsement storage nodes store the characteristic value and the endorsement signature data in an associated manner.
8. The method of claim 6, further comprising:
and when an acquisition request for the endorsement signature data is received, returning the endorsement signature data corresponding to the acquisition request.
9. The method of claim 8, wherein determining endorsement signature data corresponding to the acquisition request comprises:
and inquiring endorsement signature data corresponding to the acquisition request based on the characteristic value corresponding to the endorsement signature data carried in the acquisition request.
10. An endorsement signature data store, comprising:
the endorsement signature result collection module is used for sending the transaction request to an endorsement node and receiving an endorsement signature result returned after the endorsement node carries out endorsement signature on the transaction request;
and the endorsement signature data sending module is used for sending the endorsement signature data to an endorsement storage node when the received endorsement signature result meets a preset endorsement strategy so as to enable the endorsement storage node to store the endorsement signature data.
11. An endorsement signature data store, comprising:
the system comprises a characteristic value generation module, a transaction initiation node and a characteristic value generation module, wherein the characteristic value generation module is used for generating a characteristic value of endorsement signature data when receiving endorsement signature data sent by a corresponding transaction initiation node;
and the endorsement signature data storage module is used for storing the characteristic value and the endorsement signature data in a correlation mode.
12. An electronic device comprising a processor and a memory;
the memory is used for storing operation instructions;
the processor is used for executing the method of any one of claims 1-9 by calling the operation instruction.
13. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method of any one of claims 1-9.
CN202010880161.XA 2020-08-27 2020-08-27 Endorsement signature data storage method and device, electronic equipment and readable storage medium Pending CN112053153A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010880161.XA CN112053153A (en) 2020-08-27 2020-08-27 Endorsement signature data storage method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010880161.XA CN112053153A (en) 2020-08-27 2020-08-27 Endorsement signature data storage method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112053153A true CN112053153A (en) 2020-12-08

Family

ID=73600138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010880161.XA Pending CN112053153A (en) 2020-08-27 2020-08-27 Endorsement signature data storage method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112053153A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527912A (en) * 2021-02-07 2021-03-19 腾讯科技(深圳)有限公司 Data processing method and device based on block chain network and computer equipment
CN112686672A (en) * 2021-01-08 2021-04-20 新晨科技股份有限公司 Block chain endorsement signature compression method, electronic device and storage medium
CN113806441A (en) * 2021-02-09 2021-12-17 京东科技控股股份有限公司 Block chain based signature processing method and device, electronic equipment and storage medium
CN115033645A (en) * 2022-07-06 2022-09-09 贵州电网有限责任公司 Electric power data storage method and system based on block chain technology

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112686672A (en) * 2021-01-08 2021-04-20 新晨科技股份有限公司 Block chain endorsement signature compression method, electronic device and storage medium
CN112527912A (en) * 2021-02-07 2021-03-19 腾讯科技(深圳)有限公司 Data processing method and device based on block chain network and computer equipment
CN112527912B (en) * 2021-02-07 2021-06-01 腾讯科技(深圳)有限公司 Data processing method and device based on block chain network and computer equipment
WO2022166637A1 (en) * 2021-02-07 2022-08-11 腾讯科技(深圳)有限公司 Blockchain network-based method and apparatus for data processing, and computer device
CN113806441A (en) * 2021-02-09 2021-12-17 京东科技控股股份有限公司 Block chain based signature processing method and device, electronic equipment and storage medium
CN113806441B (en) * 2021-02-09 2024-04-05 京东科技控股股份有限公司 Signature processing method and device based on blockchain, electronic equipment and storage medium
CN115033645A (en) * 2022-07-06 2022-09-09 贵州电网有限责任公司 Electric power data storage method and system based on block chain technology
CN115033645B (en) * 2022-07-06 2023-11-21 贵州电网有限责任公司 Power data storage method and system based on block chain technology

Similar Documents

Publication Publication Date Title
CN112053153A (en) Endorsement signature data storage method and device, electronic equipment and readable storage medium
CN112446785B (en) Cross-chain transaction method, system, device, equipment and storage medium
CN113329031B (en) Method and device for generating state tree of block
CN109242500B (en) Block chain transaction validity verification method and device and storage medium
US11336451B2 (en) Cross-blockchain resource transmission
US10341431B2 (en) System and method for announcing cryptographic keys on a blockchain
WO2018177093A1 (en) Block chain processing method, accounting node, verification node and storage medium
CN109167661B (en) Byzantine fault-tolerant consensus method applied to alliance chain and terminal
CN110070445B (en) Transaction processing method and device based on blockchain system
CN111080287B (en) Service data processing method, related equipment and system
CN112734431B (en) Method and device for querying Fabric Block Link book data
CN111640018B (en) Block chain transaction existence verification method and device
CN114519198A (en) Block chain consensus method and computer-readable storage medium
CN111666289A (en) Data storage and query method and device, electronic equipment and readable storage medium
CN111241586A (en) Anonymous processing method and system for block link address, terminal and storage medium
CN110545170A (en) Block chain consensus method, device and equipment based on password drawing
CN113420277A (en) Digital identity management and verification method based on intelligent contract
CN112994891B (en) Transaction request consensus method and system based on threshold signature
CN109327475B (en) Multi-layer identity authentication method, device, equipment and storage medium
US10924287B2 (en) Digital signature technique
JP2003513480A (en) A method for proving the authenticity of an entity and / or the integrity of a message
CN106856431A (en) Improved ECDSA and sign test method
CN113112269B (en) Multiple signature method, computer device, and storage medium
CN111524011B (en) Parallel link consensus validation method, apparatus, and storage medium
CN112634034A (en) Reservation method, reservation device, electronic equipment and computer 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