A coin transaction signature verification method and system
By performing field integrity verification and fixed-order encapsulation on coin transaction messages, combined with public key indexing and status querying, the problem of inconsistent verification results in coin transaction signature verification is solved, and deterministic and accurate verification result output is achieved.
Patent Information
- Application Number
- CN202611432847.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2046-09-16
AI Technical Summary
In the existing coin transaction signature verification process, the signature verification and coin status query are processed separately, which leads to inconsistent verification results after the transaction message is submitted repeatedly. Furthermore, it is difficult to locate the reason for the verification failure, and there is a lack of field encapsulation order constraints and public key index boundary verification.
By performing field integrity verification and fixed-order encapsulation on coin transaction messages, reading local public key records in conjunction with the public key index field, performing signature verification, querying coin status records and verified transaction indexes after successful verification, generating a definite verification result, and writing the verified transaction index to update the most recent verification digest before output.
It achieves deterministic verification of coin transaction messages, reduces inconsistencies caused by duplicate submissions, ensures the accuracy and traceability of verification results, and improves the locatability of the reasons for verification failures.
Smart Images

Figure CN122948486B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital signature technology, and in particular to a method and system for verifying signatures in coin transactions. Background Technology
[0002] The field of digital signature technology involves computer security processing technology that verifies the source and integrity of electronic data through a public-private key mechanism. It can be applied to the identity verification and anti-tampering processing of terminal messages, transaction messages, device instructions, and data credentials. Among them, traditional coin transaction signature verification refers to the process of verifying the transaction content by using the signature value and corresponding public key carried in the message after the coin transaction message arrives at the verification node, and determining whether the transaction message can continue to be processed based on the locally stored transaction records or status records.
[0003] Existing coin transaction verification processes often separate signature verification from coin status query. The order of transaction field encapsulation lacks unified constraints, there is no boundary check between the public key index and the transaction time, and verified transaction records cannot be continuously invoked by the verification results. This can lead to inconsistent verification conclusions even after the same coin transaction message is repeatedly submitted or the status changes. It is difficult to pinpoint the reason for verification failure, and there is a lack of clear basis for subsequent status record updates. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method for verifying signatures in coin transactions, comprising the following steps: Obtain the coin transaction message, parse the coin transaction message to obtain the coin identifier, transaction subject identifier, transaction content field, signature value and public key index field; The transaction content fields are standardized and encapsulated according to the predetermined field order to generate data to be verified. The verification public key is read from the local public key record based on the public key index field. The verification public key is then used to perform signature verification on the data to be verified and the signature value to obtain the signature verification result. When the signature verification result is successful, the local coin status record and verified transaction index are queried based on the coin identifier to obtain the status judgment result and the duplicate judgment result, and the verification result is output based on the status judgment result and the duplicate judgment result.
[0005] Furthermore, when parsing the coin transaction message, the integrity of the fields in the coin transaction message is first checked. The field integrity check includes determining whether the coin identifier, transaction subject identifier, transaction content field, signature value and public key index field all exist. If any field is missing, generate a field missing result and output the field missing result as a verification failure result. When all fields exist, proceed to the standardized encapsulation of the transaction content fields.
[0006] Furthermore, the transaction content fields include the transaction direction field, transaction amount field, transaction time field, and recipient identifier field; When standardizing and encapsulating transaction content fields, the field names and values are concatenated in a fixed order: transaction direction field, transaction amount field, transaction time field, and recipient identifier field. When a field value is empty, the corresponding field is marked as a failed encapsulation field, and the failed encapsulation field is written into the verification failure result.
[0007] Furthermore, when reading and verifying the public key, the public key identifier and public key status in the local public key record are queried based on the public key index field; If no public key identifier matching the public key index field is found, output a public key missing result. When a matching public key identifier is found and the public key is in an enabled state, the corresponding public key will be used as the verification public key for signature verification.
[0008] Furthermore, the local public key record also includes the start time and end time of the public key's validity period; Before reading the public key for verification, the transaction time field is compared with the public key's valid start time and public key's valid end time respectively; If the transaction time field is earlier than the public key's valid start time or later than the public key's valid end time, an invalid public key time result is generated, and the invalid public key time result is output as a verification failure result.
[0009] Furthermore, the local coin status record includes a coin identifier, a coin status field, a summary of the most recently verified transaction, and a tradable status field. The tradable status field is a pre-configured value indicating the coin's status as allowed to enter transaction processing. The summary of the most recently verified transaction is used to record the summary data of the transaction content field in the coin transaction message that has passed the most recent verification. When querying local coin status records based on coin identifiers, the coin status field obtained from the query is compared with the tradable status field; When the coin status field equals the tradable status field, the generated status passes the result; If the coin status field is not equal to the tradable status field, the status generation fails.
[0010] Furthermore, the verified transaction index consists of a coin identifier, a transaction entity identifier, a transaction time field, and a transaction content field summary; The transaction time field is a data field in the transaction content field used to indicate the time corresponding to this transaction message. The transaction content field summary is the summary data obtained by summarizing the transaction content field that has been standardized and encapsulated in the current coin transaction message. When performing duplicate checks, the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message are compared item by item with the verified transaction index; When all the comparison results are consistent, a duplicate failure result is generated; A duplicate pass result is generated when at least one comparison result is inconsistent.
[0011] Furthermore, when outputting the verification result, if the signature verification result is "passed", the status judgment result is "passed", and the duplicate judgment result is "passed", the verification result is output as "passed". When any of the following results exist: signature verification result is unsuccessful, status judgment result is status failure, public key is missing, public key time is invalid, field is missing, result contains field of encapsulation failure, or repeated failure result, output verification failure result; The verification failure result includes a field for the reason for failure.
[0012] Furthermore, after determining that the conditions for outputting the verification result are met, and before outputting the verification result, the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message are written into the verified transaction index. When the write to the verified transaction index is successful, update the summary of the most recent verified transaction in the local coin status record to the summary of the current transaction content field, and output the verification result; When writing to the verified transaction index fails, output the verification failure result, along with the reason field for the index write failure.
[0013] The present invention also provides a coin transaction signature verification system, which corresponds to the coin transaction signature verification method described above, and includes a message parsing module, a data encapsulation module, a signature verification module, and a status verification module; The message parsing module is used to obtain coin transaction messages and parse them to obtain the coin identifier, transaction entity identifier, transaction content field, signature value, and public key index field. The data encapsulation module is used to standardize and encapsulate the transaction content fields according to a predetermined field order, generating data to be verified. The signature verification module is used to read the verification public key based on the public key index field, and use the verification public key to perform signature verification on the data to be verified and the signature value; The status verification module is used to query local coin status records and verified transaction indexes based on coin identifiers, and generate and output verification results.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by performing field integrity verification and fixed-order encapsulation on the coin transaction message, a definite correspondence is established between the data to be verified and the original transaction fields. The local public key record is read through the public key index field and verified in conjunction with the public key status and validity time boundaries, ensuring that the source and scope of the public key for signature verification can be confirmed by the verification node. After successful signature verification, the local coin status record and verified transaction index are queried, ensuring that changes in coin status and duplicate submissions enter the verification chain. By writing the verified transaction index before outputting the verification result and updating the most recent verification transaction digest after successful writing, subsequent verifications can call upon previous results, reducing verification inconsistencies caused by repeated verification of the same transaction message. Attached Figure Description
[0015] Figure 1 A schematic diagram of the data flow topology for the signature verification method of coin transactions; Figure 2 A schematic diagram illustrating the parsing and standardized encapsulation of fields in a coin transaction message; Figure 3 This is a diagram illustrating the public key reading and signature verification process. Figure 4 A diagram illustrating the state transitions for coin state determination and duplicate determination; Figure 5 A schematic diagram illustrating the interaction of the signature verification system module for coin transactions; Figure 6 A schematic diagram illustrating the collaboration between a coin authentication instrument and a coin transaction signature verification system. Detailed Implementation
[0016] The technical solution described in this invention will be further explained below with reference to embodiments and accompanying drawings. The coin transaction message in the following embodiments refers to a data message used for submitting coin transaction verification, which includes at least a coin identifier, a transaction entity identifier, a transaction content field, a signature value, and a public key index field. In the embodiment where the coin authenticator acts as the message acquisition and verification carrier, the coin transaction message can be formed by the coin authenticator after reading coin-related transaction information, or it can be received by the coin authenticator and then entered into the subsequent verification link. The coin identifier is used to uniquely point to the coin data object being traded, the transaction entity identifier is used to point to the entity initiating or participating in the transaction, the transaction content field is used to carry the business content of this transaction, the signature value is used to carry the verification object formed after signing the transaction content field, and the public key index field is used to locate the verification public key used for signature verification in the local public key record. When performing coin identification, coin reading, or coin transaction verification, the coin authenticator can use the coin identifier as the basic index connecting the physical coin state and the transaction message state. The local public key record is a set of public key data that the verification node can read. It includes at least a public key identifier and public key status, and may include the public key's validity start time and expiration time. When the verification node is integrated into the coin authenticator, the local public key record can be read as the coin authenticator's local secure data record, reducing reliance on external public key sources during the signature verification process. The local coin status record is a set of status data maintained by the verification node for the coin identifier. It includes at least the coin identifier, coin status field, most recent verified transaction digest, and tradable status field. The tradable status field is a pre-configured value indicating the coin's allowed status for transaction processing. The most recent verified transaction digest records the summary data of the transaction content field in the most recently verified coin transaction message. The verified transaction index is a transaction index structure used by the verification node to record transactions that have completed verification processing. Its data items include the coin identifier, transaction subject identifier, transaction time field, and transaction content field digest. The transaction time field is a data field within the transaction content field that indicates the time corresponding to this transaction message. The transaction content field summary is the result of summarizing the transaction content fields in the current coin transaction message that have been standardized and encapsulated according to the same encapsulation rules. A consistent summary processing rule is used within the same verification node so that subsequent repeated judgments can be compared item by item on the same data scale. When the coin authenticator processes the same coin or the same coin transaction message multiple times, it can use the verified transaction index to distinguish between processed transactions and pending transactions, ensuring that the coin authenticator's authentication output and the transaction verification output remain consistent within the same data link.
[0017] Example 1 Please see Figures 1-3This embodiment provides a coin transaction signature verification method. The method uses a coin transaction message as input and a verification result as output. The verification result includes a successful verification result and a failed verification result, with the failed result carrying a failure reason field. When a coin authenticator participates in executing this method, the coin authenticator can act as a receiver, parser, or local verification end for the coin transaction message, and use the coin identifier obtained from its authentication along with the coin identifier in the transaction message within the same processing chain. This method places field integrity verification, transaction content field normalization and encapsulation, public key reading and signature verification, coin status judgment, duplicate judgment, and index writing within the same processing chain, establishing a predetermined data transmission relationship between the input message, signature verification object, status data, and duplicate transaction judgment result. The method includes four main steps, S1 to S4.
[0018] S1, obtain the coin transaction message, parse the coin transaction message to obtain the coin identifier, transaction subject identifier, transaction content field, signature value and public key index field.
[0019] In S1, after receiving the coin transaction message, the verification node parses the fields of the message body. The verification node can be a data processing unit within the coin authenticator or a verification processing unit communicating with the coin authenticator. When a verification node is set up inside the coin authenticator, field parsing is completed as soon as the coin transaction message enters the coin authenticator. The output of the field parsing includes the coin identifier, transaction entity identifier, transaction content field, signature value, and public key index field. The coin identifier serves as the retrieval input for subsequent queries of local coin status records; the transaction entity identifier serves as the data item for generating the verified transaction index; the transaction content field serves as the original input for subsequent encapsulation to generate the data to be verified; the signature value serves as the object to be verified; and the public key index field serves as the retrieval input for subsequent queries of local public key records. During the parsing process, each field maintains its own data identity; the signature value is not encapsulated as part of the transaction content field, and the public key index field is not written into the data to be verified. In a scenario where a coin detector reads a physical coin and receives the corresponding transaction message, the coin identifier read by the coin detector and the coin identifier obtained from message parsing can both enter into the subsequent consistency processing. However, this consistency processing does not change the field identity of the signature value and the public key index field.
[0020] Field integrity verification is performed after field parsing. Field integrity verification checks the existence of each of the following fields: coin identifier, transaction entity identifier, transaction content field, signature value, and public key index field. Existence means that the corresponding field name and its value can be read in the parsing result. An empty field value does not necessarily mean the field does not exist; this is determined by subsequent encapsulation processing. When any of the following fields is missing, the verification node generates a field missing result, writes it to the failure reason field of the verification failure result, and terminates subsequent signature verification and status verification processing for that coin transaction message. When outputting a field missing result, the coin authenticator can associate and save the field missing reason with the coin identifier or reading status formed during the current coin reading process, so that the same coin can be used again with the same failure reason classification when it enters the coin authenticator again. When all fields exist, the verification node transfers the transaction content field to S2 and retains the coin identifier, transaction entity identifier, signature value, and public key index field as input objects for subsequent steps.
[0021] S2: Standardize and encapsulate the transaction content fields according to the predetermined field order to generate data to be verified.
[0022] In S2, the transaction content field includes a transaction direction field, a transaction amount field, a transaction time field, and a recipient identifier field. The transaction direction field indicates the direction of the coin transaction; the transaction amount field indicates the monetary value of the transaction; the transaction time field indicates the time of the transaction message; and the recipient identifier field indicates the entity receiving the coin. Standardized encapsulation takes the transaction content field as input and the data to be verified as output. Its processing does not change the meaning of the transaction expressed by the fields; it only standardizes the combination of field order, field names, and field values. When performing standardized encapsulation, the coin authenticator can keep the transaction content field separate from the coin identifier read by the coin authenticator, preventing the mixing of fields between the physical coin reading data and the transaction signature data during the encapsulation stage.
[0023] During normalized encapsulation, the verification node reads the field names and values in a fixed order: transaction direction, transaction amount, transaction time, and recipient identifier. The field names and values are then written to the encapsulation cache according to the same concatenation rules. The encapsulation cache is an intermediate data structure within this step used to hold the encapsulation results, and its writing order is consistent with the aforementioned fixed order. After the encapsulation cache is written, the verification node outputs the contents of the encapsulation cache as the data to be verified. The subsequent recipient of the data to be verified is the signature verification step, whose data content is determined by the transaction content field and does not include data from the coin status field, public key status, or verified transaction index. When the coin authenticator acts as the device holding the encapsulation cache, the encapsulation cache within the coin authenticator only temporarily stores the normalized encapsulation results and is overwritten or cleared according to the device configuration after the data to be verified is output to the signature verification process.
[0024] During the encapsulation process, if any of the transaction direction, transaction amount, transaction time, or receiver identifier fields is empty, the verification node marks that field as an encapsulation failure field. The encapsulation failure field includes the field name and the corresponding empty value status, which is written as the failure reason field in the verification failure result. When an encapsulation failure field occurs, the data to be verified does not enter the signature verification step, and the verification node outputs the verification failure result. If the transaction direction, transaction amount, transaction time, and receiver identifier fields all have values, the data to be verified is transmitted to S3, and the transaction time field is retained for subsequent public key validity time boundary verification and duplicate detection. After recognizing an encapsulation failure field, the coin authenticator can stop the signature verification processing of the current coin transaction message, maintaining the isolation between the coin authenticator's authentication process for the physical coin itself and the transaction message verification process.
[0025] S3 reads the verification public key from the local public key record based on the public key index field, and uses the verification public key to perform signature verification on the data to be verified and the signature value to obtain the signature verification result.
[0026] In S3, the verification node uses the public key index field as the retrieval input to query the public key identifier and public key status in the local public key record. The local public key record establishes a readable index based on the public key identifier, and the public key index field is compared for consistency with the public key identifier. When no public key identifier matching the public key index field is found, the verification node generates a public key missing result, writes the public key missing result to the failure reason field of the verification failure result, and stops signature verification. When a matching public key identifier is found, the verification node continues to read the corresponding public key status. With the coin authenticator having a built-in local public key record, the coin authenticator can directly read the verification public key based on the public key index field, ensuring that the public key reading path is consistent with the coin authenticator's local transaction verification path.
[0027] Public key status includes at least an enabled state and an disabled state. When the public key status is enabled, the corresponding public key can be used as a verification public key for signature verification. When the public key status is disabled, the verification node writes this situation into the failure reason field of the verification failure result and no longer uses the corresponding public key for signature verification. If the local public key record also includes a public key validity start time and a public key validity end time, before reading the verification public key, the verification node compares the transaction time field stored in S2 with the public key validity start time and public key validity end time respectively. If the transaction time field is earlier than the public key validity start time, or later than the public key validity end time, the verification node generates a public key time invalid result and writes the public key time invalid result into the failure reason field of the verification failure result. If the transaction time field is neither earlier than the public key validity start time nor later than the public key validity end time, the verification node outputs the corresponding public key as the verification public key to the signature verification process. When performing this time boundary verification, the coin authenticator can use the transaction time field as the transaction message time input and the public key validity start time and public key validity end time as the applicable boundaries in the local public key record, thereby determining whether the current verification public key can be used for this coin transaction message.
[0028] The signature verification process takes the data to be verified, the signature value, and the verification public key as input, and outputs the signature verification result. The verification node uses the verification public key to perform verification on the data to be verified and the signature value. The output of the verification process includes two states: successful and unsuccessful. When the verification process confirms that the signature value matches the data to be verified under the verification public key, it generates a successful signature verification result; when it confirms that the signature value does not match the data to be verified under the verification public key, it generates a failed signature verification result. When the signature verification result is unsuccessful, the verification node outputs a verification failure result and writes the signature verification failure status in the failure reason field. When the signature verification result is successful, the verification node transmits the coin identifier, transaction entity identifier, transaction time field, transaction content field digest, and signature verification result to S4. When the signature verification result is successful, the coin authenticator does not directly determine that the transaction message has passed verification, but continues to enter the coin state judgment and repeated judgment, so that the signature verification conclusion of the coin authenticator is simultaneously constrained by the authenticity of the transaction and the coin state.
[0029] The transaction content field digest is used to construct the duplicate detection object for the current transaction after the signature verification result passes. The verification node performs digest processing on the transaction content field data that has been formed in a fixed order in S2 to obtain the transaction content field digest. The input of the digest processing is the normalized and encapsulated transaction content field, and the output is the digest data used for comparison. The digest data does not replace the original transaction content field in signature verification, but is used as an index item in duplicate detection and the update of the most recent verified transaction digest. When generating the transaction content field digest, the coin counter can use the digest data and the current coin identifier together as local input for duplicate detection, so that the processing results of the same coin in different transaction messages can be distinguished.
[0030] S4. When the signature verification result is passed, query the local coin status record and verified transaction index based on the coin identifier to obtain the status judgment result and the duplicate judgment result, and output the verification result based on the status judgment result and the duplicate judgment result.
[0031] In S4, the verification node first queries the local coin status record based on the coin identifier. The local coin status record includes the coin identifier, a coin status field, a summary of the most recent verification transaction, and a tradable status field. The tradable status field is a pre-configured value indicating the coin's permission to enter transaction processing. During the query, the coin identifier in the coin transaction message is compared with the coin identifier in the local coin status record to obtain the coin status field corresponding to the current coin transaction message. The verification node compares the obtained coin status field with the tradable status field. When the coin status field equals the tradable status field, a status pass result is generated; when the coin status field does not equal the tradable status field, a status failure result is generated. The status failure result is written to the failure reason field of the verification failure result. The coin authentication instrument reads the local coin status record at this stage, connecting the coin transaction signature verification with the coin status management maintained by the coin authentication instrument, allowing the coin status field to participate in the generation of the final verification result.
[0032] The duplicate detection uses the verified transaction index as the query object and the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message as the current comparison item. The verified transaction index consists of the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary. The transaction content field summary is the summary data obtained by summarizing the transaction content fields in the current coin transaction message after normalization and encapsulation. The verification node compares the current comparison item with each index item in the verified transaction index. The item-by-item comparison includes coin identifier comparison, transaction entity identifier comparison, transaction time field comparison, and transaction content field summary comparison. If all four items in the same index item match the current comparison item, a duplicate failure result is generated. The duplicate failure result indicates that the current coin transaction message is duplicated with a transaction message that has completed verification processing, and the failure reason field of the verification failure result is written. If there is no index item where all four items match, a duplicate pass result is generated. Through this duplicate detection process, the coin authenticator can identify duplicate index entries when the same coin is submitted in the same transaction message repeatedly, and use the duplicate failure result as one of the reasons for the coin authenticator to output the verification failure result.
[0033] The verification result is determined by the signature verification result, status judgment result, and duplicate judgment result. When the signature verification result is passed, the status judgment result is passed, and the duplicate judgment result is passed, the verification node determines that the conditions for outputting the verification passed result are met. Before outputting the verification passed result, it writes the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message into the verified transaction index. When the verified transaction index is successfully written, the verification node updates the most recent verified transaction summary in the local coin status record to the current transaction content field summary and outputs the verification passed result. This write and update process allows the current verification result to be read by the duplicate judgment of subsequent coin transaction messages or related transaction messages. After completing this write and update process, the coin authenticator can establish a correspondence between the verification passed status formed by the coin authenticator this time and the most recent verified transaction summary, thereby providing a locally readable status basis for subsequent coin transaction verification.
[0034] When any of the following results exist: signature verification fails, status judgment fails, public key is missing, public key time is invalid, field is missing, the result contains a field indicating encapsulation failure, or a repeated failure, the verification node outputs a verification failure result. The verification failure result carries a failure reason field, which can record at least one of the following: field missing, encapsulation failure, public key missing, public key time invalid, signature verification failed, status failure, or repeated failure. After outputting the verification failure result, the data corresponding to the current coin transaction message is not written to the verified transaction index, nor is the current transaction content field summary updated to the most recent verified transaction summary. When outputting verification failure results, the coin authenticator can use the failure reason field as a data object for display, interface return, or subsequent maintenance reading, but the existence of the failure reason field does not change the original data identity of the transaction content field, signature value, and verification public key.
[0035] If the verified transaction index write fails after the verification result has been output and the process has entered the index writing stage, the verification node will convert the output verification result into a verification failure result and write the index write failure reason field into the failure reason field. The index write failure reason field indicates that the current transaction failed to enter a subsequent re-evaluation readable index structure. Through this conversion process, subsequent verifications will not be based on a transaction that failed to fall into the verified transaction index, thus maintaining consistency between the verification result output, index writing, and status record update. By performing the verification result conversion when the index write fails, the coin counter can avoid inconsistencies between the passed status already output by the coin counter and its local verified transaction index.
[0036] Example 2 Please see Figure 2 and Figure 4 This embodiment provides a method for verifying coin transaction signatures. The difference between this embodiment and Embodiment 1 lies in the hierarchical writing of the failure reason field in the verification failure result, allowing subsequent processing nodes to read different failure sources according to their source category. Apart from the differences described below, the field parsing of the coin transaction message, the standardized encapsulation of the transaction content field, public key reading, signature verification, coin status judgment, and duplicate judgment in this embodiment can all adopt the processing methods described in Embodiment 1. In scenarios where the coin authenticator needs to display or provide interface feedback on the failure reason, this hierarchical writing method enables the coin authenticator to distinguish between field-type, public key-type, signature-type, status-type, duplicate-type, and write-type failure reasons.
[0037] In this embodiment, the failure reason field includes field-related failure reasons, public key-related failure reasons, signature-related failure reasons, status-related failure reasons, duplicate-related failure reasons, and write-related failure reasons. Field-related failure reasons are used to receive field missing results and encapsulation failure fields; public key-related failure reasons are used to receive public key missing results and public key time invalid results; signature-related failure reasons are used to receive signature verification failure statuses; status-related failure reasons are used to receive status failure results; duplicate-related failure reasons are used to receive duplicate failure results; and write-related failure reasons are used to receive index write failure reason fields. Each failure reason is written by the processing step that generated the failure result; other steps only read the already written failure reason field without changing the category of the failure reason. The coin authentication device can locate the source of failure of the current coin transaction message to the corresponding stage in field parsing, encapsulation, public key reading, signature verification, status judgment, duplicate judgment, or index writing based on the category of the failure reason field.
[0038] When S1 outputs a missing field, the verification node writes the missing field result into the field-class failure reason and outputs the verification failure result. When S2 outputs a failed encapsulation field, the verification node writes the failed encapsulation field into the field-class failure reason and retains the corresponding field name in the failure reason field. When S3 fails to find the public key identifier or the transaction time field is not within the public key's valid time boundary, the verification node writes the missing public key result or the invalid public key time result into the public key-class failure reason, respectively. When S3 obtains a signature verification result of failure, the signature-class failure reason is written. When S4 generates a status failure result or a duplicate failure result, the status-class failure reason and the duplicate-class failure reason are written, respectively. If the written verification transaction index fails after the verification pass result is output, the write-class failure reason is written, triggering the conversion of the verification pass result to the verification failure result. When reading the above-mentioned hierarchical failure reasons, the coin authenticator can output the corresponding verification status according to the category of the failure reason field, so that the verification feedback of the coin authenticator corresponds to the internal processing links.
[0039] Through the layered writing method described above, the verification failure result remains the same output object, but the failure reason field reflects which stage of the process the failure originated from: field parsing, data encapsulation, public key reading, signature verification, status judgment, duplicate judgment, or index writing. Subsequent log recordings, page displays, or API responses can directly read the category and value from the failure reason field when reading the verification failure result, without needing to re-execute signature verification, status judgment, or duplicate judgment processing. The coin authenticator can directly call this failure reason field when performing subsequent log recordings, page displays, or API responses, avoiding the coin authenticator repeatedly initiating the verification process for the same coin transaction message to explain the failure status.
[0040] Example 3 Please see Figure 1 and Figure 5 This embodiment provides a coin transaction signature verification system, which corresponds to the coin transaction signature verification method described in Embodiment 1. The system includes a message parsing module, a data encapsulation module, a signature verification module, and a status verification module. In one system deployment, the message parsing module, data encapsulation module, signature verification module, and status verification module can all be installed within a coin authenticator, enabling the coin authenticator to simultaneously perform coin data reading and coin transaction signature verification. The message parsing module, data encapsulation module, signature verification module, and status verification module establish data transmission relationships sequentially. The parsed output of the message parsing module enters the data encapsulation module and the signature verification module; the encapsulated output of the data encapsulation module enters the signature verification module; the verification output of the signature verification module enters the status verification module; and the status verification module outputs the verification result.
[0041] The message parsing module is used to acquire coin transaction messages and parse them to obtain the coin identifier, transaction entity identifier, transaction content field, signature value, and public key index field. The message parsing module also performs field integrity checks on the coin identifier, transaction entity identifier, transaction content field, signature value, and public key index field. When any field is missing, the message parsing module generates a field missing result and sends it to the status verification module to form a verification failure result. When all fields are present, the message parsing module sends the transaction content field to the data encapsulation module and the coin identifier, transaction entity identifier, signature value, and public key index field to the subsequent processing module. When the message parsing module is installed within the coin authenticator, after the coin authenticator receives the coin transaction message, the message parsing module can complete the field output and directly transmit the field missing result to the verification result output path of the coin authenticator.
[0042] The data encapsulation module is used to standardize and encapsulate the transaction content fields according to a predetermined field order, generating data to be verified. The data encapsulation module reads the transaction direction field, transaction amount field, transaction time field, and recipient identifier field, and writes the field names and values into the encapsulation cache in a fixed order. The encapsulation cache outputs the data to be verified. When the data encapsulation module finds an empty field value, it generates an encapsulation failure field and sends it to the status verification module to form a verification failure result. After completing the standardization and encapsulation, the data encapsulation module passes the data to be verified and the transaction time field to the signature verification module. The data encapsulation module in the coin authenticator can convert the transaction content fields into data to be verified that the signature verification module can directly read, ensuring that the data encapsulation result inside the coin authenticator is consistent with the subsequent signature verification input.
[0043] The signature verification module reads the verification public key based on the public key index field and uses it to perform signature verification on the data to be verified and the signature value. After receiving the public key index field, the signature verification module queries the public key identifier, public key status, public key validity start time, and public key validity end time in the local public key record. When the public key index field does not match the public key identifier, the signature verification module outputs a public key missing result. When the transaction time field is earlier than the public key validity start time or later than the public key validity end time, the signature verification module outputs a public key time invalid result. When the public key status is enabled and the transaction time field is within the public key validity time boundary, the signature verification module reads the verification public key and performs signature verification on the data to be verified and the signature value, obtaining the signature verification result. The signature verification result, the transaction content field digest corresponding to the data to be verified, and the coin identifier are transmitted to the status verification module. When outputting the signature verification result, the signature verification module in the coin authenticator can also synchronously transmit the transaction content field digest to the status verification module, so that the coin authenticator can continue to perform repeated judgments within the same verification cycle.
[0044] The status verification module queries the local coin status record and verified transaction index based on the coin identifier, generating and outputting the verification result. When the signature verification result is successful, the status verification module reads the coin status field from the local coin status record, compares it with the tradable status field, and obtains the status judgment result. The status verification module also reads the verified transaction index, comparing the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message with each item in the verified transaction index to obtain the duplication judgment result. The status verification module outputs a successful verification result when the signature verification result, status judgment result, and duplication judgment result all meet the success conditions, writes the data corresponding to the current transaction to the verified transaction index, and updates the summary of the most recent verified transaction. If any failure result exists, the status verification module outputs a verification failure result, writing the failure reason field into the failure result. When the status verification module is installed within a coin authenticator, the coin authenticator can use the status verification module to merge the transaction signature result, coin status result, and duplication judgment result into the final verification result.
[0045] The message parsing module, data encapsulation module, signature verification module, and status verification module can be deployed within the same verification node, or they can form a processing chain through interface calls within the same trusted communication environment. Data objects passed between modules maintain fixed names and field meanings. The coin identifier output by the message parsing module is still used as the retrieval input for querying local coin status records in the status verification module; the signature data to be verified output by the data encapsulation module is still used as the signature verification input in the signature verification module; and the signature verification result output by the signature verification module is still used as the trigger condition for whether to perform status judgment and duplicate judgment in the status verification module. The coin authentication device can serve as the physical carrier device of the same verification node, or it can work collaboratively with external verification processing units as a front-end authentication device in a trusted communication environment.
[0046] Example 4 Please see Figures 3-5 This embodiment provides a coin transaction signature verification system. The difference between this embodiment and Embodiment 3 is that the system further includes an index maintenance processing path. This path maintains the verified transaction index after the verification result is output and returns the reason for failure when index writing fails. Except for the index maintenance processing path, the processing methods of the message parsing module, data encapsulation module, signature verification module, and status verification module can adopt the methods described in Embodiment 3. In the implementation where the coin authenticator locally maintains the verified transaction index, the index maintenance processing path can serve as the post-transaction verification processing path within the coin authenticator.
[0047] In this embodiment, before outputting the verification pass result, the status verification module first forms a write-to-index item. The write-to-index item consists of the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message. The status verification module sends the write-to-index item to the verified transaction index. After receiving the write-to-index item, the verified transaction index uses the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary as the write object. After writing is complete, the verified transaction index returns a write-complete status to the status verification module. Upon receiving the write-complete status, the status verification module updates the most recent verified transaction summary in the local coin status record to the current transaction content field summary and outputs the verification pass result. After receiving the write-complete status, the coin authenticator can mark the current coin transaction message as having completed verification processing, enabling the coin authenticator to enter the duplicate judgment path when subsequently reading the same coin transaction message.
[0048] If the verified transaction index does not return a write-complete status, or returns a write-failure status, the status verification module will write the index write-failure reason field into the verification failure result, and will not output a verification-pass result, but rather a verification-failure result. This process ensures that the verification result is consistent with the actual write status of the verified transaction index. When the same coin transaction message enters the verification node again, repeated checks will not misread an index entry that was not successfully written, nor will it treat a transaction that has not completed index maintenance as a transaction that has completed traceable verification. Through this conversion process, the coin authenticator can prevent the verification-pass status from being used as the basis for subsequent transactions when local index maintenance fails.
[0049] Example 5 Please see Figures 1-5 This embodiment provides a collaborative implementation method for a coin transaction signature verification method and system. In this collaborative implementation method, the coin transaction signature verification method is executed by the coin transaction signature verification system. The message parsing module performs message acquisition, field parsing, and field integrity verification in S1; the data encapsulation module performs normalized encapsulation of transaction content fields in S2; the signature verification module performs local public key record reading, public key time boundary verification, and signature verification in S3; and the status verification module performs local coin status record query, verified transaction index comparison, verification result output, verified transaction index writing, and latest verified transaction digest update in S4. When the coin authenticator executes this collaborative implementation method, the coin authenticator can schedule coin reading, message parsing, signature verification, status verification, and index maintenance as a continuous processing procedure.
[0050] In this collaborative implementation, after the coin transaction message enters the message parsing module, the message parsing module outputs two types of data. The first type of data is the transaction content field, which enters the data encapsulation module; the second type of data includes the coin identifier, transaction entity identifier, signature value, and public key index fields, which enter the subsequent processing paths of the signature verification module and the status verification module, respectively. The data encapsulation module outputs the data to be verified and the transaction time field. The data to be verified and the signature value enter the signature verification module together, and the transaction time field enters the public key validity time boundary verification and duplicate judgment. The signature verification module outputs the signature verification result. If the signature verification result is successful, the status verification module reads the local coin status record and the verified transaction index. If the signature verification result is unsuccessful, the status verification module directly outputs the verification failure result carrying the reason for the signature failure. During this data transmission process, the coin authenticator maintains consistency in the names of the coin identifier, transaction entity identifier, transaction time field, and transaction content field digest, enabling continuous tracking of the processing results of the same transaction object by each module within the coin authenticator.
[0051] When performing status verification, the status verification module reads the local coin status record using the coin identifier as a query condition and obtains the coin status field. If the coin status field matches the tradable status field, the status verification module generates a status pass result; otherwise, it generates a status failure result. When performing duplicate verification, the status verification module reads the verified transaction index and uses the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message as the current comparison item. If all four items match any index item in the verified transaction index, a duplicate failure result is generated; otherwise, a duplicate pass result is generated. When reading the local coin status record and verified transaction index, the coin identification instrument can identify the coin recognition result formed during the physical coin identification process and the coin identifier in the transaction message as the same coin object, thus preventing referential drift between status verification and duplicate verification.
[0052] The verification pass condition is formed by the signature verification result being passed, the status judgment result being passed, and the duplicate judgment result being passed. The verification pass result is output after the verified transaction index is successfully written. The verification failure result is triggered by any of the following: missing field result, result containing a field of encapsulation failure, missing public key result, invalid public key time result, signature verification result failing, status failure result, duplicate failure result, or index write failure reason field. This triggering relationship ensures that the output of each processing node has a clear subsequent receiving location. The field parsing result enters the encapsulation and query path, the encapsulation result enters the signature verification path, the signature verification result enters the status verification path, and the status verification result enters the output and index maintenance path, thus forming a complete processing closed loop from coin transaction message input to verification result output. Through the above triggering relationship, the coin authentication instrument can connect the authentication, verification, and index maintenance stages into an internal processing chain with clear input, processing, output, and feedback.
[0053] The specific processes, field names, module connection relationships, failure reason field classifications, index item composition, and status update methods in the above embodiments are used to illustrate the feasible implementations of the present invention and should not limit the present invention to the specific embodiments listed. Without departing from the technical solutions described in the present invention and the technical solutions described in the application documents, any equivalent substitutions, equivalent modifications, equivalent combinations, order adjustments, corresponding module replacements, equivalent changes in field names, equivalent acceptance of the execution subject, or equivalent changes in the carrier form that can be conceived by those skilled in the art should fall within the protection scope of this patent application, but should not be extended to unclaimed topics, nor should the substantive correspondence of the technical objects be changed through name changes. When the coin authenticator serves as the physical carrier device in the above embodiments, equivalent substitutions, interface acceptance, or changes in the carrier form of the internal modules of the coin authenticator should not change the substantive processing relationship between the coin transaction message, the data to be verified, the verification public key, the local coin status record, and the verified transaction index.
Claims
1. A method for verifying signatures in coin transactions, characterized in that, include: Obtain the coin transaction message, and parse the coin transaction message to obtain the coin identifier, transaction subject identifier, transaction content field, signature value, and public key index field; The transaction content fields are standardized and encapsulated according to a predetermined field order to generate data to be verified. The verification public key is read from the local public key record based on the public key index field, and the signature verification is performed on the data to be verified and the signature value using the verification public key to obtain the signature verification result; When the signature verification result is passed, the local coin status record and verified transaction index are queried based on the coin identifier to obtain the status judgment result and the duplicate judgment result, and the verification result is output according to the status judgment result and the duplicate judgment result; The local coin status record includes the coin identifier, coin status field, most recently verified transaction summary, and tradable status field. The tradable status field is a pre-configured value indicating the coin's status as allowed to enter transaction processing. The most recently verified transaction summary is used to record the summary data of the transaction content field in the most recently verified coin transaction message. When querying the local coin status record based on the coin identifier, the coin status field obtained from the query is compared with the tradable status field; When the coin status field equals the tradable status field, a status pass result is generated; When the coin status field is not equal to the tradable status field, a status failure result is generated; The verified transaction index consists of the coin identifier, the transaction entity identifier, the transaction time field, and a summary of the transaction content field. The transaction time field is a data field in the transaction content field used to indicate the time corresponding to this transaction message, and the transaction content field summary is a summary data obtained by summarizing the transaction content field that has completed the normalization and encapsulation in the current coin transaction message; When performing duplicate checks, the coin identifier, transaction entity identifier, transaction time field, and transaction content field summary corresponding to the current coin transaction message are compared item by item with the verified transaction index; When all the comparison results are consistent, a duplicate failure result is generated; A duplicate pass result is generated when at least one comparison result is inconsistent. When outputting the verification result, if the signature verification result is passed, the status judgment result is the status passed result, and the duplicate judgment result is the duplicate passed result, the verification passed result is output. When the signature verification result is unsuccessful, the status judgment result is a status failure result, there is a missing public key result, there is an invalid public key time result, there is a missing field result, there is a result containing a field with encapsulation failure, or the duplicate judgment result is a duplicate failure result, the verification failure result is output. The verification failure result carries a failure reason field; After determining that the conditions for outputting the verification pass result are met, and before outputting the verification pass result, the coin identifier, the transaction subject identifier, the transaction time field, and the transaction content field summary corresponding to the current coin transaction message are written into the verified transaction index; When the written transaction index is successful, the most recent verified transaction summary in the local coin status record is updated to the current transaction content field summary, and the verification result is output. When writing to the verified transaction index fails, the verification failure result is output, along with the index writing failure reason field.
2. The coin transaction signature verification method according to claim 1, characterized in that, When parsing the coin transaction message, the integrity of the fields in the coin transaction message is first verified. The field integrity verification includes determining whether the coin identifier, the transaction subject identifier, the transaction content field, the signature value, and the public key index field all exist. If any field is missing, generate a field missing result and output the field missing result as a verification failure result. When all fields exist, proceed to the normalized encapsulation of the transaction content field.
3. The coin transaction signature verification method according to claim 2, characterized in that, The transaction content fields include the transaction direction field, transaction amount field, transaction time field, and recipient identifier field; When performing the standardized encapsulation on the transaction content field, the field name and the field value are concatenated in a fixed order of the transaction direction field, the transaction amount field, the transaction time field, and the recipient identifier field; When a field value is empty, the corresponding field is marked as a failed encapsulation field, and the result containing the failed encapsulation field is written into the verification failure result.
4. The coin transaction signature verification method according to claim 1, characterized in that, When reading the verification public key, the public key identifier and public key status in the local public key record are queried based on the public key index field; If no public key identifier matching the public key index field is found, output a public key missing result. When a matching public key identifier is found and the public key is in an enabled state, the corresponding public key is used as the verification public key in the signature verification.
5. The coin transaction signature verification method according to claim 4, characterized in that, The local public key record also includes the public key's valid start time and public key's valid end time; The transaction time field is a data field in the transaction content field used to indicate the time corresponding to this transaction message; Before reading the verification public key, the transaction time field is compared with the public key's valid start time and the public key's valid end time, respectively; When the transaction time field is earlier than the public key's valid start time or later than the public key's valid end time, a public key time invalid result is generated, and the public key time invalid result is output as the verification failure result.
6. A coin transaction signature verification system, corresponding to the coin transaction signature verification method of claim 1, characterized in that, include: The message parsing module is used to obtain the coin transaction message and parse the coin transaction message to obtain the coin identifier, the transaction subject identifier, the transaction content field, the signature value, and the public key index field; The data encapsulation module is used to encapsulate the transaction content fields in a standardized manner according to a predetermined field order to generate data to be verified. The signature verification module is used to read the verification public key based on the public key index field, and use the verification public key to perform the signature verification on the data to be verified and the signature value; The status verification module is used to query the local coin status record and verified transaction index based on the coin identifier, and generate and output the verification result.
Citation Information
Patent Citations
Systems and methods for personal identification and verification
CN107710258A
Offline payment method based on digital currency, terminal and agent delivery device
CN109493016A
