Mobile terminal digital currency wallet based on security unit and trusted execution environment

By adopting a digital currency wallet based on a secure unit and a trusted execution environment on the mobile terminal, the problem of incompatibility of existing mobile payment technology with the central bank's digital currency dual offline payment is solved, and the secure exchange, redeem and return functions are realized, ensuring the security of user data.

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

Patent Information

Application Number
CN202210479630.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2025-05-13
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

The existing mobile payment technology is incompatible with the dual offline payment of central bank digital currency, and there are data leakage and security risks, leading to the spread of security risks.

Method used

Using a mobile terminal digital currency wallet based on security units (SE) and trusted execution environment (TEE), a data structure such as wallet private key, public key certificate and central bank digital currency issuance public key is implemented to achieve secure exchange, redeem and return functions, and deeply integrate into the security framework of SE technology and TEE technology.

Benefits of technology

Effectively prevent data leakage, ensure the security of user's private keys and core keys, realize the dual offline transaction function between users, and provide a reliable technical foundation for the safe use of central bank digital currency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115018497B_ABST
    Figure CN115018497B_ABST
Patent Text Reader

Abstract

The present invention provides a mobile terminal digital currency wallet based on a security unit and a trusted execution environment, calls a trusted exchange interface, executes a digital currency exchange-in or exchange-back process in a trusted execution environment, and exchanges digital currency from the central bank's digital currency system. The advantage is that the wallet registration and activation, coin string exchange-in and exchange-back functions are deeply integrated into a security framework composed of SE technology and TEE technology, forming a comprehensive protection of the core key data and key processes of the central bank's digital currency wallet, ensuring that users can safely and effectively exchange in and exchange back the central bank's digital currency coin strings, and providing a reliable technical foundation for realizing the dual offline transaction function between users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital currency, and in particular to a mobile terminal digital currency wallet 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 central bank digital currencies. In line with the current requirements of building a digital economy to adapt to the times, digital currencies, as the blood of the digital economy, have become necessary financial infrastructure.

[0003] As central banks of various countries continue to deepen their research on digital currencies, the central bank's digital currency target positioning, applicable scenarios, technical architecture and the positive changes it brings to the financial system have become clearer. For example, the People's Bank of China proposed that the digital RMB it led to develop is a retail central bank digital currency, mainly to meet domestic retail payment needs, issued to the public and used for daily transactions, and used to improve the level of inclusive financial development. In view of the use scenarios of retail central bank digital currency and the current development status of domestic mobile payments, mobile terminal devices are the most suitable medium for the public to use central bank digital currency. While mobile payment technology brings convenient consumer experience to end users, it also introduces complex personal privacy data leakage issues. Various security risks caused by personal privacy data leakage have gradually attracted attention from all walks of life.

[0004] In addition, one of the cash-like functions of the central bank's digital currency, dual offline payment, is also incompatible with existing mobile payment technologies, and may pose certain security risks such as data leakage and non-interoperability. Therefore, if the central bank's digital currency payment wallet is implemented on the existing mobile payment technology infrastructure, security risks caused by data leakage will arise and spread to the entire financial system.

[0005] Therefore, how to provide a digital currency wallet that can avoid the risk of data leakage has become an urgent problem to be solved. Summary of the invention

[0006] The present invention provides a mobile terminal digital currency wallet based on a security unit and a trusted execution environment, which is used to solve the problem in the prior art that dual offline payment is also incompatible with the existing mobile payment technology, resulting in a high risk of data leakage.

[0007] In order to achieve the above purpose, the technical solution of the present invention provides a mobile terminal digital currency wallet based on a security unit and a trusted execution environment. The wallet data structure of the digital currency wallet consists of a wallet private key, a wallet public key certificate, a central bank digital currency issuance public key, a wallet remaining offline transaction amount, a wallet remaining online transaction amount, and offline transaction coin string data. The user data structure of the digital currency wallet consists of a user private key, a user public key certificate, a central bank server verification public key, and a wallet payment password.

[0008] When the digital currency wallet starts the exchange, the wallet application in the rich execution environment calls the trusted exchange interface, and the trusted wallet application in the trusted execution environment generates an exchange message. The security unit SE recovers and sends the user private key and wallet private key to the trusted wallet application; the trusted application wallet program uses the user private key and wallet private key to calculate the signature data, fills the signature data, the user public key certificate and the wallet public key certificate into the exchange request message, and passes the exchange request message to the central bank digital currency system through the wallet application. The central bank digital currency system verifies the exchange request message, and if successful, sends an exchange request response message to the wallet application, otherwise terminates. After receiving the exchange request response message, the trusted wallet application passes the coin string exchange certificate to the security unit SE. The security unit SE verifies the coin string exchange certificate. If it passes, it extracts the public key in the coin string exchange certificate and passes the public key data to the trusted wallet application. The trusted wallet application verifies the exchange request response message, and terminates if the verification fails. If the redemption procedure is currently being executed, if the redemption request response message passes the verification of the trusted wallet application, the redemption procedure will be terminated; if the redemption procedure is currently being executed, then after the redemption request response message passes the verification of the trusted wallet application, the trusted wallet application creates an offline transaction coin string, generates a coin string exchange completion message, and passes it to the central bank's digital currency system through the wallet application. The central bank's digital currency system receives and verifies the coin string exchange completion message. If successful, the central bank's digital currency system sends a coin string exchange completion response message, and the trusted wallet application updates the current offline transaction coin string to a tradable state and updates the account information.

[0009] As a preferred embodiment of the above technical solution, preferably, the trusted wallet application in the trusted execution environment generates a redemption request message, including: if the redemption procedure in the exchange is currently being executed, the trusted wallet application changes the state of the offline transaction coin string to be redeemed to frozen, and then generates a first redemption request message. If the redemption procedure in the exchange is currently being executed, the trusted wallet application checks the redemption application amount, and generates a first redemption request message if it passes the check, otherwise it terminates.

[0010] As a preferred embodiment of the above technical solution, preferably, in the redemption procedure, after the trusted wallet application receives the user private key and the wallet private key, it further assembles the first redemption request message to obtain the second redemption request message, and the wallet application transmits the second redemption request message to the central bank digital currency system.

[0011] As a preferred embodiment of the above technical solution, preferably, in the redemption procedure, after the trusted wallet application receives the user private key and the wallet private key, it calculates the signature data and assembles the second redemption request message, and the wallet application transmits the second redemption request message to the central bank digital currency system.

[0012] As a preferred embodiment of the above technical solution, preferably, the central bank digital currency system verifies the exchange request message, and if successful, sends an exchange request response message to the wallet application, including:

[0013] The central bank’s digital currency system verifies the offline transaction record of the second redemption request message and updates the user’s online account balance;

[0014] The hash value of the redeemed offline transaction coin string data structure is calculated according to the offline transaction coin string data structure extracted in a loop, a first redemption request message is generated, the signature data is calculated using the coin string redemption private key, the signature data and the coin string redemption certificate are filled into the first redemption request response message, and a second redemption request response message is obtained.

[0015] As a preferred embodiment of the above technical solution, preferably, if the exchange request response message passes the verification of the trusted wallet application, then the redemption procedure in the exchange is terminated, including:

[0016] If the redemption request response message passes the verification of the trusted wallet application, the trusted wallet application extracts the hash value list of the redeemed offline transaction coin strings and matches it with the local data. The status of the matched offline transaction coin strings is set to redeemed, otherwise it is set to redemption exception.

[0017] As a preferred embodiment of the above technical solution, preferably, the central bank digital currency system verifies the exchange request message, and if successful, sends an exchange request response message to the wallet application, including:

[0018] After generating an inactivated central bank digital currency string, the central bank digital currency system generates a first coin string exchange request response message, uses the coin string exchange certificate to calculate the signature data, fills the signature data and the coin string exchange certificate into the first coin string exchange request response message, and obtains the second coin string exchange request response message.

[0019] As a preferred embodiment of the above technical solution, preferably, the trusted wallet application verifies the second coin string exchange request response message. If successful, it creates an unactivated offline transaction coin string data structure and sends the assembled coin string exchange completion message to the central bank's digital currency system.

[0020] As a preferred embodiment of the above technical solution, preferably, the central bank digital currency system receives and verifies the coin-to-string exchange completion message. If successful, the central bank digital currency system sends a coin-to-string exchange completion response message to the wallet application, including:

[0021] The central bank's digital currency system receives and verifies the coin string exchange completion message. If successful, the amount of the coin string will be deducted from the user's online account balance, marking the coin string status as tradable. The central bank's digital currency system then generates a coin string exchange completion response message and sends it to the trusted wallet application via the wallet application. The trusted wallet application updates the current offline transaction coin string to a tradable state and updates the account information.

[0022] The technical solution of the present invention provides a mobile terminal digital currency wallet based on a security unit and a trusted execution environment, provides a data structure of a digital currency wallet and a data structure of a user, and when the digital currency wallet starts the exchange, the wallet application in the rich execution environment calls the trusted exchange interface, and the trusted wallet application in the trusted execution environment generates an exchange request message. The security unit SE recovers and sends the user private key and the wallet private key to the trusted wallet application; the trusted application wallet program uses the user private key and the wallet private key to calculate the signature data, fills the signature data, the user public key certificate and the wallet public key certificate into the exchange request message, and passes the exchange request message to the central bank digital currency system through the wallet application. The central bank digital currency system verifies the exchange request message, and if successful, sends an exchange request response message to the wallet application, otherwise terminates. After receiving the exchange request response message, the trusted wallet application passes the coin string exchange certificate to the security unit SE. The security unit SE verifies the coin string exchange certificate, and if it passes, extracts the public key in the coin string exchange certificate, passes the public key data to the trusted wallet application, and the trusted wallet application verifies the exchange request response message, and terminates if the verification fails. If the redemption procedure in the current exchange is being executed, if the exchange request response message passes the verification of the trusted wallet application, the redemption procedure ends. If the redemption procedure in the current exchange is being executed, after the exchange request response message passes the verification of the trusted wallet application, the trusted wallet application creates an offline transaction coin string, generates a coin string exchange completion message, and passes it to the central bank digital currency system through the wallet application. The central bank digital currency system receives and verifies the coin string exchange completion message. If successful, the central bank digital currency system sends a coin string exchange completion response message, and the trusted wallet application updates the current offline transaction coin string to a tradable state and updates the account information.

[0023] The advantage of the present invention is that it deeply integrates the functional processes such as wallet registration and activation, coin string exchange and redemption into the security framework composed of SE technology and TEE technology, forming a comprehensive protection for the core key data and key processes of the central bank's digital currency wallet, ensuring that users can safely and effectively exchange and redeem central bank digital currency strings, and providing a reliable technical foundation for realizing dual offline transaction functions between users. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] 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.

[0025] Figure 1 A schematic diagram of the structure of wallet data provided by the technical solution of the present invention.

[0026] Figure 2 A structural diagram of the offline transaction coin string data structure provided by the technical solution of the present invention.

[0027] Figure 3 A schematic diagram of the structure of the coin string expression provided by the technical solution of the present invention.

[0028] Figure 4 A structural diagram of the offline transaction record data structure provided by the technical solution of the present invention.

[0029] Figure 5 A user registration flow chart of a digital currency wallet provided by the technical solution of the present invention.

[0030] Figure 6 A wallet activation flow chart of a digital currency wallet provided by the technical solution of the present invention.

[0031] Figure 7 A flow chart of the digital currency wallet provided by the technical solution of the present invention during the process of exchanging central bank digital currency strings.

[0032] Figure 8 A flow chart of the digital currency wallet provided by the technical solution of the present invention during the process of redeeming the central bank digital currency string.

[0033] Fig. 9 This is an overall system framework diagram provided for the technical solution of the present invention. DETAILED DESCRIPTION

[0034] 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.

[0035] The digital currency wallet based on the security unit and the trusted execution environment provided by the present invention is now described in conjunction with specific embodiments. Specifically:

[0036] The overall trust system of the central bank's digital currency system is established through a public key certificate infrastructure (PKI). The central bank produces and distributes digital certificates to each entity in its digital currency ecosystem for identity authentication and secure channel establishment between entities. In order for the central bank's digital currency to circulate and be used normally, the central bank needs to issue user public key certificates, wallet public key certificates, and issuer public keys used to verify the authenticity of the central bank's digital currency to newly registered users.

[0037] The digital currency wallet provided by the present invention relies on the mobile terminal security framework to realize the protection of security-sensitive program execution process and core keys. The security framework can be implemented based on SE and TEE. At present, the use of ARM processors with TrustZone technology to implement TEE is the mainstream method in the industry. TrustZone technology can achieve hardware-level memory isolation, relying on physical isolation capabilities to completely separate trusted applications in TEE from rich execution environments, protecting trusted applications from software attacks from rich execution environments, and further combining SE technology to provide financial-level security protection for sensitive data.

[0038] The present invention provides a wallet data structure, such as Figure 1 As shown, it includes: wallet private key, wallet public key certificate, central bank digital currency issuance public key, wallet remaining offline transaction amount, wallet remaining online transaction amount, and offline transaction coin string data.

[0039] Furthermore, offline transaction coin strings are used to record offline transaction records in offline transactions. Offline transaction coin strings are based on coin strings. In order to support dual offline transactions of central bank digital currency, a data structure is created when the central bank digital currency coin string is redeemed in TEE. Figure 2 shown.

[0040] The coin string is the digital expression of the central bank's digital currency. It is a string of encrypted characters with the following structure: Figure 3As shown. In the present invention, the coin string at least includes a number, an amount, a unique identifier of the owner, and a digital signature of the central bank. 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 unique identifier of the owner represents the owner of the coin string; the digital signature of the central bank 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.

[0041] During the offline transaction process, the wallet's offline transaction record is used to record the necessary information for each dual offline transaction, including transaction amount, transaction timestamp, payer certificate, payee certificate and payer digital signature. Figure 4 The offline transaction record shown is a one-way linked list data structure, and each node on the linked list records the necessary information of a dual offline transaction.

[0042] The user data structure defined in the present invention includes: user private key, user public key certificate, central bank server verification public key, and wallet payment password.

[0043] The central bank digital currency wallet based on the security unit SE and the trusted execution environment TEE provided by the present invention consists of two parts: a wallet application in a rich execution environment and a trusted wallet application in a trusted execution environment. The wallet application only provides basic non-security sensitive functions to users, including graphical user interface and data processing, remote access, data download and other functions. The trusted wallet application is responsible for executing the transaction process and related sensitive information processing.

[0044] When a transaction is initiated, the wallet application sends a trusted service request command package to the trusted wallet application. After the trusted wallet application is started normally, it processes the trusted service request command package and performs the corresponding trusted operation. When it is necessary to use the cryptographic key stored in the security unit SE, the trusted wallet application in the TEE obtains the key from the SE and temporarily stores it in the TEE, and clears it immediately after use. Based on the wallet application and the trusted wallet application, the central bank digital currency wallet provided by the present invention can provide three functions: registration and activation, central bank digital currency coin string exchange, and redemption.

[0045] The central bank's digital currency wallet needs to obtain authorization to use the TEE from the mobile terminal manufacturer in advance. The wallet application does not need to be pre-installed on the mobile terminal when it leaves the factory, but the trusted wallet application (TA) part located in the TEE should be authorized by the mobile terminal manufacturer in advance so that the user can download it and allow it to be installed and run.

[0046] For the registration process:

[0047] Step 101: The user installs the central bank digital currency wallet including the wallet application and the trusted wallet application on the mobile terminal.

[0048] Step 102: Set the account and login password to register an account.

[0049] The wallet application controls SE to generate the user's public and private key pair through the trusted wallet application, and then sends the public key and user-related information to the central bank's digital currency system for issuing the user's public key certificate.

[0050] Step 103: The central bank’s digital currency system generates a user public key certificate and returns the certificate to the mobile terminal.

[0051] Step 104: The mobile terminal uses the secure storage function of TEE to save the user's public key certificate.

[0052] For the activation procedure:

[0053] Step 201: The user logs in to the wallet application using the account name and password and chooses to activate a digital currency wallet.

[0054] Step 202: The user sets a wallet payment password based on the TEE trusted UI function.

[0055] The wallet application controls the security unit SE through the trusted wallet application to generate a wallet public and private key pair, and then sends the public key as well as user information, wallet-related information, and terminal information to the central bank's digital currency system for issuing a wallet public key certificate and terminal binding.

[0056] Step 203: Create a wallet public key certificate and send it to the mobile terminal.

[0057] Specifically, the central bank's digital currency system creates a wallet public key certificate, and transmits the wallet public key certificate and the central bank's digital currency issuance public key back to the mobile terminal; records user information, wallet information and terminal information, and establishes a binding relationship between the user, wallet and terminal.

[0058] Step 204: The mobile terminal saves the wallet public key certificate and the central bank’s digital currency issuance public key.

[0059] Specifically, the mobile terminal uses the secure storage function of TEE to save the wallet public key certificate and the central bank's digital currency issuance public key.

[0060] In actual use, in order to ensure that the central bank's digital currency has a cash-like user experience and to make up for the inability of existing mobile payment technology to conduct transactions when both terminals are offline, the central bank's digital currency wallet must support dual offline transaction functions. Before using this function, users must apply to the central bank's digital currency system and redeem the coin string into the terminal. After the wallet application and the central bank's digital currency system establish a secure communication channel, the coin string redemption process is executed.

[0061] Now let’s explain the wallet redemption process:

[0062] Step 301: The wallet application calls the trusted wallet application coin string redemption interface.

[0063] Step 302: Enter the application amount.

[0064] The user enters the requested amount based on the TUI. The trusted wallet application confirms that the user's online account balance is greater than the requested amount.

[0065] Step 303: The trusted wallet application generates a coin string redemption request message.

[0066] The request message includes the request information field, the terminal information field and the signature information field. The request information field contains parameter information such as the coin string amount, random number, timestamp, etc. The terminal information field contains the terminal information.

[0067] Step 304: The trusted wallet application controls the security unit SE to restore the user private key and the wallet private key.

[0068] The security unit SE obtains the ciphertext data block of the user private key and wallet private key from the internal secure storage area, decrypts the data in it after verifying the integrity of the data block, obtains the plaintext data of the user private key and wallet private key, and sends the two to the trusted wallet application.

[0069] Step 305: Calculate signature data and assemble the coin string redemption request message.

[0070] Specifically, the trusted wallet application uses the user's private key to sign the request information domain to obtain the request information domain signature data, uses the wallet's private key to sign the terminal information domain to obtain the terminal information domain signature data, and puts the request information domain signature data, the terminal information domain signature data, the user's public key certificate, and the wallet's public key certificate into the signature information domain of the request message.

[0071] Step 306: The wallet application sends the completed coin string redemption request message to the central bank digital currency system.

[0072] The trusted wallet application returns the assembled coin string redemption request message to the wallet application, which then sends it to the central bank's digital currency system.

[0073] Step 307: Verify the coin string redemption request message.

[0074] Specifically, the central bank's digital currency system verifies and extracts the public keys in the user's public key certificate and the wallet's public key certificate, and then uses the extracted public key to verify the signature data in the request information domain and the signature data in the terminal information domain. If the signature data verification fails, the system terminates. The central bank's digital currency system checks whether the information in the coin string redemption request message is consistent with the binding relationship between the user, wallet, and terminal recorded in the system. If so, step 308 is executed, otherwise it terminates.

[0075] Step 308: Generate a central bank digital currency string and mark it frozen.

[0076] In this embodiment, frozen represents an inactivated state.

[0077] The central bank's digital currency system generates a central bank digital currency string of the corresponding amount for the user according to the application amount in the string exchange request message, and marks the string as frozen.

[0078] Step 309: Generate the first redemption request response message of the central bank’s digital currency.

[0079] The central bank's digital currency system generates a first redemption request response message for the currency string. The response message includes a response information field and a signature information field, wherein the response information field contains the central bank's digital currency currency string, a random number, and a timestamp.

[0080] Step 310: Calculate signature data and assemble the second coin string redemption request response message.

[0081] The central bank's digital currency system uses the coin string exchange private key signature response information field to obtain the signature data, puts the signature data and coin string exchange certificate into the signature information field of the first exchange request response message, and obtains the second coin string exchange request response message.

[0082] Step 311: The wallet application transmits the second redemption request response message.

[0083] The central bank's digital currency system returns the coin string redemption request response message to the wallet application, and the wallet application passes the second redemption request response message to the trusted wallet application.

[0084] Step 312: The trusted wallet application passes the coin string redemption certificate to the SE.

[0085] Step 313, SE verifies and extracts the public key in the coin string redemption certificate. If the verification is successful, execute step 314, otherwise terminate.

[0086] Step 314, verify the second coin string redemption request response message, if passed, execute step 315, otherwise terminate.

[0087] Specifically, the trusted wallet application uses the extracted public key to verify the response information field of the second redemption request response message, and terminates if the signature data verification fails; the trusted wallet application verifies whether the random number in the response information field is consistent with the one generated in step 303, and if so, executes step 315, otherwise terminates.

[0088] Step 315: Create an offline transaction coin string data structure and mark it frozen.

[0089] The trusted wallet application creates an offline transaction coin string data structure, extracts the central bank digital currency coin string in the response information field, encapsulates it into the offline transaction coin string data structure, and then sets the offline transaction coin string to a frozen state.

[0090] Step 316: Generate and assemble a coin string exchange completion message, wherein the coin string exchange completion message includes a hash value of the offline transaction coin string data structure.

[0091] Step 317: The trusted wallet application passes the coin string redemption completion message to the wallet application, which then sends it to the central bank's digital currency system.

[0092] Step 318, verify the coin string exchange completion message, if successful, execute step 319, otherwise terminate.

[0093] The central bank's digital currency system verifies the offline transaction coin string data structure hash value in the coin string redemption completion message based on the central bank's digital currency coin string data. If the hash value is consistent, the verification is passed.

[0094] Step 319: The central bank’s digital currency system deducts the corresponding amount from the user’s online account and marks the currency string as normal.

[0095] Step 320: The central bank digital currency system generates and assembles a response message indicating that the coin string exchange is completed. The response message includes the hash value of the offline transaction coin string data structure and the user's online account balance.

[0096] Step 321: The central bank digital currency system returns the coin string exchange completion response message to the wallet application, and the wallet application passes the response message to the trusted wallet application.

[0097] Step 322: The trusted wallet application sets the offline transaction coin string data structure to a normal state and updates the online account balance.

[0098] Step 323: The wallet application displays the coin string exchange result, and ends the coin string exchange process.

[0099] When any step of the above process triggers the termination of the process, the entity performing the termination operation needs to send an exception message to the wallet application in the mobile terminal REE environment. After receiving the exception message, the wallet application jumps to step 323 to display the reason for the abnormal exchange of the coin string to the user.

[0100] In actual transaction scenarios, the offline use of central bank digital currency strings requires the setting of corresponding risk control policies, such as transaction number limits, offline use time limits, etc. The central bank digital currency strings that trigger the risk control policy can no longer be used for transactions and can only be redeemed and handed over to the central bank for processing. When the device is connected to the Internet, the wallet application regularly checks whether there are offline transaction strings that have triggered or are about to trigger the risk control policy through the trusted wallet application. After the wallet application and the central bank digital currency system establish a secure communication channel, the string redemption process is executed.

[0101] The following is an explanation of the redemption process of digital currency wallets: Figure 5 As shown:

[0102] Step 401: Call the trusted wallet application coin string redemption interface.

[0103] Step 402: Set the status of all offline transaction coin strings to be redeemed to frozen.

[0104] Step 403: Generate the first coin string redemption request message. The first coin string redemption request message includes a request information field, a terminal information field and a signature information field. The request information field includes all offline transaction coin string data structures and random numbers to be redeemed, and the terminal information field includes terminal information.

[0105] Wherein, step 401 is performed in a wallet application, and steps 402 and 403 are performed in a trusted wallet application.

[0106] Step 404: The security unit SE restores the user private key and the wallet private key.

[0107] Step 405: Calculate the signature data to assemble the first redemption request message to obtain a second redemption request message.

[0108] The trusted wallet application uses the user's private key to sign the request information domain to obtain the request information domain signature data, uses the wallet's private key to sign the terminal information domain to obtain the terminal information domain signature data, and puts the request information domain signature data, terminal information domain signature data, user public key certificate, and wallet public key certificate into the signature information domain of the request message.

[0109] Step 406: transmit the second redemption request message of the coin string.

[0110] The trusted wallet application returns the assembled second redemption request message to the wallet application, which then sends it to the central bank's digital currency system.

[0111] Step 407: Verify the second redemption request message. If it passes, execute step 408; otherwise, terminate.

[0112] Specifically, the central bank's digital currency system verifies and extracts the public keys in the user's public key certificate and wallet's public key certificate, and then uses the extracted public key to verify the signature data in the request information domain and the signature data in the terminal information domain. If the signature data verification fails, the system will terminate. The central bank's digital currency system checks whether the information in the second redemption request message is consistent with the binding relationship between the user, wallet, and terminal recorded in the system. If they are consistent, the verification is successful.

[0113] Step 408: Loop to extract the offline transaction coin string data structure in the request information field.

[0114] This step is used by the central bank digital currency system to check the status of the corresponding central bank digital currency string in the system.

[0115] Step 409: Verify all offline transaction records, calculate the remaining currency value of the coin string and update the user's online account balance.

[0116] Extract offline transaction records from all offline transaction coin string data structures, verify offline transaction information of all nodes on each linked list and calculate the remaining currency value of the corresponding coin string. Update the calculated remaining currency value to the user's online account.

[0117] Step 410: Calculate and record the hash value of the redeemed offline transaction coin string data structure.

[0118] This step is carried out in the central bank's digital currency system to avoid users from redeeming repeatedly.

[0119] Step 411: Generate a first redemption request response message.

[0120] The central bank's digital currency system generates a first redemption request response message, which includes a response information field and a signature information field, where the response information field contains a hash value list of the redeemed offline transaction coin strings, a random number, and a timestamp.

[0121] Step 412: Calculate the signature data to assemble the first redemption request response message, and generate the second redemption request response message of the coin string.

[0122] The central bank's digital currency system uses the coin string redemption private key signature response information field to obtain the signature data, and puts the signature data and coin string redemption certificate into the signature information field of the first redemption response message, thereby obtaining the second redemption request response message.

[0123] Step 413: The wallet application transmits a second redemption request response message.

[0124] The central bank's digital currency system returns the second redemption request response message of the coin string to the wallet application, and the wallet application passes the second redemption request response message to the trusted wallet application.

[0125] Step 414: Transfer the coin string back to the certificate.

[0126] The trusted wallet application extracts and passes the coin string redemption certificate to the security unit SE.

[0127] Step 415, the security unit SE verifies and extracts the public key in the coin string redemption certificate. If the verification is successful, execute step 416, otherwise terminate.

[0128] Step 416: Verify the second redemption request response message. If it passes, execute step 417; otherwise, terminate.

[0129] The trusted wallet application uses the extracted public key to verify the response information field of the second redemption request response message. If the signature data verification fails, the application is terminated. The application determines whether the random number in the response information field is consistent with the one generated in step 403. If so, the application executes step 417, otherwise the application is terminated.

[0130] Step 417: Match the hash value with the local data and set the offline transaction coin string status according to the result.

[0131] Specifically, the trusted wallet application extracts the hash value list of the redeemed offline transaction coin strings in the response information field and matches it with the local data. The offline transaction coin strings that are successfully matched are set to the status of redeemed, and those that are unsuccessful are set to the status of redemption exception.

[0132] Step 418: The wallet application displays the coin string redemption result, and ends the coin string redemption process.

[0133] When any step of the above process triggers the termination of the process, the entity performing the termination operation needs to send an exception message to the wallet application in the mobile terminal REE environment. After receiving the exception message, the wallet application jumps to step 418 to display the abnormal reason for the coin string redemption to the user.

[0134] The central bank digital currency wallet provided by the present invention enables mobile terminal users to safely and conveniently open a central bank digital currency wallet, as well as redeem and redeem central bank digital currency strings. The wallet registration and activation, coin string redemption and redemption and other functional processes are deeply integrated into the security framework composed of SE technology and TEE technology, forming a comprehensive protection of the core key data and key processes of the central bank digital currency wallet, ensuring that users can redeem and redeem central bank digital currency strings safely and effectively, and providing a reliable technical foundation for realizing the dual offline transaction function between users.

[0135] 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 mobile terminal digital currency wallet based on a security unit and a trusted execution environment, characterized in that: The wallet data structure of the digital currency wallet consists of a wallet private key, a wallet public key certificate, a central bank digital currency issuance public key, a wallet remaining offline transaction amount, a wallet remaining online transaction amount, and offline transaction coin string data. The user data structure of the digital currency wallet consists of a user private key, a user public key certificate, a central bank server verification public key, and a wallet payment password. When the digital currency wallet starts the exchange, the wallet application in the rich execution environment calls the trusted exchange interface, and the trusted wallet application in the trusted execution environment generates an exchange request message; The security unit SE recovers and sends the user private key and wallet private key to the trusted wallet application; the trusted wallet application uses the user private key to sign the request information domain to obtain the request information domain signature data, uses the wallet private key to sign the terminal information domain to obtain the terminal information domain signature data, puts the request information domain signature data, the terminal information domain signature data, the user public key certificate, and the wallet public key certificate into the signature information domain of the request message, and transmits the exchange request message to the central bank digital currency system through the wallet application; The central bank digital currency system verifies the exchange request message, and if successful, sends an exchange request response message to the wallet application, otherwise terminates; After receiving the exchange request response message, the trusted wallet application transmits the coin-to-string exchange certificate to the security unit SE. Including generating a first redemption request response message of the central bank digital currency, calculating signature data, assembling a second coin string redemption request response message, the wallet application transmits the second redemption request response message, and the trusted wallet application transmits the coin string redemption certificate to the security unit SE; The security unit SE verifies the coin-to-string exchange certificate, extracts the public key in the coin-to-string exchange certificate if it passes, and transmits the public key data to the trusted wallet application. The trusted wallet application verifies the exchange request response message, and terminates if the verification fails; If the redemption procedure in the current redemption is executed, in the redemption procedure, if the redemption request response message passes the verification of the trusted wallet application, the redemption procedure is terminated; including: the central bank digital currency system generates a first redemption request response message; calculates signature data to assemble the first redemption request response message to generate a second redemption request response message of the coin string; the wallet application transmits the second redemption request response message; the trusted wallet application extracts and transmits the coin string redemption certificate to the security unit SE; the security unit SE verifies and extracts the public key in the coin string redemption certificate, and if the verification passes, verifies the second redemption request response message, otherwise terminates, and continues if the second redemption request response message passes the verification; If the redemption procedure is currently being executed, then after the redemption request response message is verified by the trusted wallet application, the trusted wallet application creates an offline transaction coin string, generates a coin string exchange completion message, and passes it to the central bank's digital currency system through the wallet application. The central bank's digital currency system receives and verifies the coin string exchange completion message. If successful, the central bank's digital currency system sends a coin string exchange completion response message, and the trusted wallet application updates the current offline transaction coin string to a tradable state and updates the account information.

2. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 1, characterized in that: The trusted wallet application in the trusted execution environment generates a redemption request message, including: If the redemption procedure in the exchange is currently being executed, the trusted wallet application changes the state of the offline transaction coin string to be redeemed to frozen, and generates a first redemption request message; If the redemption procedure is currently being executed, the trusted wallet application checks the redemption application amount, and generates a first redemption request message if it passes the check, otherwise it terminates.

3. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 2, characterized in that: In the redemption procedure, after the trusted wallet application receives the user private key and the wallet private key, it further assembles the first redemption request message to obtain a second redemption request message, and the wallet application transmits the second redemption request message to the central bank digital currency system.

4. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 2, characterized in that: In the redemption procedure, after the trusted wallet application receives the user private key and the wallet private key, it calculates the signature data and assembles a second redemption request message, and the wallet application transmits the second redemption request message to the central bank digital currency system.

5. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 3, characterized in that: The central bank digital currency system verifies the exchange request message, and if successful, sends an exchange request response message to the wallet application, including: The central bank digital currency system verifies the offline transaction record of the second redemption request message and updates the user's online account balance; Calculate the hash value of the redeemed offline transaction coin string data structure according to the offline transaction coin string data structure extracted in a loop, generate a first redemption request response message, use the coin string redemption private key to calculate the signature data, fill the signature data and the coin string redemption certificate into the first redemption request response message, and obtain the second redemption request response message.

6. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 5, characterized in that: If the exchange request response message passes the verification of the trusted wallet application, the redemption procedure in the exchange is terminated, including: If the exchange request response message passes the verification of the trusted wallet application, the trusted wallet application extracts the hash value list of the redeemed offline transaction coin strings and matches it with the local data. The status of the matched offline transaction coin strings is set to redeemed, otherwise it is set to redemption exception.

7. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 4, characterized in that: The central bank digital currency system verifies the exchange request message, and if successful, sends an exchange request response message to the wallet application, including: After generating an inactivated central bank digital currency string, the central bank digital currency system generates a first coin string exchange request response message, uses the coin string exchange certificate to calculate the signature data, fills the signature data and the coin string exchange certificate into the first coin string exchange request response message, and obtains a second coin string exchange request response message.

8. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 7, characterized in that: The trusted wallet application verifies the second coin string exchange request response message. If successful, it creates an unactivated offline transaction coin string data structure and sends the assembled coin string exchange completion message to the central bank digital currency system.

9. The mobile terminal digital currency wallet based on a security unit and a trusted execution environment according to claim 8, characterized in that: The central bank digital currency system receives and verifies the coin-to-string exchange completion message. If successful, the central bank digital currency system sends a coin-to-string exchange completion response message to the wallet application, including: The central bank digital currency system receives and verifies the coin string redemption completion message. If successful, the amount of the coin string will be deducted from the user's online account balance and the coin string will be marked as tradable. The central bank digital currency system then generates a coin string redemption completion response message and sends it to the trusted wallet application via the wallet application. The trusted wallet application updates the current offline transaction coin string to a tradable state and updates the account information.

Citation Information

Patent Citations

  • SGX-based digital currency payment method

    CN111798224A

  • Digital currency hardware wallet based on mobile terminal

    CN112669021A