A method and device for password-free operation of blockchain terminal equipment

Through the method of implementing password-free operations on blockchain terminal equipment, the judgment of the instruction type and limited number of times is used, combined with user confirmation, to generate interactive credentials, which solves the troublesome operation problems caused by frequent password verification and improves operational convenience and efficiency.

CN112651053BActive Publication Date: 2024-08-27FEITIAN TECHNOLOGIES CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011627308.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2024-08-27
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

Blockchain terminal equipment frequently inputs passwords for verification during multiple consecutive operations, causing user operations to be cumbersome, inconvenient, and a waste of time.

Method used

Provide a method and device for password-free operation of blockchain terminal equipment. By judging the instruction type and limited number of times, combined with the user confirmation operation, interactive credentials are generated to achieve password-free operation, saving the user the step of entering a password.

Benefits of technology

It realizes the password-free operation of blockchain terminal equipment, improves the convenience and efficiency of user operations, and saves users the time of entering passwords.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112651053B
    Figure CN112651053B
Patent Text Reader

Abstract

The present invention discloses a method and device for secret-free operation of a blockchain terminal device, the method comprising: when receiving a signature instruction, judging whether the interaction value is less than the limit, if so, judging whether the current limit number is equal to the threshold, if not equal to the threshold, judging whether a key confirmation is required, if so, displaying the interaction value, performing a signature operation when receiving a user confirmation operation, otherwise performing a signature operation; when the interaction value is not less than the limit or the current limit number is equal to the threshold, saving an unfinished mark, returning a PIN code verification response to a host computer; when receiving a PIN code verification instruction, verifying the PIN code, and if the verification is successful, judging whether the unfinished mark exists, if so, judging whether a key confirmation is required, if so, displaying the interaction value, performing a signature operation when receiving a user confirmation operation, otherwise performing a signature operation. The present invention can realize secret-free operation during operation, saving user time, and making operation more convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security, and in particular to a method and device for password-free operation of a blockchain terminal device. Background Art

[0002] A blockchain terminal device is a hardware device that stores blockchain encrypted virtual assets. To ensure the security of interaction and comply with user operating habits, each time a blockchain terminal device is used for operation, the user is required to enter a password for verification. However, during multiple consecutive operations, frequent password entry is troublesome for users, inconvenient, and a waste of time. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and to provide a method and device for password-free operation of a blockchain terminal device.

[0004] The present invention provides a method for password-free operation of a blockchain terminal device, comprising:

[0005] Step S1: When the blockchain terminal device receives the instruction sent by the host computer, it determines the instruction type. If it is a signature instruction, it executes step S2; if it is a PIN code verification instruction, it executes step S7;

[0006] Step S2: The blockchain terminal device parses the signature instruction to obtain the interactive input value and the interactive data, obtains the interactive value according to the interactive input value and the interactive data, and determines whether the interactive value is less than the limited amount. If so, execute step S3; otherwise, save the unfinished mark, return the verification PIN code response to the host computer, and return to step S1;

[0007] Step S3: The blockchain terminal device determines whether the current limited number of times is equal to the threshold value. If so, the unfinished flag is saved, and a response indicating that the limited number of times reaches the threshold value and that the PIN code needs to be verified is returned to the host computer, and the process returns to step S1. Otherwise, step S4 is executed.

[0008] Step S4: The blockchain terminal device determines whether a key press is required, if yes, executes step S5, otherwise executes step S6;

[0009] Step S5: The blockchain terminal device displays the interaction value and waits for the user's operation. If a user confirmation operation is received, step S6 is executed. If a user cancellation operation is received, the interaction is canceled and the process ends.

[0010] Step S6: The blockchain terminal device obtains the subkey index in the interactive data, obtains the master key pre-stored in the secure storage area, generates a public key based on the master key, derives a subkey pair through a key derivation algorithm based on the public key and the subkey index, obtains the subprivate key in the subkey pair, generates data to be signed based on the interactive data, uses the subprivate key to sign the data to be signed to generate a signature result, obtains the subpublic key in the subkey pair, generates an interactive credential based on the subpublic key and the signature result, returns the interactive credential to the host computer, and returns to step S1;

[0011] Step S7: The blockchain terminal device verifies the PIN code. If the verification is successful, step S8 is executed. If the verification fails, the process ends.

[0012] Step S8: The blockchain terminal device determines whether an unfinished mark exists. If yes, it executes step S4. Otherwise, it returns a successful response of the verification PIN code to the host computer and returns to step S1.

[0013] When it is determined in step S3 that the current limited number of times is not equal to the threshold and when it is determined in step S8 that an unfinished mark exists, it also includes: updating the limited number of times; after the interaction is cancelled, it also includes: updating the limited number of times.

[0014] The present invention provides a device for secret-free operation of a blockchain terminal device, comprising:

[0015] The first receiving and judging module is used to judge the instruction type when the blockchain terminal device receives the instruction sent by the host computer. If it is a signature instruction, the parsing and judging module is triggered; if it is a PIN code verification instruction, the verification module is triggered;

[0016] A parsing and judging module is used to parse the signature instruction to obtain the interactive input value and the interactive data, obtain the interactive value according to the interactive input value and the interactive data, and judge whether the interactive value is less than the limited amount. If so, the first judging module is triggered; otherwise, an unfinished mark is saved, and a PIN code verification response is returned to the host computer to trigger the first receiving and judging module;

[0017] The first judgment module is used to judge whether the current limited number of times is equal to the threshold value. If yes, the unfinished mark is saved, and the response that the limited number of times reaches the threshold value and the verification of the PIN code is required is returned to the host computer to trigger the first receiving judgment module, otherwise the second judgment module is triggered;

[0018] The second judgment module is used to judge whether key confirmation is required, and if so, trigger the first display receiving module, otherwise, trigger the signature module;

[0019] The first display receiving module is used to display the interaction value and wait for the user's operation. If the user confirms the operation, the signature module is triggered. If the user cancels the operation, the interaction is cancelled and ends.

[0020] A signature module is used to obtain a subkey index in the interactive data, obtain a master key pre-stored in a secure storage area, generate a public key according to the master key, derive a subkey pair according to the public key and the subkey index through a key derivation algorithm, obtain a subprivate key in the subkey pair, generate data to be signed according to the interactive data, use the subprivate key to sign the data to be signed to generate a signature result, obtain a subpublic key in the subkey pair, generate an interactive credential according to the subpublic key and the signature result, return the interactive credential to the host computer, and trigger the first receiving judgment module;

[0021] A verification module is used to verify the PIN code. If the verification is successful, the third judgment module is triggered, and if the verification fails, the process ends;

[0022] The third judgment module is used to judge whether there is an unfinished mark, and if so, trigger the second judgment module, otherwise return a successful response of the verification PIN code to the host computer, triggering the first receiving judgment module;

[0023] The device also includes a first update number module and a second update number module;

[0024] A first update times module, used for updating the limited times when the first judgment module determines that the current limited times are not equal to the threshold; and also for updating the limited times when the third judgment module determines that an unfinished mark exists;

[0025] The second updating number module is used to update the limited number of times when the first display receiving module receives a user cancellation operation.

[0026] The present invention provides a method for password-free operation of a blockchain terminal device, comprising:

[0027] Step Q1: When the blockchain terminal device receives the instruction sent by the host computer, it determines the instruction type. If it is a signature instruction, it executes step Q2; if it is a PIN code verification instruction, it executes step Q6;

[0028] Step Q2: The blockchain terminal device determines whether the current limited number of times is equal to the threshold. If so, it saves the unfinished mark, returns the response that the limited number of times reaches the threshold and the verification PIN code is required to the host computer, and executes step Q1. Otherwise, it executes step Q3.

[0029] Step Q3: The blockchain terminal device determines whether a key press is required, if yes, executes step Q4, otherwise executes step Q5;

[0030] Step Q4: The blockchain terminal device displays the authorization information in the signature instruction and waits for the user to operate. If a user confirmation operation is received, step Q5 is executed. If a user cancellation operation is received, the interaction is canceled and ends.

[0031] Step Q5: The blockchain terminal device queries the key index according to the sub-public key in the signature instruction, calculates the sub-private key according to the queried key index, signs the authorization information with the sub-private key to obtain the signature result, generates the interaction credential according to the signature result, returns the interaction credential to the host computer, and returns to step Q1;

[0032] Step Q6: The blockchain terminal device verifies the PIN code. If the verification is successful, step Q7 is executed. If the verification fails, the process ends.

[0033] Step Q7: The blockchain terminal device determines whether the unfinished mark exists. If yes, execute step Q3. Otherwise, return the verification PIN code successfully to the host computer and execute step Q1.

[0034] When it is determined in step Q2 that the current limited number of times is not equal to the threshold and when it is determined in step Q7 that an unfinished mark exists, it also includes: updating the limited number of times; after the interaction is cancelled, it also includes: updating the limited number of times.

[0035] The present invention provides a device for secret-free operation of a blockchain terminal device, comprising:

[0036] The first receiving judgment module is used to judge the instruction type when the blockchain terminal device receives the instruction sent by the host computer. If it is a signature instruction, the first judgment module is triggered; if it is a PIN code verification instruction, the verification module is triggered;

[0037] The first judgment module is used to judge whether the current limited number of times is equal to the threshold value. If yes, the unfinished flag is saved, and a response that the limited number of times reaches the threshold value and the PIN code needs to be verified is returned to the host computer to trigger the first receiving judgment module, otherwise the second judgment module is triggered;

[0038] The second judgment module is used to judge whether key confirmation is required, and if so, trigger the first display receiving module, otherwise, trigger the signature module;

[0039] The first display receiving module is used to display the authorization information in the signature instruction and wait for the user's operation. If the user confirms the operation, the signature module is triggered. If the user cancels the operation, the interaction is canceled and ends.

[0040] The signature module is used to query the key index according to the sub-public key in the signature instruction, calculate the sub-private key according to the queried key index, use the sub-private key to sign the authorization information to obtain a signature result, generate an interactive credential according to the signature result, return the interactive credential to the host computer, and trigger the first receiving judgment module;

[0041] A verification module is used to verify the PIN code. If the verification is successful, the third judgment module is triggered, and if the verification fails, the process ends;

[0042] The third judgment module is used to judge whether there is an unfinished mark, and if so, trigger the second judgment module, otherwise return a successful response of the verification PIN code to the host computer, triggering the first receiving judgment module;

[0043] The device also includes a first update number module and a second update number module;

[0044] A first update times module, used for updating the limited times when the first judgment module determines that the current limited times are not equal to the threshold; and also for updating the limited times when the third judgment module determines that an unfinished mark exists;

[0045] The second updating number module is used to update the limited number of times when the first display receiving module receives a user cancellation operation.

[0046] Compared with the prior art, the present invention has the following advantages:

[0047] The present invention provides a method and device for password-free operation of a blockchain terminal device, which can realize password-free operation during the operation process, save user time, and make the operation more convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart of a method for password-free operation of a blockchain terminal device provided in Embodiment 1 of the present invention;

[0049] Figure 2 A flowchart of a method for password-free operation of a blockchain terminal device provided in Embodiment 4 of the present invention;

[0050] Figure 3 A block diagram of a device for password-free operation of a blockchain terminal device provided in Embodiment 7 of the present invention;

[0051] Figure 4 A block diagram of an apparatus for password-free operation of a blockchain terminal device provided in Example 8 of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0053] Embodiment 1

[0054] Embodiment 1 of the present invention provides a method for password-free operation of a blockchain terminal device, such as Figure 1 As shown, including:

[0055] Step S1: When the blockchain terminal device receives the instruction sent by the host computer, it determines the instruction type. If it is a signature instruction, it executes step S2; if it is a PIN code verification instruction, it executes step S7;

[0056] Step S2: The blockchain terminal device parses the signature instruction to obtain the interactive input value and the interactive data, obtains the interactive value according to the interactive input value and the interactive data, and determines whether the interactive value is less than the limited amount. If so, execute step S3; otherwise, save the unfinished mark, return the verification PIN code response to the host computer, and return to step S1;

[0057] Step S3: The blockchain terminal device determines whether the current limited number of times is equal to the threshold value. If so, the unfinished flag is saved, and a response indicating that the limited number of times reaches the threshold value and that the PIN code needs to be verified is returned to the host computer, and the process returns to step S1. Otherwise, step S4 is executed.

[0058] Step S4: The blockchain terminal device determines whether a key press is required, if yes, executes step S5, otherwise executes step S6;

[0059] Step S5: The blockchain terminal device displays the interaction value and waits for the user's operation. If a user confirmation operation is received, step S6 is executed. If a user cancellation operation is received, the interaction is canceled and the process ends.

[0060] Step S6: The blockchain terminal device obtains the subkey index in the interactive data, obtains the master key pre-stored in the secure storage area, generates a public key based on the master key, derives a subkey pair through a key derivation algorithm based on the public key and the subkey index, obtains the subprivate key in the subkey pair, generates data to be signed based on the interactive data, uses the subprivate key to sign the data to be signed to generate a signature result, obtains the subpublic key in the subkey pair, generates an interactive credential based on the subpublic key and the signature result, returns the interactive credential to the host computer, and returns to step S1;

[0061] Step S7: The blockchain terminal device verifies the PIN code. If the verification is successful, step S8 is executed. If the verification fails, the process ends.

[0062] Step S8: The blockchain terminal device determines whether an unfinished mark exists. If yes, it executes step S4. Otherwise, it returns a successful response of the verification PIN code to the host computer and returns to step S1.

[0063] When it is determined in step S3 that the current limited number of times is not equal to the threshold and when it is determined in step S8 that an unfinished mark exists, it also includes: updating the limited number of times; after the interaction is cancelled, it also includes: updating the limited number of times.

[0064] Optionally, in this embodiment, before executing step S2, the process also includes: the blockchain terminal device determines whether the password-free operation is enabled, and if so, executes step S2; otherwise, the blockchain terminal device returns a PIN code verification response to the host computer, and returns to step S1.

[0065] Optionally, in this embodiment, the blockchain terminal device determines whether the password-free operation is enabled by:

[0066] Step A1: The blockchain terminal device obtains the first flag bit from the preset password-free operation information;

[0067] Step A2: The blockchain terminal device determines whether the first flag bit is in a set state. If so, the password-free operation is not enabled; otherwise, the password-free operation is enabled.

[0068] Optionally, in this embodiment, if the initial value of the limited number of times is a preset limited number of times, when it is determined in step S3 that the current limited number of times is not equal to the threshold value and when it is determined in step S8 that the unfinished mark exists, the updated limited number of times is specifically: the result of subtracting the fifth preset value from the current limited number of times is updated; the updated limited number of times after the interaction is canceled is specifically: the result of adding the fifth preset value to the current limited number of times is updated;

[0069] If the threshold is a preset limit number of times, when it is determined in step S3 that the current limit number is not equal to the threshold and when it is determined in step S8 that an incomplete mark exists, the updated limit number of times is specifically updated as follows: the current limit number of times plus the fifth preset value is added to update the limit number of times; the updated limit number of times after the interaction is canceled is specifically updated as follows: the current limit number of times minus the fifth preset value is subtracted to update the limit number of times.

[0070] Optionally, in this embodiment, the blockchain terminal device verifies the PIN code specifically by obtaining the PIN code from the received verification PIN code instruction, and matching the obtained PIN code with the PIN code stored in the hardware main security area of ​​the blockchain terminal device. If the match is successful, the verification is successful, and if the match fails, the verification fails.

[0071] Optionally, in this embodiment, obtaining the interaction value according to the interaction input value and the interaction data specifically includes:

[0072] Step B1: The blockchain terminal device obtains the number of input interactions in the interaction data, and obtains corresponding input interaction data according to the number of input interactions;

[0073] Step B2: The blockchain terminal device obtains the number of output interactions in the interaction data, and obtains corresponding output interaction data according to the number of output interactions;

[0074] Step B3: The blockchain terminal device calculates the output interaction public key hash value in the output interaction data in turn according to a preset algorithm to obtain the output interaction address data;

[0075] Step B4: The blockchain terminal device obtains the interaction fee by subtracting the output interaction value from the interaction input value data, and determines whether the interaction fee is legal. If it is legal, it executes step B5. Otherwise, it returns an error response to the upper computer and ends.

[0076] Step B5: The blockchain terminal device compares the calculated output interaction address data with the non-receiver address data in the signature instruction in turn, queries the output interaction address data that is consistent with the non-receiver address data, and subtracts the output interaction value corresponding to the queried output interaction address data from the interaction input value data to obtain the interaction value.

[0077] Optionally, in this embodiment, determining whether the interaction fee is legal in step B4 specifically includes:

[0078] Step B4-1: The blockchain terminal device determines whether the interaction fee is greater than the seventh preset value, and if so, executes step B4-2, otherwise it is determined to be illegal;

[0079] Step B4-2: The blockchain terminal device determines whether the interaction fee is less than one-third of the interactive input numerical data. If so, execute step B5; otherwise, it is determined to be illegal.

[0080] Optionally, in this embodiment, step S1 further includes: when it is determined that the instruction type is a load last limited number of times instruction, executing step M;

[0081] Step M: The blockchain terminal device sets the limited number of times according to the last limited number of times instruction loaded, returns a successful setting response to the host computer, and returns to step S1.

[0082] Optionally, in this embodiment, step S4 specifically includes:

[0083] The blockchain terminal device obtains the second flag from the preset password-free operation information and determines whether the second flag is in a set state. If so, a key confirmation is required, otherwise no key confirmation is required.

[0084] Embodiment 2

[0085] Embodiment 2 of the present invention provides a method for password-free operation of a blockchain terminal device, comprising:

[0086] Step 101: When the blockchain terminal device receives the signature instruction sent by the host computer, it determines whether the user needs to enter a PIN code for verification. If yes, it executes step 102, otherwise it executes step 103;

[0087] Specifically, the signature instructions are:

[0088] 3f2323000f0000010f00000003abcada606d2f3434272f30272f30272f302f306d2f3434272f30272f30272f302f316d2f3434272f3 0272f30272f302f320100000003c9f3b07ebfca68fd1a6339d0808fbb013c90c6095fc93901ea77410103489ab700000000ffffffff c9f3b07ebfca68fd1a6339d0808fbb013c90c6095fc93901ea77410103489ab701000000 ffffffffc98620a6c40fc7b3a506ad79af339541762facd1dd80ff0881d773fb72b230da0 1000000ffffffff0200bd0105000000001976a914634228c26cf40a02a05db93f2f98b768a8e0e61b88acc096c7a603000 0001976a9147514080ab2fcac0764de3a77d10cb790c71c74c288ac000000001A3q9pDtR4h8wpvyb8SVpiNPpT8ZNbHY8h;

[0089] Among them: 3f 23 23 is the instruction header, 00 0f is the instruction id, 00 00 01 0f is the instruction length, expressed in hexadecimal, 271 bytes;

[0090] The following is the input interaction data: 00000003abcada60 is the interaction input value, 6d2f3434272f30272f30272f302f302f30 is the subkey index, 6d2f3434272f30272f30272f302f31 is the subkey index, 6d2f3434272f30272f30272f302f32 is the subkey index, 01000000 version number; 03 input interaction quantity 3;

[0091] c9f3b07ebfca68fd1a6339d0808fbb013c90c6095fc93901ea77410103489ab7 the hash value of this input interaction in its previous output interaction; 00000000 the sequence number of this input interaction in its previous output interaction; ff ff ff ff additional instruction bytes;

[0092] c9f3b07ebfca68fd1a6339d0808fbb013c90c6095fc93901ea77410103489ab7 the hash value of this input interaction in its previous output interaction; 01000000 the sequence number of this input interaction in its previous output interaction; ff ff ff ff additional instruction bytes;

[0093] c98620a6c40fc7b3a506ad79af339541762facd1dd80ff0881d773fb72b230da the hash value of the input interaction in its previous output interaction; 01000000 the sequence number of the input interaction in its previous output interaction; ff ff ff ff additional instruction bytes;

[0094] The following is the output interaction data: 02 output interaction quantity 2; 00bd010500000000 output interaction value; 19 output total number of bytes of public key: 25 bytes 76a9 additional instruction characters; 14 the output interaction public key hash value length; 634228c26cf40a02a05db93f2f98b768a8e0e61b output interaction public key hash value; 88ac additional instruction characters; c096c7a603000000 output interaction value; 19 output total number of bytes of public key: 25 bytes; 76a9 additional instruction characters; 14 the output interaction public key hash value length; 7514080ab2fcac0764de3a77d10cb790c71c74c2 output interaction public key hash value; 88ac additional instruction characters; 00000000 interaction lock time characters;

[0095] 1A3q9pDtR4h8wpvyb8SVpiNPpT8ZNbHY8h is the non-receiver address;

[0096] Specifically, in step 101, determining whether the user needs to enter a PIN code for verification is as follows:

[0097] Step A1: The blockchain terminal device obtains the first flag bit from the preset password-free operation information;

[0098] Step A2: The blockchain terminal device determines whether the first flag bit is in a set state, and if so, executes step 102, otherwise, executes step 103;

[0099] Step 102: The blockchain terminal device returns a PIN code verification response to the host computer. When receiving the PIN code verification instruction sent by the host computer, it determines whether the number of PIN code retry attempts is equal to the first preset value. If yes, the blockchain terminal device is locked and ends; otherwise, the PIN code is verified. If the verification is successful, step 109 is executed. If the verification fails, the number of PIN code retry attempts is updated by subtracting the eighth preset value from the number of PIN code retry attempts, and the process returns to step 102;

[0100] Specifically, the first preset value is 0; the eighth preset value is 1;

[0101] Specifically, the verification of the PIN code is as follows: the PIN code is obtained from the received verification PIN code instruction, and matched with the PIN code stored in the hardware main security zone of the blockchain terminal device. If the match is successful, the verification is successful, and if the match fails, the verification fails;

[0102] Step 103: The blockchain terminal device determines whether the limited amount is equal to the second preset value, and if so, executes step 104, otherwise, executes step 107;

[0103] Optionally, in this embodiment, before step 103, the process further includes: the blockchain terminal device obtains a limited amount from preset password-free operation information;

[0104] Specifically, the second preset value is 0xFFFFFFFFFFFFFFFF;

[0105] Step 104: The blockchain terminal device determines whether the limited number of times is equal to a third preset value, and if so, executes step 109, otherwise, executes step 105;

[0106] Specifically, the third preset value is 0xFFFFFFFF;

[0107] Optionally, in this embodiment, before step 104, the process further includes: the blockchain terminal device obtains a limited number of times from preset password-free operation information;

[0108] Step 105: The blockchain terminal device determines whether the current limited number of times is equal to the fourth preset value, and if so, executes step 106; otherwise, the limited number of times is updated and step 108 is executed;

[0109] Optionally, if the initial value of the limited number of times is a preset limited number of times, the fourth preset value is 0, and updating the limited number of times is to update the limited number of times by subtracting the fifth preset value from the current limited number of times;

[0110] Optionally, if the initial value of the limited number is 0, the fourth preset value is the preset limited number, and updating the limited number is to update the limited number by adding the current limited number to the fifth preset value;

[0111] Specifically, the fifth preset value is 1;

[0112] Step 106: The blockchain terminal device returns a response to the host computer indicating that the limited number of times reaches the threshold and that the PIN code needs to be verified. When receiving the verification PIN code instruction sent by the host computer, it determines whether the number of PIN code retry attempts is equal to the first preset value. If so, the blockchain terminal device is locked and ends; otherwise, the PIN code is verified. If the verification is successful, step 108 is executed. If the verification fails, the number of PIN code retry attempts is updated by subtracting the eighth preset value from the number of PIN code retry attempts, and the process returns to step 106;

[0113] Optionally, in this embodiment, after the blockchain terminal device returns a response to the host computer indicating that the number of limited times has reached the threshold and that the PIN code needs to be verified, the process further includes: prompting the user whether to load the last limited times method, if yes, the host computer sends an instruction to load the last limited times to the blockchain terminal device, and the blockchain terminal device sets the limited times according to the instruction to load the last limited times, and returns a successful setting response to the host computer;

[0114] Optionally, in this embodiment, step 106 further includes: receiving a load last limited number of times instruction sent by a host computer;

[0115] Specifically, the verification PIN code command sent by the host computer is 3f 23 23 00 13 00 00 00 06 0a 043533 31 39;

[0116] Specifically, the verification of the PIN code is as follows: the PIN code is obtained from the received verification PIN code instruction, and matched with the PIN code stored in the hardware main security zone of the blockchain terminal device. If the match is successful, the verification is successful, and if the match fails, the verification fails;

[0117] Step 107: The blockchain terminal device parses the signature instruction to obtain the interactive input value and the interactive data, obtains the interactive value according to the interactive input value and the interactive data, and determines whether the interactive value is less than the limited amount. If yes, execute step 105, otherwise execute step 102;

[0118] Specifically, the interaction data includes: interaction version number, input interaction number, input interaction data, output interaction number, output interaction data, and interaction lock time;

[0119] Optionally, in this embodiment, obtaining the interaction value according to the interaction input value and the interaction data in step 107 specifically includes:

[0120] Step B1: The blockchain terminal device obtains the number of input interactions in the interaction data, and obtains corresponding input interaction data according to the number of input interactions;

[0121] Specifically, the input interaction data includes: a hash value of the input interaction in its previous output interaction, a sequence number of the input interaction in its previous output interaction, and a subkey index;

[0122] Specifically, the input interaction data is:

[0123]

[0124] Step B2: The blockchain terminal device obtains the number of output interactions in the interaction data, and obtains corresponding output interaction data according to the number of output interactions;

[0125] Specifically, the output interaction data includes: output interaction value, output interaction sequence number and output interaction public key hash value;

[0126] Specifically, the output interaction data is:

[0127]

[0128] Step B3: The blockchain terminal device calculates the output interaction public key hash value in the output interaction data in turn according to a preset algorithm to obtain the output interaction address data;

[0129]

[0130] Step B4: The blockchain terminal device obtains the interaction fee by subtracting the output interaction value from the interaction input value data, and determines whether the interaction fee is legal. If it is legal, it executes step B5. Otherwise, it returns an error response to the upper computer and ends.

[0131] Optionally, in this embodiment, determining whether the interaction fee is legal specifically includes:

[0132] Step B4-1: The blockchain terminal device determines whether the interaction fee is greater than the seventh preset value. If yes, execute step B4-2; otherwise, return an error response to the upper computer and end;

[0133] Specifically, the seventh preset value is 0;

[0134] Step B4-2: The blockchain terminal device determines whether the interaction fee is less than one third of the interactive input numerical data. If so, execute step B5; otherwise, return an error response to the upper computer and end;

[0135] Step B5: The blockchain terminal device compares the calculated output interactive address data with the non-receiver address data in the signature instruction in turn, queries the output interactive address data that is consistent with the non-receiver address data, and obtains the interactive value by subtracting the interactive input value data from the output interactive value corresponding to the queried output interactive address data;

[0136] Step B6: The blockchain terminal device determines whether the interaction value is less than the limit, if yes, executes step 105, otherwise executes step 102;

[0137] Step 108: The blockchain terminal device determines whether a key press is required for confirmation. If yes, execute step 109; otherwise, execute step 110;

[0138] Optionally, in this embodiment, step 108 is specifically as follows:

[0139] Step 108-1: The blockchain terminal device obtains the second flag bit from the preset password-free operation information;

[0140] Step 108-2: The blockchain terminal device determines whether the second flag bit is in a set state, if yes, executes step 109, otherwise executes step 110;

[0141] Step 109: The blockchain terminal device screen displays the interaction value and waits for user confirmation. When receiving a user trigger, the user key type is determined. If it is a confirmation key, step 110 is executed. If it is a cancel key, the interaction is canceled, the limited number of times is updated, and the process ends.

[0142] Optionally, updating the limited number of times is to update the limited number of times by adding a fifth preset value to the current limited number of times;

[0143] Optionally, updating the limited number of times is to update the limited number of times by subtracting a fifth preset value from the current limited number of times;

[0144] Step 110: The blockchain terminal device signs the data to be signed to obtain a signature result, generates an interaction credential based on the signature result, and returns the interaction credential to the host computer;

[0145] Optionally, in this embodiment, after step 110, the process further includes clearing the limited number of times;

[0146] Optionally, in step 110 of this embodiment, the blockchain terminal device signs the data to be signed to obtain a signature result, generates an interaction credential according to the signature result, and returns the interaction credential to the host computer as follows:

[0147] Step 110-1: The blockchain terminal device obtains the subkey index in the interaction data;

[0148] Step 110-2: The blockchain terminal device obtains a master key pre-stored in a secure storage area and generates a public key based on the master key;

[0149] Specifically, the blockchain terminal device performs an ECC point multiplication operation on the master key and the elliptic curve base point to obtain the public key;

[0150] Step 110-3: The blockchain terminal device derives a sub-key pair according to the public key and the sub-key index through a key derivation algorithm, and obtains the sub-private key in the sub-key pair;

[0151] Specifically, the public key and the current child key index are concatenated in order, the parent chain code is used as the hash key, the hash value of the concatenated data is calculated according to the preset algorithm, the child chain code is intercepted according to the hash value, and the ECC addition modulus operation is performed on the intercepted remaining data. If the operation result is not the preset value, the operation result is used as the child private key, and the ECC point multiplication operation is performed on the child private key to obtain the child public key;

[0152]

[0153] Step 110-4: The blockchain terminal device generates data to be signed according to the input interaction data and the output interaction data in the signature instruction, and signs the data to be signed using the sub-private key to generate a signature result;

[0154]

[0155]

[0156] Specifically, the data to be signed includes: the sequential concatenation of the hash values ​​of all input interactions in their previous output interactions and the serial numbers of all input interactions in their previous output interactions, the sub-public key hash value corresponding to the input interaction, the numerical values ​​of all output interactions and the sequential concatenation of the public key hash values ​​of all output interactions;

[0157] Specifically, the sub-private key signs the signature data using the elliptic curve digital signature algorithm. For example, in this embodiment, the 256-bit sub-private key "6c5544797a91115dc3330ebd003851d239a706ff2aa2ab70039c5510ddf06420" uses the elliptic curve digital signature algorithm to sign the data c9f3b07ebfca68fd1a6339d0808fbb013c90c6095fc93901ea77410103489ab7000000001976a9149bcc25cea896e5ebf5e38850a2038e215f2393cb88acffffffffc9f3b07ebfca68fd1a6339d d0808fbb013c90c6095fc93901ea77410103489ab701000000ffffffffc98620a6c40fc 7b3a506ad79af339541762facd1dd80ff0881d773fb72b230da01000000ffffffff00bd 0105000000001976a914634228c26cf40a02a05db93f2f98b768a8e0e61b88acc096c7a6030000001976a9147514080ab2fcac0764de3a77d10cb790c71c74c288ac is signed to get the signature result.

[0158] The generated signature result is

[0159] "048aefd78bba80e2d1686225b755dacea890c9ca1be10ec98173d7d5f2fefb bf881a6e918f3b051f8aaaa3fcc18bbf65097ce8d30d5a7e5ef8d1005eaafd4b3fbe”;

[0160] Step 110-5: The blockchain terminal device obtains the sub-public key in the sub-key pair, and generates an interactive credential based on the sub-public key and the signature result;

[0161] Specifically, the blockchain terminal device calculates the interactive credential length according to the sub-public key length, the sub-public key, the signature result length and the signature result; and sequentially concatenates the interactive credential length, the sub-public key length, the sub-public key, the signature result length and the signature result to generate the interactive credential; and sequentially concatenates all the interactive credentials to obtain a complete interactive credential;

[0162] For example, the interactive credentials obtained by the first signature in this embodiment are specifically:

[0163] "0X8a473044022055bac1856ecbc377dd5e869b1a84ed1d5228c987b098c095030c124 31a4d5249022055523130a9d0af5fc27828aba43b464ecb1991172ba2a509b5fbd6cac9 7ff3af0141048aefd78bba80e2d1686225b755dacea890c9ca1be10ec98173d7d5f2fe fbbf881a6e918f3b051f8aaaa3fcc18bbf65097ce8d30d5a7e5ef8d1005eaafd4b3fbe”

[0164] Among them, 8a: indicates that the length of the interaction credential is 1104 bits, 8a=138 bytes=1104 bits, and the 16-bit data of "8a" is not included in the total interaction credential length.

[0165] 47: indicates that the length of the sub-public key is 568 bits, 47 = 71 bytes = 568 bits

[0166] The child public key is:

[0167] 0X3044022055bac1856ecbc377dd5e869b1a84ed1d5228c987b098c095030c12431a4d5249022062723130a9d0af5fc27828aba43b464ecb1991172ba2a509b5fbd6cac97ff3af01, 568 bits in total

[0168] 41: indicates the length of the signature result, 41 = 65 bytes = 520 bits

[0169] The signature result is:

[0170] 0X048aefd78bba80e2d1686225b755dacea890c9ca1be10ec98173d7d5f2fefbbf881a6e918f3b051f8aaaa3fcc18bbf65097ce8d30d5a7e5ef8d1005eaafd4b3fbe, 520 bits in total;

[0171] This embodiment requires three signatures, generating a total of three interaction credentials. The spliced ​​interaction credentials are: 8a473044022055bac1856ecbc377dd5e869b1a84ed1d5228c987b098c095030c12431a4d5249022055523130a9d0af5fc27828aba43b464ecb1991172ba2a509b5fbd6ca c97ff3af0141048aefd78bba80e2d1686225b755dacea890c9ca1be10ec98173d7d5f2fefbbf881a6e918f3b051f8aaaa3fcc1 8bbf65097ce8d30d5a7e5ef8d1005eaafd4b3fbe8a47304402206b993231adec55e6085e75f7dc5ca6c19e42e744cd60abaff9 57b1c352b3ef9a022022a22fec37dfa2c646c78d9a0753d56cb4393e8d0b22dc580ef1aa6cccef208d0141042ff65bd6b3ef04 253225405ccc3ab2dd926ff2ee48aac210819698440f35d785ec3cec92a51330eb0c76cf49e9e474fb9159ab41653a9c1725c0 31449d31026a8b483045022040a5d957e087ed61e80f1110bcaf4901b5317c257711 a6cbc54d6b98b6a8563f02210081e3697031fe82774b8f44dd3660901e61ac5a99bf f2d0efc83ad261da5b4f1d014104a7d1a57e650613d3414ebd59e3192229dc09d3613e547bdd1f 83435cc4ca0a11c679d96456cae75b1f5563728ec7da1c1f42606db15bf554dbe8a829f3a8fe2;

[0172] Step 110-6: The blockchain terminal device returns the interaction credentials to the host computer.

[0173] Embodiment 3

[0174] Embodiment 3 of the present invention provides a method for setting a password-free operation of a blockchain terminal device, including:

[0175] Step 201: The host computer sends a request for querying password-free operation information to the blockchain terminal device;

[0176] Step 202: When the blockchain terminal device receives the request for querying the secret-free operation information sent by the host computer, it obtains the secret-free operation information in the storage area and returns the secret-free operation information to the host computer;

[0177] Specifically, the password-free operation information includes the first flag status, the second flag status, the limited amount and the limited number of times; the first flag is used to determine whether the user needs to enter a PIN code for verification. When the first flag is 1, the user needs to enter a PIN code for verification, and when the first flag is 0, the user does not need to enter a PIN code for verification; the second flag is used to determine whether to use key confirmation. When the second flag is 1, key confirmation is used, and when the second flag is 0, key confirmation is not used;

[0178] Step 203: When the host computer receives the password-free operation information returned by the blockchain terminal device, it determines whether it is the first preset data. If yes, it sends a password-free operation start instruction to the blockchain terminal device and executes step 205; otherwise, it executes step 204;

[0179] Specifically, the first preset data is the first flag bit = 1, the second flag bit = 1, the limit amount = 0, and the limit number of times = 0;

[0180] Step 204: The host computer pops up a window to prompt the user that the small amount password-free operation and the specific password-free operation mode have been enabled, and determines whether the user has changed the password-free operation mode. If yes, a password-free operation enablement instruction is sent to the blockchain terminal device, and step 205 is executed. Otherwise, the process ends.

[0181] Step 205: The blockchain terminal device returns a PIN code verification response to the host computer;

[0182] Step 206: The host computer sends a PIN code verification instruction to the blockchain terminal device;

[0183] Specifically, the host computer sends the verification PIN code command 3f 23 23 00 13 00 00 00 06 0a 04 353331 39;

[0184] Step 207: The blockchain terminal device determines whether the number of PIN code retry times is the sixth preset value. If yes, the blockchain terminal device returns the blockchain terminal device to the host computer to lock. Otherwise, the blockchain terminal device verifies the PIN code. If the verification is successful, the PIN verification success response is returned to the host computer. If the verification fails, the number of PIN code retry times is subtracted from the eighth preset value to update the number of PIN code retry times, and step 205 is executed.

[0185] Specifically, the sixth preset value is 0; the eighth preset value is 1;

[0186] Step 208: The host computer sets the small amount password-free operation according to the user settings, combines the password-free operation information into a password-free operation setting instruction, and sends the password-free operation setting instruction to the blockchain terminal device;

[0187] Specifically, the password-free operation command is set to 3f 23 23 00 19 00xx 60 80 68 81 70 8000000000 001E 8480 78 80 00 00 00 0a; 6080 means that the user does not need to enter a PIN code for verification; 6881 means turning on screen display and button confirmation; 70 80 00 00 00 00 00 1E 84 80 means limit; 7880 00 0000 0a means the number of times is limited to 10 times;

[0188] Specifically, step 208 is as follows:

[0189] Step 208-1: Determine whether the user input PIN code verification is triggered, if yes, set the first flag and execute step 208-2, otherwise reset the first flag and execute step 208-4;

[0190] Specifically, when the user is triggered to enter a PIN code for verification, the first flag bit is set to 1, and when the user is triggered not to enter a PIN code for verification, the first flag bit is set to 0;

[0191] Step 208-2: Determine whether the user triggers the key confirmation. If yes, a pop-up window displays that the user operation mode is not password-free but requires key confirmation, the second flag is set, and step 208-12 is executed. Otherwise, a pop-up window displays that the user operation mode is not password-free and does not require key confirmation, the second flag is reset, and step 208-12 is executed.

[0192] Specifically, when the user triggers the use of a button to confirm, the second flag bit is set to 1, and when the user triggers the use of a button to confirm, the second flag bit is set to 0;

[0193] Step 208-3: Determine whether the user chooses to limit the amount, if yes, execute step 208-4, otherwise execute step 208-8;

[0194] Step 208-4: Determine whether the user selects a limited number of times. If yes, prompt the user to enter the password-free limited amount and the limited number of times, and execute step 208-5. Otherwise, execute step 208-6.

[0195] Step 208-5: Determine whether the user triggers the key confirmation. If yes, display the user's password-free operation mode as password-free limited quota limited times and requires key confirmation, set the second flag, and execute step 208-12. Otherwise, display the user's password-free operation mode as password-free limited quota limited times but does not require key confirmation, reset the second flag, and execute step 208-12.

[0196] Specifically, when the user triggers the use of a button to confirm, the second flag bit is set to 1, and when the user triggers the use of a button to confirm, the second flag bit is set to 0;

[0197] Step 208-6: prompt and wait for the user to input the password-free limit, and then execute step 208-7;

[0198] Specifically, the password-free limit is set, which is represented by an 8-byte hexadecimal number as 0x00000000001E8480;

[0199] Step 208-7: Determine whether the user triggers the key confirmation. If yes, display the user's password-free operation mode as a password-free limited quota and a key confirmation is required, set the second flag, and execute step 208-12. Otherwise, display the user's password-free operation mode as a password-free limited quota but no key confirmation is required, reset the second flag, and execute step 208-12.

[0200] Specifically, when the user triggers the use of a button to confirm, the second flag bit is set to 1, and when the user triggers the use of a button to confirm, the second flag bit is set to 0;

[0201] Step 208-8: Determine whether the number of times is limited, if yes, execute step 208-9, otherwise execute step 208-11;

[0202] Step 208-9: prompt and wait for the user to input the number of password-free times, and then execute step 208-10;

[0203] Step 208-10: Determine whether the user triggers the need for key confirmation. If yes, display the user's password-free operation mode as a password-free limited number of times and requiring key confirmation, set the second flag, and execute step 208-12. Otherwise, display the user's password-free operation mode as a password-free limited number of times but requiring no key confirmation, reset the second flag, and execute step 208-12.

[0204] Specifically, when the user triggers a key confirmation, the second flag bit is set to 1; when the user triggers a key confirmation, the second flag bit is set to 0;

[0205] Step 208-11: Prompt the user that the risk of interaction is high when there is no limit on the number of times and the amount during password-free operation, and a pop-up window prompts the user whether to enable the user to enter the PIN code for verification. When the user is prompted to enable the user to enter the PIN code for verification, it is displayed that the password-free payment is not enabled, and the user needs to enter the PIN during interaction and needs to press the button to confirm, and step 208-12 is executed. When the user is prompted not to enable the user to enter the PIN code for verification, it is displayed that the password-free payment is enabled with no limit on the amount and the number of times, and the user does not need to enter the PIN during interaction but needs to press the button to confirm, and step 208-12 is executed;

[0206] Step 208-12: The host computer composes the password-free operation information according to the first flag bit, the second flag bit, the limited amount and the limited number of times, composes the password-free operation instruction according to the password-free operation information, and sends the password-free operation instruction to the blockchain terminal device;

[0207] Step 209: The blockchain terminal device receives the password-free operation setting instruction sent by the host computer, obtains the password-free operation information and displays it on the screen to wait for user confirmation;

[0208] Step 210: When the blockchain terminal device receives a trigger from the user, it determines the key type. If it is a confirmation key, it executes step 211. If it is a cancel key, it returns an error response to the host computer;

[0209] Step 211: The blockchain terminal device resets the non-confidential operation information, and sets the non-confidential operation information in the blockchain terminal device according to the non-confidential operation information in the received non-confidential operation setting instruction;

[0210] Step 212: The blockchain terminal device determines whether the password-free operation information is the second preset data. If yes, the setting fails, and the password-free operation information is reset to the first preset data, and the process ends. Otherwise, a setting success response is returned to the host computer, and step 213 is executed.

[0211] Specifically, the second preset data is: first flag bit=0, second flag bit=0, limit amount=0xFFFFFFFFFFFFFFFF; limit number=0xFFFFFFFF;

[0212] Step 213: The host computer prompts the user that the setting is successful, and the process ends.

[0213] Embodiment 4

[0214] Embodiment 4 of the present invention provides a method for password-free operation of a blockchain terminal device, such as Figure 2 As shown, including:

[0215] Step Q1: When the blockchain terminal device receives the instruction sent by the host computer, it determines the instruction type. If it is a signature instruction, it executes step Q2; if it is a PIN code verification instruction, it executes step Q6;

[0216] Step Q2: The blockchain terminal device determines whether the current limited number of times is equal to the threshold. If so, it saves the unfinished mark, returns the response that the limited number of times reaches the threshold and the verification PIN code is required to the host computer, and executes step Q1. Otherwise, it executes step Q3.

[0217] Step Q3: The blockchain terminal device determines whether a key press is required, if yes, executes step Q4, otherwise executes step Q5;

[0218] Step Q4: The blockchain terminal device displays the authorization information in the signature instruction and waits for the user to operate. If a user confirmation operation is received, step Q5 is executed. If a user cancellation operation is received, the interaction is canceled and ends.

[0219] Step Q5: The blockchain terminal device queries the key index according to the sub-public key in the signature instruction, calculates the sub-private key according to the queried key index, signs the authorization information with the sub-private key to obtain the signature result, generates the interaction credential according to the signature result, returns the interaction credential to the host computer, and returns to step Q1;

[0220] Step Q6: The blockchain terminal device verifies the PIN code. If the verification is successful, step Q7 is executed. If the verification fails, the process ends.

[0221] Step Q7: The blockchain terminal device determines whether the unfinished mark exists. If yes, execute step Q3. Otherwise, return the verification PIN code successfully to the host computer and execute step Q1.

[0222] When it is determined in step Q2 that the current limited number of times is not equal to the threshold and when it is determined in step Q7 that an unfinished mark exists, it also includes: updating the limited number of times; after the interaction is cancelled, it also includes: updating the limited number of times.

[0223] Optionally, in this embodiment, before executing step Q2, the process also includes: the blockchain terminal device determines whether the password-free operation is enabled, and if so, executes step Q2; otherwise, it returns a PIN code verification response to the host computer, and executes step Q1.

[0224] Optionally, in this embodiment, the blockchain terminal device determines whether the password-free operation is enabled by:

[0225] Step A1: The blockchain terminal device obtains the first flag bit from the preset password-free operation information;

[0226] Step A2: The blockchain terminal device determines whether the first flag bit is in a set state. If so, the password-free operation is not enabled; otherwise, the password-free operation is enabled.

[0227] Optionally, in this embodiment, if the initial value of the limited number of times is a preset limited number of times, when it is determined in step Q2 that the current limited number of times is not equal to the threshold value and when it is determined in step Q7 that the unfinished mark exists, the updated limited number of times is specifically: the result of subtracting the fifth preset value from the current limited number of times is updated; the updated limited number of times after the interaction is canceled is specifically: the result of adding the fifth preset value to the current limited number of times is updated;

[0228] If the threshold is a preset limit number of times, when it is determined in step Q2 that the current limit number is not equal to the threshold and when it is determined in step Q7 that an incomplete mark exists, the updated limit number of times is specifically updated as follows: the current limit number of times plus the fifth preset value is added to update the limit number of times; the updated limit number of times after the interaction is canceled is specifically updated as follows: the current limit number of times minus the fifth preset value is subtracted to update the limit number of times.

[0229] Optionally, in this embodiment, the blockchain terminal device verifies the PIN code specifically by obtaining the PIN code from the received verification PIN code instruction, and matching the obtained PIN code with the PIN code stored in the hardware main security area of ​​the blockchain terminal device. If the match is successful, the verification is successful, and if the match fails, the verification fails.

[0230] Optionally, in this embodiment, step Q1 further includes: when it is determined that the instruction type is a load last limited number of times instruction, executing step N;

[0231] Step N: The blockchain terminal device sets the limited number of times according to the instruction of the last password-free number, returns a successful setting response to the host computer, and returns to step Q1.

[0232] Optionally, in this embodiment, step Q3 specifically includes:

[0233] The blockchain terminal device obtains the second flag from the preset password-free operation information and determines whether the second flag is in a set state. If so, a key confirmation is required, otherwise no key confirmation is required.

[0234] Optionally, in the present embodiment, before the blockchain terminal device queries the key index according to the sub-public key, the blockchain terminal device also includes: determining whether the sub-public key is valid, and if so, querying the key index according to the sub-public key, otherwise reporting an error.

[0235] Embodiment 5

[0236] Embodiment 5 of the present invention provides a method for password-free operation of a blockchain terminal device, including:

[0237] Step 301: When the blockchain terminal device receives the signature instruction sent by the host computer, it determines whether the user needs to enter a PIN code for verification. If yes, it executes step 302, otherwise it executes step 303;

[0238] Specifically, the signature instruction is 3f 23 23 00 26 00 00 00 27 08ac 80 80 80 08 08 808080 80 08 08 80 80 80 80 08 08 00 08 00 12 04 61 68 6f 79 1a 07 42 6974 63 6f69 6e 20 00; 3f 23 23 is the instruction header; 00 26 is the instruction id, indicating that the instruction is a signature instruction; 00 00 0027 represents the instruction length of 39 bytes, 08ac 80 80 80 08 08 8080 80 80 08 08 80 80 80 8008 08 00 08 00 12 04 61 68 6f 79 1a 07 42 6974 63 6f 69 6e 20 00 is the authorization information;

[0239] Specifically, in step 301, determining whether the user needs to enter a PIN code for verification is as follows:

[0240] Step A1: The blockchain terminal device obtains the first flag bit from the preset password-free operation information;

[0241] Step A2: The blockchain terminal device determines whether the first flag bit is in a set state, and if so, executes step 302, otherwise, executes step 303;

[0242] Step 302: The blockchain terminal device returns a PIN code verification response to the host computer. When receiving the PIN code verification instruction sent by the host computer, it determines whether the number of PIN code retry attempts is equal to the first preset value. If yes, the blockchain terminal device is locked and ends; otherwise, the PIN code is verified. If the verification is successful, step 306 is executed. If the verification fails, the number of PIN code retry attempts is updated by subtracting the eighth preset value from the number of PIN code retry attempts, and the process returns to step 302;

[0243] Specifically, the first preset value is 0; the eighth preset value is 1;

[0244] Step 303: The blockchain terminal device determines whether the limited number of times is equal to a third preset value, and if so, executes step 306, otherwise, executes step 304;

[0245] Specifically, the third preset value is 0xFFFFFFFF;

[0246] Optionally, in this embodiment, before step 303, the process further includes: the blockchain terminal device obtains a limited number of times from preset password-free operation information;

[0247] Step 304: The blockchain terminal device determines whether the current limited number of times is equal to the fourth preset value, and if so, executes step 305; otherwise, the limited number of times is updated and step 306 is executed;

[0248] Optionally, if the initial value of the limited number of times is a preset limited number of times, the fourth preset value is 0, and updating the limited number of times is to update the limited number of times by subtracting the fifth preset value from the current limited number of times;

[0249] Optionally, if the initial value of the limited number is 0, the fourth preset value is the preset limited number, and updating the limited number is to update the limited number by adding the current limited number to the fifth preset value;

[0250] Specifically, the fifth preset value is 1;

[0251] Step 305: The blockchain terminal device returns a response to the host computer indicating that the limited number of times reaches the threshold and that the PIN code needs to be verified. When receiving the PIN code verification instruction sent by the host computer, it determines whether the number of PIN code retry attempts is equal to the first preset value. If so, the blockchain terminal device is locked and ends; otherwise, the PIN code is verified. If the verification is successful, step 306 is executed. If the verification fails, the number of PIN code retry attempts is updated by subtracting the eighth preset value from the number of PIN code retry attempts, and the process returns to step 305;

[0252] Optionally, in this embodiment, after the blockchain terminal device returns a response to the host computer indicating that the number of limited times has reached the threshold and that the PIN code needs to be verified, the process further includes: prompting the user whether to load the last limited times method, if yes, the host computer sends an instruction to load the last limited times to the blockchain terminal device, and the blockchain terminal device sets the limited times according to the instruction to load the last limited times, and returns a successful setting response to the host computer;

[0253] Step 306: The blockchain terminal device determines whether a key press is required, if yes, executes step 307, otherwise executes step 308;

[0254] Optionally, in this embodiment, step 306 is specifically:

[0255] Step 306-1: The blockchain terminal device obtains the second flag bit from the preset password-free operation information;

[0256] Step 306-2: The blockchain terminal device determines whether the second flag bit is in a set state, if yes, executes step 307, otherwise executes step 308;

[0257] Step 307: The blockchain terminal device screen displays the authorization information in the signature instruction and waits for user confirmation. When receiving a user trigger, the user key type is determined. If it is a confirmation key, step 308 is executed. If it is a cancel key, the interaction is canceled, the limited number of times is updated, and the process ends.

[0258] Optionally, updating the limited number of times is to update the limited number of times by adding a fifth preset value to the current limited number of times;

[0259] Optionally, updating the limited number of times is to update the limited number of times by subtracting a fifth preset value from the current limited number of times;

[0260] Step 308: The blockchain terminal device signs the authorization information in the signature instruction to obtain a signature result, generates an interaction credential based on the signature result, and returns the interaction credential to the host computer;

[0261] Optionally, in this embodiment, after step 308, the method further includes: clearing the limited number of times;

[0262] Optionally, in this embodiment, in step 308, the blockchain terminal device signs the authorization information in the signature instruction to obtain a signature result, generates an interaction credential based on the signature result, and returns the interaction credential to the host computer as follows:

[0263] Step 308-1: The blockchain terminal device obtains authorization information and sub-public key from the signature instruction;

[0264] Specifically, the authorization information is 01 00 00 00 01c9 f3 b0 7e bf ca 68fd 1a 63 39d0 808fbb 01 3c 90c6 09 5f c9 39 01ea 77 41 01 03 48 9a b7 00 00 00 00ff ff ff ff 0100bd 01 05 00 00 00 00 19 76a9 14 63 42 28c2 6c f4 0a 02a0 5db9 3f 2f 98b768a8 e0 e6 1b 88ac 00 00 00 00;

[0265] Specifically, the sub-public key is 1HZwkjkeaoZfTSaJxDw6aKkxp45agDiEzN;

[0266] Step 308-2: The blockchain terminal device determines whether the sub-public key is valid. If so, step 308-3 is executed. Otherwise, an error is reported.

[0267] Step 308-3: The blockchain terminal device queries the corresponding key index from the secure storage area according to the sub-public key;

[0268] Specifically, the key index is m / 44' / 0' / 0' / 0 / 0;

[0269] Step 308-4: The blockchain terminal device calculates the sub-private key according to the queried key index;

[0270] Specifically, the child private key is

[0271] 0X6c5544797a91115dc3330ebd003851d239a706ff2aa2ab70039c5510ddf06420;

[0272] Step 308-5: The blockchain terminal device signs the authorization information using the sub-private key to obtain a signature result;

[0273] Specifically, the signature result is JKNXqIV / 1oGUdI3G sAgjmKX3 Yfc0g+y0 2UXNvDf895v+TObwVUO2dv2g aC6 / UXNU TdnNXrli FjfbDNa5 vhymuhQ=;

[0274] Step 308-6: The blockchain terminal device generates an interaction credential based on the signature result and returns the interaction credential to the host computer;

[0275] Specifically, the blockchain terminal device concatenates the interaction credential length, the signature result length, and the signature result sequence to generate the interaction credential;

[0276] Specific, the interaction credentials are 3f 23 23 00 28 00 00 00 67 0a 22 31 33 79 36 54 5341 44 68 79 42 63 57 61 79 6f 4a 42 6b 56 70 63 65 6e 4e 45 4a 4a 4e 69 77 6453 47 12 41 1f 1b 92af 05 f2 cc 12 96 4d 75 0a ba b5 d2 f1 1e 1b cd ca 96b7d7 88 aa a5 3a 54 5d 16f2 06 5c 66 9e e0 c6 db 01c8 c0 79 84 1b aa e1 b1 6bc9 6b 85f2 05 83 0b 4f c7 ff 2e 63 31 fc 61e5 e5.

[0277] Embodiment 6

[0278] Embodiment 6 of the present invention provides a method for setting a password-free operation of a blockchain terminal device, including:

[0279] Step 401: The host computer sends a request for querying password-free operation information to the blockchain terminal device;

[0280] Step 402: When the blockchain terminal device receives the request for querying the secret-free operation information sent by the host computer, it obtains the secret-free operation information in the storage area and returns the secret-free operation information to the host computer;

[0281] Specifically, the password-free operation information includes a first flag bit state, a second flag bit state, and a limited number of times; wherein the first flag bit is used to determine whether the user needs to enter a PIN code for verification. When the first flag bit is 1, the user needs to enter a PIN code for verification, and when the first flag bit is 0, the user does not need to enter a PIN code for verification; the second flag bit is used to determine whether to use a key confirmation. When the second flag bit is 1, the key confirmation is used, and when the second flag bit is 0, the key confirmation is not used;

[0282] Step 403: When the host computer receives the password-free operation information returned by the blockchain terminal device, it determines whether it is the first preset data. If it is, it sends an instruction to enable the password-free operation to the blockchain terminal device and executes step 405. Otherwise, it executes step 404.

[0283] Specifically, the first preset data is the first flag bit=1, the second flag bit=1, and the limited number of times=0;

[0284] Step 404: The host computer pops up a window to prompt the user that the small amount password-free operation and the specific password-free operation mode have been enabled, and determines whether the user has changed the password-free operation mode. If yes, a password-free operation enablement instruction is sent to the blockchain terminal device, and step 405 is executed. Otherwise, the process ends.

[0285] Step 405: The blockchain terminal device returns a PIN code verification response to the host computer;

[0286] Step 406: The host computer sends a PIN code verification instruction to the blockchain terminal device;

[0287] Specifically, the host computer sends the verification PIN code command 3f 23 23 00 13 00 00 00 06 0a 04 353331 39;

[0288] Step 407: The blockchain terminal device determines whether the number of PIN code retry attempts is the sixth preset value. If yes, the blockchain terminal device returns the blockchain terminal device to the host computer to lock. Otherwise, the blockchain terminal device verifies the PIN code. If the verification is successful, the PIN verification success response is returned to the host computer. If the verification fails, the number of PIN code retry attempts is subtracted from the eighth preset value to update the number of PIN code retry attempts, and step 405 is executed.

[0289] Specifically, the sixth preset value is 0; the eighth preset value is 1;

[0290] Step 408: The host computer sets the password-free operation according to the user setting, composes the password-free operation information into a password-free operation setting instruction, and sends the password-free operation setting instruction to the blockchain terminal device;

[0291] Specifically, the password-free operation command is set to 3f 23 23 00 19 00xx 60 80 68 81 78 80 00 00000a; 6080 means that the user does not need to enter a PIN code for verification; 6881 means turning on screen display and key confirmation; 78 8000 00 00 0a means the number of times is limited to 10 times;

[0292] Specifically, step 408 is as follows:

[0293] Step 408-1: Determine whether the user input PIN code verification is triggered, if yes, set the first flag and execute step 408-2, otherwise reset the first flag and execute step 408-3;

[0294] Specifically, when the user is triggered to enter a PIN code for verification, the first flag bit is set to 1, and when the user is triggered not to enter a PIN code for verification, the first flag bit is set to 0;

[0295] Step 408-2: Determine whether the user triggers the key confirmation. If yes, a pop-up window displays that the user operation mode is not password-free but requires key confirmation, the second flag is set, and step 408-6 is executed. Otherwise, a pop-up window displays that the user operation mode is not password-free and does not require key confirmation, the second flag is reset, and step 408-6 is executed.

[0296] Specifically, when the user triggers the use of a button to confirm, the second flag bit is set to 1, and when the user triggers the use of a button to confirm, the second flag bit is set to 0;

[0297] Step 408-3: Determine whether the user selects a limited number of times. If yes, prompt the user to enter the limited number of times without password and execute step 408-4. Otherwise, execute step 408-5.

[0298] Step 408-4: Determine whether the user triggers the key confirmation. If yes, display the user's password-free operation mode as a password-free limited number of times and requiring key confirmation, set the second flag, and execute step 408-6. Otherwise, display the user's password-free operation mode as a password-free limited number of times but requiring no key confirmation, reset the second flag, and execute step 408-6.

[0299] Specifically, when the user triggers the use of a button to confirm, the second flag bit is set to 1, and when the user triggers the use of a button to confirm, the second flag bit is set to 0;

[0300] Step 408-5: Prompt the user that the risk of unlimited number of interactions during password-free operation is high, and a pop-up window prompts the user whether to enable the user to enter the PIN code verification. When the user is prompted to enable the user to enter the PIN code verification, it is displayed that the password-free payment is not enabled, and the user needs to enter the PIN during interaction and needs to press the button to confirm, and execute step 408-6. When the user is prompted not to enable the user to enter the PIN code verification, it is displayed that the password-free payment is enabled and the number of interactions is unlimited. The user does not need to enter the PIN during interaction but needs to press the button to confirm, and execute step 408-6;

[0301] Step 408-6: The host computer composes the password-free operation information according to the first flag bit, the second flag bit and the limited number of times, composes the password-free operation instruction according to the password-free operation information, and sends the password-free operation instruction to the blockchain terminal device;

[0302] Step 409: The blockchain terminal device receives the password-free operation setting instruction sent by the host computer, obtains the password-free operation information and displays it on the screen to wait for user confirmation;

[0303] Step 410: When the blockchain terminal device receives a trigger from the user, it determines the key type. If it is a confirmation key, it executes step 411. If it is a cancel key, it returns an error response to the host computer;

[0304] Step 411: The blockchain terminal device resets the non-confidential operation information, and sets the non-confidential operation information in the blockchain terminal device according to the non-confidential operation information in the received non-confidential operation setting instruction;

[0305] Step 412: The blockchain terminal device determines whether the password-free operation information is the second preset data. If yes, the setting fails, and the password-free operation information is reset to the first preset data, and the process ends. Otherwise, a setting success response is returned to the host computer, and step 413 is executed.

[0306] Specifically, the second preset data is the first flag bit=0, the second flag bit=0, and the limited number of times=0xFFFFFFFF;

[0307] Step 413: The host computer prompts the user that the setting is successful, and the process ends.

[0308] Embodiment 7

[0309] Embodiment 7 of the present invention provides a device for password-free operation of a blockchain terminal device, such as Figure 3 As shown, including:

[0310] The first receiving and judging module 11 is used to judge the type of instruction when the blockchain terminal device receives the instruction sent by the host computer. If it is a signature instruction, it triggers the parsing and judging module 12; if it is a PIN code verification instruction, it triggers the verification module 17;

[0311] The parsing and judging module 12 is used to parse the signature instruction to obtain the interactive input value and the interactive data, obtain the interactive value according to the interactive input value and the interactive data, and judge whether the interactive value is less than the limited amount. If so, the first judging module 13 is triggered. Otherwise, the unfinished mark is saved, and a PIN code verification response is returned to the host computer, triggering the first receiving and judging module 11;

[0312] The first judgment module 13 is used to judge whether the current limited number of times is equal to the threshold value, if yes, save the unfinished mark, return the response that the limited number of times reaches the threshold value and the verification of the PIN code is required to the host computer, triggering the first receiving judgment module 11, otherwise triggering the second judgment module 14;

[0313] The second judgment module 14 is used to judge whether key confirmation is required, and if so, trigger the first display receiving module, otherwise, trigger the signature module 16;

[0314] The first display receiving module 15 is used to display the interaction value and wait for the user's operation. If a user confirmation operation is received, the signature module 16 is triggered. If a user cancellation operation is received, the interaction is cancelled and ends.

[0315] The signature module 16 is used to obtain the subkey index in the interactive data, obtain the master key pre-stored in the secure storage area, generate a public key according to the master key, derive a subkey pair according to the public key and the subkey index through a key derivation algorithm, obtain the subprivate key in the subkey pair, generate data to be signed according to the interactive data, use the subprivate key to sign the data to be signed to generate a signature result, obtain the subpublic key in the subkey pair, generate an interactive credential according to the subpublic key and the signature result, return the interactive credential to the host computer, and trigger the first receiving judgment module 11;

[0316] A verification module 17, used to verify the PIN code, if the verification is successful, the third judgment module 18 is triggered, if the verification fails, the process ends;

[0317] The third judgment module 18 is used to judge whether there is an unfinished mark, and if so, trigger the second judgment module 14, otherwise return a successful response of the verification PIN code to the host computer, triggering the first receiving judgment module 11;

[0318] The device also includes a first update number module and a second update number module;

[0319] A first update number module, used for updating the limited number when the first judgment module 13 judges that the current limited number is not equal to the threshold; and also for updating the limited number when the third judgment module 18 judges that an unfinished mark exists;

[0320] The second updating number module is used to update the limited number of times when the first display receiving module 15 receives a user cancellation operation.

[0321] Optionally, in this embodiment, it also includes: a fourth judgment module, used to judge whether the password-free operation is enabled, and if so, trigger the parsing judgment module; otherwise, a PIN code verification response is returned to the host computer, triggering the first receiving judgment module.

[0322] Optionally, in this embodiment, the fourth determination module specifically includes:

[0323] A first acquisition submodule is used for the blockchain terminal device to obtain a first flag bit from preset password-free operation information;

[0324] The first judgment submodule is used for the blockchain terminal device to determine whether the first flag bit is in a set state. If so, the password-free operation is not enabled, and a PIN code verification response is returned to the host computer to trigger the first receiving judgment module. Otherwise, the password-free operation is enabled, triggering the parsing judgment module.

[0325] Optionally, in this embodiment, if the initial value of the limited number of times is a preset limited number of times, the first update number module is specifically used to update the limited number of times by subtracting the result of the fifth preset value from the current limited number of times; the second update number module is specifically used to update the limited number of times by adding the fifth preset value to the current limited number of times;

[0326] If the threshold is a preset limit number, the first update number module is used to update the limit number by adding the current limit number to the fifth preset value, and the second update number module is used to update the limit number by subtracting the fifth preset value from the current limit number.

[0327] Optionally, in this embodiment, the verification module 17 is specifically used to obtain a PIN code from a received verification PIN code instruction, and match the obtained PIN code with the PIN code stored in the hardware main security area of ​​the blockchain terminal device. If the match is successful, the verification is successful, triggering the third judgment module; if the match fails, the verification fails and ends.

[0328] Optionally, in this embodiment, the analysis and judgment module 12 specifically includes:

[0329] The second acquisition submodule is used to acquire the number of input interactions in the interaction data, and sequentially acquire corresponding input interaction data according to the number of input interactions;

[0330] The third acquisition submodule is used to acquire the number of output interactions in the interaction data, and acquire corresponding output interaction data according to the number of output interactions;

[0331] A first calculation submodule, configured to calculate the output interaction public key hash value in the output interaction data according to a preset algorithm to obtain the output interaction address data;

[0332] The second judgment submodule is used to obtain the interaction fee by subtracting the output interaction value from the interaction input value data, and judge whether the interaction fee is legal. If it is legal, the second calculation submodule is triggered, otherwise, an error response is returned to the upper computer and the process ends;

[0333] The second calculation submodule is used to compare the calculated output interactive address data with the non-receiver address data in the signature instruction in turn, query the output interactive address data that is consistent with the non-receiver address data, and use the interactive input numerical data to subtract the output interactive numerical value corresponding to the queried output interactive address data to obtain the interactive numerical value.

[0334] Optionally, in this embodiment, the second judgment submodule specifically includes:

[0335] A first calculation unit, configured to obtain an interaction fee by subtracting an output interaction value from the interaction input value data;

[0336] The first judgment unit is used to judge whether the interaction fee is greater than the seventh preset value, and if so, trigger the second judgment unit; otherwise, it is judged to be illegal, and an error response is returned to the upper computer, and the process ends;

[0337] The second judgment unit is used to judge whether the interaction fee is less than one third of the interactive input numerical data, and if so, trigger the second calculation submodule; otherwise, it is judged as illegal, an error response is returned to the upper computer, and the process ends.

[0338] Optionally, in this embodiment, a setting module is also included;

[0339] The setting module is used to set the limited number of times according to the instruction for loading the last limited number of times when the first receiving judgment module 11 determines that the type of the instruction is the instruction for loading the last limited number of times, and return a setting success response to the host computer to trigger the first receiving judgment module.

[0340] Optionally, in this embodiment, the second determination module 14 specifically includes:

[0341] A fourth acquisition submodule, used to acquire a second flag bit from preset password-free operation information;

[0342] The third judgment submodule is used to judge whether the second flag is in the set state. If it is, a key confirmation is required to trigger the first display receiving module. Otherwise, no key confirmation is required to trigger the signature module.

[0343] Embodiment 8

[0344] Embodiment 8 of the present invention provides a device for password-free operation of a blockchain terminal device, such as Figure 4 As shown, including:

[0345] The first receiving judgment module 11 is used to judge the instruction type when the blockchain terminal device receives the instruction sent by the host computer. If it is a signature instruction, the first judgment module 12 is triggered; if it is a PIN code verification instruction, the verification module 16 is triggered;

[0346] The first judgment module 12 is used to judge whether the current limited number of times is equal to the threshold value, if yes, save the unfinished mark, return the limited number of times reaching the threshold value and the need to verify the PIN code response to the host computer, triggering the first receiving judgment module 11, otherwise triggering the second judgment module 13;

[0347] The second judgment module 13 is used to judge whether key confirmation is required, and if so, trigger the first display receiving module 14, otherwise, trigger the signature module 15;

[0348] The first display receiving module 14 is used to display the authorization information in the signature instruction and wait for the user's operation. If a user confirmation operation is received, the signature module 15 is triggered. If a user cancellation operation is received, the interaction is canceled and ends.

[0349] The signature module 15 is used to query the key index according to the sub-public key in the signature instruction, calculate the sub-private key according to the queried key index, use the sub-private key to sign the authorization information to obtain a signature result, generate an interactive credential according to the signature result, return the interactive credential to the host computer, and trigger the first receiving judgment module 11;

[0350] A verification module 16, used to verify the PIN code, if the verification is successful, the third judgment module 17 is triggered, if the verification fails, the process ends;

[0351] The third judgment module 17 is used to judge whether there is an unfinished mark, and if so, trigger the second judgment module 13, otherwise return a successful response of the verification PIN code to the host computer, triggering the first receiving judgment module 11;

[0352] The device also includes a first update number module and a second update number module;

[0353] A first update number module, used for updating the limited number when the first judgment module 12 judges that the current limited number is not equal to the threshold; and also for updating the limited number when the third judgment module 17 judges that an unfinished mark exists;

[0354] The second updating number module is used to update the limited number of times when the first display receiving module 14 receives a user cancellation operation.

[0355] Optionally, in this embodiment, it also includes: a fourth judgment module, which is used to judge whether the password-free operation is enabled, and if so, trigger the first judgment module; otherwise, it returns a PIN code verification response to the host computer, triggering the first receiving judgment module.

[0356] Optionally, in this embodiment, the fourth determination module specifically includes:

[0357] A first acquisition submodule, used to acquire a first flag bit from preset non-secret operation information;

[0358] The first judgment submodule is used to judge whether the first flag is in a set state. If so, the password-free operation is not enabled, and a PIN code verification response is returned to the host computer to trigger the first receiving judgment module. Otherwise, the password-free operation is enabled, triggering the first judgment module.

[0359] Optionally, in this embodiment, if the initial value of the limited number of times is a preset limited number of times, the first update number module is specifically used to update the limited number of times by subtracting the result of the fifth preset value from the current limited number of times; the second update number module is specifically used to update the limited number of times by adding the fifth preset value to the current limited number of times;

[0360] If the threshold is a preset limit number, the first update number module is specifically used to update the limit number by adding the current limit number to the fifth preset value, and the second update number module is specifically used to update the limit number by subtracting the fifth preset value from the current limit number.

[0361] Optionally, in this embodiment, the verification module 16 is specifically used to obtain a PIN code from a received verification PIN code instruction, and match the obtained PIN code with the PIN code stored in the hardware main security area of ​​the blockchain terminal device. If the match is successful, the verification is successful, triggering the third judgment module 17; if the match fails, the verification fails and ends.

[0362] Optionally, in this embodiment, a setting module is also included;

[0363] The setting module is used to set the limited number of times according to the instruction for loading the last limited number of times when the first receiving judgment module 11 determines that the type of the instruction is the instruction for loading the last limited number of times, and return a setting success response to the host computer to trigger the first receiving judgment module 11.

[0364] Optionally, in this embodiment, the second judgment module 13 specifically includes:

[0365] A fourth acquisition submodule, used to acquire a second flag bit from preset password-free operation information;

[0366] The third judgment submodule is used to judge whether the second flag is in the set state. If it is, a key confirmation is required to trigger the first display receiving module. Otherwise, no key confirmation is required to trigger the signature module.

[0367] Optionally, in this embodiment, the signature module 15 is also used to determine whether the sub-public key is valid, and if so, query the key index according to the sub-public key, otherwise report an error.

[0368] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for password-free operation of a blockchain terminal device, characterized in that: include: Step S1: When the blockchain terminal device receives the instruction sent by the host computer, it determines the instruction type. If it is a signature instruction, it executes step S2; if it is a PIN code verification instruction, it executes step S7; Step S2: the blockchain terminal device parses the signature instruction to obtain the interactive input value and the interactive data, obtains the interactive value according to the interactive input value and the interactive data, and determines whether the interactive value is less than the limited amount. If so, step S3 is executed; otherwise, the unfinished mark is saved, and a PIN verification response is returned to the host computer, and the process returns to step S1; Step S3: The blockchain terminal device determines whether the current limited number of times is equal to the threshold value, if yes, saves the unfinished mark, returns a response to the host computer indicating that the limited number of times reaches the threshold value and that the PIN code needs to be verified, and returns to step S1, otherwise, executes step S4; Step S4: The blockchain terminal device determines whether a key confirmation is required, and if so, executes step S5; otherwise, executes step S6; Step S5: The blockchain terminal device displays the interaction value on the screen and waits for user confirmation. When receiving a user trigger, the user key type is determined. If it is a confirmation key, step S6 is executed. If it is a cancel key, the interaction is canceled and the process ends. Step S6: The blockchain terminal device obtains the subkey index in the interactive data, obtains the master key pre-stored in the secure storage area, generates a public key according to the master key, derives a subkey pair according to the public key and the subkey index through a key derivation algorithm, obtains the subprivate key in the subkey pair, generates data to be signed according to the interactive data, signs the data to be signed using the subprivate key to generate a signature result, obtains the subpublic key in the subkey pair, generates an interactive credential according to the subpublic key and the signature result, returns the interactive credential to the host computer, and returns to step S1; Step S7: The blockchain terminal device verifies the PIN code. If the verification is successful, step S8 is executed. If the verification fails, the process ends. Step S8: The blockchain terminal device determines whether an unfinished mark exists, and if so, executes step S4; otherwise, returns a successful verification PIN code response to the host computer, and returns to step S1; When it is determined in step S3 that the current limited number of times is not equal to the threshold value and when it is determined in step S8 that the unfinished mark exists, the method further includes: updating the limited number of times; after the interaction is cancelled, the method further includes: updating the limited number of times; The blockchain terminal device is a hardware device that stores blockchain encrypted virtual assets; The obtaining of the interaction value according to the interaction input value and the interaction data specifically includes: Step B1: the blockchain terminal device obtains the number of input interactions in the interaction data, and sequentially obtains corresponding input interaction data according to the number of input interactions; Step B2: the blockchain terminal device obtains the number of output interactions in the interaction data, and sequentially obtains corresponding output interaction data according to the number of output interactions; Step B3: The blockchain terminal device calculates the output interaction public key hash value in the output interaction data in sequence according to a preset algorithm to obtain output interaction address data; Step B4: The blockchain terminal device obtains the interaction fee using the input interaction value and the output interaction value, and determines whether the interaction fee is legal; The input interaction data includes: a hash value of the input interaction in its last output interaction, a sequence number of the input interaction in its last output interaction, and a subkey index; The output interaction data includes: an output interaction value, an output interaction sequence number and an output interaction public key hash value.

2. The method according to claim 1, characterized in that Before executing step S2, the process also includes: the blockchain terminal device determines whether the password-free operation is enabled, and if so, executes step S2; otherwise, the blockchain terminal device returns a PIN code verification response to the host computer, and returns to step S1.

3. The method according to claim 2, characterized in that The blockchain terminal device determines whether the password-free operation is enabled specifically as follows: Step A1: The blockchain terminal device obtains a first flag bit from preset password-free operation information; Step A2: the blockchain terminal device determines whether the first flag bit is in a set state, if so, the password-free operation is not enabled, otherwise, the password-free operation is enabled.

4. The method according to claim 1, characterized in that If the initial value of the limited number of times is a preset limited number of times, when it is determined in step S3 that the current limited number of times is not equal to the threshold value and when it is determined in step S8 that the unfinished mark exists, the updating of the limited number of times is specifically: the result of subtracting the fifth preset value from the current limited number of times is updated; the updating of the limited number of times after the interaction is cancelled is specifically: the result of adding the fifth preset value to the current limited number of times is updated; If the threshold is a preset limited number of times, when it is determined in step S3 that the current limited number of times is not equal to the threshold and when it is determined in step S8 that an unfinished mark exists, the updated limited number of times is specifically updated as follows: the current limited number of times plus the fifth preset value is added to update the limited number of times; and the updated limited number of times after the interaction is canceled is specifically updated as follows: the current limited number of times minus the fifth preset value is subtracted to update the limited number of times.

5. The method according to claim 1, characterized in that The blockchain terminal device verifies the PIN code specifically by obtaining the PIN code from the received verification PIN code instruction, and matching the obtained PIN code with the PIN code stored in the hardware main security area of ​​the blockchain terminal device. If the match is successful, the verification is successful, and if the match fails, the verification fails.

6. The method according to claim 1, characterized in that The blockchain terminal device subtracts the output interaction value from the input interaction value to obtain the interaction fee, and determines whether the interaction fee is legal. If so, step B5 is executed. Otherwise, an error response is returned to the host computer, and the process ends. Step B5: The blockchain terminal device compares the calculated output interaction address data with the non-receiver address data in the signature instruction in turn, queries the output interaction address data that is consistent with the non-receiver address data, and subtracts the output interaction value corresponding to the queried output interaction address data from the interaction input value data to obtain the interaction value.

7. The method according to claim 6, characterized in that The step B4 of determining whether the interaction fee is legal specifically includes: Step B4-1: The blockchain terminal device determines whether the interaction fee is greater than the seventh preset value, and if so, executes step B4-2, otherwise it is determined to be illegal; Step B4-2: The blockchain terminal device determines whether the interaction fee is less than one third of the interactive input numerical data. If so, execute step B5; otherwise, it is determined to be illegal.

8. The method according to claim 1, characterized in that The step S1 further comprises: when it is determined that the instruction type is a load last limited number of times instruction, executing step M; Step M: The blockchain terminal device sets the limited number of times according to the last limited number of times instruction loaded, returns a setting success response to the host computer, and returns to step S1.

9. The method according to claim 1, characterized in that The step S4 specifically includes: The blockchain terminal device obtains a second flag from the preset password-free operation information, and determines whether the second flag is in a set state. If so, a key confirmation is required, otherwise, a key confirmation is not required.

10. A device for password-free operation of a blockchain terminal device, characterized in that: include: The first receiving and judging module is used to judge the instruction type when the blockchain terminal device receives the instruction sent by the host computer. If it is a signature instruction, the parsing and judging module is triggered; if it is a PIN code verification instruction, the verification module is triggered; The parsing and judging module is used to parse the signature instruction to obtain the interactive input value and the interactive data, obtain the interactive value according to the interactive input value and the interactive data, and judge whether the interactive value is less than the limited amount. If so, the first judging module is triggered; otherwise, an unfinished mark is saved, and a PIN verification response is returned to the host computer to trigger the first receiving and judging module; The first judgment module is used to judge whether the current limited number of times is equal to the threshold value, if yes, save the unfinished mark, return the response that the limited number of times reaches the threshold value and the verification of the PIN code is required to the host computer, trigger the first receiving judgment module, otherwise trigger the second judgment module; The second judgment module is used to judge whether key confirmation is required, and if so, trigger the first display receiving module, otherwise, trigger the signature module; The first display receiving module is used to display the interaction value through the display screen, wait for the user to confirm, and judge the user's key type when receiving the user trigger. If it is a confirmation key, the signature module is triggered; if it is a cancel key, the interaction is canceled and ends; The signature module is used to obtain the subkey index in the interactive data, obtain the master key pre-stored in the secure storage area, generate a public key according to the master key, derive a subkey pair according to the public key and the subkey index through a key derivation algorithm, obtain the sub-private key in the subkey pair, generate data to be signed according to the interactive data, use the sub-private key to sign the data to be signed to generate a signature result, obtain the sub-public key in the subkey pair, generate an interactive credential according to the sub-public key and the signature result, return the interactive credential to the host computer, and trigger the first receiving and judging module; The verification module is used to verify the PIN code. If the verification is successful, the third judgment module is triggered, and if the verification fails, the verification ends; The third judgment module is used to judge whether there is an unfinished mark, and if so, trigger the second judgment module; otherwise, return a successful response of the verification PIN code to the host computer to trigger the first receiving judgment module; The device also includes a first update number module and a second update number module; The first updating number module is used to update the limited number when the first judging module judges that the current limited number is not equal to the threshold; Also used for updating the limited number of times when the third judgment module determines that an unfinished mark exists; The second updating number module is used to update the limited number of times when the first display receiving module receives a user cancellation operation; The blockchain terminal device is a hardware device that stores blockchain encrypted virtual assets; The analysis and judgment module specifically includes: A second acquisition submodule is used to acquire the number of input interactions in the interaction data, and sequentially acquire corresponding input interaction data according to the number of input interactions; A third acquisition submodule is used to acquire the number of output interactions in the interaction data, and sequentially acquire corresponding output interaction data according to the number of output interactions; A first calculation submodule, configured to calculate the output interaction public key hash value in the output interaction data according to a preset algorithm to obtain output interaction address data; A second judgment submodule is used to obtain the interaction fee by using the input interaction value and the output interaction value, and to judge whether the interaction fee is legal; The input interaction data includes: a hash value of the input interaction in its last output interaction, a sequence number of the input interaction in its last output interaction, and a subkey index; The output interaction data includes: an output interaction value, an output interaction sequence number and an output interaction public key hash value.

11. The device according to claim 10, characterized in that Also includes: The fourth judgment module is used to judge whether the password-free operation is enabled, and if so, trigger the analysis judgment module; otherwise, return a PIN code verification response to the host computer, triggering the first receiving judgment module.

12. The device according to claim 11, characterized in that The fourth judgment module specifically includes: A first acquisition submodule, used for the blockchain terminal device to obtain a first flag bit from preset password-free operation information; The first judgment submodule is used for the blockchain terminal device to judge whether the first flag is in a set state. If so, the password-free operation is not enabled, and a PIN code verification response is returned to the host computer to trigger the first receiving judgment module. Otherwise, the password-free operation is enabled, triggering the parsing judgment module.

13. The device according to claim 10, characterized in that If the initial value of the limited number of times is a preset limited number of times, the first update number module is specifically used to update the limited number of times by subtracting a fifth preset value from the current limited number of times; the second update number module is specifically used to update the limited number of times by adding the fifth preset value to the current limited number of times; If the threshold is a preset limited number of times, the first update number module is used to update the limited number of times by adding the current limited number of times to the fifth preset value, and the second update number module is used to update the limited number of times by subtracting the fifth preset value from the current limited number of times.

14. The device according to claim 10, characterized in that The verification module is specifically used to obtain a PIN code from a received verification PIN code instruction, and match the obtained PIN code with the PIN code stored in the hardware main security area of ​​the blockchain terminal device. If the match is successful, the verification is successful, triggering the third judgment module; if the match fails, the verification fails and ends.

15. The device according to claim 10, characterized in that The second judgment submodule uses The interactive input value is subtracted from the output interactive value to obtain the interactive fee, and whether the interactive fee is legal is determined, if so, the second calculation submodule is triggered, otherwise, an error response is returned to the host computer, and the process ends; The second calculation submodule is used to compare the calculated output interaction address data with the non-receiver address data in the signature instruction in turn, query the output interaction address data consistent with the non-receiver address data, and use the interaction input value data to subtract the output interaction value corresponding to the queried output interaction address data to obtain the interaction value.

16. The device according to claim 15, characterized in that The second judgment submodule specifically includes: A first calculation unit, configured to obtain an interaction fee by subtracting an output interaction value from the interaction input value data; A first judgment unit is used to judge whether the interaction fee is greater than a seventh preset value, and if so, trigger a second judgment unit; otherwise, it is judged to be illegal, and an error response is returned to the host computer, and the process ends; The second judgment unit is used to judge whether the interaction fee is less than one third of the interactive input numerical data, and if so, trigger the second calculation submodule; otherwise, it is judged as illegal, and an error response is returned to the host computer, and the process ends.

17. The device according to claim 10, characterized in that Also includes settings module; The setting module is used to set the limited number of times according to the instruction for loading the last limited number of times when the first receiving and judging module determines that the type of the instruction is the instruction for loading the last limited number of times, and return a setting success response to the host computer to trigger the first receiving and judging module.

18. The device according to claim 10, characterized in that The second judgment module specifically include: A fourth acquisition submodule, used to acquire a second flag bit from preset password-free operation information; The third judgment submodule is used to judge whether the second flag is in the set state. If it is, a key confirmation is required to trigger the first display receiving module. Otherwise, no key confirmation is required to trigger the signature module.

Citation Information

Patent Citations

  • System and method for login authentication

    CN108684041A

  • SIM card, terminal and digital currency management system

    CN109615351A

  • Block chain proxy signature method and system and electronic device

    CN110009348A

  • Method and device for realizing security signature

    CN110190950A

  • Payment method and device and storage medium

    CN110458557A