A mobile blockchain secure transaction system

By integrating hardware wallets into the mobile blockchain secure transaction system and building a trusted execution environment, the hardware wallet is solved inconvenient to carry, complicated operation and private key security problems, and a high security and convenient transaction system is achieved.

CN113935736BActive Publication Date: 2025-04-01WUHAN YUNZHONGDIAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111180542.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2025-04-01
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

Existing hardware wallets have problems such as inconvenient portability, cumbersome operation and loss that lead to threats to the security of private keys, which is difficult to meet the needs of high security and convenience.

Method used

The mobile blockchain secure transaction system based on TrustZone is adopted, and a trusted execution environment is built by integrating hardware wallets into the server terminal, and the OP-TEE architecture is used for encryption, decryption and secure storage, ensuring the isolation of the private key from the network, and improving the confidentiality of the private key.

Benefits of technology

It improves the simplicity of operation and portability, while retaining the isolated secure signature environment of the hardware wallet, enhancing the security of private keys and data protection, and meeting the security and convenience needs of the hardware wallet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935736B_ABST
    Figure CN113935736B_ABST
Patent Text Reader

Abstract

The present invention discloses a mobile terminal blockchain security transaction system, wherein the mobile terminal application module provides interaction for users, obtains user needs, completes wallet creation, transaction sending, information receiving and various functions of the mobile terminal; the trusted environment module completes encryption and decryption operations, the generation of encryption and decryption keys, and secure file operations; the secure storage module stores the encrypted private key in the TEE side security file, and can better protect the private key from leakage even if the device is damaged; the transaction signature module performs RLP serialization encoding on the transaction data structure, calculates the hash value and signature and inserts them into the transaction; the network proxy module mainly calls the API interface of the electronic currency network according to user requirements, and correctly returns the data to the client, and also includes the access module of the private chain. The present invention makes it difficult for the private key to flow out, has high security, ensures the security of the private key after the device is broken, and improves the security and reliability of the existing hardware wallet.
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 and blockchain, and in particular to a mobile blockchain secure transaction system based on TrustZone. Background Art

[0002] To address the security issues of traditional software wallets, hardware wallets have emerged. Hardware wallets can be categorized as Android hardware wallets and chip hardware wallets. As the name suggests, an Android hardware wallet is essentially an Android phone stripped of unnecessary components and modified with software to serve as a wallet. Hardware wallets generally offer network isolation, but Android lacks system integrity protection, making them vulnerable to supply chain attacks and malicious maid attacks. Furthermore, the Android system itself can also be vulnerable if security is not hardened. Chip hardware wallets are the mainstream product in the international market. They primarily program the core wallet logic directly onto the chip system, storing the wallet seed internally as a security feature. While chip hardware wallets offer excellent security, they also come with significant inconveniences. For example, transactions can be difficult to achieve smooth and instantaneous, they are not easy to carry, and there is a risk of loss. For some hardware wallets, loss can even mean permanent loss of account assets.

[0003] Therefore, hardware wallets need to solve the security issues of inconvenience in carrying, relatively cumbersome procedures, and loss, improve the ease of operation and portability, while retaining the hardware wallet's isolated secure signature environment and even higher private key confidentiality, to better ensure data security and transaction security. Summary of the Invention

[0004] The present invention addresses the shortcomings of existing technologies by providing a mobile blockchain secure transaction system that integrates a hardware wallet into a server terminal, improving ease of operation and portability. This system establishes a trusted execution environment and securely stores private keys, isolating them from the network and user applications from the wallet, enhancing private key confidentiality and providing multi-layered protection for data and transaction security.

[0005] The purpose of the present invention is to adopt the following scheme to achieve:

[0006] The present invention discloses a mobile-end blockchain secure transaction system, comprising a mobile-end application module, a trusted environment module, a secure storage module, a transaction signature module, and a network proxy module. The mobile-end application module mainly provides interaction for users and obtains user requirements; the trusted environment module mainly uses the OP-TEE architecture; the secure storage module adopts secure storage technology based on the TEE-side architecture, the encryption and decryption processes are all completed in the trusted environment, and the generation of encryption and decryption keys is also performed in OP-TEE, the private key is encrypted and stored in the TEE-side secure file, and even if the device is damaged, the private key can be well protected from leakage.

[0007] The trusted environment module finds the security file containing the private key through dirf.db, decrypts the private key in the trusted environment and passes it to the transaction signature module for transaction signing.

[0008] The transaction signature module generates a signature data packet containing a message sent from a user account. The data packet stores a message to be sent from one account to another account on the blockchain. It first creates a transaction data structure containing nine fields (nonce, gasPrice, gasLimit, to, value, data, V, R, S), then generates an RLP-encoded transaction serialization message and calculates the Keccak256 hash value of this message, calculates the ECDSA signature and signs the hash using the sender's private key, and finally inserts the R and S values ​​calculated by the ECDSA signature into the transaction.

[0009] The mobile application module provides an interactive terminal and interface for users. When a user opens a wallet on their phone to conduct a transaction, the network proxy module transfers the transaction structure to the signature server via SSH. The REE-side OP-TEE driver transfers the data to the trusted environment module. The OP-TEE driver parses and reassembles the data, loads the data required to be transferred to the TEE into shared memory, triggers a security monitoring mode call, and sends the data to the TEE. Simultaneously, the REE-side executes the CA to open a session and call a command in the TA. Based on the session ID, the created session content is obtained. The function is called to begin processing the operation request that calls the TA command. The TA then obtains the hash value number of the file name containing the private key. Based on the security file number, it can open the security file in the secure storage module, read the security file header, and establish a node tree for the security file. It can then begin reading the security file to obtain the information required to decrypt the ciphertext data. When reading the private key, it obtains the TA's session ID and execution context and checks permissions. The function is then called to implement the data read operation and return the execution result to the CA, obtaining the raw data. The session ends, and the digital currency transaction is completed through the transaction signature module.

[0010] The network proxy module is an integral part of the desktop client. Its main function is to call the API interface of the electronic currency network according to user requirements and return the data correctly to the client. It also includes an access module for the private chain.

[0011] The advantages of the present invention are as follows: Based on the OP-TEE trusted execution environment, function calls are initiated by the CA, which then implements the specific functions and returns data to the CA. This ensures that only user applications with the same corresponding UUID on the TEE side can call functions and data in the security module. This isolates the security module from the user application layer, further secures TEE data, prevents private keys from being stolen by malicious applications, and makes transaction signatures more secure, thus forming a secure trusted execution environment on the TEE side. After establishing the first layer of security protection through the trusted environment, the present invention utilizes secure storage technology based on the TEE architecture to store private keys on the TEE side. The encryption and decryption processes are all completed within the trusted environment, and encryption and decryption key generation is also performed within the OP-TEE, thus ensuring the security of the private keys and data. Based on the signature server TrustZone, the present invention implements a "hardware wallet" in software, integrating the hardware wallet into the server terminal. While improving operational simplicity and portability, it still retains the hardware wallet's isolated secure signing environment and even higher levels of private key confidentiality. This solution effectively meets the security and convenience requirements of hardware wallets.

[0012] Compared to existing hardware wallets, this patented invention addresses the inconvenience of carrying and cumbersome operation of hardware wallets. It simplifies transactions while ensuring high security, significantly improving the timeliness of transactions. As a tool for financial transactions, hardware wallets have higher security and reliability requirements than general products. To address the current problems faced by hardware wallets, such as the threat to private key security after device disassembly and the easy leakage of private keys from the chip, resulting in low security, the private key of this patented invention is encrypted and stored in a secure file using secure storage technology, ensuring that the private key is not easily leaked, thereby improving the security of existing hardware wallets. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 The overall architecture of the mobile blockchain secure transaction system based on OP-TEE digital wallet of the present invention;

[0014] Figure 2 It is the security-driven framework in the mobile blockchain secure transaction system OP-TEE of the present invention;

[0015] Figure 3 This is the trusted execution environment processing flow of the mobile blockchain secure transaction system of the present invention. DETAILED DESCRIPTION

[0016] See also Figures 1 to 3 This embodiment discloses a mobile blockchain secure transaction system, including a mobile application module (i.e., a CA module on the REE side), a trusted environment module (i.e., a TA module on the TEE side), a secure storage module, a transaction signature module, and a network proxy module. The mobile application module is the user-facing application layer of the hardware wallet, primarily providing user interaction, understanding user needs, and completing wallet creation, transaction sending, information reception, and other mobile functions. The trusted environment module utilizes the OP-TEE architecture to perform encryption and decryption operations, generate encryption and decryption keys, and perform secure file operations.

[0017] The secure storage module uses secure storage technology based on the TEE architecture to store encrypted private keys in a secure file on the TEE. This effectively protects the private key from being leaked even if the device is compromised. When the private key is first stored, a dirf.db file is created and a random number (FEK) is generated. When the file update function is called, another random number is generated as the IV value for encrypting the FEK and stored in the secure file header. Each file update replaces the IV value with a new random number. After the interface function is called in the TA to create the secure file, the initialization data is encrypted and written to the secure file. The node tree information for the entire secure file is then updated, completing the creation of the secure file. To enable subsequent access to the secure file through the dirf.db file, the contents of the dirf.db file must be updated, primarily by updating the file path interface data in the dirf.db file's data area. The trusted environment module uses dirf.db to locate the secure file containing the private key. It then enters the OP-TEE kernel space within the TA to perform an open operation. Within the trusted environment, the private key is decrypted and passed to the transaction signing module for transaction signing.

[0018] The transaction signature module includes an RLP (Recursive Length Prefix) encoding and serialization module, a hash module, and an ECDSA signature module. A signature packet containing a message sent from a user account stores the message to be sent from one account to another on the blockchain. This data packet generates a transaction data structure containing nine fields (nonce, gasPrice, gasLimit, to, value, data, V, R, S). The RLP encoding and serialization module then generates an RLP-encoded transaction serialization message based on the transaction data structure. The hash module calculates the Keccak256 hash value of this message. The ECDSA signature module calculates the ECDSA signature and signs the hash using the sender's private key. Finally, the R and S values ​​calculated from the ECDSA signature are inserted into the transaction.

[0019] The network proxy module is an integral part of the desktop client, which is mainly responsible for calling the API interface of the electronic currency network according to user requirements and returning the data correctly to the client. It also includes the access module of the private chain.

[0020] The OP-TEE and Linux application of the hardware wallet system built in the trusted environment module are integrated into the Raspberry Pi 3B.

[0021] The patent of this invention mainly protects the secure storage of keys, such as using secure storage technology to encrypt and store private keys in secure files, making it difficult for private keys to leak out, with high security, and also ensuring the security of private keys after the device is cracked.

[0022] The working principle of the present invention is as follows: after the user opens the wallet on the mobile phone to conduct a transaction, the transaction structure is transferred to the signature server via SSH. The OP-TEE driver on the REE side transfers the data to the trusted side. The OP-TEE driver parses the data and reassembles it, loads the data that needs to be transferred to the TEE side into the shared memory, triggers the security monitoring mode call (smc) to send the data to the TEE, and at the same time, the REE side executes CA to open the session, calls the command in TA to obtain the created session content according to the session ID, calls the tee_ta_invoke_command function to start processing the operation request of calling the TA command, and the function corresponding to the invoke_command_entry_point will perform the corresponding operation according to the different command IDs, and then the TA executes the read dirf The hash value number of the file name corresponding to the private key in the .db file. After obtaining the secure file number, the secure file can be opened, the header of the secure file can be read, the root node information can be obtained, and the node tree of the secure file can be established. Then, the secure file can be read. Decrypting the ciphertext data in a block in the data area requires the IV value in the corresponding node ID and the corresponding FEK. The FEK is encrypted and stored in the header of the secure file. When reading the private key, the TA's session ID and execution context are obtained and the permissions are checked. The ree_fs_read function is then called to implement the data read operation and return the execution result to the CA to obtain the raw data. The session ends and the digital currency transaction is completed through the transaction signature.

[0023] While this invention incorporates preferred embodiments and describes implementation schemes in detail, the scope of protection of this invention is not limited thereto. For example, the information stored in the secure storage module may be adjusted based on actual needs while remaining within the scope of protection of this invention; the signature algorithm and hash algorithm used by the transaction signature module are not limited to the ECDSA signature algorithm and the Keccak256 hash algorithm; the use of other signature and hash algorithms also falls within the scope of protection of this invention. Persons skilled in the art should understand that various changes in form and detail may be made to this invention without departing from the spirit and scope of the invention as defined by the appended claims, and these changes are within the scope of protection of this invention.

Claims

1. A mobile blockchain secure transaction system, characterized by: It includes mobile application module, trusted environment module, secure storage module, transaction signature module, and network proxy module. The mobile application module is a program for the user application layer of the hardware wallet, which provides interaction for users, obtains user needs, completes wallet creation, transaction sending, and receiving information; The trusted environment module uses the OP-TEE architecture to complete encryption and decryption operations, encryption and decryption key generation, and secure file operations; The secure storage module uses secure storage technology based on the TEE side architecture to store the encrypted private key in the TEE side secure file; The transaction signature module performs RLP serialization encoding on the transaction data structure, calculates the hash value and signature, and inserts them into the transaction; The network proxy module calls the API interface of the electronic currency network according to user requirements, returns the data correctly to the client, and accesses the private chain; The mobile application module includes a wallet creation module, a wallet management module, a transaction information acquisition module, a transaction sending module, a transaction processing module, and an information receiving module. The wallet creation module is connected to the secure storage module, and after creating a wallet according to user needs, a private key is generated, and the secure storage module stores the private key in a secure file; The transaction information acquisition module includes a key-in module and a code scanning module to obtain the transaction destination address and amount; Click Next to proceed with the transaction, and the private key on the TEE side of the trusted environment will be called for offline digital signature. The transaction signature module completes the signature, and then the network proxy module sends the signature to the node server and returns information in response. The transaction signature module includes an RLP encoding serialization module, a hash module, and an ECDSA signature module. The signature data packet containing the message sent from the user account stores the message to be sent from one account to another account on the blockchain, and a transaction data structure containing nine fields is generated accordingly. Then, the RLP encoding serialization module generates an RLP-encoded transaction serialization message according to the transaction data structure. The hash module calculates the Keccak256 hash value of the message. The ECDSA signature module calculates the ECDSA signature and signs the hash using the sender's private key. Finally, the R and S values ​​calculated by the ECDSA signature are inserted into the transaction. Wherein, the trusted environment module is connected with the mobile application module and the secure storage module to complete the security operation; The trusted environment module uses the OP-TEE architecture to provide a secure storage function for the secure storage module.

2. The mobile blockchain secure transaction system according to claim 1, characterized in that: The secure storage module uses secure storage technology based on the TEE side architecture to store the encrypted private key in the TEE side secure file; The secure storage module completes the private key storage function, including creating a db file module, creating a secure file module, and updating a db file module. The secure storage module is connected to a trusted environment module and performs secure file operations in a trusted environment. The trusted environment module finds the secure file containing the private key through the db file, decrypts the private key in a trusted environment, and passes it to the transaction signature module for transaction signing.

3. The mobile blockchain secure transaction system according to claim 1, characterized in that: The transaction signature module includes a transaction signing module and a signature verification module, wherein: The transaction signing module includes RLP encoding serialization module, hash module, and signature generation module; The transaction signature module is connected to the mobile application module. When a user creates a wallet and initiates a transaction, the transaction is signed by the transaction signature module and then sent out by the network proxy module. When a user receives a transaction, the transaction is subsequently processed after signature verification by the transaction signature module.

4. The mobile blockchain secure transaction system according to claim 1, characterized in that: The network proxy module is a component of the desktop client, including the API interface module for user requirements and the electronic currency network, the public chain access module, the client interaction module, and the private chain access module; The network proxy module is connected to the transaction signature module, and sends the transaction to the node after signing locally. The private key is stored in the local hardware wallet and does not need to be stored in the node wallet.

5. The mobile blockchain secure transaction system according to claim 1, characterized in that: The mobile application module, the trusted environment module, the secure storage module, the transaction signature module, and the network proxy module are all integrated on OP-TEE OS.

Citation Information

Patent Citations

  • Private key management method, device and system in blockchain scene

    CN110492990A