Digital currency dual offline transaction method based on security unit and trusted execution environment

By adopting a technology of a secure unit and a trusted execution environment in digital currency dual offline transactions, the problem that existing mobile payment technology cannot be applied to dual offline transaction scenarios is solved, and the security and integrity of transaction data is achieved, providing the same Cash is similar to payment experience and ensures the security characteristics of digital currencies.

CN114841684BActive Publication Date: 2025-02-25北京银联金卡科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210310535.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-02-25
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

The existing mobile payment technology cannot be applied to dual offline transaction scenarios, and there are problems with data leakage and security risks.

Method used

Using a dual offline transaction method of digital currency based on a secure unit and a trusted execution environment, the transaction settings are made in a trusted execution environment by both parties, a near-field communication security channel is established, and a key management module is used to obtain key information from the security unit. Construct and verify transaction packets to ensure the security and integrity of transactions.

Benefits of technology

It realizes the security and integrity of transaction data in dual offline transaction scenarios, avoids data leakage and security risks, provides a payment experience similar to cash, and ensures that digital currency cannot be spent, denied, and counterfeited. Characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841684B_ABST
    Figure CN114841684B_ABST
Patent Text Reader

Abstract

The digital currency dual offline transaction method based on a security unit and a trusted execution environment provided by the present invention is that the two parties to the transaction set up the transaction in the trusted UI of the TEE, establish a near-field communication secure channel, and securely transmit the key information from the SE to the TEE. The payee and the payee verify the initial transaction information through different parameters in their respective TEE environments. If successful, the payer constructs a transaction message and sends it to the payee, who verifies the transaction message. After passing the message, the payee updates the local data and notifies the payer to update. The payer sends a transaction success notification to the payee. If the payee does not receive it, all transaction-related data is rolled back to the initial state. The advantage is that the core keys of the dual offline transactions and the security of the program execution process are protected by SE technology, TEE technology and cryptographic methods, so that the two parties to the transaction can trade digital currency multiple times offline, achieving a payment experience similar to cash, and making the digital currency of offline transactions have the security characteristics of non-double-spending, non-repudiation, and non-forgery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of digital currency wallet technology and dual offline payment technology, and in particular to a digital currency dual offline transaction method based on a security unit and a trusted execution environment. Background Art

[0002] The world is transitioning from the information age to the digital age. Cryptocurrencies, especially global stablecoins, are developing rapidly in the financial field. At the same time, the international community is paying close attention to the development of digital currencies. At present, the construction of the digital economy is adapting to the requirements of the times. As the blood of the digital economy, digital currencies have become a necessary financial infrastructure. With the continuous deepening of research on digital currencies, the target positioning, applicable scenarios, technical architecture and positive changes brought to the financial system by digital currencies have become clearer.

[0003] In view of the retail central bank digital currency usage scenarios and the current development status of domestic mobile payments, mobile terminal devices are the most suitable medium for the public to use the central bank digital currency. While mobile payment technology brings convenient consumption experience to end users, it also introduces the problem of personal privacy data leakage. If the central bank digital currency payment wallet is implemented on the existing mobile payment technology infrastructure, data leakage and other problems may occur, causing security risks and spreading to the entire financial system. Existing mobile payment technology only has security protection for this type of ledger transaction system and is not suitable for offline transactions.

[0004] In addition, dual offline payment, one of the cash-like functions of the central bank's digital currency, is also incompatible with existing mobile payment technology. This is reflected in the following aspects: the money spent or earned by mobile payment users is recorded in the personal account of the bank or third-party payment institution opened by the user. When making payments, the value transfer is completed by the back-end systems of banks, third-party payment institutions, acquiring institutions, clearing institutions, etc., and security-sensitive operations involving fund transfers are performed in the back-end systems of banks and third-party payment institutions. Applying existing mobile payment technology to dual offline payment scenarios will result in insufficient protection of terminal-side data, leading to the risk of data leakage.

[0005] Therefore, how to provide a secure transaction method applicable to dual offline transactions is an urgent problem to be solved. Summary of the invention

[0006] The present invention provides a digital currency dual offline transaction method based on a security unit and a trusted execution environment, so as to solve the problem that the existing mobile payment technology cannot be applied to the dual offline transaction scenario.

[0007] In order to achieve the above-mentioned purpose, the technical solution of the present invention provides a digital currency dual offline transaction method based on a security unit and a trusted execution environment, including: after the transaction parties perform transaction settings in the trusted UI of their respective trusted execution environments TEE, a near-field communication secure channel is established, and the key management module of the trusted execution environment TEE of the transaction parties obtains key information from the security unit SE. The payee of the transaction parties constructs initial transaction information in the trusted execution environment TEE environment of its terminal. The payer of the transaction parties verifies the initial transaction information through different parameters in the trusted execution environment TEE environment of its terminal. If the verification is successful, the payer constructs a transaction message in the trusted execution environment TEE environment of its terminal and sends it to the payee, wherein the transaction message is a data structure of an offline transaction coin string set with a new transaction record node. The payee verifies the transaction message in the trusted execution environment TEE environment of its terminal. After the verification is passed, the payee updates the local data and notifies the payer to update the local data synchronously. The payer sends a transaction success notification to the payee through the trusted execution environment TEE in its terminal. The payee determines whether the transaction success notification is received within the cycle. If not, all data involved in the transaction are rolled back to the state before the start of this transaction.

[0008] As a preferred embodiment of the above technical solution, preferably, after the transaction parties set up the transaction in the trusted UI of the trusted execution environment TEE, a near-field communication secure channel is established, and the key management module of the trusted execution environment TEE of the transaction parties obtains key information from the security unit SE, including: the payee sets the payment amount in the trusted UI of the trusted execution environment TEE in its terminal; the payee obtains payment authorization through the trusted UI of the trusted execution environment TEE in its terminal. The payee and the payee each obtain the wallet private key, user wallet public key certificate, user private key, user public key certificate, and central bank digital currency issuance public key in the key management module of their terminals.

[0009] As a preferred embodiment of the above technical solution, preferably, the payer of the transaction verifies the initial transaction information through different parameters in the trusted execution environment TEE of its terminal, including: obtaining the user public key from the public key certificate of the payee in the initial transaction information The verification parameter α is used to confirm that the recipient is a legitimate user authorized by the central bank. Obtain the wallet public key from the recipient's wallet public key certificate in the initial transaction information. The verification parameter β is used to confirm that the payee is a legitimate wallet authorized by the central bank. It is determined whether the remaining offline balance in the payer's wallet is greater than the offline transaction amount.

[0010] As a preferred embodiment of the above technical solution, preferably, the transaction message is a data structure of an offline transaction coin string set with a new transaction record node: the offline transaction coin string set includes multiple offline transaction coin strings, and the offline transaction coin string consists of a coin string, an offline transaction record, a remaining amount and the number of offline transactions; when the new offline transaction process is completed, a new transaction record node is added to the data structure of the offline transaction record, and the new transaction record node includes the transaction amount, the transaction timestamp, the payee certificate, the payee certificate and the payer digital signature; in the transaction process, an appropriate amount of offline transaction coin strings are selected according to the transaction amount, and a transaction record node is generated for each offline transaction coin string. The generated record node is attached to the corresponding offline transaction coin string data structure, and the above information and related transaction information are combined into transaction data tsd; the wallet private key of the payee is used Encrypt the transaction data tsd to generate the signature information γ; and send the transaction message consisting of the transaction data tsd, the payer's wallet public key certificate, and the signature information γ.

[0011] As a preferred embodiment of the above technical solution, preferably, the payee verifies the transaction message in the trusted execution environment TEE environment of its terminal, including: obtaining the payee's user public key from the payee's public key certificate The legitimacy of the payer is confirmed by verifying the payer's signature in the transaction record node information. In the same way, the payee's terminal verifies the legitimacy of the payer in all nodes in the offline transaction record; obtains the payer's wallet public key from the payer's wallet public key certificate Confirm the legitimacy of the payer's wallet by verifying the signature information γ; issue the public key pk using the central bank's digital currency c Verify whether the coin string in the offline transaction coin string is issued by the central bank; if any verification step fails, the transaction is closed.

[0012] As a preferred embodiment of the above technical solution, preferably, the payee verifies the transaction message in the trusted execution environment TEE of its terminal. Before the verification is passed, if an abnormality occurs in the terminal of either the payee or the payer, the transaction is terminated.

[0013] As a preferred embodiment of the above technical solution, preferably, when the payee verifies in the trusted execution environment TEE of its terminal that the transaction message has been verified and the local data has been updated, but the payer has not received the synchronization data notification sent by the payee, the payment is abnormal, and it is deemed that the payee's terminal is abnormal; if the payee detects that the most recent transaction has not received the transaction success notification after repairing the abnormality, the payee rolls back the local data.

[0014] As a preferred embodiment of the above technical solution, preferably, when the payee sends a request to update local data to the payee but does not receive the transaction success notification sent by the payee, the payee updates the online account, obtains the offline transaction record, confirms that the transaction has failed, checks the transaction records of both parties to the transaction, and restores the corresponding amount to the payee's online account.

[0015] As a preferred embodiment of the above technical solution, preferably, if the payee updates the local data but the payee cannot update its local data, then this exception is caused by the payee and the payee rolls back the local data.

[0016] As a preferred embodiment of the above technical solution, preferably, when a failure occurs when the payer is notifying the payee of the success of the transaction, but the payee correctly receives the transaction success notification sent by the payer, the transaction is successful.

[0017] The technical solution of the present invention provides a digital currency dual offline transaction method based on a security unit and a trusted execution environment. After the transaction parties set up the transaction in the trusted UI of the trusted execution environment TEE, a near-field communication secure channel is established, and the key management module of the trusted execution environment TEE of both parties obtains the key information from the security unit SE. The payee of the transaction parties constructs the initial transaction information in the trusted execution environment TEE environment of its terminal. The payer of the transaction parties verifies the initial transaction information through different parameters in the trusted execution environment TEE environment of its terminal. If the verification is successful, the payer constructs a transaction message in the trusted execution environment TEE of its terminal and sends it to the payee, wherein the transaction message is a data structure of an offline transaction coin string set with a new transaction record node. The payee verifies the transaction message in the trusted execution environment TEE of its terminal. After the verification is passed, the payee updates the local data and notifies the payer to update the local data synchronously. The payer sends a transaction success notification to the payee through the trusted execution environment TEE in its terminal. The payee determines whether the transaction success notification is received within the cycle. If not, all data involved in the transaction are rolled back to the state before the start of this transaction. The advantages of the present invention are that the core key security of dual offline transactions and the program execution process security are protected through security unit SE technology, trusted execution environment TEE technology and cryptographic methods, so that both parties to the transaction can still conduct multiple transactions when both devices are offline, achieving a payment experience similar to cash, and making the digital currency of offline transactions have the security characteristics of non-double spending, non-repudiation and non-forgeability. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A flow chart before transaction preparation in the digital currency dual offline transaction method solution based on a security unit and a trusted execution environment provided by the present invention.

[0020] Figure 2 A flowchart of the transaction process in a digital currency dual offline transaction method based on a security unit and a trusted execution environment provided in an embodiment of the present invention.

[0021] Figure 3 This is a system framework flow chart of the digital currency dual offline transaction method based on a security unit and a trusted execution environment provided by the present invention.

[0022] Figure 4 The transaction message data structure provided by the present invention.

[0023] Figure 5 This is the offline transaction coin string data structure provided by the present invention.

[0024] Figure 6 The coin string expression provided by the present invention.

[0025] Figure 7 The offline transaction record data structure provided by the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] First, the transaction environment in the present invention is explained: the present invention adopts the technical architecture based on the mobile terminal TEE (trusted execution environment), and the wallet application is divided into two parts. One part is implemented in the REE (rich execution environment, common environment for mobile devices), which is responsible for providing basic software application functions such as graphical user interface and remote service access; the other part is implemented in the trusted execution environment TEE, which is responsible for providing high-security functions such as dual offline payment and sensitive information processing. The core key-related security functions are implemented by the security unit SE (security unit SEcureelement), whose interface is subject to access control restrictions and only accepts call requests from the trusted execution environment TEE.

[0028] The key management module in the trusted execution environment TEE relies on the security protection capabilities of the security unit SE to provide full life cycle protection for the cryptographic keys used in the dual offline transaction method. The key management module calls the key derivation, key storage and other functions in the security unit SE to securely generate and store keys. The intrusion detection function of the security unit SE can prevent attackers from using laboratory-level attack methods to steal keys, and actively destroy keys when necessary to ensure the security of sensitive data. The encryption algorithm module in the trusted execution environment TEE provides a variety of national secret algorithm support for the dual offline transaction method, including asymmetric encryption algorithm SM2, symmetric encryption algorithm SM4, and hash algorithm SM3. The key management and encryption algorithms implemented in the trusted execution environment TEE can protect the encryption process and key data from being tampered with or stolen by attackers.

[0029] The trusted UI in the trusted execution environment TEE is a secure human-machine interface that forcibly takes over the control of the mobile terminal display screen and touch screen from the REE to protect the authenticity and integrity of the data input and output through the screen. In the method provided by the present invention, this function is used to ensure that the sensitive data involved in the process of entering the transaction amount or payment password will not be stolen or tampered by the adversary.

[0030] The process of the present invention is now described. Figure 1 Schematic diagram of the process provided by the embodiment of the present invention Figure 1 , used to explain the preparations of both parties before the offline transaction begins, such as Figure 1 As shown, including:

[0031] Step 101: The payee sets the payment amount on the trusted UI in the trusted execution environment TEE.

[0032] Step 102: The payer enters the wallet payment password on the trusted UI in the trusted execution environment TEE, and obtains the wallet payment authorization after successful verification.

[0033] Step 103: The payer terminal and the payee terminal establish a near field communication secure channel.

[0034] Step 104: The payee and the payer obtain key information respectively.

[0035] The key management module of the payee terminal and the key management module of the payment terminal both obtain the wallet private key wsk, the user wallet public key certificate, the user private key usk, the user public key certificate, and the central bank digital currency issuance public key pk from the security unit SE. c .

[0036] The preparations for offline transactions are completed until step 104. The offline transaction process is now described. Figure 2 As shown:

[0037] Step 201: The payee sends initial transaction information to the payer.

[0038] Specifically, the payee's terminal constructs the initial transaction information in its trusted execution environment TEE and sends it to the payer's terminal. The initial transaction information includes: the transaction unique serial number, the offline transaction amount, and the payee's user private key. The unique serial number of the encrypted transaction generates a signature message α, and the recipient uses his wallet private key The offline transaction amount is encrypted to generate a signature information β, the recipient user's public key certificate and the recipient user's wallet public key certificate.

[0039] Step 202: The payer verifies the initial transaction information.

[0040] Specifically, the payer obtains the user's public key from the recipient's public key certificate By verifying the signature information α, confirm that the payee is a legitimate user authorized by the central bank. Obtain the wallet public key from the payee's wallet public key certificate By verifying the signature information β, it is confirmed that the payee is a legal wallet authorized by the central bank; and it is determined whether the remaining offline balance in the payer's wallet is greater than the offline transaction amount.

[0041] If any of the above verification steps fails, the payer terminal notifies the payee terminal of the transaction failure and closes the transaction.

[0042] Step 203: The payer constructs a transaction message and sends it to the payee.

[0043] Specifically, the payer constructs a transaction message in the trusted execution environment TEE of its terminal and sends it to the payee. The details include: selecting an appropriate amount of offline transaction coin strings according to the transaction amount, generating a transaction record node for each offline transaction coin string, attaching the generated record node to the corresponding offline transaction coin string data structure, and combining the transaction amount, the number of offline transaction coin strings, the transaction record nodes of each offline transaction coin string, the offline transaction coin string data structure with the transaction record node, and related transaction information into the transaction data tsd. Use the payer's wallet private key The signature information γ generated by encrypting the transaction data tsd; the transaction message consisting of the transaction data tsd, the payer's wallet public key certificate, and the signature information γ is sent to the payee's terminal. The transaction message contains tsd, γ, and the payer's wallet public key certificate. Among them, the relevant transaction information includes: transaction unique serial number, transaction amount, number of offline transaction coin strings, total number of transactions of all offline transaction coin strings, etc. Specifically, the transaction message data structure is as follows Figure 4 shown.

[0044] Step 204: The payee verifies the transaction message.

[0045] Specifically, the payee's terminal verifies the transaction message in the trusted execution environment TEE, including obtaining the payee's user public key from the payee's public key certificate. The legitimacy of the payer is confirmed by verifying the payer's signature in the transaction record node information. The payee uses the aforementioned verification method to verify the legitimacy of the payer described in all nodes in each offline transaction record through the terminal. Obtain the payer's wallet public key from the payer's wallet public key certificate The legitimacy of the payer's wallet is confirmed by verifying the signature information γ. The public key pk is issued using the central bank's digital currency c Verify whether the coin string in the offline transaction coin string is issued by the central bank. If any verification link in step 204 fails, the transaction is closed.

[0046] Step 205: The payee updates local data.

[0047] Specifically, the payee terminal updates local data in the trusted execution environment TEE, including inserting the transaction record node information into the offline transaction record linked list of the offline transaction coin string, increasing the offline transaction times of the offline transaction coin string, and updating the remaining amount of the offline transaction coin string.

[0048] Specifically, the present invention also provides an offline transaction coin string data structure applicable to the offline transaction method, including a coin string, an offline transaction record, a remaining amount, and an offline transaction number, the structure of which is as follows: Figure 5As shown. This data structure represents a certain amount of digital currency and its information. In the process of digital currency dual offline transaction, the payer pays the offline transaction coin string to the payee. The offline transaction coin string provided by the present invention can be used in multiple combinations according to the actual transaction amount or only use part of the amount of a coin string in the transaction, and the used coin string can also be traded multiple times.

[0049] Among them, the coin string is a digital expression of the central bank's digital currency. In form, it is an encrypted string with the following structure: Figure 6 As shown, the coin string should at least include the number, amount, owner's unique identifier, and central bank digital signature. Among them, the coin string number represents the unique identifier of the coin string, and the number cannot be repeated; the amount represents the monetary value of the coin string; the owner's unique identifier represents the owner of the coin string; the central bank digital signature is generated by the central bank's digital currency system based on all information in the coin string data structure except the digital signature, representing the legitimacy of the coin string and protecting the coin string from tampering or forgery.

[0050] Specifically for offline transaction records, it is a one-way linked list such as Figure 7 As shown in the figure, each node on the linked list records the necessary information of a dual offline transaction, including the transaction amount, transaction timestamp, payer certificate, payee certificate and payer digital signature. The remaining amount and the number of offline transactions are statistical data, which change dynamically when the coin string participates in the dual offline transaction. The remaining amount is calculated based on the currency amount of the coin string and the transaction amount of each node in the transaction record; the number of offline transactions indicates the total number of times the coin string participates in the dual offline transaction.

[0051] Step 206: The payee terminal notifies the payer terminal to update local data in the trusted execution environment TEE.

[0052] Step 207: The payer terminal updates local data in the trusted execution environment TEE. The updating step of step 207 is consistent with step 205.

[0053] Step 208: The payer notifies the payee that the transaction is successful. Specifically, the payer terminal notifies the payee terminal of the success of the transaction in its trusted execution environment TEE.

[0054] Step 209: The payee determines whether a transaction success notification has been received.

[0055] Specifically, the payee terminal monitors the results returned by the payer terminal in the trusted execution environment TEE. If the payee terminal receives the information sent by the payer terminal in step 208 within a period of time, it is determined that the transaction process has been completely executed, otherwise all data involved in the transaction are rolled back to the state before the start of this transaction.

[0056] During the execution of steps 201 to 209, various abnormal situations may occur during the operation of the terminal, such as terminal system crash, power outage, near field communication data loss, etc. The occurrence of the above abnormalities during the dual offline transaction process will cause the transaction process to terminate at the location where the abnormality occurred, resulting in failure to update key data, incomplete transaction process execution, and other data asynchronization problems on both sides. For this reason, we have designed an exception handling mechanism to protect the trader's digital currency from being lost or unusable due to abnormalities. Figure 2 Abnormalities below the middle dashed line will cause data asynchrony between the two parties. Based on the location and the affected terminals, all abnormalities can be divided into six situations, each of which has its own special processing flow described below.

[0057] Abnormal situation 1 occurs at any position in the entire process before step 205. In this case, if an abnormality occurs in the terminal of either the payee or the payer, the transaction can be terminated immediately. The data structure of the offline transaction coin string of both parties has not changed substantially, and the offline transaction coin string has not been transferred from the payer to the payee.

[0058] Abnormal situation 2: occurs after step 205 and before step 206 and is caused by an abnormality in the payee's terminal.

[0059] If an exception occurs at this position in the entire process, the payee terminal will update the local data but fail to notify the payer terminal, resulting in the payer terminal being unable to synchronize and update the local data. When the payee terminal restarts the digital currency wallet, it can be checked that the most recent transaction did not execute step 209, which means that the transaction is not normal and complete, and the local data will be automatically rolled back. In the end, the data structure of the offline transaction coin string of both parties has not changed substantially, and the offline transaction coin string has not been transferred from the payer to the payee.

[0060] Abnormal situation 3 occurs after step 206 and before step 209 and is caused by an abnormality in the payee's terminal. An abnormality occurs at this position in the entire process, which will cause the payee to send a notification after synchronizing local data, but the payee's terminal cannot receive the returned transaction result. The payee's terminal will automatically roll back the local data because the situation is consistent with abnormal situation 2 for the payee's terminal. In the end, the offline transaction coin string was paid but the payee did not receive it. To handle this special situation, it is necessary to rely on the online account synchronization function of the central bank's digital currency system. When the payee updates the online account, the central bank will confirm that the transaction has failed based on the uploaded offline transaction records, and then track and check the relevant transaction records of the payee and payer, and finally restore the corresponding amount to the payee's online account.

[0061] Abnormal situation 4: occurs after step 205 and before step 207 and is caused by an abnormality in the payer's terminal.

[0062] If an exception occurs at this point in the entire process, the payee will be unable to synchronize local data, and the payee terminal will not receive the transaction results returned by the payee. In this case, the payee automatically rolls back the local data. In the end, the data structure of the offline transaction coin string of both parties has not changed substantially, and the offline transaction coin string has not been transferred from the payer to the payee.

[0063] Abnormal situation 5: occurs after step 207 and before step 208 and is caused by an abnormality in the payer's terminal.

[0064] An exception occurs at this point in the entire process. The payee and payee terminals have updated local data, but the payee terminal cannot return the transaction result to the payee terminal. In the end, the payer paid the offline transaction coin string but the payee did not receive it. The handling method of this situation is the same as abnormal situation 3.

[0065] Abnormal situation 6: occurs after step 208 and before step 9 and is caused by an abnormality in the payer's terminal.

[0066] If an exception occurs at this point in the entire process, the local data of both the payee and payer terminals have been updated, and the terminals can normally receive the transaction results sent by the payer terminal, the transaction can be considered successful, and the offline transaction coin string is normally transferred from the payer to the payee.

[0067] In addition to the above 6 abnormal situations, there are a few extreme situations. For example, problems occur at both the payee and payee terminals, resulting in the termination of the transaction process, or problems occur at any of the payee and payee terminals during the execution of the transaction steps, which are not within the scope of this patent.

[0068] The dual offline transaction method proposed in the present invention is applicable to scenarios where both mobile terminals support security unit SE technology, trusted execution environment TEE technology and near-field communication technology. This method deeply combines security unit SE technology and trusted execution environment TEE technology to form a security framework, which is fully protected during the execution of offline transactions. The key data is protected by the security unit SE, which further improves the security of the method. The transaction process involves the payee and the payer exchanging data through near-field communication. Before the two parties transmit data, a secure channel that can protect the confidentiality and integrity of the data is established. The method for establishing the secure channel is not within the scope of this article.

[0069] The offline transaction coin string data structure provided by the present invention can safely participate in dual offline transactions multiple times until the remaining amount is zero. The key steps and keys involved in the method are all protected by the security unit SE and the trusted execution environment TEE. The offline transaction coin string data structure securely stored by the trusted execution environment TEE can always accurately and effectively record each real transaction record, and the related interfaces of the offline transaction coin string data structure in the trusted execution environment TEE cannot be illegally accessed and used by the outside world, ensuring that the offline transaction coin string has the security characteristics of non-double-spending, non-repudiation, and non-forgeability. Even if abnormal situation three or abnormal situation five occurs, the offline transaction coin string amount can be restored for the user through the central bank's central bank digital currency system.

[0070] The dual offline transaction provided by the present invention is implemented by two components, namely, the dual offline transaction function interface in the REE and the dual offline transaction function in the trusted execution environment TEE. The dual offline transaction function interface is the only way to call the dual offline transaction function, which is responsible for receiving the transaction request from the REE and then passing it to the dual offline transaction function in the trusted execution environment TEE. The dual offline transaction function depends on key management, encryption algorithm, data storage, and trusted UI module functions. The legitimacy of both parties to the transaction is verified by cryptographic methods, and transaction records that cannot be denied, forged, or illegally accessed are generated, and the information input and output on the screen is protected by the trusted UI. Each step of the method is deeply customized based on the trusted execution environment TEE technology, relying on the trusted execution environment TEE to protect the transaction process and the related functional modules involved from software attacks from the REE side. In addition, the trusted execution environment TEE key management module exclusively controls and uses the key management related functions in the security unit SE, minimizing the possibility of attacks on the core keys of the method.

[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A digital currency dual offline transaction method based on a security unit and a trusted execution environment, characterized in that: include: After the transaction parties set up the transaction in the trusted UI of their respective trusted execution environments TEE, a near field communication secure channel is established, and the transaction parties obtain key information from the security unit SE from the key management module of the trusted execution environment TEE; The payee of the transaction constructs initial transaction information in the trusted execution environment TEE environment of its terminal; The payer of the transaction verifies the initial transaction information through different parameters in the trusted execution environment TEE environment of its terminal; If the verification is successful, the payer constructs a transaction message in the trusted execution environment TEE environment of its terminal and sends it to the payee, wherein the transaction message is a data structure of an offline transaction coin string set with a new transaction record node; The payee verifies the transaction message in the trusted execution environment TEE environment of its terminal. After the verification is passed, the payee updates the local data and notifies the payer to update the local data synchronously; The payer sends a transaction success notification to the payee through the trusted execution environment TEE in its terminal; The payee determines whether the transaction success notification is received within the period, and if not, rolls back all data involved in the transaction to the state before the start of the transaction.

2. The dual offline transaction method according to claim 1, characterized in that: After the transaction parties set up the transaction in the trusted UI of the trusted execution environment TEE, a near field communication secure channel is established. The transaction parties obtain key information from the security unit SE in the key management module of the trusted execution environment TEE, including: The payee sets the payment amount in the trusted UI of the trusted execution environment TEE in its terminal; the payer obtains payment authorization through the trusted UI of the trusted execution environment TEE in its terminal; The payee and the payer each obtain the wallet private key, user wallet public key certificate, user private key, user public key certificate, and central bank digital currency issuance public key from the key management module of their terminal.

3. The dual offline transaction method according to claim 1, characterized in that: The payer of the transaction verifies the initial transaction information through different parameters in the trusted execution environment TEE environment of its terminal, including: Obtain the user public key from the recipient's public key certificate in the initial transaction information Confirm that the payee is a legitimate user authorized by the central bank by verifying the signature information α in the initial transaction information; Obtain the wallet public key from the recipient's wallet public key certificate in the initial transaction information Confirm that the payee is a legitimate wallet authorized by the central bank by verifying the signature information β in the initial transaction information; Determine whether the remaining offline balance in the payer's wallet is greater than the offline transaction amount.

4. The dual offline transaction method according to claim 1, characterized in that: The transaction message is a data structure of an offline transaction coin string set with a new transaction record node, including: The offline transaction coin string set includes multiple offline transaction coin strings, and the offline transaction coin string consists of a coin string, an offline transaction record, a remaining amount, and the number of offline transactions; when a new offline transaction process is completed, a transaction record node is added to the data structure of the offline transaction record, and the added transaction record node includes the transaction amount, transaction timestamp, payer certificate, payee certificate, and payer digital signature; In the transaction process, select an appropriate amount of offline transaction coin strings according to the transaction amount, generate a transaction record node for each offline transaction coin string, attach the generated record node to the corresponding offline transaction coin string data structure, and combine the above information and related transaction information into transaction data tsd; Use the payer's wallet private key Encrypt transaction data tsd to generate signature information γ; The transaction message consists of transaction data tsd, payer's wallet public key certificate, and signature information γ.

5. The dual offline transaction method according to claim 4, characterized in that: The payee verifies the transaction message in the trusted execution environment TEE environment of its terminal, including: Obtain the payer's user public key from the payer's user public key certificate The legitimacy of the payer is confirmed by verifying the payer's signature in the transaction record node information. In the same way, the payee's terminal verifies the legitimacy of the payer in all nodes in the offline transaction record; Obtain the payer's wallet public key from the payer's wallet public key certificate Confirm the legitimacy of the payer's wallet by verifying the signature information γ; Use central bank digital currency to issue public key pk c Verify whether the coin string in the offline transaction coin string is issued by the central bank; If any of the verification steps fails, the transaction is closed.

6. The dual offline transaction method according to claim 1, characterized in that: The payee verifies the transaction message in the trusted execution environment TEE of its terminal. Before the verification is passed, if an abnormality occurs in the terminal of either the payee or the payer, the transaction is terminated.

7. The dual offline transaction method according to claim 1, characterized in that: The payee verifies in the trusted execution environment TEE of its terminal that the transaction message has been verified and the local data has been updated, but the payee does not send a synchronization data notification to the payer, then the payment is abnormal, and it is determined that the payee's terminal is abnormal; If the payee detects that the most recent transaction has not received the transaction success notification after repairing the anomaly, the payee rolls back the local data.

8. The dual offline transaction method according to claim 1, characterized in that: When the payee sends a request to update local data to the payee but does not receive the transaction success notification sent by the payee, the payee updates the online account, obtains the offline transaction record, confirms that the transaction has failed, checks the transaction records of both parties to the transaction, and restores the corresponding amount to the payee's online account.

9. The dual offline transaction method according to claim 1, characterized in that: If the payee updates the local data but the payee cannot update its local data, this exception is caused by the payee and the payee rolls back the local data.

10. The dual offline transaction method according to claim 1, characterized in that: When a failure occurs when the payer is notifying the payee of the success of the transaction, but the payee correctly receives the transaction success notification sent by the payer, the transaction is successful.

Citation Information

Patent Citations

  • Authentication method, authentication terminal and authentication system

    CN106899552A

  • A digital currency double offline payment system, method and device

    CN113159744A