CN112734423A - Transaction method based on block chain and terminal equipment - Google Patents

Transaction method based on block chain and terminal equipment Download PDF

Info

Publication number
CN112734423A
CN112734423A CN202011634790.0A CN202011634790A CN112734423A CN 112734423 A CN112734423 A CN 112734423A CN 202011634790 A CN202011634790 A CN 202011634790A CN 112734423 A CN112734423 A CN 112734423A
Authority
CN
China
Prior art keywords
transaction
account
initiator
public key
receiver
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011634790.0A
Other languages
Chinese (zh)
Inventor
邱炜伟
李伟
蔡亮
黄方蕾
乔沛杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202011634790.0A priority Critical patent/CN112734423A/en
Publication of CN112734423A publication Critical patent/CN112734423A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Abstract

The application is applicable to the technical field of block chains, and provides a transaction method and terminal equipment based on the block chains, which comprises the following steps: encrypting the transaction amount according to the initiator public key and the receiver public key respectively to obtain a transaction amount ciphertext; generating transaction information containing the transaction amount ciphertext and a zero knowledge certificate; the transaction information is sent to the block chain node, the transaction information is encrypted through an encryption mechanism, then the transaction is realized based on the encrypted transaction information and zero knowledge certification, all information is transmitted on the chain and is realized based on whole network consensus, the transaction data cannot be tampered, the privacy of the transaction can be guaranteed, and the safety of an account can be guaranteed.

Description

Transaction method based on block chain and terminal equipment
Technical Field
The application belongs to the technical field of block chains, and particularly relates to a transaction method based on a block chain and a terminal device.
Background
The blockchain technology is a novel decentralized distributed account book technology, can safely store digital currency transactions or other data, and is characterized in that information stored on a blockchain cannot be forged and tampered, a blockchain consensus algorithm drives each node on the blockchain to participate in a transaction verification process, the transactions on the blockchain are guaranteed to be credible, each node on the blockchain maintains a public account book for storing balance and intelligent contract data of all users on a blockchain network, and any node does not modify the account book maintained by the node to be acknowledged by other nodes, so that the public account book cannot be forged and tampered.
In the process of executing transaction by the existing block chain network, transaction information such as account balance and transaction amount of both transaction parties can be recorded in a clear text mode, so that the risk of leakage of the transaction information in non-transaction related parties can be caused.
Disclosure of Invention
The embodiment of the application provides a transaction method based on a block chain and a terminal device, which can solve the problem that the transaction information has a risk of leakage in a non-transaction related party.
In a first aspect, an embodiment of the present application provides a transaction method based on a blockchain, including:
encrypting the transaction amount according to the initiator public key and the receiver public key respectively to obtain a transaction amount ciphertext;
generating transaction information containing the transaction amount ciphertext and a first zero knowledge certificate;
and sending the transaction information to a block chain node.
The first zero knowledge proof is used for proving that the transaction amount ciphertext of the initiator is obtained by encrypting the terminal of the initiator by using the public key of the initiator, and the transaction amount ciphertext of the receiver is obtained by encrypting the terminal of the initiator by using the public key of the receiver; and the plaintext corresponding to the cryptograph of the transaction amount of the initiator is equal to the plaintext corresponding to the cryptograph of the transaction amount of the receiver, and the zero knowledge proof is also used for proving that the plaintext corresponding to the cryptograph of the transaction amount of the initiator is smaller than or equal to the plaintext corresponding to the account balance of the initiator.
In a possible implementation manner of the first aspect, the encrypting the transaction amount according to the initiator public key and the receiver public key to obtain a transaction amount ciphertext includes:
determining an initiator public key according to the initiator address;
determining a receiver public key according to the receiver address;
encrypting the transaction amount according to the initiator public key to obtain an initiator transaction amount ciphertext;
and encrypting the transaction amount according to the public key of the receiver to obtain a transaction amount ciphertext of the receiver.
In a possible implementation manner of the first aspect, the method further includes: a first zero knowledge proof corresponding to the transaction is generated.
In one possible implementation manner of the first aspect, the method further includes implementing account conversion according to the conversion transaction.
In one possible implementation manner of the first aspect, the conversion transaction includes a first conversion transaction that converts the private account into a general account and a second conversion transaction that converts the general account into the private account.
When the converted transaction is a first converted transaction, the transaction information of the first converted transaction comprises a receiver address, an initiator address, a transaction signature, account balance plaintext and a second zero knowledge proof.
And the second zero knowledge proof is used for proving that the account balance plaintext and the account balance ciphertext of the account in the first conversion transaction are corresponding.
When the converted transaction is a second converted transaction, the transaction information of the second converted transaction includes: the address of the receiving party, the address of the initiating party, the transaction signature, the account balance ciphertext and the third zero knowledge proof.
Wherein the third zero knowledge proof is used for proving that the account balance plaintext and the account balance ciphertext of the account in the second conversion transaction are corresponding
In a second aspect, an embodiment of the present application provides a terminal device, including:
the encryption module is used for encrypting the transaction amount according to the initiator public key and the receiver public key respectively to obtain a transaction amount ciphertext;
the generating module is used for generating transaction information containing the transaction amount ciphertext and the zero knowledge proof;
and the sending module is used for sending the transaction information to the block chain node.
In a third aspect, an embodiment of the present application provides a terminal device, including: memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the method according to any of the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to any one of the first aspect.
In a fifth aspect, the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the method of any one of the above first aspects.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Compared with the prior art, the embodiment of the application has the advantages that:
according to the block chain-based transaction method and the terminal device, the transaction information is encrypted through the encryption mechanism, then the transaction is realized based on the encrypted transaction information and the zero-knowledge proof, all information is transmitted on the chain and is realized based on the whole network consensus, the transaction data cannot be tampered, the privacy of the transaction can be guaranteed, the safety of an account can be guaranteed, the account amount does not need to be maintained under a user chain, meanwhile, the trusted computing environment is not needed, the implementation is easier, the implementation cost is lower, and the account is not tampered while the private transaction is realized based on the whole network consensus concept.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic architecture diagram of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a transaction method based on a blockchain according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a terminal device provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The existing block chain network records the transaction information such as account balance and transaction amount of both transaction parties in a clear text form in the transaction executing process, so that the risk of transaction information leakage in non-transaction related parties exists. In order to avoid the leakage of transaction information among non-transaction related parties and protect the privacy of the transaction related parties, the transaction can be carried out in a privacy transaction mode. The privacy transaction refers to a transaction in which the transaction amount and the transaction account information are hidden.
The existing methods for performing privacy transactions include the following:
1. private transactions based on a trusted context. The privacy transaction based on the trusted environment refers to that part of logic in the block chain nodes or nodes is executed in the trusted computing environment so as to achieve the purpose of privacy protection.
2. Privacy transactions based on sub-channel/partition consensus. The privacy transaction based on the channel/partition consensus refers to that privacy data are shared among partial nodes only, so that the purpose of privacy protection is achieved.
3. Private transaction based on hash chaining. The privacy transaction based on the hash uplink refers to that the privacy information is not uplinked, but the hash value corresponding to the privacy information is uplinked.
4. Privacy transactions committed based on the homomorphic nature. A private transaction based on a homomorphic commitment refers to a homomorphic commitment that includes plaintext information in the transaction, such as peterson's commitment, followed by a zero knowledge proof that the committed transaction value is positive and less than the user balance.
The various privacy transactions mentioned above have the following hidden dangers respectively:
1. privacy transactions based on trusted environments need to have certain requirements on executed hardware environments, and also have the problem of privacy disclosure because the provision of trusted computing environments is not fortified.
2. The privacy transaction based on the common channel/partition is contrary to the concept of block chain decentralization, and the situation that a plurality of nodes capable of sharing privacy data jointly tamper with the data is easy to happen.
3. In the privacy transaction based on the hash uplink, since the hash value cannot be logically operated, the plaintext of transaction data still needs to be transmitted under the link, and the problem of privacy disclosure still exists.
4. Based on the privacy transaction committed by the homomorphism, the initiator and the receiver of the transfer account need to maintain the account amount and the plain text value of the transaction amount under the chain, and once the synchronization is lost on the chain and under the chain, the transfer operation can not be carried out. Secondly, the transfer initiator also needs to inform the receiving party of the transfer amount and the related random number in the clear text offline, and the receiving party can verify the transaction only after receiving the information. Therefore, the initiator can transfer the money maliciously, and the real transfer amount is notified to the receiver offline, so that the balance under the chain of the receiver and the balance on the chain are desynchronized, and the account of the receiver cannot be used.
In order to solve the above problems, an embodiment of the present application provides a transaction method based on a blockchain, where transaction information is encrypted through an encryption mechanism, then a transaction is implemented based on the encrypted transaction information and a zero-knowledge proof, all information is transmitted on the chain and implemented based on a global network consensus, transaction data is not falsifiable, and thus, not only privacy of the transaction can be ensured, but also security of an account can be ensured.
In order to describe a specific implementation of the blockchain-based transaction method provided by the embodiment of the present application in more detail, the following description is made with reference to the accompanying drawings for the blockchain-based transaction method provided by the embodiment of the present application:
the block chain-based transaction method provided by the embodiment of the application can be applied to the scene shown in fig. 1. Fig. 1 is a schematic architecture diagram of an application scenario of a transaction method based on a blockchain according to an embodiment of the present application. As shown in fig. 1, a blockchain network may include a blockchain 10 and a plurality of nodes 20 connected in the blockchain. The plurality of nodes can be different devices such as user terminals, servers and cloud servers, each node is registered in the block chain and can broadcast transaction data to the whole network, and each node can participate in the verification process of transactions initiated by other nodes.
In this embodiment of the present application, an execution subject of the above block chain based transaction method may be a terminal of an initiator, and the terminal of the initiator may be any node of the above nodes. When a user needs to initiate a transaction, the user can log in an account of the user at a certain node in the blockchain network, so that a terminal of an initiator is connected to the blockchain network, and then the transaction is initiated by using the terminal of the initiator. The method provided by the embodiment of the present application is described below with the terminal of the initiator as the execution subject.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating an implementation flow of a transaction method based on a blockchain according to an embodiment of the present application. By way of example and not limitation, the method may be applied to the terminal of the initiator, and the method includes:
s11: and encrypting the transaction amount according to the initiator public key and the receiver public key respectively to obtain a transaction amount ciphertext.
In the embodiment of the application, when a user needs to perform privacy transaction, the user can log in the privacy account of the user through the node, and then the user initiates the transaction through the node. The private account refers to an account whose account balance exists in the form of a ciphertext on the blockchain.
It should be noted that the account of the user may be a general account in addition to the private account. The common account refers to an account whose account balance exists in a plaintext form on the block chain.
It should be further noted that each user may have multiple accounts, which may be a private account or a general account, and this application is not limited thereto.
In the embodiment of the application, the terminal of the initiator encrypts the transaction amount according to the public key of the initiator and the public key of the receiver, so as to obtain the encrypted transaction amount ciphertext.
Specifically, the terminal of the initiator may obtain the public key of the initiator and the public key of the receiver, and then encrypt the transaction amount once by using the public key of the initiator and encrypt the transaction amount once by using the public key of the receiver. And further obtaining the encrypted transaction amount ciphertext. That is, the above-mentioned transaction amount ciphertext includes two parts, one is the initiator transaction amount ciphertext obtained by encrypting the transaction amount with the initiator public key, and the other is the receiver transaction amount ciphertext obtained by encrypting the transaction amount with the receiver public key.
In this embodiment of the present application, the public key refers to information that can be used for identity authentication, and is an identifier of a user.
It should be noted that the blockchain may maintain account information of all users, including account information of the initiator and account information of the receiver. Thus, for each node of the blockchain, the public keys of all users are public and can be known by each node, and the public key of each user can be obtained in the user public key pool. As long as the node in the block chain knows the address of the initiator and the address of the receiver, the node can determine the public key corresponding to the user corresponding to the initiator (i.e., the initiator public key) and the public key corresponding to the user corresponding to the receiver (i.e., the receiver public key). The address of the initiator refers to the unique identifier of the account of the transaction initiator, and the account of the transaction initiator can be known through the address of the initiator. Similarly, the address of the receiver is the unique identifier of the account of the transaction receiver, and the account of the transaction receiver can be known through the address of the receiver.
It should be noted that, when a user needs to initiate a transaction, the user may input account information of both parties of the transaction, mainly account information of the initiator (i.e., an account on which the user logs in) and account information of the recipient. Specifically, the account information of the initiator may be an account address of the initiator, that is, an address of the initiator. The account information of the receiver may be an account address of the receiver, that is, a receiver address. Of course, the account information of the initiator may also include information such as an account name of the initiator, and the account information of the receiver may also include information such as an account name of the receiver.
In an embodiment of the present application, the step S11 may include the following steps:
determining an initiator public key according to the initiator address;
determining a receiver public key according to the receiver address;
encrypting the transaction amount according to the initiator public key to obtain an initiator transaction amount ciphertext;
and encrypting the transaction amount according to the public key of the receiver to obtain a transaction amount ciphertext of the receiver.
In a specific application, taking a transfer transaction as an example, a user inputs a transfer amount to a transfer object and an account address of the transfer object on a terminal of the user after logging in an account of the user. Therefore, the terminal of the initiator can determine the user identity of the initiator according to the account address (namely the initiator address) logged by the user so as to obtain the public key of the initiator, and determine the user identity of the receiver according to the account address (namely the receiver address) of the transfer object so as to obtain the public key of the receiver. The terminal of the initiator encrypts the transfer amount by using the public key of the initiator and the public key of the receiver respectively to obtain encrypted transfer amount ciphertext.
In this embodiment of the present application, the terminal of the initiator encrypts the transaction amount according to the public key of the initiator and the public key of the receiver, and may encrypt the transaction amount by using an addition homomorphic encryption algorithm. The additive homomorphic encryption algorithm includes, but is not limited to, an ELGamle algorithm, a Paillier algorithm, an elliptic curve-based encryption algorithm, and a bilinear pairwise cryptography-based encryption algorithm.
It should be noted that the ciphertext obtained by encrypting the transaction amount by using the same encryption algorithm can be directly added. The transaction can thus be verified in the context of the ciphertext.
For example, if the ciphertext of the account balance on the blockchain of the initiator is a, the ciphertext of the account balance on the blockchain of the receiver is B, the ciphertext obtained by encrypting the transaction amount with the public key of the initiator is C, and the ciphertext obtained by encrypting the transaction amount with the public key of the receiver is D, A, B, C, D can be directly used for operation. After the transfer, the account balance ciphertext of the initiator blockchain is A-C, and the account balance ciphertext of the receiver blockchain is B + D.
S12: and generating transaction information containing the transaction amount ciphertext and the first zero knowledge proof.
In this embodiment, after obtaining the transaction amount ciphertext and the zero knowledge certificate, the terminal of the initiator may generate transaction information including the transaction amount ciphertext and the first zero knowledge certificate.
In addition, the transaction information may also include information commonly included in common blockchain transactions, such as an initiator address, a receiver address, a transaction signature, and the like, which is not described in detail herein.
In an embodiment of the present application, before the terminal of the initiator generates the transaction information, a first zero-knowledge proof corresponding to the transaction is generated. The first zero knowledge proof is used for proving that the initiator transaction amount ciphertext is obtained by encrypting the initiator terminal by using the initiator public key, and the receiver transaction amount ciphertext is obtained by encrypting the initiator terminal by using the receiver public key; and the plaintext corresponding to the cryptograph of the transaction amount of the initiator is equal to the plaintext corresponding to the cryptograph of the transaction amount of the receiver. The first zero knowledge proof is also used for proving that the plaintext corresponding to the cryptograph of the transaction amount of the initiator is smaller than or equal to the plaintext corresponding to the account balance of the initiator.
It should be noted that the zero-knowledge proof is a proof idea of cryptography. The prover and the verifier negotiate a rule together, in the rule, the prover provides a series of ciphertext to the verifier under the condition that the prover does not expose own private evidence, and the verifier can trust that the prover has corresponding private evidence through verifying the ciphertext, but the verifier cannot know the content of the private evidence. For a specific process of generating the zero knowledge proof, reference may be made to an existing zero knowledge proof generation method, which is not described in detail herein.
In some application scenarios, a user may need to prove that the user owns a certain amount of assets, and at this time, the user may show a zero-knowledge proof that the account balance is greater than a certain specified value to indicate that the assets in the privacy account satisfy the specified value. Similarly, for some specific scenes (such as actions of preventing money laundering and the like), the user needs to prove that the own transfer amount is not more than a certain value, and the user can carry zero-knowledge proof for proving that the own transfer amount is less than or equal to the specific value in private transactions. Therefore, the transaction information of the user can be effectively protected from being leaked.
S13: and sending the transaction information to a block chain node.
In this embodiment of the present application, the terminal of the initiator may send the generated transaction information to all nodes in the blockchain for verification. It should be noted that the transaction may be generated by a software structure that can be used to generate the transaction at the client or outside, and then the terminal of the initiator may send the transaction (including the transaction information) to any one of the blockchain nodes of the blockchain.
After receiving the transaction information sent by the terminal of the initiator, the nodes in the block chain verify the zero knowledge proof, and after the verification is passed, the updated account balance can be registered on the block chain. Here, updating the account balance may include updating the account balance of the originator and updating the account balance of the recipient.
It should be noted that, after completing the transaction, the receiving party may use its own private key to query the plaintext value of its own account balance.
Therefore, the transaction information is encrypted through the encryption mechanism, the transaction is realized based on the encrypted transaction information and the zero knowledge certification, all information is transmitted on a chain and is realized based on the whole network consensus, the transaction data cannot be tampered, the privacy of the transaction can be guaranteed, the safety of an account can be guaranteed, the account amount does not need to be maintained under a user chain, meanwhile, the trusted computing environment does not need to be relied on, the implementation is easier, the implementation cost is lower, and the private transaction is realized based on the whole network consensus concept while the account is not tampered.
In an embodiment of the application, in order to facilitate user operation, requirements that both privacy transaction and ordinary transaction can be performed under the condition that only one account is logged in are met, and the privacy account of a user can be converted into the ordinary account under the condition that the transaction is not required to be encrypted. Similarly, when the account that the user logs in is a common account but wants to perform private transaction, the user may convert the common account into a private account. Therefore, the above block chain based transaction method may further include the following steps:
the account conversion is effected according to the conversion transaction.
In an embodiment of the present application, the conversion transaction includes a first conversion transaction for converting the private account into the general account and a second conversion transaction for converting the general account into the private account.
When the converted transaction is a first converted transaction, the transaction information of the first converted transaction includes: the address of the receiver, the address of the initiator, the transaction signature, the plaintext of the account balance, and the second zero knowledge proof.
When the account is a privacy account, the blockchain is a plaintext corresponding to the account balance of the privacy account, and only a ciphertext corresponding to the account balance of the privacy account is known. Therefore, when the private account needs to be converted into a common account, the first node needs to inform the blockchain of the account balance plaintext, so that the transaction information needs to carry the account balance plaintext.
In the embodiment of the present application, the second zero knowledge proves that the account balance plaintext and the account balance ciphertext of the account in the first conversion transaction are corresponding to each other.
It should be noted that, since account conversion only involves one account, the receiver address and the initiator address should be identical.
When the converted transaction is a second converted transaction, the transaction information of the second converted transaction includes: the address of the receiving party, the address of the initiating party, the transaction signature, the account balance ciphertext and the third zero knowledge proof.
When the account is a common account, the account balance of the account in the blockchain is stored in a plaintext form, so that when the common account needs to be converted into a privacy user, the blockchain can encrypt the account balance of the user by using the public key of the account, and further obtain an account balance ciphertext.
In addition, the blockchain needs to verify that the originator of the second converted transaction is the owner of the account before encrypting the account balance of the account, and thus, at the time of initiating the second converted transaction, the transaction needs to be signed using the private key of the account.
In this embodiment, the third zero knowledge proves that the account balance plaintext and the account balance ciphertext of the account in the second conversion transaction are corresponding to each other.
It should be noted that, since account conversion only involves one account, the receiver address and the initiator address should be identical.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Corresponding to the above embodiment of the transaction method based on the blockchain, fig. 3 shows a structural block diagram of the terminal device 3 provided in the embodiment of the present application, and for convenience of explanation, only the relevant parts related to the embodiment of the present application are shown.
Referring to fig. 3, the terminal device includes: an encryption module 31, a generation module 32 and a transmission module 33. Wherein:
the encryption module 31 is configured to encrypt the transaction amount according to the initiator public key and the receiver public key, respectively, to obtain a transaction amount ciphertext.
The generating module 32 is configured to generate transaction information including the transaction amount ciphertext and the first zero knowledge proof;
the sending module 33 is configured to send the transaction information to the blockchain node.
In an embodiment of the present application, the encryption module 31 may include: the device comprises a first determining unit, a second determining unit, a first encrypting unit and a second encrypting unit. Wherein:
the first determining unit is used for determining the initiator public key according to the initiator address;
the second determining unit is used for determining a public key of the receiver according to the address of the receiver;
the first encryption unit is used for encrypting the transaction amount according to the initiator public key to obtain an initiator transaction amount ciphertext;
the second encryption unit is used for encrypting the transaction amount according to the public key of the receiver to obtain the cryptograph of the transaction amount of the receiver.
In an embodiment of the present application, the generating module 32 is further configured to generate a zero knowledge proof corresponding to the transaction.
In an embodiment of the present application, the terminal device 3 further includes a conversion module.
The conversion module is used for realizing account conversion according to conversion transaction.
Wherein the converted transaction comprises a first converted transaction converting the private account into the general account and a second converted transaction converting the general account into the private account.
When the converted transaction is a first converted transaction, the transaction information of the first converted transaction comprises a receiver address, an initiator address, a transaction signature, account balance plaintext and a second zero knowledge proof.
When the converted transaction is a second converted transaction, the transaction information of the second converted transaction includes: the address of the receiving party, the address of the initiating party, the transaction signature, the account balance ciphertext and the third zero knowledge proof.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment includes: at least one processor 40 (only one processor is shown in fig. 4), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, the steps of any of the various method embodiments described above being implemented when the computer program 42 is executed by the processor 40.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of the terminal device 4, and does not constitute a limitation of the terminal device 4, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 40 may be a Central Processing Unit (CPU), and the Processor 40 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may in some embodiments be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. In other embodiments, the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/device and method may be implemented in other ways. For example, the above-described apparatus/device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A blockchain-based transaction method, comprising:
encrypting the transaction amount according to the initiator public key and the receiver public key respectively to obtain a transaction amount ciphertext;
generating transaction information containing the transaction amount ciphertext and a first zero knowledge certificate;
and sending the transaction information to a block chain node.
2. The blockchain-based transaction method of claim 1, wherein the encrypting the transaction amounts according to the initiator public key and the receiver public key respectively to obtain transaction amount ciphertexts comprises:
determining an initiator public key according to the initiator address;
determining a receiver public key according to the receiver address;
encrypting the transaction amount according to the initiator public key to obtain an initiator transaction amount ciphertext;
and encrypting the transaction amount according to the public key of the receiver to obtain a transaction amount ciphertext of the receiver.
3. The blockchain-based transaction method of claim 1, further comprising:
a first zero knowledge proof corresponding to the transaction is generated.
4. The blockchain-based transaction method of claim 1, further comprising:
the account conversion is effected according to the conversion transaction.
5. The blockchain-based transaction method of claim 4, wherein the converted transaction includes a first converted transaction converting a private account to a general account and a second converted transaction converting a general account to a private account.
6. The blockchain-based transaction method of claim 5, wherein when the converted transaction is a first converted transaction, the transaction information of the first converted transaction includes a receiver address, an initiator address, a transaction signature, account balance plaintext, and a second zero knowledge proof.
7. The blockchain-based transaction method of claim 5, wherein when the converted transaction is a second converted transaction, the transaction information of the second converted transaction includes: the address of the receiving party, the address of the initiating party, the transaction signature, the account balance ciphertext and the third zero knowledge proof.
8. A terminal device, comprising:
the encryption module is used for encrypting the transaction amount according to the initiator public key and the receiver public key respectively to obtain a transaction amount ciphertext;
the generating module is used for generating transaction information containing the transaction amount ciphertext and the first zero knowledge certificate;
and the sending module is used for sending the transaction information to the block chain node.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202011634790.0A 2020-12-31 2020-12-31 Transaction method based on block chain and terminal equipment Pending CN112734423A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011634790.0A CN112734423A (en) 2020-12-31 2020-12-31 Transaction method based on block chain and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011634790.0A CN112734423A (en) 2020-12-31 2020-12-31 Transaction method based on block chain and terminal equipment

Publications (1)

Publication Number Publication Date
CN112734423A true CN112734423A (en) 2021-04-30

Family

ID=75608587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011634790.0A Pending CN112734423A (en) 2020-12-31 2020-12-31 Transaction method based on block chain and terminal equipment

Country Status (1)

Country Link
CN (1) CN112734423A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113988863A (en) * 2021-12-28 2022-01-28 浙江大学 Supervision-capable online payment privacy protection method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
CN108764874A (en) * 2018-05-17 2018-11-06 深圳前海微众银行股份有限公司 Anonymous refund method, system and storage medium based on block chain
CN109858281A (en) * 2019-02-01 2019-06-07 杭州云象网络技术有限公司 A kind of block chain account model method for secret protection based on zero-knowledge proof
WO2019209168A2 (en) * 2018-04-26 2019-10-31 华为国际有限公司 Data processing method, related apparatus, and blockchain system
AU2018347190A1 (en) * 2018-11-07 2020-05-21 Advanced New Technologies Co., Ltd. Blockchain data protection based on account note model with zero-knowledge proof
CN111191280A (en) * 2019-12-24 2020-05-22 远光软件股份有限公司 Block chain transaction method based on encrypted data, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
WO2019209168A2 (en) * 2018-04-26 2019-10-31 华为国际有限公司 Data processing method, related apparatus, and blockchain system
CN108764874A (en) * 2018-05-17 2018-11-06 深圳前海微众银行股份有限公司 Anonymous refund method, system and storage medium based on block chain
AU2018347190A1 (en) * 2018-11-07 2020-05-21 Advanced New Technologies Co., Ltd. Blockchain data protection based on account note model with zero-knowledge proof
CN109858281A (en) * 2019-02-01 2019-06-07 杭州云象网络技术有限公司 A kind of block chain account model method for secret protection based on zero-knowledge proof
CN111191280A (en) * 2019-12-24 2020-05-22 远光软件股份有限公司 Block chain transaction method based on encrypted data, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113988863A (en) * 2021-12-28 2022-01-28 浙江大学 Supervision-capable online payment privacy protection method and device and electronic equipment
CN113988863B (en) * 2021-12-28 2022-03-29 浙江大学 Supervision-capable online payment privacy protection method and device and electronic equipment

Similar Documents

Publication Publication Date Title
Zhang et al. Deco: Liberating web data using decentralized oracles for tls
US11936774B2 (en) Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
CN109756485B (en) Electronic contract signing method, electronic contract signing device, computer equipment and storage medium
EP4120114A1 (en) Data processing method and apparatus, smart device and storage medium
CN108965230B (en) Secure communication method, system and terminal equipment
CN109478223B (en) Method and system for realizing block chain
CN110046996B (en) Data processing method and device
CN112446785A (en) Cross-chain transaction method, system, device, equipment and storage medium
US8661240B2 (en) Joint encryption of data
CN111431713A (en) Private key storage method and device and related equipment
WO2021041771A1 (en) Decentralized techniques for verification of data in transport layer security and other contexts
CN109981287A (en) A kind of code signature method and its storage medium
Luong et al. Privacy-preserving blockchain-based healthcare system for IoT devices using zk-SNARK
CN115396115B (en) Block chain data privacy protection method, device, equipment and readable storage medium
Skudnov Bitcoin clients
CN114553590A (en) Data transmission method and related equipment
CN115203749A (en) Data transaction method and system based on block chain
Zhang et al. A novel privacy protection of permissioned blockchains with conditionally anonymous ring signature
CN112734423A (en) Transaction method based on block chain and terminal equipment
CN110266478B (en) Information processing method and electronic equipment
CN116797227A (en) Method and system for secure exchange protection of client privacy information based on homomorphic encryption
CN115967568A (en) Cross-chain access control method based on block chain and group signature mechanism
US20240031341A1 (en) Methods, devices and system related to a distributed ledger and user identity attribute
CN113627911A (en) Method, device and storage medium for anonymously receiving and sending red packet based on block chain
Bella Mechanising a protocol for smart cards

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination