Transaction verification method and device, electronic equipment and computer readable storage medium
Through the transaction verification method of elliptic curve cryptography algorithm and zero-knowledge proof technology, the challenges of privacy protection and data verification in transaction information processing in the financial industry are solved, and high-security transaction processing is achieved to prevent information leakage and improve user experience.
Patent Information
- Application Number
- CN202411378304.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-14
AI Technical Summary
The financial industry faces the dual challenges of privacy protection and data accuracy verification when processing customer transaction information. Traditional methods are prone to leakage of privacy information, pose security risks, and bring bad experience to users.
A transaction verification method is adopted, by obtaining the transaction information and public key, performing encryption processing based on the elliptic curve cryptographic algorithm, constructing a zero-knowledge proof, and performing verification processing according to its type, and finally generates transaction feedback information.
Effectively prevent privacy information leakage, improve transaction security, bring a good experience to users, and enhance the security of privacy protection and transaction verification.
Smart Images

Figure CN119313345A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to but are not limited to the field of financial technology, and in particular to a transaction verification method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the continuous development of social economy, people's living standards are constantly improving, and science and technology are constantly advancing. The financial industry has been moving more and more towards intelligence. Among them, with the development of financial technology, banks face the dual challenges of privacy protection and data accuracy verification when processing customer transaction information. Traditional methods often compare information without paying much attention to privacy, which can easily lead to the leakage of private information, pose security risks, and bring a bad experience to users. Summary of the invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] In order to solve the problems mentioned in the above background technology, the embodiments of the present application provide a transaction verification method, device, electronic device and computer-readable storage medium, which can effectively prevent the leakage of privacy information, improve the security of transactions, and bring a good experience to users.
[0005] In a first aspect, an embodiment of the present application provides a transaction verification method, comprising:
[0006] Get transaction information and public key;
[0007] Based on a preset elliptic curve cryptographic algorithm and the public key, encrypt the transaction information to obtain encrypted information;
[0008] Constructing a zero-knowledge proof according to a preset zero-knowledge proof template and the encrypted information;
[0009] Verifying the zero-knowledge proof according to the type of the zero-knowledge proof to obtain first transaction verification information; and comparing the transaction information with preset platform transaction input information to obtain second transaction verification information;
[0010] Transaction feedback information is generated according to the first transaction verification information and the second transaction verification information.
[0011] According to some embodiments of the present application, the encrypting the transaction information based on a preset elliptic curve cryptographic algorithm and the public key to obtain the encrypted information includes:
[0012] Determine a target elliptic curve according to the elliptic curve cryptographic algorithm;
[0013] Converting the transaction information into a target point on the target elliptic curve;
[0014] Encrypting the target point according to the public key to obtain an encrypted point;
[0015] The encryption point is transformed into the encryption information.
[0016] According to some embodiments of the present application, the step of constructing a zero-knowledge proof according to a preset zero-knowledge proof template and the encrypted information includes:
[0017] Determine proof target information and verification logic information according to the zero-knowledge proof template;
[0018] The zero-knowledge proof is generated according to the proof target information, the verification logic information and the encryption information.
[0019] According to some embodiments of the present application, the verifying the zero-knowledge proof according to the type of the zero-knowledge proof to obtain the first transaction verification information includes at least one of the following:
[0020] When the type of the zero-knowledge proof indicates that the zero-knowledge proof is unrelated to a preset private key, verifying the zero-knowledge proof based on a preset verification algorithm to obtain the first transaction verification information;
[0021] In a case where the type of the zero-knowledge proof indicates that the zero-knowledge proof is related to a preset private key, the zero-knowledge proof is verified based on the private key and a preset verification algorithm to obtain the first transaction verification information, wherein the private key corresponds to the public key.
[0022] According to some embodiments of the present application, the verifying the zero-knowledge proof based on a preset verification algorithm to obtain the first transaction verification information includes:
[0023] Verifying the integrity of the zero-knowledge proof to obtain proof structural information;
[0024] Performing a first cryptographic operation on the zero-knowledge proof to obtain a first operation result;
[0025] The proof structural information and the first operation result are compared with a preset transaction verification condition to obtain the first transaction verification information.
[0026] According to some embodiments of the present application, the verifying the zero-knowledge proof based on the private key and a preset verification algorithm to obtain the first transaction verification information includes:
[0027] Generate signature certification information according to the private key;
[0028] Verifying the validity of the zero-knowledge proof according to the signature proof information to obtain validity verification information;
[0029] Performing a second cryptographic operation on the zero-knowledge proof to obtain a second operation result;
[0030] The validity verification information and the second operation result are compared with a preset transaction verification condition to obtain the first transaction verification information.
[0031] According to some embodiments of the present application, the transaction feedback information includes transaction success information and transaction failure information, and the generating of the transaction feedback information according to the first transaction verification information and the second transaction verification information includes:
[0032] generating the transaction success information when the first transaction verification information indicates that the transaction information is accurate and the second transaction verification information indicates that the transaction information is authentic;
[0033] When the first transaction verification information indicates that the transaction information is wrong or the second transaction verification information indicates that the transaction information is untrue, the transaction failure information is generated.
[0034] In a second aspect, the embodiment of the present application further provides a transaction verification device, including:
[0035] A first processing module, used to obtain transaction information and public keys;
[0036] A second processing module, configured to encrypt the transaction information based on a preset elliptic curve cryptographic algorithm and the public key to obtain encrypted information;
[0037] A third processing module, used to construct a zero-knowledge proof according to a preset zero-knowledge proof template and the encrypted information;
[0038] A fourth processing module is used to verify the zero-knowledge proof according to the type of the zero-knowledge proof to obtain first transaction verification information; and compare the transaction information with preset platform transaction input information to obtain second transaction verification information;
[0039] A fifth processing module is configured to generate transaction feedback information according to the first transaction verification information and the second transaction verification information.
[0040] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the transaction verification method as described in the first aspect above is implemented.
[0041] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the transaction verification method described in the first aspect above.
[0042] According to the transaction verification method of the embodiment provided by the present application, at least the following beneficial effects are achieved: in the process of transaction verification, firstly, the transaction information and the public key are obtained; then, based on the preset elliptic curve cryptographic algorithm and the public key, the transaction information is encrypted to obtain the encrypted information; then, a zero-knowledge proof is constructed according to the preset zero-knowledge proof template and the encrypted information; then, the zero-knowledge proof is verified according to the type of the zero-knowledge proof to obtain the first transaction verification information; and the transaction information is compared with the preset platform transaction input information to obtain the second transaction verification information; finally, the transaction feedback information is generated according to the first transaction verification information and the second transaction verification information. Through the above method, the leakage of privacy information can be well prevented, the security of transactions can be improved, and a good experience can be brought to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0044] Figure 1 is a flow chart of a transaction verification method provided by an embodiment of the present application;
[0045] Figure 2 is a specific flow chart of step S200 provided in one embodiment of the present application;
[0046] Figure 3 is a specific flow chart of step S300 provided in one embodiment of the present application;
[0047] Figure 4 is a specific flow chart of step S400 provided in one embodiment of the present application;
[0048] Figure 5 is a specific flow chart of step S410 provided in one embodiment of the present application;
[0049] Figure 6 is a specific flow chart of step S420 provided in one embodiment of the present application;
[0050] Figure 7 is a specific flow chart of step S500 provided in one embodiment of the present application;
[0051] Figure 8 is a schematic diagram of a transaction verification device provided by an embodiment of the present application;
[0052] Fig. 9 It is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] It should be noted that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0055] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0056] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0057] AI is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. Artificial intelligence is a branch of computer science. Artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0058] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0059] Artificial intelligence is AI. AI is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0060] The servers involved in artificial intelligence technology can be independent servers or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0061] The present application provides a transaction verification method, device, electronic device and computer-readable storage medium. In the process of transaction verification, firstly, the transaction information and public key are obtained; then, based on the preset elliptic curve cryptographic algorithm and public key, the transaction information is encrypted to obtain the encrypted information; then, a zero-knowledge proof is constructed according to the preset zero-knowledge proof template and the encrypted information; then, the zero-knowledge proof is verified according to the type of the zero-knowledge proof to obtain the first transaction verification information; and the transaction information is compared with the preset platform transaction input information to obtain the second transaction verification information; finally, the transaction feedback information is generated according to the first transaction verification information and the second transaction verification information. Through the above method, the leakage of privacy information can be well prevented, the security of transactions can be improved, and a good experience can be brought to users.
[0062] The transaction verification method provided in the embodiment of the present application relates to the field of financial technology. The transaction verification method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the transaction verification method, etc., but is not limited to the above forms.
[0063] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0064] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0065] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0066] like Figure 1 As shown, Figure 1 It is a flowchart of a transaction verification method provided by an embodiment of the present application, and the transaction verification method includes but is not limited to steps S100 to S500.
[0067] Step S100, obtaining transaction information and public key;
[0068] Step S200, encrypting the transaction information based on a preset elliptic curve cryptographic algorithm and a public key to obtain encrypted information;
[0069] Step S300, constructing a zero-knowledge proof according to a preset zero-knowledge proof template and encrypted information;
[0070] Step S400, verifying the zero-knowledge proof according to the type of the zero-knowledge proof to obtain first transaction verification information; and comparing the transaction information with preset platform transaction input information to obtain second transaction verification information;
[0071] Step S500: Generate transaction feedback information according to the first transaction verification information and the second transaction verification information.
[0072] It should be noted that in the process of transaction verification, first obtain the transaction information and public key; then encrypt the transaction information based on the preset elliptic curve cryptographic algorithm and public key to obtain the encrypted information; then build a zero-knowledge proof based on the preset zero-knowledge proof template and encrypted information; then verify the zero-knowledge proof according to the type of zero-knowledge proof to obtain the first transaction verification information; and compare the transaction information with the preset platform transaction input information to obtain the second transaction verification information; finally, generate transaction feedback information based on the first transaction verification information and the second transaction verification information. Through the above method, it is possible to prevent the leakage of privacy information, improve the security of transactions, and bring a good experience to users.
[0073] It is worth noting that in the process of encrypting the transaction information to obtain encrypted information, based on the preset elliptic curve cryptography algorithm and public key, based on the above method, the security of transaction verification can be well improved; subsequently, a zero-knowledge proof can be constructed based on the zero-knowledge proof template and the encrypted information to further improve the security of transaction verification; then, the zero-knowledge proof can be verified according to the type of zero-knowledge proof to obtain the first transaction verification information; and the transaction information and the preset platform transaction input information are compared to obtain the second transaction verification information; finally, transaction feedback information can be generated based on the first transaction verification information and the second transaction verification information; by constructing a zero-knowledge proof through a zero-knowledge proof template, and comparing according to the preset platform transaction input information, and verifying the transaction based on the above two methods, the security of transaction verification can be well improved.
[0074] It is worth noting that Elliptic Curve Cryptography (ECC) is a public key cryptography system based on elliptic curve mathematics. It is widely used in cryptography because it provides higher security than asymmetric encryption algorithms while requiring shorter key lengths. Applications of Elliptic Curve Cryptography: Key exchange, used to securely exchange keys over an insecure channel; digital signatures, used to verify the integrity and origin of data. Encryption: Although ECC is mainly used for key exchange and signatures, it can also be used for encryption through an integrated mode. Security: The security of ECC is based on the elliptic curve discrete logarithm problem, which is a difficult problem to solve discrete logarithms on elliptic curve groups. Due to the computational complexity of this problem, ECC can use shorter key lengths than traditional algorithms such as asymmetric encryption algorithms, providing higher efficiency at the same security level.
[0075] It is worth noting that Zero-Knowledge Proof (ZKP) is a cryptographic technique that allows one party to prove to another party that a statement is correct without providing any information other than its correctness. This type of proof ensures the information security of the prover because no additional information is leaked during the proof process. Key features of zero-knowledge proofs: Completeness: If the statement is correct, an honest verifier can always be convinced. Soundness: If the statement is wrong, a cheater cannot convince an honest verifier. Zero-knowledge: The proof does not leak any information other than the correctness of the statement. Types of zero-knowledge proofs: Interactive zero-knowledge proofs: There are multiple rounds of interaction between the prover and the verifier. This type of proof is usually more secure, but less efficient. Non-interactive zero-knowledge proofs: The prover generates a proof that the verifier can verify independently without further interaction. This type of proof is more efficient, but more complex to implement. Zero-knowledge proofs based on cryptographic hash functions: Use the properties of hash functions to construct proofs. Zero-knowledge proofs based on elliptic curves: Use the properties of elliptic curve cryptography to construct proofs.
[0076] In some embodiments of the present application, illustratively, in the process of transaction processing, first select the encryption algorithm, and the bank selects elliptic curve cryptography as the encryption algorithm because it is efficient and secure in zero-knowledge proof; Generate key pair: Generate ECC public and private key pair using a secure random number generator; The private key should be stored in the bank's secure hardware, and the public key is publicly released to customers; Set encryption parameters: Determine the specific parameters of the elliptic curve (such as curve type, base point, order, etc.), as well as any additional encryption parameters (such as hash function type); Technical details: Private key protection: The private key should be protected by both physical and logical protection, such as multi-factor authentication, access control list, etc. Public key release: The public key can be publicly released through the bank's official website or secure application interface, and is accompanied by a digital signature to verify its authenticity. Customer data encryption and submission, detailed steps: Data encryption: The customer uses the public key and ECC encryption algorithm provided by the bank to encrypt transaction information (such as account ID, transaction amount, timestamp, etc.). During the encryption process, it may be necessary to split the information into multiple data blocks, and each data block is encrypted separately. Data integrity verification: Hash each data block (such as SHA-256) and append the hash value to the encrypted data block. Secure submission: Submit the encrypted data block and its hash value to the bank through a secure protocol. Technical details: Data segmentation: To enhance security, sensitive information can be segmented into multiple parts, each encrypted using a different key or encryption parameter. Transport layer security. Building a zero-knowledge proof, detailed steps: Prepare a proof template: The bank provides a zero-knowledge proof template that defines the structure of the proof, the required input data, and the verification conditions. Customer builds the proof: The customer uses the zero-knowledge proof library to build a zero-knowledge proof based on the template and transaction information. The proof should contain a commitment to the encrypted data, the verification logic of the transaction information, and a proof that the verification conditions are met. Verification conditions: Verification conditions may include sufficient account balance, valid transaction time, and legality of the counterparty. Technical details: Commitment scheme: Use data structures such as hash chains to build commitments so that encrypted data can be efficiently referenced and verified in proofs. Verification logic: The verification logic should ensure that the validity and accuracy of the transaction can be verified without knowing the specific transaction information. The bank verifies the zero-knowledge proof, detailed steps: Receiving the proof: The bank receives the zero-knowledge proof submitted by the customer through a secure channel. Verification algorithm: Use a predetermined verification algorithm and private key (in some cases, a private key may not be required, depending on the specific type of zero-knowledge proof) to verify the proof. The verification process includes checking the integrity of the commitment, the correctness of the verification logic, and the satisfaction of the verification conditions. Result determination: Based on the verification results, determine whether the transaction information is accurate. Technical details: Verification efficiency: Optimize the verification algorithm to improve verification efficiency and ensure that the verification process is completed within a reasonable time. Verification log: Record the key steps and results of the verification process for subsequent audits and inquiries.Privacy intersection and data comparison, detailed steps: Protocol setting: The bank negotiates with the third-party payment platform and sets the specific parameters and processes of the multi-party secure computing protocol. Data input: Both parties input encrypted transaction data (such as transaction ID, amount, etc.). Secure calculation: In the encrypted state, the data is compared and calculated through the MPC protocol to confirm the authenticity of the transaction. Result output: Output the comparison result, but do not disclose the original data of either party. Technical details: MPC protocol selection: Select a suitable MPC protocol to ensure data security and privacy. Communication security: Ensure communication security during the MPC process to prevent information leakage or tampering. Result feedback and subsequent processing, detailed steps: After the verification is completed, the bank will feedback to the customer based on the verification results. If the verification passes, the transaction is approved and the customer account information is updated; if the verification fails, the transaction is rejected and the customer is notified of the reason. At the same time, the bank also needs to record the verification process and results for subsequent audits and inquiries. Technical details: Result feedback should be carried out through a secure channel to ensure the confidentiality and integrity of the information. At the same time, the bank should establish a complete logging mechanism to track and record the entire verification process.
[0077] It is worth noting that the above technical solutions can enhance privacy protection: transaction verification can be completed without revealing sensitive data, protecting customer privacy. Efficient and secure verification: transaction information can be verified quickly and accurately to reduce fraud risks. Promote cross-institutional cooperation: cross-institutional transaction verification can be achieved without leaking sensitive data, enhancing mutual trust.
[0078] In some embodiments, Figure 2 As shown, the above step S200 may include but is not limited to steps S210 to S240.
[0079] Step S210, determining a target elliptic curve according to an elliptic curve cryptographic algorithm;
[0080] Step S220, converting the transaction information into a target point on the target elliptic curve;
[0081] Step S230, encrypting the target point according to the public key to obtain an encrypted point;
[0082] Step S240, transforming the encryption point into encryption information.
[0083] It should be noted that in the process of encrypting transaction information to obtain encrypted information based on a preset elliptic curve cryptographic algorithm and a public key, the target elliptic curve can be determined first according to the elliptic curve cryptographic algorithm; then the transaction information is converted into a target point on the target elliptic curve; then the target point is encrypted according to the public key to obtain an encrypted point; finally, the encrypted point is transformed to obtain the corresponding encrypted information. Through the above technical solution, the transaction information can be encrypted by the elliptic curve cryptographic algorithm and the public key to obtain encrypted information, which greatly improves security.
[0084] It is worth noting that in the process of encrypting transaction information, the target elliptic curve is first determined according to the elliptic curve cryptography algorithm, and then the transaction information is converted into a target point on the target elliptic curve. Then, the target point is encrypted according to the public key to obtain the encrypted point. Finally, the encrypted point is transformed to obtain the corresponding encrypted information. By encrypting the transaction information in a stable and reliable way, information leakage is well prevented and the security of the transaction is greatly improved.
[0085] In some embodiments, Figure 3 As shown, the above step S300 may include but is not limited to step S310 to step S320.
[0086] Step S310, determining proof target information and verification logic information according to the zero-knowledge proof template;
[0087] Step S320, generating a zero-knowledge proof according to the proof target information, the verification logic information and the encryption information.
[0088] It should be noted that in the process of constructing a zero-knowledge proof based on a preset zero-knowledge proof template and encrypted information, the proof target information and verification logic information are first determined based on the zero-knowledge proof template; then, the corresponding zero-knowledge proof can be generated based on the proof target information, verification logic information and encrypted information. Based on zero-knowledge proof, the prerequisites for subsequent transaction verification can be prepared.
[0089] It is worth noting that in the process of generating zero-knowledge proof, the target information and verification logic information are first determined according to the zero-knowledge proof template. Subsequently, the encrypted information can be converted and processed according to the target information and verification logic information to obtain the zero-knowledge proof, so as to further verify the transaction information and improve security.
[0090] In some embodiments, Figure 4 As shown, the above step S400 may include but is not limited to step S410 to step S420.
[0091] Step S410, when the type of the zero-knowledge proof indicates that the zero-knowledge proof is irrelevant to a preset private key, verify the zero-knowledge proof based on a preset verification algorithm to obtain first transaction verification information;
[0092] Step S420, when the type of zero-knowledge proof represents that the zero-knowledge proof is related to a preset private key, the zero-knowledge proof is verified based on the private key and a preset verification algorithm to obtain first transaction verification information, wherein the private key corresponds to the public key.
[0093] It should be noted that, in the process of verifying the zero-knowledge proof according to the type of zero-knowledge proof to obtain the first transaction verification information, when the type of zero-knowledge proof represents that the zero-knowledge proof is independent of the preset private key, the zero-knowledge proof can be verified based on the preset verification algorithm to obtain the first transaction verification information; when the type of zero-knowledge proof represents that the zero-knowledge proof is related to the preset private key, the zero-knowledge proof can be verified based on the private key and the preset verification algorithm to obtain the first transaction verification information, wherein the private key and the public key correspond to each other; through the above technical scheme, the corresponding algorithm is selected according to the type of zero-knowledge proof to verify the zero-knowledge proof, thereby realizing the preliminary verification of the transaction.
[0094] It is worth noting that verifying the zero-knowledge proof by its type makes the entire verification process more flexible, and the corresponding verification method can be selected according to different types to better verify the zero-knowledge proof.
[0095] In some embodiments, Figure 5 As shown, the above step S410 may include but is not limited to steps S411 to S413.
[0096] Step S411, verifying the integrity of the zero-knowledge proof to obtain proof structural information;
[0097] Step S412, performing a first cryptographic operation on the zero-knowledge proof to obtain a first operation result;
[0098] Step S413, comparing the proof structural information and the first operation result with the preset transaction verification condition to obtain first transaction verification information.
[0099] It should be noted that in the process of verifying the zero-knowledge proof based on the preset verification algorithm, the integrity of the zero-knowledge proof is first verified to obtain the proof structural information; then the first cryptographic operation is performed on the zero-knowledge proof to obtain the first operation result; finally, the proof structural information and the first operation result are compared with the preset transaction verification conditions to obtain the first transaction verification information. Through the above technical solution, the preset verification algorithm can be directly used to verify the zero-knowledge proof without the need to use a private key, making the entire verification process simpler and faster.
[0100] It is worth noting that by verifying the integrity of the zero-knowledge proof, the proof structural information can be obtained, and by performing a first cryptographic operation on the zero-knowledge proof, the first operation result can be obtained; finally, by comparing the proof structural information and the first operation result with the preset transaction verification conditions, the first transaction verification information can be obtained. The whole process is simple and reliable.
[0101] In some embodiments, Figure 6 As shown, the above step S420 may include but is not limited to steps S421 to S424.
[0102] Step S421, generating signature certification information according to the private key;
[0103] Step S422, verifying the validity of the zero-knowledge proof according to the signature proof information to obtain validity verification information;
[0104] Step S423, performing a second cryptographic operation on the zero-knowledge proof to obtain a second operation result;
[0105] Step S424, comparing the validity verification information and the second operation result with the preset transaction verification condition to obtain first transaction verification information.
[0106] It should be noted that in the process of verifying the zero-knowledge proof based on the private key and the preset verification algorithm to obtain the first transaction verification information, firstly, the signature proof information is generated according to the private key; then, the validity of the zero-knowledge proof is verified according to the signature proof information to obtain the validity verification information; then, the second cryptographic operation is performed on the zero-knowledge proof to obtain the second operation result; finally, the validity verification information and the second operation result can be compared with the preset transaction verification conditions to obtain the first transaction verification information. Through the above technical solution, when the type of zero-knowledge proof is related to the private key, the signature proof information can be generated according to the private key, and then the validity of the zero-knowledge proof can be verified according to the signature proof information to obtain the validity verification information; finally, the validity verification information and the second operation result can be compared with the preset transaction verification conditions to obtain the corresponding first transaction verification information. The whole process is stable and reliable, which greatly improves the reliability of transaction verification.
[0107] In some embodiments, Figure 7 As shown, the transaction feedback information includes transaction success information and transaction failure information, and the above step S500 may include but is not limited to steps S510 to S520.
[0108] Step S510, generating transaction success information when the first transaction verification information indicates that the transaction information is accurate and the second transaction verification information indicates that the transaction information is authentic;
[0109] Step S520: Generate transaction failure information when the first transaction verification information indicates that the transaction information is wrong or the second transaction verification information indicates that the transaction information is untrue.
[0110] It should be noted that, when the first transaction verification information and the second transaction verification information are obtained through analysis, transaction success information will be generated to inform the user that the transaction is successful only when the first transaction verification information indicates that the transaction information is accurate and the second transaction verification information indicates that the transaction information is true; when the first transaction verification information indicates that the transaction information is wrong or the second transaction verification information indicates that the transaction information is untrue, transaction failure information will be generated to stop the corresponding transaction, and the user can also be informed that an abnormality has occurred in the transaction, thereby improving the security of the transaction.
[0111] In addition, if Figure 8 As shown, an embodiment of the present application further provides a transaction verification device 10, comprising:
[0112] The first processing module 100 is used to obtain transaction information and public keys;
[0113] The second processing module 200 is used to encrypt the transaction information based on a preset elliptic curve cryptographic algorithm and a public key to obtain encrypted information;
[0114] The third processing module 300 is used to construct a zero-knowledge proof according to a preset zero-knowledge proof template and encrypted information;
[0115] The fourth processing module 400 is used to verify the zero-knowledge proof according to the type of the zero-knowledge proof to obtain first transaction verification information; and compare the transaction information with the preset platform transaction input information to obtain second transaction verification information;
[0116] The fifth processing module 500 is configured to generate transaction feedback information according to the first transaction verification information and the second transaction verification information.
[0117] It should be noted that in the process of transaction verification, first obtain the transaction information and public key; then encrypt the transaction information based on the preset elliptic curve cryptographic algorithm and public key to obtain the encrypted information; then build a zero-knowledge proof based on the preset zero-knowledge proof template and encrypted information; then verify the zero-knowledge proof according to the type of zero-knowledge proof to obtain the first transaction verification information; and compare the transaction information with the preset platform transaction input information to obtain the second transaction verification information; finally, generate transaction feedback information based on the first transaction verification information and the second transaction verification information. Through the above method, it is possible to prevent the leakage of privacy information, improve the security of transactions, and bring a good experience to users.
[0118] The specific implementation of the transaction verification device 10 is substantially the same as the specific implementation of the transaction verification method described above, and will not be described in detail herein.
[0119] In addition, if Fig. 9 As shown, an embodiment of the present application further provides an electronic device 700 , which includes: a memory 720 , a processor 710 , and a computer program stored in the memory 720 and executable on the processor 710 .
[0120] The processor 710 and the memory 720 may be connected via a bus or in other ways.
[0121] The non-transitory software programs and instructions required to implement the transaction verification methods of the above embodiments are stored in the memory 720 , and when executed by the processor 710 , the transaction verification methods of the above embodiments are executed.
[0122] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by a processor 710 or a controller, for example, by a processor 710 in the above-mentioned device embodiment, so that the above-mentioned processor 710 can execute the transaction verification method in the above-mentioned embodiment.
[0124] The above embodiments may be used in combination, and modules with the same name in different embodiments may be the same or different.
[0125] The above describes specific embodiments of the present application, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0126] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0127] The apparatus, device, computer-readable storage medium and method provided in the embodiments of the present application correspond to each other. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and computer storage medium will not be repeated here.
[0128] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and produce dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs. The original code before compilation must also be written in a specific programming language, which is called Hardware Description Language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Basic Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCall, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used one is VHDL (Very-High-Speed Integrated Circuit Hardware Description Language). Those skilled in the art should also be aware that by programming the method flow in the above-mentioned hardware description languages and programming it into an integrated circuit, a hardware circuit for implementing the logic method flow can be easily obtained.
[0129] The controller can be implemented in any appropriate manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the means for realizing various functions may be regarded as both a software module for realizing the method and a structure within a hardware component.
[0130] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0131] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0132] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0133] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0136] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0137] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash memory (Flash RAM). The memory is an example of a computer-readable medium.
[0138] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (Transitory Med ia), such as modulated data signals and carrier waves.
[0139] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0140] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0141] Embodiments of the present application may be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. Embodiments of the present application may also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0142] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0143] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A transaction verification method, characterized in that: The method comprises: Get transaction information and public key; Based on a preset elliptic curve cryptographic algorithm and the public key, encrypt the transaction information to obtain encrypted information; Constructing a zero-knowledge proof according to a preset zero-knowledge proof template and the encrypted information; Verifying the zero-knowledge proof according to the type of the zero-knowledge proof to obtain first transaction verification information; and comparing the transaction information with preset platform transaction input information to obtain second transaction verification information; Transaction feedback information is generated according to the first transaction verification information and the second transaction verification information.
2. The transaction verification method according to claim 1, characterized in that: The encrypting the transaction information based on the preset elliptic curve cryptographic algorithm and the public key to obtain the encrypted information includes: Determine a target elliptic curve according to the elliptic curve cryptographic algorithm; Converting the transaction information into a target point on the target elliptic curve; Encrypting the target point according to the public key to obtain an encrypted point; The encryption point is transformed into the encryption information.
3. The transaction verification method according to claim 1, characterized in that: The constructing of the zero-knowledge proof according to the preset zero-knowledge proof template and the encrypted information includes: Determine proof target information and verification logic information according to the zero-knowledge proof template; The zero-knowledge proof is generated according to the proof target information, the verification logic information and the encryption information.
4. The transaction verification method according to claim 1, characterized in that: The verifying the zero-knowledge proof according to the type of the zero-knowledge proof to obtain the first transaction verification information includes at least one of the following: When the type of the zero-knowledge proof indicates that the zero-knowledge proof is unrelated to a preset private key, verifying the zero-knowledge proof based on a preset verification algorithm to obtain the first transaction verification information; In a case where the type of the zero-knowledge proof indicates that the zero-knowledge proof is related to a preset private key, the zero-knowledge proof is verified based on the private key and a preset verification algorithm to obtain the first transaction verification information, wherein the private key corresponds to the public key.
5. The transaction verification method according to claim 4, characterized in that: The verifying the zero-knowledge proof based on a preset verification algorithm to obtain the first transaction verification information includes: Verifying the integrity of the zero-knowledge proof to obtain proof structural information; Performing a first cryptographic operation on the zero-knowledge proof to obtain a first operation result; The proof structural information and the first operation result are compared with a preset transaction verification condition to obtain the first transaction verification information.
6. The transaction verification method according to claim 4, characterized in that: The verifying the zero-knowledge proof based on the private key and a preset verification algorithm to obtain the first transaction verification information includes: Generate signature certification information according to the private key; Verifying the validity of the zero-knowledge proof according to the signature proof information to obtain validity verification information; Performing a second cryptographic operation on the zero-knowledge proof to obtain a second operation result; The validity verification information and the second operation result are compared with a preset transaction verification condition to obtain the first transaction verification information.
7. The transaction verification method according to claim 1, characterized in that: The transaction feedback information includes transaction success information and transaction failure information, and the generating of the transaction feedback information according to the first transaction verification information and the second transaction verification information includes: generating the transaction success information when the first transaction verification information indicates that the transaction information is accurate and the second transaction verification information indicates that the transaction information is authentic; When the first transaction verification information indicates that the transaction information is wrong or the second transaction verification information indicates that the transaction information is untrue, the transaction failure information is generated.
8. A transaction verification device, characterized in that: include: A first processing module, used to obtain transaction information and public keys; A second processing module, configured to encrypt the transaction information based on a preset elliptic curve cryptographic algorithm and the public key to obtain encrypted information; A third processing module, used to construct a zero-knowledge proof according to a preset zero-knowledge proof template and the encrypted information; A fourth processing module, configured to verify the zero-knowledge proof according to the type of the zero-knowledge proof to obtain first transaction verification information; and, comparing the transaction information with preset platform transaction input information to obtain second transaction verification information; A fifth processing module is configured to generate transaction feedback information according to the first transaction verification information and the second transaction verification information.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the transaction verification method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer executable instructions are used to execute the transaction verification method described in any one of claims 1 to 7.
Citation Information
Cited By
Method and system for realizing double offline verification based on non-interactive zero-knowledge proof algorithm
CN119515389A
Dual offline verification method and system based on non-interactive zero-knowledge proof algorithm
CN119515389B