CN112884477B - Block chain transaction initiating method and system - Google Patents

Block chain transaction initiating method and system Download PDF

Info

Publication number
CN112884477B
CN112884477B CN202110403707.7A CN202110403707A CN112884477B CN 112884477 B CN112884477 B CN 112884477B CN 202110403707 A CN202110403707 A CN 202110403707A CN 112884477 B CN112884477 B CN 112884477B
Authority
CN
China
Prior art keywords
transaction
random factor
user
hash value
transaction data
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
Application number
CN202110403707.7A
Other languages
Chinese (zh)
Other versions
CN112884477A (en
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110403707.7A priority Critical patent/CN112884477B/en
Publication of CN112884477A publication Critical patent/CN112884477A/en
Application granted granted Critical
Publication of CN112884477B publication Critical patent/CN112884477B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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/389Keeping log of transactions for guaranteeing non-repudiation of a transaction

Abstract

The embodiment of the specification discloses a method and a system for initiating and verifying a blockchain transaction. For fixed transaction content, the user terminal initiates a first transaction, the first transaction comprises first transaction data and a first random factor, and the first transaction data comprises transaction content and a first time stamp. And after the user side confirms that the first transaction uplink fails, calculating a second random factor at least based on the second transaction data and the private key of the user, and sending the second transaction to the block chain network. Wherein the second transaction comprises second transaction data and a second random factor, the second transaction data comprising the transaction content and a second timestamp. And the second random factor enables the output of the chameleon hash function when the second transaction data, the second random factor and the public key of the user are used as input to be equal to the transaction hash value, and the transaction hash value is the output of the chameleon hash function when the first transaction data, the first random factor and the public key of the user are used as input.

Description

Block chain transaction initiating method and system
Description of the cases
The application is a divisional application of the Chinese invention patent 202011247837.8 entitled "a method and system for initiating and verifying a blockchain transaction".
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to a method and a system for initiating a blockchain transaction.
Background
In the blockchain system, the ue-initiated transaction is not necessarily performed by the blockchain node (also called uplink failure). The transaction re-initiated by the user side not only contains fixed transaction content, but also contains modified transaction timestamp, so that the problem that different transaction hash values are generated by the fixed transaction content occurs, and troubles are caused to the user.
In view of the above, it is desirable to provide a scheme for maintaining the transaction hash value after modifying the transaction timestamp.
Disclosure of Invention
One embodiment of the present disclosure provides a method for initiating a blockchain transaction. The method comprises the following steps: confirming a uplink result of a first transaction, wherein the first transaction comprises first transaction data and a first random factor, and the first transaction data comprises transaction content and a first time stamp; if the first trade uplink fails, then: obtaining second transaction data, the second transaction data including the transaction content and a second timestamp; and calculating a second random factor based on at least the second transaction data and the private key of the user, and sending a second transaction to a blockchain network, wherein the second transaction comprises the second transaction data and the second random factor, the second random factor enables the output of the chameleon hash function when the second transaction data, the second random factor and the public key are used as input to be equal to a transaction hash value, and the transaction hash value is the output of the chameleon hash function when the first transaction data, the first random factor and the public key of the user are used as input.
One embodiment of the present specification provides a blockchain transaction initiation system. The system comprises a transaction compensation uplink module; the transaction compensation uplink module is used for: confirming a uplink result of a first transaction, wherein the first transaction comprises first transaction data and a first random factor, and the first transaction data comprises transaction content and a first time stamp; if the first trade uplink fails, then: obtaining second transaction data, the second transaction data including the transaction content and a second timestamp; and calculating a second random factor based on at least the second transaction data and the private key of the user, and sending a second transaction to a blockchain network, wherein the second transaction comprises the second transaction data and the second random factor, the second random factor enables the output of the chameleon hash function when the second transaction data, the second random factor and the public key are used as input to be equal to a transaction hash value, and the transaction hash value is the output of the chameleon hash function when the first transaction data, the first random factor and the public key of the user are used as input.
One embodiment of the present disclosure provides a method for initiating a blockchain transaction. The method comprises the following steps: obtaining first transaction data, wherein the first transaction data comprises transaction content and a first timestamp; obtaining a first random factor; and sending a first transaction to a blockchain network, wherein the first transaction comprises the first transaction data and the first random factor, and the transaction hash value of the first transaction is output by a chameleon hash function and the first transaction data, the first random factor and a public key of a user are input.
One embodiment of the present disclosure provides a blockchain transaction initiation system. The system comprises: a first transaction data obtaining module for obtaining first transaction data, wherein the first transaction data comprises transaction content and a first timestamp; a first random factor obtaining module, configured to obtain a first random factor; and the transaction initiating module is used for sending a first transaction to a blockchain network, wherein the first transaction comprises the first transaction data and the first random factor, and the transaction hash value of the first transaction is output when a chameleon hash function takes the first transaction data, the first random factor and a public key of a user as input.
One embodiment of the present disclosure provides a blockchain transaction initiating device. The apparatus includes a processor and a storage device for storing instructions that, when executed by the processor, implement a blockchain transaction initiation method according to any embodiment of the specification.
One embodiment of the present disclosure provides a method for verifying a blockchain transaction. The method comprises the following steps: acquiring a transaction initiated by a target user through a blockchain user side, wherein the transaction comprises transaction data and a random factor; acquiring a public key of the target user; inputting the transaction data, the random factor and the public key into a chameleon hash function, and comparing the output of the chameleon hash function with a transaction hash value associated with the transaction; a transaction verification result is determined based on the comparison result.
One embodiment of the present disclosure provides a blockchain transaction verification system. The system comprises: the system comprises a transaction obtaining module, a block chain user side and a block chain processing module, wherein the transaction obtaining module is used for obtaining a transaction initiated by a target user through the block chain user side, and the transaction comprises transaction data and a random factor; the public key acquisition module is used for acquiring the public key of the target user; the calculation module is used for inputting the transaction data, the random factor and the public key into a chameleon hash function and comparing the output of the chameleon hash function with a transaction hash value associated with the transaction; and the verification result determining module is used for determining a transaction verification result based on the comparison result.
One embodiment of the present disclosure provides a blockchain transaction verification device. The apparatus comprises a processor and a storage device for storing instructions that, when executed by the processor, implement a blockchain transaction verification method as in any embodiment of the present specification.
Drawings
The present description will be further explained by way of exemplary embodiments, which will be described in detail by way of the accompanying drawings. These embodiments are not intended to be limiting, and in these embodiments like numerals are used to indicate like structures, wherein:
FIG. 1 is a schematic diagram of an application scenario of a blockchain system according to some embodiments of the present disclosure;
fig. 2 is an exemplary flow diagram of a blockchain transaction initiation method according to some embodiments of the present description;
FIG. 3 is an exemplary flow diagram of a blockchain transaction verification method according to some embodiments of the present description;
FIG. 4 is an exemplary block diagram of a blockchain transaction initiation system according to some embodiments of the present description;
fig. 5 is an exemplary block diagram of a blockchain transaction verification system according to some embodiments of the present description.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only examples or embodiments of the present description, and that for a person skilled in the art, the present description can also be applied to other similar scenarios on the basis of these drawings without inventive effort. Unless otherwise apparent from the context, or otherwise indicated, like reference numbers in the figures refer to the same structure or operation.
It should be understood that "system", "device", "unit" and/or "module" as used herein is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, other words may be substituted by other expressions if they accomplish the same purpose.
As used in this specification, the terms "a", "an" and/or "the" are not intended to be inclusive of the singular, but rather are intended to be inclusive of the plural, unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" are intended to cover only the explicitly identified steps or elements as not constituting an exclusive list and that the method or apparatus may comprise further steps or elements.
Flow charts are used in this description to illustrate operations performed by a system according to embodiments of the present description. It should be understood that the preceding or following operations are not necessarily performed in the exact order in which they are performed. Rather, the various steps may be processed in reverse order or simultaneously. Meanwhile, other operations may be added to or removed from these processes.
Fig. 1 is a schematic diagram of an application scenario of a blockchain system according to some embodiments of the present disclosure. As shown in fig. 1, the blockchain system 100 may include a user terminal 110, a blockchain network 120, and a network 130. Therein, blockchain network 120 may include a plurality of blockchain nodes, such as node 120-1, node 120-2, node 120-3, a.
The user terminal 110 may be a terminal using blockchain services, which may be linked to a node in the blockchain network 120 through the network 130. The client 110 may initiate a transaction, i.e., generate a transaction and send the generated transaction to the blockchain network 120, such that the transaction is broadcast over the blockchain network 120.
Transactions may be used to record various types of events and/or data. In some embodiments, the events of the transaction record may include one or more of an addition characterizing a new node, an exit of a node, a transfer, and the like. In some embodiments, the data of the transaction record may include one or more of medical information, electronic contracts, electronic credentials, electronic orders, digital fingerprints, and the like.
The desired code may be executed by a transaction trigger, which may also be referred to as execution of a transaction, and the block link points may be executors of the transaction. By way of example only, a transaction for recording transfer activity may trigger an update to the account balances of both transferring parties, a transaction for crediting data may trigger writing data to blockchain data, a transaction for querying data may trigger a query for blockchain data, and so on.
For various reasons, the transaction initiated by the ue 110 is not necessarily executed by the blk (also referred to as uplink failure), including the case where the transaction is never executed by the blk, and the transaction is executed and then rolled back (i.e. the node restores the data from the state after the transaction is executed to the state before the transaction is executed).
Some details of the uplink failure are illustrated below.
In some embodiments, the blockchain system 100 may employ a receive mode in order to achieve higher uplink throughput. In the receipt mode, the node may queue the transactions that are subsequently received and process the transactions in the queue in sequence. After the consensus passes, the node may pack the transaction into blocks, i.e., out of blocks.
Wherein, the transactions packed into the block can be screened from the queue. Typically, the blockchain system 100 has a mechanism to prevent transactions from being replayed, i.e., to prevent the same transaction from being repeatedly received and executed. Some mechanisms to prevent replay of transactions are illustrated below.
In some mechanisms, a user may initiate a transaction with their account, which is associated with a public-private key pair, where the account public key may be associated with an account identification. In some embodiments, an account-initiated transaction may include an identification of the account (which may also be referred to as an account address) and a transaction number associated with the account to distinguish between different transactions initiated by a particular account. Based on this, the nodes participating in the consensus may first check the above-mentioned fields in the received transaction to determine whether a particular transaction initiated by a particular account is repeatedly received. If not, the description is that the specific transaction initiated by the specific account is received for the first time, and the transaction can be executed. If so, indicating that the transaction has already been executed, execution of the transaction may be denied.
In still other mechanisms, the nodes participating in the consensus may compare the received transaction as a whole with other transactions, i.e., determine whether the two transactions are the same. If not, the description is that the specific transaction initiated by the specific account is received for the first time, and the transaction can be executed. If so, indicating that the transaction has been executed, execution of the transaction may be denied to prevent replay of the transaction.
In the above mechanism, even if any one of the received transactions is compared with other transactions partially or entirely, if all the transactions are compared together, the processing efficiency is very low.
In view of this, when the node processes the transaction in the queue in the receipt mode, it may be determined whether the transaction occurs within the set valid time period based on the timestamp in the transaction. If so, the transaction is considered valid, and necessary validation of the transaction is performed (e.g., anti-replay validation of the transaction based on valid transactions in the queue), and the transaction is blocked and executed based on the transaction. Otherwise, the transaction is deemed invalid and execution of the transaction may be denied without block generation based on the transaction.
In some embodiments, a user-initiated transaction may contain a digital signature generated using the user's private key on a digest (hash value) of a signed message composed of partial fields of the transaction. Accordingly, when processing the received transaction (denoted as transaction T), the node may also first verify the digital signature (i.e., the signature) with the public key associated with the account (denoted as user a) identifier in the transaction to confirm the origin and integrity of the received transaction. If the check sign passes, the transaction T is really from the user A and is not tampered. If the check-out fails, transaction T will not continue to be processed.
In some embodiments, a node may roll back a transaction executed later if two transactions are found to trigger an update to the same item of data (e.g., a balance of the same account) in the course of executing multiple transactions.
After confirming the uplink failure, the ue 110 may re-initiate a transaction that is the same as the uplink failed transaction. In some embodiments, the ue may query the node for the corresponding transaction based on the transaction identifier (e.g., transaction hash value), and if the corresponding transaction is queried, the node may confirm that the transaction is successfully linked. If the corresponding transaction is not inquired, it indicates that the uplink transaction fails. In some embodiments, after a period of processing, the node that received the transaction may return an uplink result to the ue 110 indicating the uplink success/failure.
It will be appreciated that the re-initiated transaction and the uplink failed transaction have different time stamps, which results in different hash values being generated due to the difference in time stamps even though the two transactions have the same transaction content. The transaction includes transaction data, the transaction data may include transaction content and a timestamp, and the transaction hash value may refer to a hash value obtained by using the transaction data as plaintext. In some embodiments, the transaction may also include a transaction hash value. It should be understood that the probability of a hash collision (same hash value but different plaintext) is extremely low (negligible), so the hash value and plaintext are generally considered to be in a one-to-one correspondence.
The same transaction content but different transaction hash values lead to problems. For example, to remain user friendly, the user terminal 110 may return the transaction hash value as a transaction identification to the user after initiating the transaction (e.g., display the transaction hash value on a graphical user interface). The user can query based on the transaction hash value, that is, the user terminal queries the node for the corresponding transaction based on the transaction hash value. If the transaction link fails, the ue 110 cannot query the transaction. Conversely, if the transaction is linked successfully, the ue 110 may query the transaction. Thus, the ue 110 may initiate a query to the blockchain network based on the hash value generated by the subsequently initiated uplink successful transaction, or still submit the hash value generated by the previous uplink failed transaction, but the node needs to find the hash value generated by the uplink successful transaction according to the hash value generated by the uplink failed transaction to query the uplink successful transaction. It is also confusing for the user to find that the same transaction content produces different hash values.
In view of this, in the embodiments of the present disclosure, the chameleon hash algorithm is used to calculate the transaction hash value, and the same hash value can be generated under the condition that the transaction timestamps are different, so as to avoid the problem that the transaction hash values are different while the transaction contents are the same.
In some embodiments, the nodes in the user end 110/blockchain network 120 may include various types of computing devices, such as laptops, desktops, servers, and so on. Wherein a server may be a stand-alone server or a group of servers, which may be centralized or distributed. In some embodiments, the server may be regional or remote. In some embodiments, the server may execute on a cloud platform. For example, the cloud platform may include one or any combination of a private cloud, a public cloud, a hybrid cloud, a community cloud, a decentralized cloud, an internal cloud, and the like. In some embodiments, the user end 110 and the node may be integrated into the same computing device.
The network 130 connects the various components of the system so that communication can occur between the various components. The network between the various parts in the system may include wired networks and/or wireless networks. For example, network 130 may include a cable network, a wired network, a fiber optic network, a telecommunications network, an intranet, the internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Network (WLAN), a Metropolitan Area Network (MAN), a Public Switched Telephone Network (PSTN), a bluetooth network, a ZigBee network (ZigBee), Near Field Communication (NFC), an intra-device bus, an intra-device line, a cable connection, and the like, or any combination thereof. The network connection between each two parts may be in one of the above-mentioned ways, or in a plurality of ways. It is understood that the network 130 and the blockchain network 120 do not have to have a distinct boundary, and in a more general application scenario, blockchain nodes and common network nodes may be accessed together into the same physical network, wherein the blockchain nodes logically form the blockchain network.
Fig. 2 is an exemplary flow diagram of a blockchain transaction initiation method according to some embodiments of the present description. The process 200 may be performed by the user terminal 110. As shown in fig. 2, the process 200 may include:
at step 210, first transaction data (denoted as m) is obtained.
The first transaction data m may include transaction content (denoted as content) and a first timestamp. The transaction content may include data required when the transaction is executed, which may include, by way of example only, content that may be perceived by the user, for example, some information may be input at the user terminal 110 when the user initiates the transaction, and the input information may be part of the transaction content for the user terminal 110 to package the transaction. It can be understood that after any uplink failure initiated by the ue 110, the contents of the transaction in the transaction initiated by the ue 110 are still consistent with the contents of the transaction in the uplink failure transaction, so that the ue only perceives the initially initiated transaction. Therefore, for fixed transaction content, once different transaction hash values are generated, the user is bothered. In some embodiments, the first transaction data m may further include other data added when the user terminal packages the transaction, such as a nonce used for anti-replay verification, and the like, which is not limited in this specification.
At step 220, a first random factor (denoted as r) is obtained.
In some embodiments, the user terminal 110 may generate a random number as the first random factor r.
At step 230, a transaction hash value (denoted as H) is obtained.
The transaction hash value H is output by a chameleon hash function with the first transaction data m, the first random factor r, and the public key of the user as input.
The chameleon hash function may be represented by hash (m, r, pk), where m represents a message (e.g., first transaction data), r represents a random factor, and pk represents a public key. The chameleon hash function has the property that, in the case of holding a private key (denoted sk) that matches the public key pk, a new random factor r 'can be found, so that two different messages (the new message, e.g. the second transaction data, is denoted m') result in the same hash value, i.e. hash (m ', r', pk) ═ hash (m, r, pk). That is, for any hash value hash (m, r, pk), given m ', there is an efficient algorithm to compute r' (denoted as a random factor function, mathematically denoted as F (), whose input contains at least m 'and the private key sk), F () making the computed r' satisfy hash (m ', r', pk) or hash (m, r, pk). In some embodiments, the input to the random factor function may include the private key sk, the new message m', and the original hash value (e.g., the transaction hash value H). In some embodiments, the input to the random factor function may include the private key sk, the original message m, the original random factor r, the new message m'.
In some embodiments, the user terminal 110 may calculate the transaction hash value itself. In some embodiments, since the transaction hash value is calculated using the public key of the user, the transaction hash value may also be calculated by another device (e.g., a backend server of the blockchain system) and returned to the user terminal 110. It should be noted that, the transaction data (e.g., the first random factor, the first transaction data, the second random factor, the second transaction data, etc.) and the transaction hash value may be transmitted between the user terminal 110 and the device for calculating the transaction hash value through a trusted transmission link, so as to prevent the data from being tampered.
In addition, the chameleon hash algorithm-based transaction hash value and the random factor (e.g., the second random factor) may be computed using any public-private key pair held by the user. In some embodiments, user terminal 110 may compute a chameleon hash algorithm-based hash value and a random factor (e.g., a second random factor) using a public-private key pair associated with the user's blockchain account.
Step 240, sending the first transaction identified by the transaction hash value to the blockchain network.
Wherein the first transaction may comprise the first transaction data m, the transaction hash value H and the first random factor r.
In step 250, the uplink result of the first transaction is confirmed.
If the first transaction uplink fails, the ue 110 may perform steps 260-280. For more details on the uplink failure, reference may be made to the related description of fig. 1.
At step 260, second transaction data (not marked as m') is obtained.
Wherein the second transaction data m' may include the transaction content and the second time stamp. It is to be understood that the second timestamp is different (later) than the first timestamp.
Step 270, a second random factor (denoted as r ') is calculated based on the second transaction data and the user's private key (not denoted as sk).
For more details on the calculation of the second random factor r', reference may be made to the previous description of the characteristics of the chameleon hash function.
Step 280, sending the second transaction identified by the transaction hash value to the blockchain network.
Wherein the second transaction may comprise the second transaction data m ', the transaction hash value H and the first random factor r'.
It is understood that the ue 110 may need to re-initiate more than one transaction until the fixed transaction content is successfully linked. For example, after initiating the second transaction, the ue 110 may confirm the uplink result of the second transaction, and if the uplink of the second transaction fails, the ue 110 may initiate a third transaction. The third transaction may include third transaction data (denoted as m "), the transaction hash value H, and a third random factor (denoted as r"), and the third transaction data may include the transaction content and a third timestamp, the third timestamp being later than the second timestamp. Wherein the third random factor r "may be calculated based on the third transaction data m" and the private key sk of the user.
It is noted that for the fixed transaction content, the client terminal 110 may calculate the hash value only once, i.e., generate a subsequently initiated transaction (e.g., a second transaction, a third transaction, etc.) based on the transaction hash value H calculated in step 230. Of course, for the fixed transaction content, the user side may also calculate the transaction hash value (or obtain the transaction hash value calculated by other devices) again on the basis of the transaction data (e.g., the second transaction data, the third transaction data, etc.) including the new time stamp (e.g., the second time stamp, the third time stamp, etc.) each time the transaction is reinitiated, so as to generate a new transaction based on the transaction hash value obtained last time. For example, the user terminal 110 may input the second transaction data m ', the second random factor r ', and the user's public key pk into the chameleon hash function to obtain the transaction hash value H again (and generate a second transaction based on H). For reliability, in some embodiments, the user terminal 110 may check whether the latest transaction hash value is equal to the original transaction hash value H, and if so, generate a new transaction based on the latest calculated transaction hash value.
In some embodiments, the user terminal 110 may return the transaction hash value H to the user. It will be appreciated that for fixed transaction content, the user terminal 110 may have initiated two or more transactions, but the transaction hash value obtained by the user is unique. For fixed transaction content, although the user terminal 110 may have initiated two or more transactions, the user may query the blockchain network 120 for transactions based on the unique transaction hash value.
It should be noted that for any user, only the user end of the user can modify the timestamp in the transaction and use the private key of the user to calculate the random factor (e.g., the second threshold meal parameter r') used to generate the same transaction hash value, i.e., the modification of the transaction is controlled by the user who initiated the transaction, so that the authenticity of the transaction can be guaranteed.
In some embodiments, any user-initiated transaction may also include a digital signature generated using the user's private key on a digest of the signed message containing the transaction data, the random factor, and the transaction hash value. The first transaction may further include a first digital signature generated from a digest of the first signed message using a private key of the user, the second transaction may further include a second digital signature generated from a digest of the second signed message using the private key of the user, the first signed message may include the first transaction data, the first random factor, and the transaction hash value, and the second signed message may include the second transaction data, the second random factor, and the transaction hash value. Any verifier can confirm the source and integrity of the transaction through the check label, and further details of the verification can be referred to fig. 3 and its related description.
In some embodiments, for a transaction (e.g., a second transaction) that a user re-initiates with fixed transaction content, other users or blockchain nodes may also verify the transaction hash value in the transaction using the user's public key to confirm the origin and integrity of the transaction.
For more details on verifying the transaction hash value, reference may be made to fig. 3 and its associated description.
Fig. 3 is an exemplary flow diagram of a blockchain transaction verification method according to some embodiments of the present description. As shown in fig. 3, the process 300 may include:
in step 310, a transaction initiated by a target user through a user side is obtained.
The transaction may include, among other things, transaction data, a transaction hash value, and a random factor. The target user is the user operating the user terminal 110 that initiated the transaction. It is understood that the transaction herein may be any transaction in the flow 200, such as a first transaction/a second transaction/a third transaction.
Step 320, obtain the public key of the target user.
It is understood that the process 300 can be performed by any authenticator, such as other clients or block chain nodes besides the client 110 of the target user. The public key of the target user is publicly available to any authenticator.
Step 330, inputting the transaction data in the transaction, the random factor and the public key of the target user into the chameleon hash function.
Step 340, comparing the output of the chameleon hash function with the transaction hash value in the transaction.
A transaction verification result is determined based on the comparison result, step 350.
If the calculated output of the chameleon hash function is equal to the hash value in the transaction, it is indicated that the transaction data in the transaction is not tampered and the transaction hash value in the transaction is correct. Of course, verification of the transaction includes, but is not limited to, verification of a transaction hash value in the transaction, and accordingly, validity of the transaction may be determined based on the results of multiple verifications of the transaction. For example, in some embodiments, the target user initiated transaction may also include a digital signature generated on a digest of the signed message using the target user's private key, wherein the signed message includes the transaction data, the random factor, and the transaction hash value. The verifier may verify the digital signature in the received transaction based on the signature message and the public key of the target user, and if the verification is passed, which indicates that the transaction data, the random factor and the transaction hash value are all from the target user and have not been tampered with, the verifier may continue to perform step 330. Otherwise, step 330 need not be performed.
It should be noted that the above description of the flow is for illustration and description only and does not limit the scope of the application of the present specification. Various modifications and alterations to the flow may occur to those skilled in the art, given the benefit of this description. However, such modifications and variations are intended to be within the scope of the present description.
Fig. 4 is a block diagram of a blockchain transaction initiation system in accordance with some embodiments of the present description. The system 400 may be implemented on the user terminal 110. As shown in fig. 4, the system 400 may include a first transaction data obtaining module 410, a first random factor obtaining module 420, a transaction hash value obtaining module 430, and a transaction compensated uplink module 440.
The first transaction data acquisition module 410 may be used to acquire first transaction data. Wherein the first transaction data comprises transaction content and a first timestamp.
The first random factor obtaining module 420 may be configured to obtain a first random factor.
The transaction hash value obtaining module 430 may be configured to obtain a transaction hash value and send a first transaction identified by the transaction hash value to the blockchain network. Wherein the transaction hash value is an output of a chameleon hash function to take the first transaction data, the first random factor, and the public key of the user as inputs, and the first transaction includes the first transaction data, the transaction hash value, and the first random factor.
The transaction compensated uplink module 440 may be configured to confirm the uplink result of the first transaction, and if the first transaction uplink fails: obtaining second transaction data, the second transaction data including the transaction content and a second timestamp; calculating a second random factor based at least on the second transaction data and the user's private key, and sending a second transaction identified by the transaction hash value to the blockchain network. Wherein the second random factor causes an output of the chameleon hash function when the second transaction data, the second random factor, and the public key are input to be equal to the transaction hash value, the second transaction including the second transaction data, the transaction hash value, and the second random factor.
For more details on the system 400 and its modules, reference may be made to fig. 2 and its associated description.
Fig. 5 is a block diagram of a blockchain transaction verification system in accordance with some embodiments of the present description. As shown in fig. 5, system 500 may include a transaction obtaining module 510, a public key obtaining module 520, a calculating module 530, and a verification result determining module 540.
The transaction obtaining module 510 may be configured to obtain a transaction initiated at a user end of a target user, the transaction including transaction data, a transaction hash value, and a random factor.
The public key obtaining module 520 may be configured to obtain a public key of a target user.
The calculation module 530 may be configured to input transaction data in a transaction, a random factor, and a public key of a target user into the chameleon hash function, and compare an output of the chameleon hash function with a transaction hash value in the transaction.
The verification result determination module 540 may be used to determine a transaction verification result based on the comparison result.
For more details on the system 500 and its modules, reference may be made to fig. 3 and its associated description.
It should be understood that the systems shown in fig. 4 and 5 and their modules may be implemented in a variety of ways. For example, in some embodiments, the system and its modules may be implemented in hardware, software, or a combination of software and hardware. Wherein the hardware portion may be implemented using dedicated logic; the software portions may be stored in a memory and executed by a suitable instruction execution system, such as a microprocessor or specially designed hardware. Those skilled in the art will appreciate that the methods and systems described above may be implemented using computer executable instructions and/or embodied in processor control code, such code being provided, for example, on a carrier medium such as a diskette, CD-or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The system and its modules in this specification may be implemented not only by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., but also by software executed by various types of processors, for example, or by a combination of the above hardware circuits and software (e.g., firmware).
It should be noted that the above description of the system and its modules is for convenience only and should not limit the present disclosure to the illustrated embodiments. It will be appreciated by those skilled in the art that, given the teachings of the system, any combination of modules or sub-system configurations may be used to connect to other modules without departing from such teachings. For example, in some embodiments, the first random factor obtaining module 420 and the transaction hash value obtaining module 430 may be different modules in a system, or one module may implement the functions of the two modules. For another example, in some embodiments, the public key obtaining module 520 and the calculating module 530 may be two modules, or may be combined into one module. Such variations are within the scope of the present disclosure.
The beneficial effects that may be brought by the embodiments of the present description include, but are not limited to: (1) aiming at fixed transaction content, even if the timestamp in the transaction is modified, a unique transaction hash value can be generated, so that the user is not disturbed; (2) for fixed transaction content, even if two or more transactions exist, the two or more transactions are also related to the same transaction hash value, and the conversion among different hash values is not needed to be concerned in the inquiry process; (3) the verifying party can verify the validity of the transaction by using the public key of the transaction initiating user. It is to be noted that different embodiments may produce different advantages, and in different embodiments, the advantages that may be produced may be any one or combination of the above, or any other advantages that may be obtained.
Having thus described the basic concept, it will be apparent to those skilled in the art that the foregoing detailed disclosure is to be considered merely illustrative and not restrictive of the embodiments herein. Although not explicitly described herein, various modifications, improvements and adaptations to the embodiments described herein may occur to those skilled in the art. Such alterations, modifications, and improvements are intended to be suggested in the embodiments of this disclosure, and are intended to be within the spirit and scope of the exemplary embodiments of this disclosure.
Also, the description uses specific words to describe embodiments of the specification. Reference to "one embodiment," "an embodiment," and/or "some embodiments" means a feature, structure, or characteristic described in connection with at least one embodiment of the specification. Therefore, it is emphasized and should be appreciated that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, certain features, structures, or characteristics may be combined as suitable in one or more embodiments of the specification.
Moreover, those skilled in the art will appreciate that aspects of the embodiments of the present description may be illustrated and described in terms of several patentable species or situations, including any new and useful combination of processes, machines, manufacture, or materials, or any new and useful improvement thereof. Accordingly, aspects of embodiments of the present description may be carried out entirely by hardware, entirely by software (including firmware, resident software, micro-code, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data block," module, "" engine, "" unit, "" component, "or" system. Furthermore, aspects of the embodiments of the present specification may be represented as a computer product, including computer readable program code, embodied in one or more computer readable media.
The computer storage medium may comprise a propagated data signal with the computer program code embodied therewith, for example, on baseband or as part of a carrier wave. The propagated signal may take any of a variety of forms, including electromagnetic, optical, etc., or any suitable combination. A computer storage medium may be any computer-readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code located on a computer storage medium may be propagated over any suitable medium, including radio, cable, fiber optic cable, RF, or the like, or any combination of the preceding.
Computer program code required for operation of various portions of the embodiments of the present description may be written in any one or more programming languages, including an object oriented programming language such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C + +, C #, VB.NET, Python, and the like, a conventional programming language such as C, VisualBasic, Fortran2003, Perl, COBOL2002, PHP, ABAP, a dynamic programming language such as Python, Ruby, and Groovy, or other programming languages, and the like. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or processing device. In the latter scenario, the remote computer may be connected to the user's computer through any network format, such as a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet), or in a cloud computing environment, or as a service, such as a software as a service (SaaS).
In addition, unless explicitly stated in the claims, the order of processing elements and sequences, use of numbers and letters, or use of other names in the embodiments of the present specification are not intended to limit the order of the processes and methods in the embodiments of the present specification. While certain presently contemplated useful embodiments of the invention have been discussed in the foregoing disclosure by way of various examples, it is to be understood that such detail is solely for that purpose and that the appended claims are not limited to the disclosed embodiments, but, on the contrary, are intended to cover all modifications and equivalent arrangements that are within the spirit and scope of the embodiments herein described. For example, although the system components described above may be implemented by hardware devices, they may also be implemented by software-only solutions, such as installing the described system on an existing processing device or mobile device.
Similarly, it should be noted that in the preceding description of embodiments of the specification, various features are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more embodiments of the invention. This method of disclosure, however, is not intended to imply that more features are required than are expressly recited in the claims. Indeed, the embodiments may be characterized as having less than all of the features of a single embodiment disclosed above.
For each patent, patent application publication, and other material, such as articles, books, specifications, publications, documents, etc., cited in this specification, the entire contents of each are hereby incorporated by reference into this specification. Except where the application history document does not conform to or conflict with the contents of the present specification, it is to be understood that the application history document, as used herein in the present specification or appended claims, is intended to define the broadest scope of the present specification (whether presently or later in the specification) rather than the broadest scope of the present specification. It is to be understood that the descriptions, definitions and/or uses of terms in the accompanying materials of this specification shall control if they are inconsistent or contrary to the descriptions and/or uses of terms in this specification.
Finally, it should be understood that the embodiments described herein are merely illustrative of the principles of the embodiments of the present disclosure. Other variations are possible within the scope of the embodiments of the present description. Thus, by way of example, and not limitation, alternative configurations of the embodiments of the specification can be considered consistent with the teachings of the specification. Accordingly, the embodiments of the present description are not limited to only those embodiments explicitly described and depicted herein.

Claims (10)

1. A blockchain transaction initiation method, comprising:
Confirming a UL result of a first transaction, wherein the first transaction comprises first transaction data and a first random factor, and the first transaction data comprises transaction content and a first time stamp;
if the first trade uplink fails, then: obtaining second transaction data, the second transaction data including the transaction content and a second timestamp; calculating a second random factor based on at least the second transaction data and a private key of a user, and sending a second transaction to a blockchain network, wherein the second transaction comprises the second transaction data and the second random factor, the second random factor enables an output of a chameleon hash function when the second transaction data, the second random factor and a public key of the user are used as inputs to be equal to a transaction hash value, the transaction hash value is an output of the chameleon hash function when the first transaction data, the first random factor and the public key are used as inputs, transaction contents of the first transaction and transaction contents of the second transaction are the same, and the first timestamp and the second timestamp are different.
2. The method of claim 1, wherein the first transaction further comprises the transaction hash value and the second transaction further comprises the transaction hash value.
3. The method of claim 2, further comprising:
and inputting the second transaction data, the second random factor and the public key of the user into the chameleon hash function to obtain the transaction hash value.
4. The method of claim 3, wherein the first transaction further comprises an account identification of the user, the second transaction further comprises an account identification of the user, the account identification of the user being associated with the public key of the user.
5. The method of claim 2, wherein the first transaction further comprises a first digital signature generated from a digest of a first signed message using a private key of the user, the second transaction further comprises a second digital signature generated from a digest of a second signed message using the private key of the user, the first signed message comprising the first transaction data, the first random factor, and the transaction hash value, the second signed message comprising the second transaction data, the second random factor, and the transaction hash value.
6. The method of claim 2, wherein the method further comprises:
returning the transaction hash value to the user.
7. The method of claim 1, wherein said calculating a second random factor based on at least the second transaction data and the user's private key comprises:
inputting the second transaction data, the user's private key, and the transaction hash value into a random factor function to calculate the second random factor.
8. The method of claim 1, wherein said calculating a second random factor based on at least the second transaction data and the user's private key comprises:
inputting the user's private key, the first transaction data, the first random factor, and the second transaction data into a random factor function to calculate the second random factor.
9. A block chain transaction initiating system comprises a transaction compensation uplink module; the transaction compensation uplink module is used for: confirming a UL result of a first transaction, wherein the first transaction comprises first transaction data and a first random factor, and the first transaction data comprises transaction content and a first time stamp; if the first trade uplink fails, then: obtaining second transaction data, the second transaction data including the transaction content and a second timestamp; calculating a second random factor based on at least the second transaction data and a private key of a user, and sending a second transaction to a blockchain network, wherein the second transaction comprises the second transaction data and the second random factor, the second random factor enables an output of a chameleon hash function when the second transaction data, the second random factor and a public key of the user are used as inputs to be equal to a transaction hash value, the transaction hash value is an output of the chameleon hash function when the first transaction data, the first random factor and the public key are used as inputs, transaction contents of the first transaction and transaction contents of the second transaction are the same, and the first timestamp and the second timestamp are different.
10. A blockchain transaction initiating device comprising a processor and a storage device for storing instructions which, when executed by the processor, implement the method of any one of claims 1 to 8.
CN202110403707.7A 2020-11-10 2020-11-10 Block chain transaction initiating method and system Active CN112884477B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110403707.7A CN112884477B (en) 2020-11-10 2020-11-10 Block chain transaction initiating method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110403707.7A CN112884477B (en) 2020-11-10 2020-11-10 Block chain transaction initiating method and system
CN202011247837.8A CN112070501B (en) 2020-11-10 2020-11-10 Block chain transaction initiating and verifying method and system

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202011247837.8A Division CN112070501B (en) 2020-11-10 2020-11-10 Block chain transaction initiating and verifying method and system

Publications (2)

Publication Number Publication Date
CN112884477A CN112884477A (en) 2021-06-01
CN112884477B true CN112884477B (en) 2022-08-19

Family

ID=73655631

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110403707.7A Active CN112884477B (en) 2020-11-10 2020-11-10 Block chain transaction initiating method and system
CN202011247837.8A Active CN112070501B (en) 2020-11-10 2020-11-10 Block chain transaction initiating and verifying method and system

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202011247837.8A Active CN112070501B (en) 2020-11-10 2020-11-10 Block chain transaction initiating and verifying method and system

Country Status (1)

Country Link
CN (2) CN112884477B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112884477B (en) * 2020-11-10 2022-08-19 支付宝(杭州)信息技术有限公司 Block chain transaction initiating method and system
CN112819628B (en) * 2021-02-01 2024-02-02 网易(杭州)网络有限公司 Transaction replay prevention detection method, device and system, electronic equipment and storage medium
CN113793146A (en) * 2021-08-02 2021-12-14 杭州复杂美科技有限公司 Verification method, equipment and storage medium for parallel chain synchronous transaction
CN113610526A (en) * 2021-08-24 2021-11-05 上海点融信息科技有限责任公司 Data trust method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110086599A (en) * 2019-04-24 2019-08-02 电子科技大学 Hash calculation method and label decryption method based on homomorphism chameleon hash function
CN110474762A (en) * 2019-08-22 2019-11-19 电子科技大学 The construction method of ring type editable block chain

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9785369B1 (en) * 2016-05-23 2017-10-10 Accenture Global Solutions Limited Multiple-link blockchain
CN108830602B (en) * 2018-06-27 2022-03-29 电子科技大学 Permission chain construction and management and control method based on chameleon hash function
US11025430B2 (en) * 2018-12-20 2021-06-01 International Business Machines Corporation File provenance database system
CN110061850B (en) * 2019-04-24 2021-04-23 电子科技大学 Collision calculation method of chameleon hash function and editable block chain construction method
CN110457297B (en) * 2019-07-10 2022-02-15 北京航空航天大学 Editable block chain system and method based on multi-authority attribute encryption
CN110489422B (en) * 2019-08-23 2022-04-08 电子科技大学 Automatic block chain repairing method
CN111062716B (en) * 2019-11-29 2021-06-22 支付宝(杭州)信息技术有限公司 Method and device for generating block chain signature data and block chain transaction initiating system
CN111147228B (en) * 2019-12-28 2022-04-01 西安电子科技大学 Ethernet IoT entity based lightweight authentication method, system and intelligent terminal
CN111753335B (en) * 2020-08-28 2023-09-01 支付宝(杭州)信息技术有限公司 Editing method and device for block content
CN112884477B (en) * 2020-11-10 2022-08-19 支付宝(杭州)信息技术有限公司 Block chain transaction initiating method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110086599A (en) * 2019-04-24 2019-08-02 电子科技大学 Hash calculation method and label decryption method based on homomorphism chameleon hash function
CN110474762A (en) * 2019-08-22 2019-11-19 电子科技大学 The construction method of ring type editable block chain

Also Published As

Publication number Publication date
CN112884477A (en) 2021-06-01
CN112070501A (en) 2020-12-11
CN112070501B (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN112884477B (en) Block chain transaction initiating method and system
US11233657B2 (en) Method and system for registering digital documents
US8572673B2 (en) Data processing apparatus and method
US9419804B2 (en) Data authenticity assurance method, management computer, and storage medium
US11108545B2 (en) Creating a blockchain account and verifying blockchain transactions
CN111163182A (en) Block chain-based device registration method and apparatus, electronic device, and storage medium
CN111314172B (en) Block chain-based data processing method, device, equipment and storage medium
CN110535659B (en) Method, apparatus, electronic device and computer readable medium for processing data request
US10176307B2 (en) Licensing using a node locked virtual machine
CN109861996B (en) Block chain-based relationship proving method, device, equipment and storage medium
US20130103651A1 (en) Telemetry file hash and conflict detection
CN112311779B (en) Data access control method and device applied to block chain system
EP3796613A1 (en) Techniques for repeat authentication
WO2021219038A1 (en) Credit evaluation method, credit evaluation system, and readable storage medium
CN111835514A (en) Method and system for realizing safe interaction of front-end and back-end separated data
CN110740038B (en) Blockchain and communication method, gateway, communication system and storage medium thereof
CN111339551B (en) Data verification method and related device and equipment
CN114117551B (en) Access verification method and device
CN109995775B (en) Block chain verification code application method, equipment and storage medium
JP2011205234A (en) Time stamp giving system, time stamp giving method, time stamp giving program
CN110543526B (en) Optimized storage method and system based on block chain
CN108833105B (en) Electronic signature method and device
CN112182009B (en) Block chain data updating method and device and readable storage medium
CN113112269B (en) Multiple signature method, computer device, and storage medium
CN117010889A (en) Data processing method, device, equipment, medium and product

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