CN-121581980-B - Method for online settlement interest of hardware wallet
Abstract
The application relates to the technical field of information, in particular to a method for online settlement interest of a hardware wallet, which comprises the steps that terminal equipment obtains transaction records in the hardware wallet and sends the transaction records to background service, the background service calculates interest according to the transaction records in the hardware wallet, issues an interest initialization command to the hardware wallet through the terminal equipment and obtains a terminal random number ciphertext and a wallet random number returned by the hardware wallet, if the terminal random number ciphertext passes verification, issues an interest command to the hardware wallet through the terminal equipment, and after the hardware wallet verifies that the integrity of the interest command passes, clears a transaction detail information file and an interest detail information file, and prompts success of the interest to the terminal equipment. The application realizes the interest settlement in the hardware wallet, and the provided technical scheme for the online settlement of interest in the hardware wallet can ensure the accuracy of interest redemption and improve the practicability of the hardware wallet.
Inventors
- LU ZHOU
Assignees
- 飞天诚信科技股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260123
Claims (13)
- 1. A method for online settlement of interest for a hardware wallet, comprising: Step S11, the terminal equipment acquires wallet information and transaction records of the hardware wallet and uploads the wallet information and the transaction records to a background service; Step S12, the background service generates a terminal random number according to the transaction record accounting interest, generates a statement initialization command containing the terminal random number, and sends the statement initialization command to the hardware wallet through the terminal equipment; Step S13, the hardware wallet encrypts a terminal random number in the interest initialization command by using a preset verification key to obtain a terminal random number ciphertext, generates a wallet random number, and uploads the terminal random number ciphertext and the wallet random number to the background service through the terminal equipment; Step S14, the background service acquires a verification key according to the wallet information, uses the acquired verification key and the terminal random number to verify the terminal random number ciphertext, if the verification is passed, organizes an interest command, acquires a protection key according to the wallet information, calculates a message authentication code of the interest command by using the wallet random number and the acquired protection key, sends the interest command and the message authentication code to the hardware wallet through the terminal equipment, otherwise, returns prompt information to the terminal equipment, and executes the step S16; Step S15, the hardware wallet uses a preset protection key, the wallet random number and the message authentication code to check the integrity of the interest command, if the verification is passed, the transaction detail information file and the interest detail information file are cleared, the success of the interest is prompted to the terminal equipment, step S16 is executed, otherwise, the failure of the interest is prompted to the terminal equipment, and step S16 is executed; And S16, the terminal equipment prompts corresponding information and ends.
- 2. The method for online settlement of interest by a hardware wallet of claim 1, wherein: Executing the method when the terminal equipment receives a settlement wallet interest instruction triggered by a user; And/or executing the method when the user uses the hardware wallet to recharge through the terminal equipment.
- 3. The method for online settlement of interest by a hardware wallet of claim 1, wherein: the step S11 also comprises the steps that the terminal equipment acquires interest records of the hardware wallet and uploads the interest records to the background service; The background service calculates interest according to the transaction record, specifically, the background service calculates interest according to the transaction record and interest record of the hardware wallet.
- 4. The method for online settlement of interest by a hardware wallet of claim 3, wherein: the background service further comprises confirming whether the interest rate information in the hardware wallet has expired according to the annual interest rate in the interest record when accounting interest according to the transaction record and the interest record of the hardware wallet; in the step S15, when the verification is passed, the method further includes that the hardware wallet updates the interest rate information in the interest rate command to an interest rate information file.
- 5. A method for online settlement of interest for a hardware wallet, comprising: Step S21, the terminal equipment acquires wallet information and interest rate information of the hardware wallet and uploads the wallet information and the interest rate information to a background service; Step S22, the background service judges whether the interest rate information of the hardware wallet is outdated, if yes, the interest rate update data is sent to the hardware wallet through the terminal equipment, step S23 is executed, and otherwise step S24 is executed; step S23, the hardware wallet rolls back and updates interest records in interest detail files according to the interest rate update data, updates the interest rate information recorded in the interest rate information files by using the latest interest rate information in the interest rate update data, and returns the interest rate update success information to the background service through the terminal equipment; step S24, the background service generates a terminal random number, generates a statement initialization command containing the terminal random number, and sends the statement initialization command to the hardware wallet through the terminal equipment; Step S25, the hardware wallet encrypts a terminal random number in the interest initialization command by using a preset verification key to obtain a terminal random number ciphertext, generates a wallet random number, reads accumulated interest in the latest interest record in the interest detail information file, and returns the terminal random number ciphertext, the wallet random number and the accumulated interest to the background service through the terminal equipment; Step S26, the background service acquires a check key and a protection key corresponding to the wallet according to the wallet information, checks the terminal random number ciphertext according to the check key corresponding to the wallet and the terminal random number, organizes an interest command if the check is passed, calculates a message authentication code of the interest command by using the wallet random number and the protection key corresponding to the wallet, and sends the interest command and the generated message authentication code to the hardware wallet through the terminal equipment; Step S27, the hardware wallet uses a preset protection key, the wallet random number and the received message authentication code to check the integrity of the interest command, if the verification is passed, the transaction detail information file and the interest detail information file are cleared, the success of the interest is prompted to the terminal equipment, step S28 is executed, otherwise, the failure of the interest is prompted to the terminal equipment, and step S28 is executed; Step S28, the terminal equipment prompts corresponding information and ends.
- 6. The method for online settlement of interest by hardware wallet of claim 5, wherein said step S25 further comprises said hardware wallet reading wallet balance, displaying said read wallet balance and said accumulated interest via a display screen.
- 7. The method for online settlement of interest by a hardware wallet of claim 5, wherein in step S25, before reading the accumulated interest in the latest interest record in the interest details information file, the method further comprises: Step z1, the hardware wallet judges the information date of the latest interest record in the interest list information file to obtain the latest information date, judges whether the latest information date is the last information date corresponding to the current time, if yes, continues to execute the accumulated interest in the latest interest record in the interest list information file, otherwise, executes the step z2; and step z2, calculating the interest generated by the hardware wallet after the latest interest date according to the transaction record in the transaction detail information file and the interest information recorded in the interest information file, generating a corresponding interest record, writing the interest record into the interest detail information file, and continuously executing the accumulated interest in the latest interest record in the read interest detail information file.
- 8. The method for online settlement of interest by a hardware wallet of claim 5, wherein in step S25, before reading the accumulated interest in the latest interest record in the interest details information file, the method further comprises: step z1 ', the hardware wallet judges the information date of the latest interest record in the interest list information file to obtain the latest information date, judges whether the latest information date is the last information date corresponding to the current time, if yes, continues to execute the accumulated interest in the latest interest record in the interest list information file, otherwise, executes the step z 2'; and step z 2', calculating interest generated by the hardware wallet after the latest interest date according to the transaction record in the transaction detail information file, updating the interest record in the interest detail information file and/or generating a corresponding interest record to write in the interest detail information file, and continuously executing the reading of accumulated interest in the latest interest record in the interest detail information file.
- 9. The method for online settlement of interest by hardware wallet of claim 5, wherein before the organizing the interest command in step S26, the background service reads the interest record and/or transaction record in the hardware wallet through the terminal device, calculates interest according to the read interest record and/or transaction record, if the calculated interest record and transaction record are consistent, continues to execute the organizing the interest command, otherwise, performs exception handling.
- 10. The method for online settlement of interest by hardware wallet of claim 1 or 5, wherein before the hardware wallet uses the preset check key to encrypt the terminal random number in the interest initialization command, the hardware wallet further comprises judging whether the interest initialization command contains the terminal random number or not, if yes, continuing executing the encryption of the terminal random number in the interest initialization command by using the preset check key, otherwise, prompting the terminal device of the interest failure, prompting the terminal device of corresponding information, and ending.
- 11. The method for online settlement of interest by a hardware wallet of claim 1 or 5, wherein after the clearing of the transaction detail information file and the interest detail information file, further comprises: step x1, the hardware wallet reads wallet balance, and confirms accumulated interest as zero; And step x2, the hardware wallet displays the read wallet balance and the accumulated interest through a display screen, starts timing, and refreshes the display screen to be in an initial state after the timing is finished.
- 12. The method for online settlement of interest by hardware wallet of claim 11, wherein said step x1 further comprises updating wallet balance by said hardware wallet according to the amount in said interest settlement command, generating transaction record corresponding to the present interest settlement and writing into transaction detail information file.
- 13. A computer system comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method of any one of claims 1-12.
Description
Method for online settlement interest of hardware wallet Technical Field The application relates to the technical field of information, in particular to a method for online settlement interest of a hardware wallet. Background The hardware wallet is used as a physical carrier of the digital RMB, hardware level protection is realized through a security chip technology, but the hardware wallet in the prior art does not support the digital RMB to count information, the applicant finds out in the realization process that if the interest rate of the digital RMB is dynamically updated like the deposit interest rate, in an offline state, the interest rate information in the hardware wallet may not be up to date, the interest calculated by the hardware wallet is inaccurate, and online interest is needed when a user needs to perform interest exchange. Disclosure of Invention The invention aims to overcome the defects of the prior art and provides a method for online settlement interest of a hardware wallet. In a first aspect, the present application provides a method for online settlement of interest for a hardware wallet, the method comprising: step S11, the terminal equipment acquires wallet information and transaction records of the hardware wallet and uploads the wallet information and the transaction records to a background service; Step S12, the background service generates a terminal random number according to the transaction record accounting interest, generates a statement initialization command containing the terminal random number, and sends the statement initialization command to the hardware wallet through the terminal equipment; step S13, the hardware wallet encrypts a terminal random number in the interest initialization command by using a preset verification key to obtain a terminal random number ciphertext, generates a wallet random number, and uploads the terminal random number ciphertext and the wallet random number to a background service through the terminal equipment; Step S14, the background service acquires a verification key according to the wallet information, uses the acquired verification key and the terminal random number to verify the terminal random number ciphertext, if the verification is passed, organizes an interest command, acquires a protection key according to the wallet information, calculates a message authentication code of the interest command by using the wallet random number and the acquired protection key, sends the interest command and the message authentication code to the hardware wallet through the terminal equipment, otherwise, returns prompt information to the terminal equipment, and executes the step S16; Step S15, the hardware wallet uses a preset protection key, the wallet random number and the message authentication code to check the integrity of the interest command, if the verification is passed, the transaction detail information file and the interest detail information file are cleared, the success of the interest is prompted to the terminal equipment, step S16 is executed, otherwise, the failure of the interest is prompted to the terminal equipment, and step S16 is executed; And S16, the terminal equipment prompts corresponding information and ends. Further, the step S11 is preceded by the terminal equipment starting a non-connection module to establish connection with the hardware wallet; specifically, the method for obtaining wallet information and transaction records of the hardware wallet by the terminal device specifically includes: step S11-1, the terminal equipment sends a wallet application selection command to the hardware wallet, and the hardware wallet returns a wallet application selection response to the terminal equipment, wherein the wallet information of the hardware wallet is contained in the response; in step S11-2, the terminal device sends a read wallet record command to the hardware wallet, and the hardware wallet returns the transaction record in the transaction detail information file to the terminal device. In a second aspect, the present application provides a method for online settlement of interest for a hardware wallet, the method comprising: Step S21, the terminal equipment acquires wallet information and interest rate information of the hardware wallet and uploads the wallet information and the interest rate information to a background service; Step S22, the background service judges whether the interest rate information of the hardware wallet is outdated, if yes, the interest rate update data is sent to the hardware wallet through the terminal equipment, step S23 is executed, and otherwise step S24 is executed; step S23, the hardware wallet rolls back and updates interest records in interest detail files according to the interest rate update data, updates the interest rate information recorded in the interest rate information files by using the latest interest rate information in the interest rate update data, and returns the i