CN110070443B - Bill processing method and device based on blockchain - Google Patents
Bill processing method and device based on blockchain Download PDFInfo
- Publication number
- CN110070443B CN110070443B CN201910328543.9A CN201910328543A CN110070443B CN 110070443 B CN110070443 B CN 110070443B CN 201910328543 A CN201910328543 A CN 201910328543A CN 110070443 B CN110070443 B CN 110070443B
- Authority
- CN
- China
- Prior art keywords
- bill
- information
- user
- ciphertext
- ticket
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
- G06Q20/401—Transaction verification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Computer Security & Cryptography (AREA)
- General Physics & Mathematics (AREA)
- Finance (AREA)
- Bioethics (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Technology Law (AREA)
- Marketing (AREA)
- Economics (AREA)
- Development Economics (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention discloses a bill processing method and device based on a blockchain, wherein the method comprises the following steps: the method comprises the steps that an authorization server sends a bill generation instruction to a first user, the first user generates a first ciphertext recorded with a first bill random number and a first bill amount and sends first bill information to the authorization server, the authorization server generates a signature of the first bill information after confirming that the first bill information passes verification, and sends a bill uplink transaction to a blockchain system, and the blockchain system generates and stores a first bill certificate according to the first bill information after the signature of the first bill information in the bill uplink transaction passes verification. The technical scheme is used for guaranteeing the privacy of the bill transaction in the blockchain system.
Description
Technical Field
The embodiment of the invention relates to the field of financial science (Fintech), in particular to a bill processing method and device based on Block Chain (Block Chain).
Background
With the development of computer technology, more and more technologies are applied in the financial field, the traditional financial industry is gradually changed to the financial technology, and the blockchain technology is not exceptional, but the technology is also required to be higher due to the requirements of safety and instantaneity of the financial and payment industries.
Supply chain finance is a financing model in which participants involve financial institutions, upstream and downstream enterprises (including suppliers, distributors, etc.), which have the benefit of full-flow control as ticket issuers. The supply chain finance carries out bill registration on the blockchain system, can realize digitizing bill assets, and is convenient for enterprises to transfer bills according to own demands so as to obtain cash flow support.
In the bill transaction process, enterprises of both transaction sides write information of the bill transaction into a blockchain system, and the blockchain system carries out consensus on the bill transaction so as to ensure the safety of the bill transaction. However, in this way, enterprises other than the enterprises of both sides of the transaction can read the information of the bill transaction, which is not beneficial to the privacy of the bill transaction.
Disclosure of Invention
The embodiment of the invention provides a bill processing method and device based on a blockchain, which are used for guaranteeing bill transaction privacy in a blockchain system.
The bill processing method based on the blockchain provided by the embodiment of the invention comprises the following steps:
the authorization server sends a bill generation instruction to a first user, wherein the bill generation instruction comprises a designated bill amount;
The authorization server receives first bill information sent by the first user, wherein the first bill information comprises a first ciphertext encrypted by using a public key of the first user, and the first ciphertext comprises a first bill random number and a first bill amount generated by the first user; the first bill random number is used for representing an owner of the bill;
after the authorization server determines that the first bill information passes verification, generating a signature of the first bill information; the first bill information verification decrypts the first ciphertext by using the private key of the first user, and the first bill amount is consistent with the appointed bill amount;
the authorization server sends a bill uplink transaction to a blockchain system, so that the blockchain system generates a first bill certificate according to the first bill information and stores the first bill certificate after signature verification of the first bill information in the bill uplink transaction is passed; the first ticket voucher is used to characterize a ticket of the first user having the first ticket amount.
In the above technical scheme, the first use direction authorization server sends the first bill information including the first ciphertext, the first ciphertext is the ciphertext encrypted by the public key of the first use party in the first use direction, the authorization server knows the private key of the first use party and decrypts the first ciphertext by adopting the private key of the first use party, so that other nodes except the first use party and the authorization server in the blockchain system cannot read the first ciphertext, and the privacy of bill transaction in the blockchain system is guaranteed. Further, the authorization server verifies the first bill information, namely judges whether the first bill amount is consistent with the appointed bill amount, after verification is passed, bill uplink transaction is generated and sent to the blockchain system, the blockchain system only verifies the signature in the bill uplink transaction, that is, the blockchain system does not need to decrypt the first ciphertext of the first user, and does not need to verify the first bill amount of the first user, the technical scheme avoids that the blockchain system verifies the bill amount, and only verifies the signature in the bill uplink transaction, so that verification work of the blockchain system is reduced, the running speed is higher, and the occupied memory is less.
Optionally, the method further comprises:
the authorization server receives a payment bill request sent by the first user, wherein the payment bill request comprises an identifier of the first bill certificate, second bill information and third bill information; the second bill information is used for generating a second bill voucher which characterizes the first user after payment; the third bill information is used for generating a third bill certificate representing that a second user receives the payment of the first user; after the authorization server determines that the payment bill request passes the verification, generating a signature of the second bill information and a signature of the third bill information, and sending the signature and the signature to the first user, so that the first user sends bill payment transaction to the blockchain system, the bill payment transaction is used for the blockchain system to generate a second bill certificate and a third bill certificate, and the first bill certificate is set as a used bill.
In the above technical scheme, a bill payment mode is further provided, the first use direction sends a payment bill request to the authorization server, wherein the payment bill request comprises the identification of the first bill certificate, the second bill information and the third bill information, the authorization server judges whether the payment bill request passes the verification, if yes, a bill payment transaction is generated and sent to the blockchain system, the blockchain system only verifies the signature in the bill payment transaction, the blockchain system is prevented from verifying the payment bill request, the verification work of the blockchain system is reduced, the running speed is high, and the occupied memory is small.
Optionally, the second ticket information includes a second ciphertext encrypted using a public key of the first user, the second ciphertext including a second ticket random number and a second ticket amount; the third ticket information includes a third ciphertext encrypted using a public key of the second party; the third ciphertext comprises a third bill random number and a third bill amount;
the authorization server determining that the payment ticket request is validated, comprising:
the authorization server decrypts the second ciphertext by using the private key of the first user and decrypts the third ciphertext by using the private key of the second user;
the authorization server determines the first bill amount from the blockchain system according to the identification of the first bill credential;
and the authorization server judges whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, and if so, the payment bill request is confirmed to pass the verification.
In the technical scheme, the first user encrypts the second bill amount, the second user encrypts the third bill amount, and the authorization server knows the private key of the first user and the private key of the second user, so that the second ciphertext and the third ciphertext can be decrypted, the second bill amount and the third bill amount are determined, the second ciphertext cannot be read by other nodes except the first user and the authorization server in the whole blockchain system, the third ciphertext cannot be read by other nodes except the second user and the authorization server, and the privacy of bill transaction in the blockchain system is ensured. Further, the authorization server verifies the bill payment request, judges whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, if so, generates signature information and sends the signature information to the first user, and the first user sends bill payment transaction to the blockchain system, so that the blockchain system only verifies the signature in the bill payment transaction, the bill transaction amount is not required to be verified, and the verification work of the blockchain system is reduced. In addition, through the mode, the payment bill can be split, the flexibility of bill processing is improved, and the problems of difficult and non-split commercial bill circulation in the prior art are solved.
Optionally, the method further comprises:
the authorization server receives a de-authorization request sent by the first user; the de-authorization request comprises an identification of the first bill certificate and fourth bill information; the fourth bill information comprises a fourth ciphertext encrypted by using the public key of the first user, and the fourth ciphertext comprises a fourth bill random number and a fourth bill amount;
the authorization server determines the first bill amount from the blockchain system according to the identification of the first bill credential; decrypting the fourth ciphertext using the private key of the first party; judging whether the fourth bill amount is consistent with the first bill amount, if so, determining that the fourth bill information passes verification, and generating a signature of the fourth bill information;
the authorization server sends the bill uplink transaction to the blockchain system, so that the blockchain system generates and stores a fourth bill voucher according to the fourth bill information after signature verification of the fourth bill information in the bill uplink transaction is passed, and the first bill voucher is set as a used bill.
In the technical scheme, the first user can authorize the first bill certificate to other users for use and can also reclaim the authorization, specifically, the first user generates fourth bill information and sends an authorization removal request to the authorization server, the authorization server can determine to generate the signature of the fourth bill information after confirming that the fourth bill amount is consistent with the first bill amount, and further generate bill uplink transaction, so that the blockchain system generates and stores the fourth bill certificate, and the first bill certificate is set as a used bill, which is equivalent to realizing that the first user reclaims the use right of the first bill certificate in the blockchain system, and improving the flexibility of a bill processing method in the blockchain system.
Optionally, the first ticket information further includes a first hash value, where the first hash value is obtained by performing hash calculation on the first ticket random number by the first user; the first hash value is used by the blockchain system to verify whether a user has ticket usage rights for the first ticket.
According to the technical scheme, the blockchain system verifies whether the user has the bill use right of the first bill or not by verifying the first hash value of the user, so that the order of bill processing in the blockchain system is ensured, and other users are prevented from abusing bill certificates in the blockchain system.
Optionally, the first bill information further includes an interference random number generated by the first user, where the interference random number is used for encrypting the bill amount.
According to the technical scheme, the random number of interference is increased and used for encrypting the bill amount, so that the safety of the bill amount is improved, and other users are prevented from obtaining bill amount information through exhaustion.
Correspondingly, the embodiment of the invention also provides a bill processing method based on the block chain, which comprises the following steps:
the blockchain system receives a bill uplink transaction, wherein the bill uplink transaction comprises a signature of bill information and the bill information; the bill information comprises ciphertext encrypted by using a public key of a user; the ciphertext comprises a bill random number and a bill amount; the signature of the bill information is generated after the authentication of the bill information by the authorization server is passed;
The blockchain system generates bill certificates according to the bill information after the signature verification of the bill information is passed, and stores the bill certificates; the ticket vouchers are used to characterize the ticket the user has the ticket amount.
According to the technical scheme, the bill information comprising the ciphertext is sent by the direction authorization server, the bill information is verified by the direction authorization server, after the bill information passes the verification, the bill uplink transaction is generated and sent to the blockchain system, the blockchain system only verifies the signature in the bill uplink transaction, that is, the blockchain system does not need to decrypt the ciphertext of a user, and does not need to verify the bill amount of the user, the technical scheme avoids the blockchain system to verify the bill amount, the blockchain system only verifies the signature in the bill uplink transaction, the verification work of the blockchain system is reduced, the running speed is high, and the occupied memory is small.
Optionally, the method further comprises:
the blockchain system receives a bill payment transaction, wherein the bill payment transaction comprises an identification of a first bill certificate, second bill information, a signature of the second bill information, third bill information and a signature of the third bill information; the first bill corresponding to the first bill certificate is a bill to be used, and the second bill information is used for generating a second bill certificate representing the receipt of the payment of the first bill; the third bill information is used for generating a third bill certificate for characterizing the first bill after payment;
After the signature of the second bill information and the signature of the third bill information are verified, the blockchain system generates and stores a second bill certificate according to the second bill information and generates and stores a third bill certificate according to the third bill information;
the blockchain system sets the first ticket voucher as a used ticket.
In the above technical scheme, a bill payment mode is further provided, the blockchain system receives bill payment transaction, verifies the signature of the second bill information and the signature of the third bill information in the bill payment transaction, if the second bill information and the third bill information pass the verification, the second bill certificate and the third bill certificate are generated, and the blockchain system only verifies the signature in the bill payment transaction, so that the blockchain system is prevented from verifying the payment bill request, the verification work of the blockchain system is reduced, the operation speed is higher, and the occupied memory is less. In addition, through the mode, the payment bill can be split, the flexibility of bill processing is improved, and the problems of difficult and non-split commercial bill circulation in the prior art are solved.
Correspondingly, the embodiment of the invention also provides a bill processing device based on the block chain, which comprises the following components:
A receiving and transmitting unit, configured to send a ticket generation instruction to a first user, where the ticket generation instruction includes a specified ticket amount;
the receiving and transmitting unit is further configured to receive first ticket information sent by the first user, where the first ticket information includes a first ciphertext encrypted by using a public key of the first user, and the first ciphertext includes a first ticket random number and a first ticket amount generated by the first user; the first bill random number is used for representing an owner of the bill;
the processing unit is used for generating a signature of the first bill information after the first bill information is confirmed to pass verification; the first bill information verification decrypts the first ciphertext by using the private key of the first user, and the first bill amount is consistent with the appointed bill amount;
the receiving and transmitting unit is further used for transmitting a bill uplink transaction to a blockchain system, so that the blockchain system generates a first bill certificate according to the first bill information and stores the first bill certificate after signature verification of the first bill information in the bill uplink transaction is passed; the first ticket voucher is used to characterize a ticket of the first user having the first ticket amount.
Optionally, the processing unit is further configured to:
controlling the receiving and transmitting unit to receive a payment bill request sent by the first user, wherein the payment bill request comprises an identifier of the first bill certificate, second bill information and third bill information; the second bill information is used for generating a second bill voucher which characterizes the first user after payment; the third bill information is used for generating a third bill certificate representing that a second user receives the payment of the first user; after the fact that the payment bill request passes verification is determined, a signature of the second bill information and a signature of the third bill information are generated and sent to the first user, so that the first user sends bill payment transaction to the blockchain system, the bill payment transaction is used for the blockchain system to generate a second bill certificate and a third bill certificate, and the first bill certificate is set to be a used bill.
Optionally, the second ticket information includes a second ciphertext encrypted using a public key of the first user, the second ciphertext including a second ticket random number and a second ticket amount; the third ticket information includes a third ciphertext encrypted using a public key of the second party; the third ciphertext comprises a third bill random number and a third bill amount;
The processing unit is specifically configured to:
decrypting the second ciphertext using the private key of the first user and decrypting the third ciphertext using the private key of the second user;
determining the first bill amount from the blockchain system according to the identification of the first bill voucher;
and judging whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, and if so, determining that the payment bill request passes the verification.
Optionally, the processing unit is further configured to:
controlling the receiving and transmitting unit to receive a de-authorization request sent by the first user; the de-authorization request comprises an identification of the first bill certificate and fourth bill information; the fourth bill information comprises a fourth ciphertext encrypted by using the public key of the first user, and the fourth ciphertext comprises a fourth bill random number and a fourth bill amount;
determining the first bill amount from the blockchain system according to the identification of the first bill voucher; decrypting the fourth ciphertext using the private key of the first party; judging whether the fourth bill amount is consistent with the first bill amount, if so, determining that the fourth bill information passes verification, and generating a signature of the fourth bill information;
And sending the bill uplink transaction to the blockchain system, so that the blockchain system generates and stores a fourth bill certificate according to the fourth bill information after the signature verification of the fourth bill information in the bill uplink transaction is passed, and setting the first bill certificate as a used bill.
Optionally, the first ticket information further includes a first hash value, where the first hash value is obtained by performing hash calculation on the first ticket random number by the first user; the first hash value is used by the blockchain system to verify whether a user has ticket usage rights for the first ticket.
Optionally, the first bill information further includes an interference random number generated by the first user, where the interference random number is used for encrypting the bill amount.
Correspondingly, the embodiment of the invention also provides a bill processing device based on the block chain, which comprises the following components:
the receiving and transmitting unit is used for receiving bill uplink transactions, wherein the bill uplink transactions comprise signature of bill information and the bill information; the bill information comprises ciphertext encrypted by using a public key of a user; the ciphertext comprises a bill random number and a bill amount; the signature of the bill information is generated after the authentication of the bill information by the authorization server is passed;
The processing unit is used for generating and storing bill certificates according to the bill information after the signature verification of the bill information is passed; the ticket vouchers are used to characterize the ticket the user has the ticket amount.
Optionally, the processing unit is further configured to:
controlling the receiving and transmitting unit to receive a bill payment transaction, wherein the bill payment transaction comprises an identification of a first bill certificate, second bill information, a signature of the second bill information, third bill information and a signature of the third bill information; the first bill corresponding to the first bill certificate is a bill to be used, and the second bill information is used for generating a second bill certificate representing the receipt of the payment of the first bill; the third bill information is used for generating a third bill certificate for characterizing the first bill after payment;
after the signature of the second bill information and the signature of the third bill information are verified, generating a second bill certificate according to the second bill information and storing the second bill certificate, and generating a third bill certificate according to the third bill information and storing the third bill certificate;
the first ticket voucher is set as a used ticket.
Accordingly, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the bill processing method based on the blockchain according to the obtained program.
Correspondingly, the embodiment of the invention also provides a computer readable nonvolatile storage medium, which comprises computer readable instructions, and when the computer reads and executes the computer readable instructions, the computer is caused to execute the bill processing method based on the blockchain.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a supply chain finance provided by an embodiment of the invention;
FIG. 2 is a schematic diagram of a system architecture according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a bill chaining based on a blockchain according to an embodiment of the present invention;
FIG. 4 is a schematic flow diagram of bill payment based on blockchain according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a bill handling device based on blockchain according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a bill processing device based on a blockchain according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Supply chain finance is a financing model, with participants comprising financial institutions, core enterprises, upstream and downstream enterprises (including suppliers, distributors, etc.). The supply chain finance is supported by a core enterprise, on the premise of real trade, enterprise credit of the core enterprise is used as a core wind control factor of a financial activity, and comprehensive financial products and services are provided for enterprises at the upstream and downstream of the supply chain through accounts receivable mortgages, right of goods mortgages and other means of the core enterprise. As shown in fig. 1, a core enterprise purchases raw materials from a supplier and pays a commercial bill, and the supplier pays the commercial bill issued by the core enterprise held in hand to a financial institution at a certain cost in order to enable production to be performed normally, and the financial institution has the right to decide whether to accept the commercial bill of the core enterprise and issue money to the supplier.
Fig. 2 illustrates a system architecture to which a blockchain-based ticket processing method provided by an embodiment of the present invention is applicable, where the system architecture may include an authorization server, i.e., a server in a financial institution in a supply chain finance, a user, i.e., a server in a core enterprise or upstream and downstream enterprises (including suppliers, distributors, etc.) in the supply chain finance, and a blockchain system.
On-chain communication or off-chain communication can be performed between the authorization server and the user, between the user and the user, wherein on-chain communication is understood to mean that the authorization server and the user are nodes on the blockchain system, and the authorization server and the user perform point-to-point communication on the blockchain system or the user and the user perform point-to-point communication on the blockchain system.
In a production deployment environment, the system architecture requires that nodes of a financial institution are multi-activity deployment, namely the deployment number of authorization servers is f+1, wherein f is the number of fault-tolerant nodes of a consensus algorithm.
For better explanation of the present invention, data related to the embodiments of the present invention will be described first as shown in table 1.
TABLE 1
Based on the above description, fig. 3 illustrates an exemplary process of bill chaining based on blockchain provided by the embodiment of the invention, where the process relates to an authorization server, a blockchain system and a first user.
As shown in fig. 3, the process specifically includes:
in step 301, the authorization server sends a ticket generation indication to the first party.
The bill generation instruction includes a designated bill amount, and takes the example that the financial institution initializes the bill certificate X with the amount of 100 to the enterprise a, the server in the financial institution is the authorization server, the server in the enterprise a is the first user, and the bill generation instruction includes the designated bill amount of 100.
In step 302, a first party generates first ticket information.
In the embodiment of the present invention, the first ticket information may include a first ciphertext, where the first ciphertext is information encrypted by the first user according to the public key of the first user (the public key of the first user), and the first ciphertext includes the first ticket random number and the first ticket amount generated by the first user. Here, a ticket random number and parameters for characterizing the owner of the ticket are understood as being the number that can be used by the enterprise that can provide the ticket random number.
Optionally, after receiving the ticket generation instruction, the first user generates and records the first ticket random number locally, and encrypts the content consisting of the first ticket random number and the first ticket amount by adopting the public key of the first user to generate the first ciphertext.
In addition, the first party may also generate an interfering random number that is used to encrypt the ticket amount. The public key of the first user can be adopted to encrypt the content composed of the first bill random number, the interference random number and the first bill amount to generate a first ciphertext, the first ciphertext generated in the mode increases the concealment of the first bill amount, and other people are prevented from exhausting the first bill amount through the first bill random number and the first ciphertext.
For example, the random number of the first bill is "aaaa … aaaa" and total 32 bytes, the random number of the interference is "bbbb … bbbb" and total 32 bytes, the amount of the first bill is "100" and total 3 bytes, then the first ciphertext can pass through formula C X =pk A (r x1 +r x2 +value x )=pk A (aaaa … aaaa bb … bb 100), i.e. first ciphertext C X To use pk A The result is encrypted for content of 67 bytes in length. Here, "a" represents company a and "X" represents ticket voucher X.
In the embodiment of the present invention, the first ticket information may further include a first hash value, where the first hash value is obtained by performing hash calculation on the first ticket random number by the first user, and is exemplary, H X =hash(r X1 ) The first hash value is used by the blockchain system to verify whether the user has ticket usage rights for the first ticket voucher, which will be described in more detail in the embodiments below.
In step 303, the first user sends the first ticket information to the authorization server.
In step 304, the authorization server decrypts the first ciphertext using the private key of the first user, and determines whether the first ticket information passes the verification.
The public key and the private key of the first user are stored in the first user, wherein the private key is commonly held by the first user and the authorization server, the public key is disclosed by the whole network, the authorization server can determine the private key of the first user according to the identification of the first user and is used for decrypting the first ciphertext, the first bill amount in the first ciphertext is determined from the first ciphertext, whether the first bill amount is consistent with the appointed bill amount can be further judged, if so, the first bill information is determined to pass verification, and otherwise, the first bill information is determined to not pass verification.
Optionally, when the authorization server verifies the first bill information, the authorization server may verify whether the first bill amount is non-negative, if not, then determine whether the first bill amount is consistent with the specified bill amount, otherwise, directly determine that the first bill information fails verification. That is, the process of verifying the first ticket information by the authorization server may be two steps, namely, non-negative verification of the amount and balancing verification of the equation.
In addition, the authorization server can also store the mapping relation from the bill identifier to the public key and the private key, the first bill information comprises the bill identifier, and the authorization server can determine the private key of the first user according to the bill identifier in the first bill information and is used for decrypting the first ciphertext.
In step 305, the authorization server generates a signature of the first ticket information after determining that the first ticket information passes the verification.
At step 306, the authorization server generates a ticket uplink transaction.
The transaction type of the bill uplink transaction is bill uplink, which is equivalent to that newly generated bill information is stored in a blockchain system, the bill uplink transaction comprises first bill information and a signature of the first bill information, which is equivalent to that of a first ciphertext, a first hash value, a bill identifier, an authorization server signature and the like.
The authorization server sends the ticket uplink transaction to the blockchain system, step 307.
At step 308, the blockchain system verifies the signature of the first ticket information in the ticket uplink transaction.
The blockchain system judges whether the signature of the first bill information passes verification, namely judges whether the signature of the authorization server is legal, if so, and determines that the signature of the first bill information passes verification, otherwise, the signature does not pass verification.
In step 309, the blockchain system generates and stores the first ticket vouchers from the first ticket information after determining that the signature verification passes.
After the blockchain system determines that the signature of the first bill information passes verification, the verification of the first bill information is correct, namely the first bill information is determined to be legal, corresponding first bill certificates can be generated according to the first bill information and recorded in the blockchain system, and the bill with the first bill amount is represented by a first user.
In the embodiment of the invention, the authorization server verifies the first bill information generated by the first user, if the first bill information passes the verification, the signature of the first bill information is generated, and then the blockchain system verifies the signature of the authorization server, so that each node in the blockchain system is not required to verify the first bill information, the operation amount in the verification process is saved, and the bill uplink processing efficiency in the blockchain system is effectively improved.
It should be noted that after the ticket is bound, that is, after the first ticket credential of the first user is recorded in the blockchain system, the first ticket credential is not used by the user, and at this time, the first ticket may have no first ticket random number, that is, the first ticket random number may represent whether the first ticket credential is used, and after the first ticket credential is used, the first ticket credential is recorded with the first ticket random number. Of course, it can be said that the first ticket random number exists in the first ticket voucher, and when the first ticket voucher is not used by the user, the value of the first ticket random number is null, and when the first ticket voucher is used by the user, the value of the first ticket random number is not null.
Further, the first ticket document may further record information such as a first ciphertext, a first hash value, etc., where the first ciphertext is used to determine a ticket amount of the first ticket document, and the first hash value is used by the blockchain system to verify whether the user has a ticket right of use of the first ticket document, and the details of the other embodiments are described below.
After the bill certificate is linked, the first user can use the first bill certificate which is already linked, the use process relates to the second user, in a specific environment, company A pays 70 to company B, company A pays 100 to company B, company B generates 70 to 30 to make change 30 to company A. At this time, company a is the first party, company B is the second party, ticket voucher X is the first ticket voucher, ticket voucher Y is the second ticket voucher, and ticket voucher Z is the third ticket voucher.
As shown in fig. 4, a process of bill payment based on blockchain is provided in an embodiment of the present invention, and the process involves a blockchain system, an authorization server, a first user and a second user.
The first party generates second ticket information for generating a second ticket voucher characterizing the first party after payment. The second ticket information may include a second ciphertext encrypted using the public key of the first user, the second ciphertext including the second ticket random number and the second ticket amount. In particular, the first user first locally records a second ticket random number and a second interference random number related to a second ticket credential (ticket credential Y), and can calculate a second hash value, such as H, according to the second ticket random number Y ,H Y =hash(r Y1 ) And encrypts the contents consisting of the second ticket random number, the second interfering random number and the second ticket amount by using the public key of the first user to generate a second ciphertext, e.g., C Y =pk A (r Y1 +r Y2 +value Y ) Here, "a" represents company a and "Y" represents ticket vouchers Y.
The second party generates third bill information, and the third bill information is used for generating third bill certificates representing the second party after receiving the payment of the first party. The third ticket information includes a third ciphertext encrypted using a public key of the second party, the third ciphertext including a third ticket random number and a third ticket amount. In a specific implementation, the second user first locally generates and records a third ticket random number and a third interference random number related to a third ticket (ticket certificate Z), and can calculate a third hash value, such as H, according to the third ticket random number Z ,H Z =hash(r Z1 ) And encrypts the contents consisting of the third ticket random number, the third interference random number and the third ticket amount by using the public key of the second user to generate a third ciphertext, e.g., C Z =pk B (r Z1 +r Z2 +value Z ) Here, "B" represents company B, and "Z" represents ticket voucher Z.
Here, the user may generate the ciphertext and generate the identification of the ticket, for example, the first user generates the first ciphertext and generates the identification of the first ticket, and sends the ticket identification and the ticket information to the authorization server together, and the authorization server may generate the ticket identification in the authorization server according to the received ciphertext, which is not limited herein.
In step 401, the second party sends the third ticket information to the first party.
At step 402, a first party generates a payment ticket request.
The first ticket voucher is the ticket to be used in the embodiment of the invention. After receiving the third bill information, the first user generates a payment bill request according to the identification of the first bill certificate, the second bill information and the third bill information, wherein the payment bill request comprises the identification of the first bill certificate, the second bill information and the third bill information.
In step 403, the first party sends a payment ticket request to the authorization server.
Step 404, the authorization server verifies the payment ticket request.
The invention provides a specific verification mode, wherein an authorization server decrypts a second ciphertext by using a private key of a first user to determine a second bill amount in the second ciphertext; and decrypting the third ciphertext by using the private key of the second user to determine a third bill amount in the third ciphertext. The authorization server indexes the first bill certificate from the blockchain system according to the identification of the first bill certificate, and decrypts the first ciphertext in the first bill certificate by using the private key of the first user, so as to determine the first bill amount. The authorization server judges whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, and if so, the authorization server determines that the payment bill request passes the verification.
After determining that the payment ticket request passes, the authorization server generates a signature of the second ticket information and a signature of the third ticket, step 405.
In the embodiment of the invention, after the authorization server determines that the payment bill request passes the verification, the authorization server can generate the signature of the second bill information and the signature of the third bill information, namely, generate two signatures for proving that the payment bill request passes the verification. The authorization server may also generate a common signature of the second ticket information and the third ticket information, i.e. generate a signature for proving that the payment ticket request is verified.
The authorization server sends the signature of the second ticket information and the signature of the third ticket information to the first party, step 406.
The first use sends a bill payment transaction to the blockchain system, step 407.
Step 408, the blockchain system verifies the signature of the second ticket information and the signature of the third ticket information.
And 409, after the signature of the second bill information and the signature of the third bill information are verified by the blockchain system, generating and storing a second bill certificate and a third bill certificate.
In the embodiment of the invention, the bill payment transaction is sent to the blockchain system by the user, and the bill payment transaction passes the verification of the authorization server, but the user does not have the use right of the first bill certificate, so the blockchain system also needs to verify whether the user has the use right of the first bill certificate. Specifically, the user sends a ticket random number for indicating to have the first ticket voucher to the blockchain system, the blockchain system calculates a hash value according to the ticket random number, and if the calculated hash value is the same as the first hash value of the first ticket voucher, the user is determined to have the right to use the first ticket voucher. The first ticket certificate may be held by the first party who generates the first ticket information, or by another party, and when the first party sends the first random number to a certain party, the party may have the first ticket certificate.
When the blockchain system determines that the user has the right to use the first ticket document, it is also necessary to verify whether the first ticket document has been used, that is, the ticket document can be used only once, and after being used, the ticket document is set as a used ticket (invalid ticket). As can be seen from the above description of the first random number, when the first ticket voucher is not used, the value of the first ticket random number is null; when the first ticket voucher has been used, the value of the first ticket random number is not null, the blockchain system can determine whether the value of the first ticket random number in the first ticket voucher is null, and if so, the first ticket voucher can be used.
In the technical scheme, the bill certificate is set to be disposable, and once the bill certificate is used, the bill certificate is set to be an invalid bill, so that the problem of disordered transaction caused by repeated use of the bill by a user is avoided.
At step 410, the blockchain system sets the first ticket voucher as a used ticket.
After the blockchain system generates the second ticket voucher and the third ticket voucher, the blockchain system needs to mark the first ticket voucher, which represents that the first ticket voucher is used.
In the embodiment of the invention, the first user can authorize the right of use of the first bill certificate to other users, and can also withdraw the right of use of the first bill certificate. Under a specific environment, after the enterprise C authorizes the use right of the enterprise A bill certificate X, the enterprise C still has the use right of the bill certificate X, the use right of the enterprise C is superior to that of the enterprise A, if the enterprise C needs to cancel the authorization, the bill certificate X can be spent by one transaction to generate an equal bill certificate T, the bill random number of the bill certificate T is owned by the enterprise C, and meanwhile, the bill certificate X cannot be transacted again. At this time, company C is the first party, company a is the other party, ticket voucher X is the first ticket voucher, and ticket voucher T is the fourth ticket voucher.
Specifically, the first user generates fourth bill information, and the fourth bill information may include a fourth ciphertext encrypted using the public key of the first user, where the fourth ciphertext includes a fourth bill random number and a fourth bill amount. The first user sends a de-authorization request recorded with the identification of the first bill certificate and the fourth bill information to an authorization server; the authorization server indexes the first bill certificate from the blockchain system according to the identification of the first bill certificate, decrypts a first ciphertext in the first bill certificate, and further determines the first bill amount; the authorization server decrypts the fourth ciphertext by using the private key of the first user, determines the fourth bill amount, judges whether the fourth bill amount is consistent with the first bill amount, if so, determines that the fourth bill information passes verification, and generates a signature of the fourth bill information. The authorization server sends the bill uplink transaction to the blockchain system according to the fourth bill information and the signature of the fourth bill information, the blockchain system verifies the signature of the fourth bill information in the bill uplink transaction, and if the signature passes the verification, a fourth bill voucher is generated and stored according to the fourth bill information, and meanwhile the first bill voucher is set to be a used bill.
In the embodiment of the invention, the authorization server can also send the signature of the fourth bill information to the first server, the first server generates bill uplink transaction, and the blockchain system verifies the signature of the fourth bill information in the bill uplink transaction.
In the above technical scheme, the first use direction authorization server sends the first bill information including the first ciphertext, the first ciphertext is the ciphertext encrypted by the public key of the first use party in the first use direction, the authorization server knows the private key of the first use party and decrypts the first ciphertext by adopting the private key of the first use party, so that other nodes except the first use party and the authorization server in the blockchain system cannot read the first ciphertext, and the privacy of bill transaction in the blockchain system is guaranteed. Further, the authorization server verifies the first bill information, namely judges whether the first bill amount is consistent with the appointed bill amount, after verification is passed, bill uplink transaction is generated and sent to the blockchain system, the blockchain system only verifies the signature in the bill uplink transaction, that is, the blockchain system does not need to decrypt the first ciphertext of the first user, and does not need to verify the first bill amount of the first user, the technical scheme avoids that the blockchain system verifies the bill amount, and only verifies the signature in the bill uplink transaction, so that verification work of the blockchain system is reduced, the running speed is higher, and the occupied memory is less.
Based on the same inventive concept, fig. 5 illustrates an exemplary structure of a blockchain-based bill processing device provided by an embodiment of the present invention, which may perform a flow of blockchain-based bill processing.
A transceiver unit 501 configured to send a ticket generation instruction to a first user, where the ticket generation instruction includes a specified ticket amount;
the transceiver 501 is further configured to receive first ticket information sent by the first user, where the first ticket information includes a first ciphertext encrypted by using a public key of the first user, and the first ciphertext includes a first ticket random number and a first ticket amount generated by the first user; the first bill random number is used for representing an owner of the bill;
a processing unit 502, configured to generate a signature of the first ticket information after determining that the first ticket information passes verification; the first bill information verification decrypts the first ciphertext by using the private key of the first user, and the first bill amount is consistent with the appointed bill amount;
the transceiver 501 is further configured to send a ticket uplink transaction to a blockchain system, so that the blockchain system generates a first ticket voucher according to the first ticket information after signature verification of the first ticket information in the ticket uplink transaction is passed, and stores the first ticket voucher; the first ticket voucher is used to characterize a ticket of the first user having the first ticket amount.
Optionally, the processing unit 502 is further configured to:
controlling the transceiver unit 501 to receive a payment ticket request sent by the first user, where the payment ticket request includes an identifier of the first ticket credential, second ticket information and third ticket information; the second bill information is used for generating a second bill voucher which characterizes the first user after payment; the third bill information is used for generating a third bill certificate representing that a second user receives the payment of the first user; after the fact that the payment bill request passes verification is determined, a signature of the second bill information and a signature of the third bill information are generated and sent to the first user, so that the first user sends bill payment transaction to the blockchain system, the bill payment transaction is used for the blockchain system to generate a second bill certificate and a third bill certificate, and the first bill certificate is set to be a used bill.
Optionally, the second ticket information includes a second ciphertext encrypted using a public key of the first user, the second ciphertext including a second ticket random number and a second ticket amount; the third ticket information includes a third ciphertext encrypted using a public key of the second party; the third ciphertext comprises a third bill random number and a third bill amount;
The processing unit 502 is specifically configured to:
decrypting the second ciphertext using the private key of the first user and decrypting the third ciphertext using the private key of the second user;
determining the first bill amount from the blockchain system according to the identification of the first bill voucher;
and judging whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, and if so, determining that the payment bill request passes the verification.
Optionally, the processing unit 502 is further configured to:
controlling the transceiver unit 501 to receive a de-authorization request sent by the first user; the de-authorization request comprises an identification of the first bill certificate and fourth bill information; the fourth bill information comprises a fourth ciphertext encrypted by using the public key of the first user, and the fourth ciphertext comprises a fourth bill random number and a fourth bill amount;
determining the first bill amount from the blockchain system according to the identification of the first bill voucher; decrypting the fourth ciphertext using the private key of the first party; judging whether the fourth bill amount is consistent with the first bill amount, if so, determining that the fourth bill information passes verification, and generating a signature of the fourth bill information;
And sending the bill uplink transaction to the blockchain system, so that the blockchain system generates and stores a fourth bill certificate according to the fourth bill information after the signature verification of the fourth bill information in the bill uplink transaction is passed, and setting the first bill certificate as a used bill.
Optionally, the first ticket information further includes a first hash value, where the first hash value is obtained by performing hash calculation on the first ticket random number by the first user; the first hash value is used by the blockchain system to verify whether a user has ticket usage rights for the first ticket.
Optionally, the first bill information further includes an interference random number generated by the first user, where the interference random number is used for encrypting the bill amount.
Based on the same inventive concept, fig. 6 illustrates an exemplary structure of a blockchain-based bill processing device provided by an embodiment of the present invention, which can perform a flow of blockchain-based bill processing.
A transceiver unit 601, configured to receive a ticket uplink transaction, where the ticket uplink transaction includes a signature of ticket information and ticket information; the bill information comprises ciphertext encrypted by using a public key of a user; the ciphertext comprises a bill random number and a bill amount; the signature of the bill information is generated after the authentication of the bill information by the authorization server is passed;
A processing unit 602, configured to generate and store ticket credentials according to the ticket information after signature verification of the ticket information is passed; the ticket vouchers are used to characterize the ticket the user has the ticket amount.
Optionally, the processing unit 602 is further configured to:
controlling the receiving and transmitting unit 601 to receive a bill payment transaction, wherein the bill payment transaction comprises an identification of a first bill certificate, second bill information, a signature of the second bill information, third bill information and a signature of the third bill information; the first bill corresponding to the first bill certificate is a bill to be used, and the second bill information is used for generating a second bill certificate representing the receipt of the payment of the first bill; the third bill information is used for generating a third bill certificate for characterizing the first bill after payment;
after the signature of the second bill information and the signature of the third bill information are verified, generating a second bill certificate according to the second bill information and storing the second bill certificate, and generating a third bill certificate according to the third bill information and storing the third bill certificate;
the first ticket voucher is set as a used ticket.
Based on the same inventive concept, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the bill processing method based on the blockchain according to the obtained program.
Based on the same inventive concept, the embodiment of the invention also provides a computer readable nonvolatile storage medium, which comprises computer readable instructions, when the computer reads and executes the computer readable instructions, the computer is caused to execute the bill processing method based on the blockchain.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
Claims (18)
1. A blockchain-based ticket processing method, comprising:
the authorization server sends a bill generation instruction to a first user, wherein the bill generation instruction comprises a designated bill amount;
the authorization server receives first bill information sent by the first user, wherein the first bill information comprises a first ciphertext, the first ciphertext is generated by the first user after receiving the bill generation instruction, first bill random numbers are generated and recorded locally, and contents formed by the first bill random numbers and first bill amounts are encrypted by adopting a public key of the first user;
the authorization server determines a private key of the first user according to the identifier of the first user, decrypts the first ciphertext according to the private key of the first user, determines the first bill amount from the first ciphertext, judges whether the first bill amount is consistent with the appointed bill amount, and determines that the first bill information passes verification if the first bill amount is consistent with the appointed bill amount;
The authorization server sends a bill uplink transaction to a blockchain system, so that the blockchain system generates a first bill certificate according to the first bill information and stores the first bill certificate after signature verification of the first bill information in the bill uplink transaction is passed; the first bill certificate comprises the first bill random number, the first ciphertext and a first hash value, wherein the value of the first bill random number is used for indicating whether the first bill certificate is used by a user or not, and the first hash value is used for verifying whether the user has the bill use right of the first bill certificate or not by the blockchain system.
2. The method as recited in claim 1, further comprising:
the authorization server receives a payment bill request sent by the first user, wherein the payment bill request comprises an identifier of the first bill certificate, second bill information and third bill information; the second bill information is used for generating a second bill certificate representing the first user after payment, the second bill information comprises a second ciphertext encrypted by using a public key of the first user, and the second ciphertext comprises a second bill random number and a second bill amount; the third bill information is used for generating a third bill certificate representing that a second user receives payment of the first user, the third bill information comprises a third ciphertext encrypted by using a public key of the second user, and the third ciphertext comprises a third bill random number and a third bill amount;
The authorization server decrypts the second ciphertext by using the private key of the first user, and determines the second bill amount in the second ciphertext; decrypting the third ciphertext using the private key of the second party, determining the third ticket amount in the third ciphertext;
the authorization server indexes the first bill certificate from the blockchain system according to the identification of the first bill certificate, and decrypts the first ciphertext in the first bill certificate by using the private key of the first user so as to determine the first bill amount;
the authorization server judges whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, and if so, the payment bill request is confirmed to pass verification;
after the authorization server determines that the payment bill request passes the verification, generating a signature of the second bill information and a signature of the third bill information, and sending the signature and the signature to the first user, so that the first user sends bill payment transaction to the blockchain system, the bill payment transaction is used for the blockchain system to generate a second bill certificate and a third bill certificate, and the first bill certificate is set as a used bill.
3. The method of claim 2, wherein the second ticket information includes a second ciphertext encrypted using a public key of the first user, the second ciphertext including a second ticket nonce and a second ticket amount; the third ticket information includes a third ciphertext encrypted using a public key of the second party; the third ciphertext comprises a third bill random number and a third bill amount;
the authorization server determining that the payment ticket request is validated, comprising:
the authorization server decrypts the second ciphertext by using the private key of the first user and decrypts the third ciphertext by using the private key of the second user;
the authorization server determines the first bill amount from the blockchain system according to the identification of the first bill credential;
and the authorization server judges whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, and if so, the payment bill request is confirmed to pass the verification.
4. The method as recited in claim 1, further comprising:
the authorization server receives a de-authorization request sent by the first user; the de-authorization request comprises an identification of the first bill certificate and fourth bill information; the fourth bill information comprises a fourth ciphertext encrypted by using the public key of the first user, and the fourth ciphertext comprises a fourth bill random number and a fourth bill amount;
The authorization server determines the first bill amount from the blockchain system according to the identification of the first bill credential; decrypting the fourth ciphertext using the private key of the first party; judging whether the fourth bill amount is consistent with the first bill amount, if so, determining that the fourth bill information passes verification, and generating a signature of the fourth bill information;
the authorization server sends the bill uplink transaction to the blockchain system, so that the blockchain system generates and stores a fourth bill voucher according to the fourth bill information after signature verification of the fourth bill information in the bill uplink transaction is passed, and the first bill voucher is set as a used bill.
5. The method according to any one of claims 1 to 4, wherein the first ticket information further includes a first hash value obtained by hashing the first ticket random number by the first party.
6. The method of claim 5, wherein the first ticket information further includes an interfering random number generated by the first party, the interfering random number being used to encrypt a ticket amount.
7. A blockchain-based ticket processing method, comprising:
a blockchain system receives a ticket uplink transaction, wherein the ticket uplink transaction comprises a signature of first ticket information and the first ticket information; the first bill information comprises a first ciphertext, wherein the first ciphertext is generated by a first user after receiving a bill generation instruction, firstly locally generating and recording a first bill random number, and encrypting the content consisting of the first bill random number and a first bill amount by adopting a public key of the first user; the signature of the first bill information is generated after the authentication of the first bill information by the authorization server is passed;
the blockchain system generates a first bill certificate according to the first bill information and stores the first bill certificate after signature verification of the first bill information is passed; the first bill certificate comprises the first bill random number, the first ciphertext and a first hash value, wherein the value of the first bill random number is used for indicating whether the first bill certificate is used by a user or not, the first ciphertext is used for determining the bill amount of the first bill certificate, and the first hash value is used for verifying whether the user has the bill use right of the first bill certificate or not by the blockchain system.
8. The method as recited in claim 7, further comprising:
the blockchain system receives a bill payment transaction, wherein the bill payment transaction comprises an identification of a first bill certificate, second bill information, a signature of the second bill information, third bill information and a signature of the third bill information; the first bill corresponding to the first bill certificate is a bill to be used, the second bill information is used for generating a second bill certificate representing the receipt of the payment of the first bill, the second bill information comprises a second ciphertext encrypted by using the public key of the first user, and the second ciphertext comprises a second bill random number and a second bill amount; the third bill information is used for generating a third bill certificate for representing the first bill after payment, the third bill information comprises a third ciphertext encrypted by using a public key of a second user, and the third ciphertext comprises a third bill random number and a third bill amount;
after the signature of the second bill information and the signature of the third bill information are verified, the blockchain system generates and stores a second bill certificate according to the second bill information and generates and stores a third bill certificate according to the third bill information;
The blockchain system sets the first ticket voucher as a used ticket.
9. A blockchain-based bill handling device, comprising:
a receiving and transmitting unit, configured to send a ticket generation instruction to a first user, where the ticket generation instruction includes a specified ticket amount;
the receiving and transmitting unit is further configured to receive first ticket information sent by the first user, where the first ticket information includes a first ciphertext, and the first ciphertext is generated by the first user by first locally generating and recording a first ticket random number after receiving the ticket generation instruction, and encrypting a content formed by the first ticket random number and a first ticket amount by using a public key of the first user;
the processing unit is used for determining a private key of the first user according to the identification of the first user, decrypting the first ciphertext according to the private key of the first user, determining the first bill amount from the first ciphertext, judging whether the first bill amount is consistent with the appointed bill amount, and if so, determining that the first bill information passes verification;
the receiving and transmitting unit is further used for transmitting a bill uplink transaction to a blockchain system, so that the blockchain system generates a first bill certificate according to the first bill information and stores the first bill certificate after signature verification of the first bill information in the bill uplink transaction is passed; the first bill certificate comprises the first bill random number, the first ciphertext and a first hash value, wherein the value of the first bill random number is used for indicating whether the first bill certificate is used by a user or not, and the first hash value is used for verifying whether the user has the bill use right of the first bill certificate or not by the blockchain system.
10. The apparatus of claim 9, wherein the processing unit is further to:
controlling the receiving and transmitting unit to receive a payment bill request sent by the first user, wherein the payment bill request comprises an identifier of the first bill certificate, second bill information and third bill information;
the second bill information is used for generating a second bill certificate representing the first user after payment, the second bill information comprises a second ciphertext encrypted by using a public key of the first user, and the second ciphertext comprises a second bill random number and a second bill amount; the third bill information is used for generating a third bill certificate representing that a second user receives payment of the first user, the third bill information comprises a third ciphertext encrypted by using a public key of the second user, and the third ciphertext comprises a third bill random number and a third bill amount;
decrypting the second ciphertext using the private key of the first party, determining the second ticket amount in the second ciphertext; decrypting the third ciphertext using the private key of the second party, determining the third ticket amount in the third ciphertext;
Indexing the first bill voucher from the blockchain system according to the identification of the first bill voucher, and decrypting the first ciphertext in the first bill voucher by using the private key of the first user so as to determine the first bill amount;
judging whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, if so, determining that the payment bill request passes verification;
after the fact that the payment bill request passes verification is determined, a signature of the second bill information and a signature of the third bill information are generated and sent to the first user, so that the first user sends bill payment transaction to the blockchain system, the bill payment transaction is used for the blockchain system to generate a second bill certificate and a third bill certificate, and the first bill certificate is set to be a used bill.
11. The apparatus of claim 10, wherein the second ticket information comprises a second ciphertext encrypted using a public key of the first user, the second ciphertext comprising a second ticket nonce and a second ticket amount; the third ticket information includes a third ciphertext encrypted using a public key of the second party; the third ciphertext comprises a third bill random number and a third bill amount;
The processing unit is specifically configured to:
decrypting the second ciphertext using the private key of the first user and decrypting the third ciphertext using the private key of the second user;
determining the first bill amount from the blockchain system according to the identification of the first bill voucher;
and judging whether the sum of the second bill amount and the third bill amount is consistent with the first bill amount, and if so, determining that the payment bill request passes the verification.
12. The apparatus of claim 9, wherein the processing unit is further to:
controlling the receiving and transmitting unit to receive a de-authorization request sent by the first user; the de-authorization request comprises an identification of the first bill certificate and fourth bill information; the fourth bill information comprises a fourth ciphertext encrypted by using the public key of the first user, and the fourth ciphertext comprises a fourth bill random number and a fourth bill amount;
determining the first bill amount from the blockchain system according to the identification of the first bill voucher; decrypting the fourth ciphertext using the private key of the first party; judging whether the fourth bill amount is consistent with the first bill amount, if so, determining that the fourth bill information passes verification, and generating a signature of the fourth bill information;
And sending the bill uplink transaction to the blockchain system, so that the blockchain system generates and stores a fourth bill certificate according to the fourth bill information after the signature verification of the fourth bill information in the bill uplink transaction is passed, and setting the first bill certificate as a used bill.
13. The apparatus according to any one of claims 9 to 12, wherein the first ticket information further includes a first hash value obtained by hashing the first ticket random number by the first party.
14. The apparatus of claim 13, wherein the first ticket information further comprises an interfering random number generated by the first party, the interfering random number used to encrypt a ticket amount.
15. A blockchain-based bill handling device, comprising:
the receiving and transmitting unit is used for receiving bill uplink transactions, wherein the bill uplink transactions comprise signatures of first bill information and the first bill information; the first bill information comprises a first ciphertext, wherein the first ciphertext is generated by a first user after receiving a bill generation instruction, firstly locally generating and recording a first bill random number, and encrypting the content consisting of the first bill random number and a first bill amount by adopting a public key of the first user; the signature of the first bill information is generated after the authentication of the first bill information by the authorization server is passed;
The processing unit is used for generating and storing a first bill certificate according to the first bill information after the signature verification of the first bill information is passed; the first bill certificate comprises the first bill random number, the first ciphertext and a first hash value, wherein the value of the first bill random number is used for indicating whether the first bill certificate is used by a user or not, the first ciphertext is used for determining the bill amount of the first bill certificate, and the first hash value is used for verifying whether the user has the bill use right of the first bill certificate or not by a blockchain system.
16. The apparatus of claim 15, wherein the processing unit is further to:
controlling the receiving and transmitting unit to receive a bill payment transaction, wherein the bill payment transaction comprises an identification of a first bill certificate, second bill information, a signature of the second bill information, third bill information and a signature of the third bill information; the first bill corresponding to the first bill certificate is a bill to be used, the second bill information is used for generating a second bill certificate representing the received payment of the first bill, the second bill information comprises a second ciphertext encrypted by using a public key of a first user, and the second ciphertext comprises a second bill random number and a second bill amount; the third bill information is used for generating a third bill certificate for representing the first bill after payment, the third bill information comprises a third ciphertext encrypted by using a public key of a second user, and the third ciphertext comprises a third bill random number and a third bill amount;
After the signature of the second bill information and the signature of the third bill information are verified, generating a second bill certificate according to the second bill information and storing the second bill certificate, and generating a third bill certificate according to the third bill information and storing the third bill certificate;
the first ticket voucher is set as a used ticket.
17. A computing device, comprising:
a memory for storing program instructions;
a processor for invoking program instructions stored in said memory to perform the method of any of claims 1 to 8 in accordance with the obtained program.
18. A computer readable non-transitory storage medium comprising computer readable instructions which, when read and executed by a computer, cause the computer to perform the method of any of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910328543.9A CN110070443B (en) | 2019-04-23 | 2019-04-23 | Bill processing method and device based on blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910328543.9A CN110070443B (en) | 2019-04-23 | 2019-04-23 | Bill processing method and device based on blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110070443A CN110070443A (en) | 2019-07-30 |
CN110070443B true CN110070443B (en) | 2023-07-11 |
Family
ID=67368496
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910328543.9A Active CN110070443B (en) | 2019-04-23 | 2019-04-23 | Bill processing method and device based on blockchain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110070443B (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111914023B (en) * | 2019-07-31 | 2024-06-14 | 创新先进技术有限公司 | Bill management method and device based on blockchain and electronic equipment |
US10956903B2 (en) | 2019-07-31 | 2021-03-23 | Advanced New Technologies Co., Ltd. | Obtaining a blockchain-based, real-name, electronic bill |
CN110543510B (en) * | 2019-09-05 | 2024-04-09 | 腾讯科技(深圳)有限公司 | Bill data processing method, device, storage medium and computer equipment |
CN110598457B (en) * | 2019-09-24 | 2023-11-24 | 腾讯科技(深圳)有限公司 | Bill processing method, bill processing device, bill processing equipment and computer storage medium |
CN110853216B (en) * | 2019-10-18 | 2022-06-17 | 深圳壹账通智能科技有限公司 | Information storage method, information storage device, information storage medium and computer equipment |
CN110880131A (en) * | 2019-11-11 | 2020-03-13 | 深圳前海微众银行股份有限公司 | Invoice generation method and device |
CN110992211A (en) * | 2019-11-12 | 2020-04-10 | 中建八局第一建设有限公司 | Contract management method based on BIM |
CN111310202A (en) * | 2020-01-20 | 2020-06-19 | 腾讯科技(深圳)有限公司 | Information processing method for block chain network, block chain node device and medium |
CN111985918A (en) * | 2020-07-27 | 2020-11-24 | 王李琰 | Block chain-based electronic certificate circulation management method and system and block chain platform |
CN112150148A (en) * | 2020-09-24 | 2020-12-29 | 普华云创科技(北京)有限公司 | Enterprise asset protection method and system based on block chain technology |
CN111970129B (en) * | 2020-10-21 | 2021-01-01 | 腾讯科技(深圳)有限公司 | Data processing method and device based on block chain and readable storage medium |
CN112150157B (en) * | 2020-11-25 | 2021-03-02 | 支付宝(杭州)信息技术有限公司 | Method and device for issuing receivable certificate through block chain |
CN113793149B (en) * | 2021-09-16 | 2024-10-25 | 中国银行股份有限公司 | Off-line transaction authentication system, method, central server and client |
CN114240408B (en) * | 2021-12-21 | 2022-05-06 | 环球数科集团有限公司 | Electronic ticket business transaction method based on block chain technology |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105719185A (en) * | 2016-01-22 | 2016-06-29 | 杭州复杂美科技有限公司 | Block chain data comparison and consensus method |
CN107392577A (en) * | 2017-07-27 | 2017-11-24 | 中链科技有限公司 | The method and system of commodity transaction are carried out in circulation domain using digital ticket voucher |
CN108764874A (en) * | 2018-05-17 | 2018-11-06 | 深圳前海微众银行股份有限公司 | Anonymous refund method, system and storage medium based on block chain |
CN109002732A (en) * | 2018-07-17 | 2018-12-14 | 深圳前海微众银行股份有限公司 | Data deposit card method, apparatus and system and data evidence collecting method |
CN109034797A (en) * | 2018-06-26 | 2018-12-18 | 东莞市大易产业链服务有限公司 | A kind of bill evidence's method of payment based on block chain technology |
CN109035019A (en) * | 2018-07-11 | 2018-12-18 | 平安科技(深圳)有限公司 | Bill business method, system, computer equipment and storage medium |
CN109102389A (en) * | 2018-07-27 | 2018-12-28 | 深圳前海微众银行股份有限公司 | Financial asset circulation method, apparatus and storage medium in supply chain |
CN109191275A (en) * | 2018-07-13 | 2019-01-11 | 程玉亮 | A method of based on the new Financing Mode of alliance's chain supply chain finance |
CN109544152A (en) * | 2018-10-12 | 2019-03-29 | 深圳壹账通智能科技有限公司 | Supply chain method of payment, cashing method, device, equipment and medium based on block chain |
WO2019072300A2 (en) * | 2018-12-21 | 2019-04-18 | Alibaba Group Holding Limited | Blockchain data protection based on generic account model and homomorphic encryption |
-
2019
- 2019-04-23 CN CN201910328543.9A patent/CN110070443B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105719185A (en) * | 2016-01-22 | 2016-06-29 | 杭州复杂美科技有限公司 | Block chain data comparison and consensus method |
CN107392577A (en) * | 2017-07-27 | 2017-11-24 | 中链科技有限公司 | The method and system of commodity transaction are carried out in circulation domain using digital ticket voucher |
CN108764874A (en) * | 2018-05-17 | 2018-11-06 | 深圳前海微众银行股份有限公司 | Anonymous refund method, system and storage medium based on block chain |
CN109034797A (en) * | 2018-06-26 | 2018-12-18 | 东莞市大易产业链服务有限公司 | A kind of bill evidence's method of payment based on block chain technology |
CN109035019A (en) * | 2018-07-11 | 2018-12-18 | 平安科技(深圳)有限公司 | Bill business method, system, computer equipment and storage medium |
CN109191275A (en) * | 2018-07-13 | 2019-01-11 | 程玉亮 | A method of based on the new Financing Mode of alliance's chain supply chain finance |
CN109002732A (en) * | 2018-07-17 | 2018-12-14 | 深圳前海微众银行股份有限公司 | Data deposit card method, apparatus and system and data evidence collecting method |
CN109102389A (en) * | 2018-07-27 | 2018-12-28 | 深圳前海微众银行股份有限公司 | Financial asset circulation method, apparatus and storage medium in supply chain |
CN109544152A (en) * | 2018-10-12 | 2019-03-29 | 深圳壹账通智能科技有限公司 | Supply chain method of payment, cashing method, device, equipment and medium based on block chain |
WO2019072300A2 (en) * | 2018-12-21 | 2019-04-18 | Alibaba Group Holding Limited | Blockchain data protection based on generic account model and homomorphic encryption |
Also Published As
Publication number | Publication date |
---|---|
CN110070443A (en) | 2019-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110070443B (en) | Bill processing method and device based on blockchain | |
US11785079B2 (en) | Free storage protocol for blockchain platform | |
US11687924B2 (en) | Cryptocurrency infrastructure system | |
US20220156738A1 (en) | Methods and systems of using a cryptocurrency system to manage payments and payment alternatives | |
JP7533983B2 (en) | Apparatus, system, or method for facilitating value transfer between parties with low or no trust | |
US10846663B2 (en) | Systems and methods for securing cryptocurrency purchases | |
US11245653B2 (en) | Methods and systems for creating and using massless currency | |
US9978094B2 (en) | Tokenization revocation list | |
EP3912118A1 (en) | Identity management, smart contract generator, and blockchain mediating system, and related methods | |
KR102621116B1 (en) | Elecronic device and electronic payement method using id-based public key cryptography | |
CN113994357A (en) | Method for directly transmitting electronic coin data records between a terminal and a payment system | |
CN109829767A (en) | A kind of point reward exchanging system and method based on block chain technology | |
JP2008257598A (en) | Electronic money transaction method and electronic money system | |
US20190108517A1 (en) | Digital currency for performing cash-equivalent transactions | |
CN110990855A (en) | Block chain information recording and inquiring method, device and system | |
US20120254041A1 (en) | One-time credit card numbers | |
CN112069528A (en) | Financing transaction processing method and system based on block chain | |
CN111160909B (en) | Hidden static supervision system and method for blockchain supply chain transaction | |
EP3788535B1 (en) | Techniques for performing secure operations | |
CN112513904B (en) | Digital asset transaction control method, device, terminal equipment and storage medium | |
EP3837804A1 (en) | Token keys to generate cryptograms for token interactions | |
US20220078611A1 (en) | Secure offline mobile interactions | |
JP6840319B1 (en) | Transaction information processing system | |
CN116561739B (en) | Data transaction method and device, electronic equipment and storage medium | |
KR20190065832A (en) | Method for Providing Payment based on Sound Wave by using Cryptocurrency |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |