CN110807634A - Second-hand ticket transaction method and platform based on Hasp hash chain and intelligent contract - Google Patents

Second-hand ticket transaction method and platform based on Hasp hash chain and intelligent contract Download PDF

Info

Publication number
CN110807634A
CN110807634A CN201910938551.5A CN201910938551A CN110807634A CN 110807634 A CN110807634 A CN 110807634A CN 201910938551 A CN201910938551 A CN 201910938551A CN 110807634 A CN110807634 A CN 110807634A
Authority
CN
China
Prior art keywords
transaction
ticket
seller
key
buyer
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.)
Granted
Application number
CN201910938551.5A
Other languages
Chinese (zh)
Other versions
CN110807634B (en
Inventor
段明
吴茜琼
刘依婷
于寒冰
秦潇澜
路梦搏
刘迪
王伟
郭路路
周国淼
付超辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Information Engineering University of PLA Strategic Support Force
Original Assignee
Information Engineering University of PLA Strategic Support Force
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Information Engineering University of PLA Strategic Support Force filed Critical Information Engineering University of PLA Strategic Support Force
Priority to CN201910938551.5A priority Critical patent/CN110807634B/en
Publication of CN110807634A publication Critical patent/CN110807634A/en
Application granted granted Critical
Publication of CN110807634B publication Critical patent/CN110807634B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, 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/401Transaction verification

Abstract

The invention provides a secondhand ticket transaction method and a platform based on a Hasp hash chain and an intelligent contract. The trading method and the trading platform are based on a Hasq hash chain technology, and oriented optimization is carried out on the trading method and the trading platform. In the transaction process, the secret key is directly recorded by the user, and the server only records the hash value, so that the execution efficiency of the system is greatly improved; at the beginning of transaction, a seller firstly generates a key of the seller, and the system only stores a hash block after the key is hashed into a database, and simultaneously plays a role in determining the state of a ticket owner and the state of the ticket, so that the burden of the database is reduced; based on the intelligent contract technology, the autonomous negotiation of the distributed decentralized transaction process is realized by establishing a transaction network among a plurality of users; and the transaction information, the ticket information and the ownership information are transmitted through the Hash value packaging, so that the communication between the confidentiality of information transmission and the buyer and the seller and the transaction directness are well realized.

Description

Second-hand ticket transaction method and platform based on Hasp hash chain and intelligent contract
Technical Field
The invention relates to the technical field of transaction platforms, in particular to a second-hand ticket transaction method and platform based on a Hasp hash chain and an intelligent contract.
Background
The online second-hand ticket trading platform has various forms and different characteristics, can meet the trading of various tickets of users with different requirements, and promotes the effective circulation of the tickets.
In addition, the online second-hand ticket transaction must be realized by a third-party transaction platform. Although the reliable third party can effectively ensure the normal operation of the transaction, the risk that the merchant cannot receive the goods payment of the customer can be avoided; for the client, the goods can be delivered, and the quality, namely the authenticity and the effectiveness of the goods can be ensured to a certain extent. However, the third party transaction platform collects the commission fee from the transaction while completing the guarantee payment function, and realizes the self-profit, so that the existence of the center to a great extent causes certain obstacles to the real-time performance and the transparency of the user for mastering the transaction condition.
Disclosure of Invention
In order to solve the problem that the security guarantee mechanism of the conventional second-hand ticket transaction platform still needs to be improved, the invention provides a second-hand ticket transaction method and platform based on a Hasp hash chain and an intelligent contract, and the timeliness, authenticity and fairness of transaction of buying and selling two parties are ensured.
In one aspect, the invention provides a second-hand ticket transaction method based on a Hasp hash chain and an intelligent contract, which comprises the following steps:
step 1: the seller client receives a transaction ticket request input by a seller user, and then prompts the seller user to input a price of a transferred ticket;
step 2: the server receives a key generation request of the seller client, generates a 2 n-bit key for the seller user, and takes the first n bits as a key K1The last n bits are used as a secret key K2N is a positive integer;
and step 3: the seller client side is according to the secret key K1And a secret key K2Generating a first Hash block by a Hash algorithm
Figure BDA0002222238100000021
Storing the transaction record table in the server;
and 4, step 4: the method comprises the steps that a buyer client receives an order generation request input by a buyer user, and then displays a dialog box recording ticket information;
and 5: the server receives a key generation request of the buyer client, generates a 2 n-bit key for the buyer user, and takes the first n bits as a key K3The last n bits are used as a secret key K4
Step 6: the buyer client side is according to the secret key K3Generating a first proof block by a Hash algorithm
Figure BDA0002222238100000022
Storing the order record table into a server side;
and 7: the seller client receives the secret key K input by the seller user1After submitting order confirmation request to the server, the server sends the first hash block in the transaction record table
Figure BDA0002222238100000023
Modified to a second hash block
Figure BDA0002222238100000024
And 8: the buyer client receives a secret key K input by a buyer user4According to said secret key K4Generating a second proof block by a Hash algorithm
Figure BDA0002222238100000025
After the order confirmation request and the payment request are submitted to the server side, the server side records the first verification block in the order form table
Figure BDA0002222238100000026
Modified to a second proof Block
Figure BDA0002222238100000027
And step 9: the seller client receives the secret key K input by the seller user2After submitting a confirmation transaction request to the server, the server verifies the secret key K by using an intelligent contract2After no error, the second hash block in the transaction record table is used
Figure BDA0002222238100000028
Modified to a third hash block
Figure BDA0002222238100000029
At which point the transaction is complete.
Further, the Hash algorithm employs a SHA-384 encryption algorithm.
Further, before step 3, the method further comprises: seller client side initialization transaction serial number N0Acquiring a ticket code value S of the ticket; accordingly, the number of the first and second electrodes,
in the step 3:
in the step 6:
Figure BDA0002222238100000032
in step 8:
Figure BDA0002222238100000033
wherein N is1=N0+1,N2=N1+1,N3=N2+1,N4=N3+1。
Further, step 7 further includes: the seller client receives the secret key K input by the seller user1Then, prompting the seller user whether to modify the price of the ticket; and then submitting an order confirmation request to the server side.
Further, the conditions of the intelligent contract include:
condition 1: the transaction can be normally carried out only when the personal balance of the buyer user is more than or equal to the price of the ticket submitted by the seller user; otherwise, prompting the buyer that the balance of the user is insufficient and the transaction cannot be carried out;
condition 2: if the same seller user has a plurality of buyer users to make transaction requests, and the seller user completes the transaction with one of the buyer users, the other buyer users automatically quit the transaction.
In another aspect, the present invention provides a second-hand ticket transaction platform based on a Hasp hash chain and an intelligent contract, the transaction platform comprising:
the system comprises a ticket information issuing module, a ticket information processing module and a ticket information processing module, wherein the ticket information issuing module is arranged at a seller client and used for receiving a transaction ticket request input by a seller user and then prompting the seller user to input a rolled-out ticket price to the seller client;
the first key generation module is arranged at the server side and used for receiving a key generation request of the seller client side, generating a 2 n-bit key for the seller user and taking the first n bits as a key K1The last n bits are used as the key K2N is a positive integer;
a hash block generation module arranged at the seller client and used for generating the key K according to the key K1And a secret key K2Generating a first Hash block by a Hash algorithmStoring the transaction record table in the server;
the ticket order generating module is arranged at the buyer client and used for receiving an order generating request input by a buyer user and then displaying a dialog box recorded with ticket information;
a second key generation module arranged at the server end for receiving the key generation request of the buyer client, generating a 2 n-bit key for the buyer user and using the first n bits as a key K3The last n bits are used as the key K4
A verification block generation module arranged at the buyer client for generating a verification block according to the secret key K3Generating a first proof block by a Hash algorithm
Figure BDA0002222238100000041
Storing the order record table into a server side;
a hash block modification module arranged at the server end and used for the seller client end to receive the key K input by the seller user1And after submitting an order confirmation request to the server side, the first hash block in the transaction record table is used
Figure BDA0002222238100000042
Modified to a second hash block
A verification block modification module arranged at the server end for receiving the key K input by the buyer user at the buyer client end4The verification block generation module generates a verification block according to the secret key K4Generating a second proof block by a Hash algorithm
Figure BDA0002222238100000044
After the order confirmation request and the payment request are submitted to the server side, the first verification block in the order record table is recorded
Figure BDA0002222238100000045
Modified to a second proof Block
Figure BDA0002222238100000046
An intelligent contract module arranged at the server end and used for receiving the key K input by the seller user at the seller client end2After submitting a transaction confirmation request to the server, verifying the secret key K by using an intelligent contract2After no error, the second hash block in the transaction record table is used
Figure BDA0002222238100000047
Modified to a third hash block
Figure BDA0002222238100000048
At which point the transaction is complete.
Further, the Hash algorithm employs a SHA-384 encryption algorithm.
Further, the trading platform further comprises: an information acquisition module arranged at the client of the seller and used for initializing the transaction serial number N0Acquiring a ticket code value S of the ticket; accordingly, the number of the first and second electrodes,
the hash block generation module is specifically configured to calculate a first hash block according to equation (1):
Figure BDA0002222238100000051
a verification block generation module, specifically configured to calculate a first verification block according to equation (2):
and, in particular, for calculating the second proof block according to equation (3):
Figure BDA0002222238100000053
wherein N is1=N0+1,N2=N1+1,N3=N2+1,N4=N3+1。
Further, the trading platform further comprises: a ticket price modification module arranged at the seller client and used for receiving the secret key K input by the seller user1Then, prompting the seller user whether to modify the price of the ticket; and then submitting an order confirmation request to the server side.
Further, the conditions of the intelligent contract include:
condition 1: the transaction can be normally carried out only when the personal balance of the buyer user is more than or equal to the price of the ticket submitted by the seller user; otherwise, prompting the buyer that the balance of the user is insufficient and the transaction cannot be carried out;
condition 2: if the same seller user has a plurality of buyer users to make transaction requests, and the seller user completes the transaction with one of the buyer users, the other buyer users automatically quit the transaction.
The invention has the beneficial effects that:
1. in practical application, the transaction platform provided by the invention can be used as a single source of the plug-in ticket business information directly embedded in an official ticketing website, and has guarantee on the reliability; and ticket information is directly obtained through an official ticketing system, authenticity of transfer information is guaranteed, a safe and reliable transaction platform is provided for ticket purchasers, and generalized transfer becomes possible.
2. The transaction platform randomly generates a key for each ticket owner as a certificate for the ticket owner, namely, after a seller cancels the transaction, the ticket can be redeemed through the key; similarly, the buyer can obtain the randomly generated key (or choose to input the key) before submitting the order as the ticket redemption code after the transaction is successful. In the whole transaction process, ownership of the ticket by the buyer and the seller can be directly verified through a randomly generated key which is only known by the user, the redemption key is not directly stored at the server side, and only G, O generated after the key is subjected to hash encryption is stored, so that the multi-party security of ticket redemption is ensured. Meanwhile, the server side does not seek the access authority of any personal information from the ticketing official network, so that zero complaint of the personal information can be realized, and the safety of the personal information of the user is effectively ensured.
3. In the whole ticket transfer process, the server side does not directly store the key of the user, and only stores the hash block and the verification block generated by hashing the key, so that the ticket can be verified to be owned, and the transaction instantaneity is effectively guaranteed. In view of the fact that the ticket ownership can be proved only through the hash value when the transaction platform issues the ticket, namely, the ticket owner can be determined only through verifying the hash value of the input key when the ticket is redeemed, the memory occupied by the transaction platform storage and verification service is small, the execution efficiency is high, even under the condition of an unstable network, the smoothness and the stability of the transaction can be realized, and the higher operation efficiency is ensured.
4. At present, the online second-hand ticket transaction is realized by a third-party transaction platform. Although the reliable third party can effectively ensure the normal operation of the transaction, the risk that the merchant cannot receive the goods payment of the customer can be avoided; for the client, the goods can be delivered, and the quality, namely the truth and the effectiveness, of the goods can be guaranteed to a certain extent. However, the third party transaction platform collects the commission charge from the transaction while completing the guarantee payment function, so as to realize self-profit, and therefore, the existence of the center to a great extent causes certain obstacles to the real-time performance and the transparency of the user for mastering the transaction condition. The transaction platform provided by the invention is based on an improved Hasq hash chain mode, combines a data interaction mode, integrates a hash function encryption means, is directly communicated point-to-point by buyers and sellers, transmits transaction information, ticket information and ownership information only through the encrypted G, O, K, has no excessive appeal to personal information, can well realize the confidentiality of information transmission and the communication and transaction directness of the buyers and the sellers, simultaneously ensures the validity of a ticket code, releases the transaction from the supervision and participation of a third party, and achieves the aim of decentralized autonomous negotiation.
5. The transaction platform provided by the invention is based on the Hasq hash chain, determines the ownership of the goods through the hash key source of the currently issued data value, and verifies the ownership through the hash function. Each user guarantees the timeliness of the ticket to be used through the own key. Any person who wants to buy the ticket can click on the ticket that wants to be traded to generate an order to become a buyer, and the order is sent to a seller, so that the right of the seller freely choosing the order as a consumer is exercised. After the order is sent, the initiative for the transaction is returned to the transferor, who can select the desirable one of all the orders that want to buy the ticket and determine the transaction. After the transferor identifies one of the orders, the remaining orders are automatically invalidated and the buyer sending the order is notified. At which point the transaction is in an intermediate state. And the selected buyer receives the message prompt and has the right of whether to select again for purchase, if the purchase is confirmed, the key is input again, the order message is returned to the seller, and the seller confirms the sale and then inputs the own key, namely the transaction is completed. Currently, in known purchasing systems, the purchaser confirms the order and then pays directly for the seller to ship, thus leaving the seller with a lack of opportunity to change the decision. If the seller cannot complete the delivery due to sudden change, the seller party cannot cancel the order. Therefore, in the transaction platform, the seller is given the opportunity of reselecting, so that the transaction is more humanized and rationalized.
6. In the transaction platform provided by the invention, after the buyer confirms to purchase the second-hand ticket and inputs the own key, the seller can select the order and input the own key. At this time, the intelligent contract is verified, and only after the verification is passed, the record is formally established, and the transfer of money and the change of ticket ownership occur in the transaction flow. The transaction platform writes the transaction achievement terms in the intelligent contract based on the block chain, so that the transaction platform is guaranteed to be public and transparent to each user, and the transaction records cannot be tampered. The intelligent contract ensures that the transfer of money and the change of ticket ownership are simultaneously carried out, so that the transaction is completed without a third party.
7. The second-hand ticket transaction method based on the Hasp hash chain and the intelligent contract has the same beneficial effects, and is not repeated herein.
Drawings
Fig. 1 is a schematic flowchart of a second-hand ticket transaction method based on a Hasp hash chain and an intelligent contract according to an embodiment of the present invention;
fig. 2 is a second schematic flowchart of a second hand ticket transaction method based on a Hasp hash chain and an intelligent contract according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a secondhand ticket transaction platform based on a Hasp hash chain and an intelligent contract according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
With reference to fig. 1 and fig. 2, the second-hand ticket transaction method based on a Hasp hash chain and an intelligent contract provided by the embodiment of the present invention includes the following steps:
s101: the seller client receives a transaction ticket request input by a seller user, and then prompts the seller user to input a transferred ticket price;
s102: the server receives a key generation request of the seller client, generates a 2 n-bit key for the seller user, and takes the first n bits as a key K1The last n bits are used as a secret key K2N is a positive integer; for example, n is 15.
S103: the seller client side is according to the secret key K1And a secret key K2Generating a first Hash block by a Hash algorithmStoring the transaction record table in the server;
s104: the method comprises the steps that a buyer client receives an order generation request input by a buyer user, and then displays a dialog box recorded with ticket information;
s105: the server receives a key generation request of the buyer client, generates a 2 n-bit key for the buyer user, and takes the first n bits as a key K3The last n bits are used as a secret key K4
S106: the buyer client side is according to the secret key K3Generating a first proof block by a Hash algorithm
Figure BDA0002222238100000082
Storing the order record table into a server side;
s107: the seller client receives the secret key K input by the seller user1After submitting order confirmation request to the server, the server sends the first hash block in the transaction record table
Figure BDA0002222238100000083
Modified to a second hash block
Figure BDA0002222238100000084
S108: the buyer client receives a secret key K input by a buyer user4According to said secret key K4Generating a second proof block by a Hash algorithm
Figure BDA0002222238100000085
After the order confirmation request and the payment request are submitted to the server side, the server side records the first verification block in the order form table
Figure BDA0002222238100000086
Modified to a second proof Block
Figure BDA0002222238100000087
S109: the seller client receives the secret key K input by the seller user2After submitting a confirmation transaction request to the server, the server verifies the password by using an intelligent contractKey K2After no error, the second hash block in the transaction record table is used
Figure BDA0002222238100000088
Modified to a third hash blockAt which point the transaction is complete.
As can be seen from the above description of steps S101 to S109, three hash blocks and two verification blocks are involved: a first hash block, a second hash block, and a third hash block, and a first verification block and a second verification block. At the beginning of the transaction, the key K corresponding to the first hash block1And a secret key K2The ticket is personally owned by the seller user, so that the ticket ownership is owned by the seller at the moment; during the transaction, according to the first key K of the buyer user3Generating a first verification block for modifying the first hash block into a second hash block according to the first verification block when the seller user transacts with the first verification block, wherein the second hash block corresponds to the secret key K2And a secret key K3Secret key K2Personally owned by the seller user and the key K3The ticket is personally owned by a buyer user, so that the ownership of the ticket does not belong to the seller or the buyer at the moment, and the intermediate state replaces a trusted third party in the traditional transaction process; next, the buyer and seller proceed with the transaction based on the second key K of the buyer user4Generating a second verification block for modifying the second hash block into a third hash block subsequently according to the second verification block; when the transaction is completed, the key K corresponding to the third hash block3And a secret key K4Are personally owned by the buyer user, so the ticket ownership is owned by the buyer at this time.
In the embodiment of the invention, the traditional Hash chain technology is improved, and the Hash block and the verification block are arranged, so that the Hash block plays a role in determining the ticket owner and the ticket state, namely, the key corresponding to the Hash block is owned by the owner, and the ticket is owned by the owner. The verification block provides the option for the seller, that is, when the same seller user corresponds to a plurality of buyer users, the seller user can independently select the buyer user who wants to trade with the seller user, and at this time, the 'hash block' generated by the buyer and the seller together is recorded and written into the trade record table. Only the buyer user who is selected to conduct transaction with the seller user is the buyer user whose record in the order record table is modified into a verification block generated by another key hash of the buyer user. The ticket condition is monitored and tracked in real time by the transaction platform in the whole transaction process, and the ticket state is updated in time. After each transaction is completed, the transaction platform automatically agrees with the ticketing platform, and determines the instant redemption code (namely the key and ticket code owned by the buyer) of the ticket so as to redeem the two-dimensional code of the ticket.
Optionally, when the server generates the key for the buyer user and the seller user, the pseudo-random number generator is adopted to generate the key for each user, so that the randomness and unpredictability of the key are ensured to a certain extent, the possibility that malicious users obtain the key through exhaustive calculation and steal user property is reduced, and the safety of personal information and personal property of the users is guaranteed. The Hash algorithm can adopt a SHA-384 encryption algorithm, the probability of violently cracking the encryption algorithm by a malicious user is reduced according to the characteristics of non-reversibility and conflict prevention, and the output encrypted numerical values are different even if the input numerical values have extremely small difference, so that the secrecy of a user key is ensured again, and the legal rights and interests of the user are ensured.
On the basis of the above embodiment, before step S103, the method further includes: seller client side initialization transaction sequence number N0Acquiring a ticket code value S of the ticket; accordingly, the number of the first and second electrodes,
in step S103:
Figure BDA0002222238100000101
in step S106:
in step S108:
Figure BDA0002222238100000103
wherein N is1=N0+1,N2=N1+1,N3=N2+1,N4=N3+1。
Based on the above embodiments, the ticket price can be negotiated during the transaction between the buyer and the seller, so that the seller user has the opportunity to modify the ticket price before submitting the confirmation order request to the server in step S107. Namely: step S107 specifically further includes: the seller client receives the secret key K input by the seller user1Then, prompting the seller user whether to modify the price of the ticket; and then submits a confirmation order request to the server side.
In addition, if a certain party wants to terminate the transaction in the transaction process, in order to ensure that the ownership of the goods is not lost, time stamps can be added into the transaction record table and the record data in the order record table at the server side. The time definition of the timestamp may be negotiated by the seller-buyer for decision. When the buyer and the seller choose to terminate the transaction, the seller does not continue to publish the record, and when the state lasts for a certain time, such as fifteen minutes, the transaction is automatically identified as an invalid transaction, and the goods are still owned by the seller.
Figure BDA0002222238100000104
Even if a party chooses to terminate the transaction after the second record is published, the seller has a private key K1It is disclosed that this does not affect the ownership of the item, either, since only the person who owns both private keys is the owner of the item. Meanwhile, the state represented by the second record gives the buyer and the seller the opportunity to reconsider and determine whether to carry out the transaction again, so that the possibility of error transaction is reduced to a certain extent.
The intelligent contract is made by a plurality of users in the block chain, and the right and obligation of both sides of the transaction are defined in the protocol. The distributed network enables the intelligent contract to be received by the full-network verification node nodes, and after most verification nodes achieve consensus on the event, the intelligent contract is automatically executed and the user is informed. The transaction is carried out smoothly on the premise that the buyer user has enough assets to at least pay for purchasing the commodities of the transaction, so the conditions of the intelligent contract comprise:
condition 1: the transaction can be normally carried out only when the personal balance of the buyer user is more than or equal to the price of the ticket submitted by the seller user; otherwise, prompting the buyer that the balance of the user is insufficient and the transaction cannot be carried out;
specifically, if the seller user does not modify the ticket price in step S107, the personal balance of the buyer user should be greater than or equal to the ticket price input by the seller user in step S101; if the seller user modifies the price of the ticket in step S107, the personal balance of the buyer user should be equal to or greater than the price of the ticket modified by the seller user in step S107.
Condition 2: if the same seller user has a plurality of buyer users to make transaction requests, and the seller user completes the transaction with one of the buyer users, the other buyer users automatically quit the transaction.
In an embodiment of the invention, the seller sends the key K2And when the ticket is sent to the database, the ticket is owned by the buyer, and if the transaction is judged to be legal and effective through the intelligent contract, the transaction platform automatically deducts the money with the corresponding amount from the buyer to the seller. At the moment, the intelligent contract technology can ensure that the seller takes the money with the corresponding amount, the rights and interests of the seller are ensured, the seller can obtain the fund with the corresponding amount while transferring the goods, and the credit repudiation of the buyer is avoided.
Corresponding to the method, the invention also provides a second-hand ticket transaction platform based on the Hasp hash chain and the intelligent contract. As shown in fig. 3, the trading platform includes:
the system comprises a ticket information issuing module, a ticket information processing module and a ticket information processing module, wherein the ticket information issuing module is arranged at a seller client and used for receiving a transaction ticket request input by a seller user and then prompting the seller user to input a rolled-out ticket price to the seller client;
a first key generation module arranged to generate a first keyAt the server side, the system is used for receiving a key generation request of the seller client side, generating a 2 n-bit key for a seller user, and taking the first n bits as a key K1The last n bits are used as the key K2
A hash block generation module arranged at the seller client and used for generating the key K according to the key K1And a secret key K2Generating a first Hash block by a Hash algorithm
Figure BDA0002222238100000121
Storing the transaction record table in the server;
the ticket order generating module is arranged at the buyer client and used for receiving an order generating request input by a buyer user and then displaying a dialog box recorded with ticket information;
a second key generation module arranged at the server end for receiving the key generation request of the buyer client, generating a 2 n-bit key for the buyer user and using the first n bits as a key K3The last n bits are used as the key K4
A verification block generation module arranged at the buyer client for generating a verification block according to the secret key K3Generating a first proof block by a Hash algorithm
Figure BDA0002222238100000122
Storing the order record table into a server side;
a hash block modification module arranged at the server end and used for the seller client end to receive the key K input by the seller user1And after submitting an order confirmation request to the server side, the first hash block in the transaction record table is used
Figure BDA0002222238100000123
Modified to a second hash block
A verification block modification module arranged at the server end for receiving the key K input by the buyer user at the buyer client end4Test and examineThe certificate block generation module generates a secret key K according to the secret key K4Generating a second proof block by a Hash algorithmAfter the order confirmation request and the payment request are submitted to the server side, the first verification block in the order record table is recorded
Figure BDA0002222238100000126
Modified to a second proof Block
Figure BDA0002222238100000127
An intelligent contract module arranged at the server end and used for receiving the key K input by the seller user at the seller client end2After submitting a transaction confirmation request to the server, verifying the secret key K by using an intelligent contract2After no error, the second hash block in the transaction record table is used
Figure BDA0002222238100000128
Modified to a third hash block
Figure BDA0002222238100000129
At which point the transaction is complete.
Specifically, the conditions of the intelligent contract include:
condition 1: the transaction can be normally carried out only when the personal balance of the buyer user is more than or equal to the price of the ticket submitted by the seller user; otherwise, prompting the buyer that the balance of the user is insufficient and the transaction cannot be carried out;
condition 2: if the same seller user has a plurality of buyer users to make transaction requests, and the seller user completes the transaction with one of the buyer users, the other buyer users automatically quit the transaction.
On the basis of the above embodiment, the trading platform further comprises:
an information obtaining module 210, disposed at the seller client, for initializing the transaction serial number N0Acquiring a ticket code value S of the ticket; accordingly, the number of the first and second electrodes,
the hash block generation module 203 is specifically configured to calculate a first hash block according to equation (1):
the verification block generation module 206 is specifically configured to calculate a first verification block according to equation (2):
Figure BDA0002222238100000132
and, in particular, for calculating the second proof block according to equation (3):
Figure BDA0002222238100000133
wherein N is1=N0+1,N2=N1+1,N3=N2+1,N4=N3+1. The Hash algorithm adopts a SHA-384 encryption algorithm.
On the basis of the above embodiment, the trading platform further comprises: a ticket price modification module arranged at the seller client and used for receiving the key K input by the seller user1Then, prompting the seller user whether to modify the price of the ticket; and then submitting an order confirmation request to the server side.
It should be noted that, in practical applications, the server side stores the user information table and the ticket information table in addition to the order record table and the transaction record table, so as to facilitate the use of the user. Wherein: the user information table stores personal information of the user, including personal basic information such as an account number, a password, a user name, a personal balance and the like. The ticket information table stores basic information of the ticket, including the type of the ticket, such as a movie ticket, a concert ticket, a drama ticket, a sight spot ticket and the like; the code value corresponding to the ticket, the picture display of the ticket, the place, time, field and seat number of the performance, and the transfer price of the ticket.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A secondhand ticket transaction method based on a Hasp hash chain and an intelligent contract is characterized by comprising the following steps:
step 1: the seller client receives a transaction ticket request input by a seller user, and then prompts the seller user to input a price of a transferred ticket;
step 2: the server receives a key generation request of the seller client, generates a 2 n-bit key for the seller user, and takes the first n bits as a key K1The last n bits are used as a secret key K2N is a positive integer;
and step 3: the seller client side is according to the secret key K1And a secret key K2Generating a first Hash block by a Hash algorithmStoring the transaction record table in the server;
and 4, step 4: the method comprises the steps that a buyer client receives an order generation request input by a buyer user, and then displays a dialog box recorded with ticket information;
and 5: the server receives a key generation request of the buyer client, generates a 2 n-bit key for the buyer user, and takes the first n bits as a key K3The last n bits are used as a secret key K4
Step 6: the buyer client side is according to the secret key K3Generating a first proof block by a Hash algorithm
Figure FDA0002222238090000012
Storing the order record table into a server side;
and 7: the seller client receives the secret key K input by the seller user1After submitting order confirmation request to the server, the server sends the first hash block in the transaction record table
Figure FDA0002222238090000013
Modified to a second hash block
Figure FDA0002222238090000014
And 8: the buyer client receives a secret key K input by a buyer user4According to said secret key K4Generating a second proof block by a Hash algorithm
Figure FDA0002222238090000015
After the order confirmation request and the payment request are submitted to the server side, the server side records the first verification block in the order form table
Figure FDA0002222238090000016
Modified to a second proof Block
Figure FDA0002222238090000017
And step 9: the seller client receives the secret key K input by the seller user2After submitting a transaction confirmation request to the server, the server verifies the secret key K by using an intelligent contract2After no error, the second hash block in the transaction record table is used
Figure FDA0002222238090000021
Modified to a third hash block
Figure FDA0002222238090000022
At which point the transaction is complete.
2. The second-hand ticket transaction method of claim 1, wherein the Hash algorithm employs a SHA-384 encryption algorithm.
3. A second hand ticket transaction method as in claim 2, further comprising, prior to step 3: seller client side initialization transaction serial number N0Acquiring a ticket code value S of the ticket; accordingly, the number of the first and second electrodes,
in the step 3:
in the step 6:
in step 8:
Figure FDA0002222238090000025
wherein N is1=N0+1,N2=N1+1,N3=N2+1,N4=N3+1。
4. The second-hand ticket transaction method as claimed in claim 1, further comprising, in step 7: the seller client receives the secret key K input by the seller user1Then, prompting the seller user whether to modify the price of the ticket; and then submitting an order confirmation request to the server side.
5. A second-hand ticket transaction method according to claim 1 or 4, wherein the conditions of the intelligent contract comprise:
condition 1: only when the personal balance of the buyer user is more than or equal to the price of the ticket submitted by the seller user, the transaction can be normally carried out; otherwise, prompting the buyer that the balance of the user is insufficient and the transaction cannot be carried out;
condition 2: if the same seller user has a plurality of buyer users to make transaction requests, and the seller user completes the transaction with one of the buyer users, the other buyer users automatically quit the transaction.
6. Second-hand ticket transaction platform based on Hasp hash chain and intelligent contract, comprising:
the system comprises a ticket information issuing module, a ticket information processing module and a ticket information processing module, wherein the ticket information issuing module is arranged at a seller client and used for receiving a transaction ticket request input by a seller user and then prompting the seller user to input a rolled-out ticket price to the seller client;
the first key generation module is arranged at the server side and used for receiving a key generation request of the seller client side, generating a 2 n-bit key for the seller user and taking the first n bits as a key K1The last n bits are used as a secret key K2N is a positive integer;
a hash block generation module arranged at the seller client and used for generating the key K according to the key K1And a secret key K2Generating a first Hash block by a Hash algorithm
Figure FDA0002222238090000031
Storing the transaction record table in the server;
the ticket order generating module is arranged at the buyer client and used for receiving an order generating request input by a buyer user and then displaying a dialog box recorded with ticket information;
a second key generation module arranged at the server end for receiving the key generation request of the buyer client, generating a 2 n-bit key for the buyer user and using the first n bits as a key K3The last n bits are used as a secret key K4
A verification block generation module arranged at the buyer client for generating a verification block according to the secret key K3Generating a first proof block by a Hash algorithm
Figure FDA0002222238090000032
Storing the order record table into a server side;
a hash block modification module arranged at the server end and used for the seller client end to receive the password input by the seller userKey K1And after submitting an order confirmation request to the server side, the first hash block in the transaction record table is used
Figure FDA0002222238090000033
Modified to a second hash block
Figure FDA0002222238090000034
A verification block modification module arranged at the server end for receiving the key K input by the buyer user at the buyer client end4The verification block generation module generates a verification block according to the secret key K4Generating a second proof block by a Hash algorithm
Figure FDA0002222238090000035
After the order confirmation request and the payment request are submitted to the server side, the first verification block in the order record table is recorded
Figure FDA0002222238090000036
Modified to a second proof Block
Figure FDA0002222238090000037
An intelligent contract module arranged at the server end and used for receiving the key K input by the seller user at the seller client end2After submitting a transaction confirmation request to the server, verifying the secret key K by using an intelligent contract2After no error, the second hash block in the transaction record table is used
Figure FDA0002222238090000041
Modified to a third hash block
Figure FDA0002222238090000042
At which point the transaction is complete.
7. The second-hand ticket transaction platform of claim 6, wherein the Hash algorithm employs a SHA-384 encryption algorithm.
8. The second-hand ticket transaction platform of claim 7, further comprising:
an information acquisition module arranged at the client of the seller and used for initializing the transaction serial number N0Acquiring a ticket code value S of the ticket; accordingly, the number of the first and second electrodes,
the hash block generation module is specifically configured to calculate a first hash block according to equation (1):
Figure FDA0002222238090000043
a verification block generation module, specifically configured to calculate a first verification block according to equation (2):
Figure FDA0002222238090000044
and, in particular, for calculating the second proof block according to equation (3):
Figure FDA0002222238090000045
wherein N is1=N0+1,N2=N1+1,N3=N2+1,N4=N3+1。
9. The second-hand ticket transaction platform of claim 6, further comprising: a ticket price modification module arranged at the seller client and used for receiving the secret key K input by the seller user1Then, prompting the seller user whether to modify the price of the ticket; and then submitting an order confirmation request to the server side.
10. A second-hand ticket transaction platform according to claim 6 or 9, wherein the conditions of the smart contract comprise:
condition 1: only when the personal balance of the buyer user is more than or equal to the price of the ticket submitted by the seller user, the transaction can be normally carried out; otherwise, prompting the buyer that the balance of the user is insufficient and the transaction cannot be carried out;
condition 2: if the same seller user has a plurality of buyer users to make transaction requests, and the seller user completes the transaction with one of the buyer users, the other buyer users automatically quit the transaction.
CN201910938551.5A 2019-09-30 2019-09-30 Second-hand ticket transaction method and platform based on Hasq hash chain and intelligent contract Active CN110807634B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910938551.5A CN110807634B (en) 2019-09-30 2019-09-30 Second-hand ticket transaction method and platform based on Hasq hash chain and intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910938551.5A CN110807634B (en) 2019-09-30 2019-09-30 Second-hand ticket transaction method and platform based on Hasq hash chain and intelligent contract

Publications (2)

Publication Number Publication Date
CN110807634A true CN110807634A (en) 2020-02-18
CN110807634B CN110807634B (en) 2022-08-02

Family

ID=69488018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910938551.5A Active CN110807634B (en) 2019-09-30 2019-09-30 Second-hand ticket transaction method and platform based on Hasq hash chain and intelligent contract

Country Status (1)

Country Link
CN (1) CN110807634B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340590A (en) * 2020-02-25 2020-06-26 成都即速网络科技有限公司 Collaborative operation method based on electronic commerce and distributed resale platform thereof
CN112801785A (en) * 2021-01-13 2021-05-14 中央财经大学 Fair data transaction method and device based on block chain intelligent contract
CN114401117A (en) * 2021-12-27 2022-04-26 浙江数秦科技有限公司 Account login verification system based on block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2013205125B1 (en) * 2013-04-13 2014-07-31 Hasq Technology Pty Ltd Method and system for the secure transfer and verification of ownership of digital sequences
TW201741955A (en) * 2016-05-18 2017-12-01 碩網資訊股份有限公司 An electronic ticket system using block chain and method thereof
WO2019028442A1 (en) * 2017-08-03 2019-02-07 Onli, Inc. Evolving actual possession token with verifiable evolution state
CN109523375A (en) * 2017-09-20 2019-03-26 成都高新信息技术研究院 A kind of decentralization transaction in assets method and system
CN109889504A (en) * 2019-01-23 2019-06-14 北京航空航天大学 Decentralization data access rights method of commerce and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2013205125B1 (en) * 2013-04-13 2014-07-31 Hasq Technology Pty Ltd Method and system for the secure transfer and verification of ownership of digital sequences
TW201741955A (en) * 2016-05-18 2017-12-01 碩網資訊股份有限公司 An electronic ticket system using block chain and method thereof
WO2019028442A1 (en) * 2017-08-03 2019-02-07 Onli, Inc. Evolving actual possession token with verifiable evolution state
CN109523375A (en) * 2017-09-20 2019-03-26 成都高新信息技术研究院 A kind of decentralization transaction in assets method and system
CN109889504A (en) * 2019-01-23 2019-06-14 北京航空航天大学 Decentralization data access rights method of commerce and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340590A (en) * 2020-02-25 2020-06-26 成都即速网络科技有限公司 Collaborative operation method based on electronic commerce and distributed resale platform thereof
CN112801785A (en) * 2021-01-13 2021-05-14 中央财经大学 Fair data transaction method and device based on block chain intelligent contract
CN112801785B (en) * 2021-01-13 2023-10-20 中央财经大学 Fair data transaction method and device based on blockchain intelligent contract
CN114401117A (en) * 2021-12-27 2022-04-26 浙江数秦科技有限公司 Account login verification system based on block chain
CN114401117B (en) * 2021-12-27 2024-03-19 浙江数秦科技有限公司 Block chain-based account login verification system

Also Published As

Publication number Publication date
CN110807634B (en) 2022-08-02

Similar Documents

Publication Publication Date Title
TWI822653B (en) Blockchain-based exchange with tokenisation
JP7221546B2 (en) Transaction Privacy in Public Distributed Ledger Systems
US11651365B2 (en) Blockchain architecture, system, method and device for automated cybersecurity and data privacy law compliance with proprietary off-chain storage mechanism
US11941588B2 (en) Systems and methods for blockchain virtualization and scalability
CN108734576B (en) Block chain-based educational resource sharing method and system
CN109074580B (en) Method and system for secure transfer of entities over a blockchain
JP6364132B2 (en) Blockchain transaction recording system and method
US20190354945A1 (en) Real-time buying, selling, and/or trading blockchain-based goods using traditional currency
US20170221029A1 (en) Blockchaining systems and methods for frictionless media
US20220383303A1 (en) Systems and methods for multiple ledger non-fungible tokens and multiple chain blockchains for using same
CN109886812B (en) Data transaction system and method based on block chain
JP2001524233A (en) Virtual property system
CN110807634B (en) Second-hand ticket transaction method and platform based on Hasq hash chain and intelligent contract
Martins et al. Fostering customer bargaining and E-procurement through a decentralised marketplace on the blockchain
WO2020233404A1 (en) Transaction system and method, and nodes in transaction system
CN113283957B (en) Entity product transaction method based on blockchain
KR102181078B1 (en) Platform system for dealing used goods based on block-chain
US20210319510A1 (en) Blockchain-based system for providing mergers and acquisitions service, and operation method therefor
Pop et al. An Ethereum-based implementation of English, Dutch and First-price sealed-bid auctions
TWI675336B (en) System of smart ticket, method for issuing ticket and computer-readable storage device
JP2023510320A (en) Systems and Methods for Secure Peer-to-Peer Transmission of Content in Distributed Ledger Networks
KR102149998B1 (en) System Providing Mergers and Acquisitions Service based on Block Chain using multi-chain layer and Method for operating the same
KR102149999B1 (en) System Providing Mergers and Acquisitions Service based on Block Chain using heterogeneous virtual currency and Method for operating the same
CN115170132B (en) Payment method suitable for high-speed post network member system
KR102531350B1 (en) System for processing Virtual asset Payment processing using token and Driving method therof

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