Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the embodiments in the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Example one
Referring to fig. 1, a schematic flow chart of a proxy signature method for a blockchain according to an embodiment of the present disclosure is shown, where the proxy signature method is used by a blockchain application developer, and as long as a user authorizes the application developer to use the method, the user can perform a limited time secret-free signature, which is particularly suitable for an application scenario of small-amount high-frequency transaction. The proxy signature method comprises the following steps:
step 101: and receiving agent signature information set by a user, and generating a brand new public and private key pair and an agent signature address based on the agent signature information.
When the method is used, an application generates a brand new public and private key pair. The public-private key pair corresponds to a blockchain address, which is a proxy signature address (signature account) and is an address for carrying out limited-time secret-free transaction with a user during proxy signature. Once the user inputs the password for the first time to authorize the application developer to use the method, the application developer can initiate the password-free transaction with limited time and quota by using the private key generated by the application developer within the authorization range without repeated signature of the user.
In the embodiment of the application, a user signature interface is configured, a user can select to use the proxy signature or the autonomous signature in the user signature interface, and proxy signature information can be set.
In specific implementation, the proxy signature information set by the user in the embodiment of the present application at least includes one of a proxy signature time range, a maximum number of times of proxy signatures, a single maximum value of proxy signatures, and an overall maximum value of proxy signatures.
It should be understood that the proxy signature time range refers to the time range between the start time and the end time of the proxy signature. Start time: the time at which the transaction of the authorized agent signature method is determined by the blockchain. End time: a desired end time entered by the user. Within this time frame, the user is able to conduct a limited time limit of a privacy-exempt transaction.
It should be understood that the maximum number of times a proxy signature is signed refers to the number of times the user succeeds in cryptographically-free signing. First, the maximum number of times of proxy signature is the number of times of successful secret-free signature. Assuming that the monetary parameter in a certain signature is higher than the single highest value of the proxy signature, the signature will fail. Therefore, the signature is failed and will not be recorded in the number of proxy signatures. Secondly, due to the determined delay of the blockchain transaction, when the transaction with the determined proxy signature and the transaction without the proxy signature are greater than the maximum number of times of the proxy signature, the transaction needs the user to carry out signature or needs the user to carry out a proxy signature method authorized again.
It should be understood that the single highest value of the proxy signature refers to the highest value of the amount that the user is able to transact using the proxy signature.
It should be understood that the agent signature overall highest value refers to the highest total amount of transactions that the agent signature address can proxy for during agent signature authorization. In a successful transaction of the proxy signature, the token numbers of all transactions are added to a proxy signature overall value. Due to the determined delay of the blockchain transaction, when the transaction token value is determined by the proxy signature and the transaction token value is not determined by the proxy signature and is greater than the overall maximum value of the proxy signature, the user is required to carry out signature in the transaction, or the user is required to carry out proxy signature authorization again.
Step 102: and generating a first transaction based on the user address, the proxy signature address, the application address and the proxy signature information, and requesting the user to sign and authorize the first transaction.
It should be understood that in the embodiment of the present application, the user address is an address of an authorized agent signature, and is generally an address of an application user.
It should be understood that, in the embodiment of the present application, the application address is a contract address of an application developer where a transaction is located, and is an address for creating a brand-new public and private key pair and using a proxy signature function.
Step 103: and acquiring the authorization of the user for signing the first transaction to complete the setting of the proxy signature.
Optionally, in this embodiment of the present application, assuming that the user finds the application developer doing malicious, the user may report to the blockchain operator to request to return to the token.
Step 104: a request for the user to perform a second transaction using the proxy signature is obtained.
During specific implementation, a user initiates a second transaction and requests to apply the proxy signature to execute the second transaction; the transaction information carried by the second transaction comprises transaction time and transaction amount.
Step 105: and signing and sending the second transaction by using a private key in the brand new public and private key pair to complete the transaction.
In specific implementation, when a user requests to apply the proxy signature, whether the transaction information of the second transaction is matched with proxy signature information set by the user needs to be judged; and if the judgment result is matching, signing and sending the second transaction.
It should be understood that, it is determined whether the transaction information of the second transaction matches the agent signature information set by the user, specifically, whether the following conditions are simultaneously satisfied:
1) the proxy signature has been authorized by the user;
2) the transaction time is within the proxy signature time range;
3) the number of successful transactions using the proxy signature is less than the maximum number of proxy signatures;
4) the transaction amount is less than or equal to the single highest value of the proxy signature;
5) the sum of the transaction amount and the accumulated amount of successful transactions of the proxy signature is less than or equal to the total maximum value of the proxy signature.
If the two conditions are met, the judgment result is matching, and at the moment, the private key generated when the proxy signature is set can be used for signing and sending the transaction to finish the transaction.
If at least one item is not satisfied, judging that the items are not matched, failing to sign the proxy, and returning to the user signature page. In the user signature interface, the user can choose to use the autonomous signature or reset the proxy signature information so that the proxy signature information is matched with the transaction information of the user, and then the transaction is completed by using the proxy signature.
It should be appreciated that in embodiments of the present application, when the current transaction is completed using the proxy signature, the number of successful transactions and the amount of successful transactions for the proxy signature are updated. And when the agent signature fails, the successful transaction times and the accumulated amount of the successful transactions of the agent signature are not updated.
Optionally, in an embodiment of the present application, a step of proxy signature arbitration is further included. Since the blockchain proxy signature method gives the right to sign to the developer, it is necessary to supervise and restrict the right of the developer and protect the user in case of possible problems, coordinating the relationship between the developer and the user.
In specific implementation, the agent signature arbitration mechanism is as follows: the proxy signature address transactions using the proxy signature can be arbitrated for security when one of the following 2 conditions is met. Specific ways of being arbitrated for security include, but are not limited to, the token amount of the transaction being frozen.
a) The proxy signature time is over;
b) the agent signature reaches the total maximum value within a certain time; the time is set by the user, such as within 24 hours.
It should be understood that in embodiments of the present application, the user may also make an arbitration complaint, assuming the application developer is doing malicious.
It should be noted that, in the embodiment of the present application, the user can use the original private key to revoke the authority of the proxy private key at any time. And, the user can use the original private key to obtain the rights of the proxy private key at any time (for example, the account corresponding to the proxy private key holds some kind of digital assets).
By the technical scheme, an application developer receives agent signature information set by a user and generates a brand-new public and private key pair and an agent signature address based on the agent signature information; the application developer generates a first transaction based on the user address, the proxy signature address, the application address and the proxy signature information, and requests the user to sign and authorize the first transaction; the user confirms and signs and authorizes the first transaction, and the setting of the proxy signature is completed; the user initiates a second transaction, and requests to apply the proxy signature to execute the second transaction; and after application confirmation, an authorized private key generated when the agent signature information is set is used for carrying out signature sending on the transaction, and the transaction is completed. Therefore, in the process of applying the signature to the block chain, the user can carry out the password-free signature with limited time and limited amount, and frequent password input is avoided, so that the use cost of the block chain is simplified, the use experience of the user is improved, and the safety is better.
Next, an embodiment of the present specification will be described with reference to a specific example.
The player A and the player B play a piece of block chain chess game on line, wherein the player A sets block chain agent signature information in advance, and the player B does not set the block chain agent signature information.
Firstly, player a sets block chain agent signature information in advance, and the specific operations are as follows:
the player A sets and selects to use the proxy signature on a Chinese chess user signature interface, sets proxy signature information, and the Chinese chess application generates a brand new public and private key based on the proxy signature information and takes a derived block chain address as a proxy signature address.
The set proxy signature information includes a proxy signature time range: the starting time is the time determined by the block chain for the transaction of the authorized agent signature method, and the ending time is 1 hour later; maximum number of proxy signatures: 100 times; single highest value of proxy signature: 1 unit; overall maximum value of proxy signature: 100 units.
And the chess application assembles a user address, the proxy signature address, an application address and the proxy signature information into a transaction request player A for signature authorization.
In this example, the user address is the player A address.
The proxy signature address is the generated blockchain address.
The application address is a contract address of the chess application.
Player B does not set blockchain agent signature information, i.e., player B selects to use an autonomous signature at the chess user signature interface setting.
Starting a game, wherein a player A starts, the chess application judges that the player A has set an agent signature, the judgment time is in the end time range of the agent signature, the number of times of the agent signature is judged to be less than 100, the transaction cost is judged to be less than 1 unit, the highest accumulated total transaction is judged to be less than 100 units at most, and finally, the agent signature can be confirmed. The chess application then signs the transaction using the authorized private key generated when the agent signature information is set. After the transaction is confirmed, player A completes his chess.
When the player B moves chess, the player B needs to sign independently every time, and the efficiency is very low.
Example two
An embodiment of the present application further provides a proxy signature system for a blockchain, and as shown in fig. 2, the system includes:
the setting generation module 21: receiving agent signature information set by a user, and generating a brand-new public and private key pair and an agent signature address based on the agent signature information; and generating a first transaction based on the user address, the proxy signature address, the application address and the proxy signature information, and requesting and acquiring the authorization of the first transaction signature by the user to complete the setting of the proxy signature.
The signature calling module 22: when a user requests to apply the proxy signature to execute transaction, judging whether the information of the transaction is matched with the proxy signature information set by the user; and if the judgment result is matching, using the private key in the public and private keys to sign and send the transaction, and finishing the transaction.
In specific implementation, the method steps described in the first embodiment may be executed to implement the same functions, which are not described herein again.
By the technical scheme, an application developer receives agent signature information set by a user and generates a brand-new public and private key pair and an agent signature address based on the agent signature information; the application developer generates a first transaction based on the user address, the proxy signature address, the application address and the proxy signature information, and requests the user to sign and authorize the first transaction; the user confirms and signs and authorizes the first transaction, and the setting of the proxy signature is completed; the user initiates a second transaction, and requests to apply the proxy signature to execute the second transaction; and after application confirmation, an authorized private key generated when the agent signature information is set is used for carrying out signature sending on the transaction, and the transaction is completed. Therefore, in the process of applying the signature to the block chain, the user can carry out the password-free signature with limited time and limited amount, and frequent password input is avoided, so that the use cost of the block chain is simplified, the use experience of the user is improved, and the safety is better.
EXAMPLE III
The electronic apparatus of the embodiment of the present specification is described in detail below with reference to fig. 3. Referring to fig. 3, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a Non-Volatile Memory (Non-Volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form an offline signature device (specifically, the offline signature device may be an online wallet side or an offline signature side) on a logic level. And the processor is used for executing the program stored in the memory and is specifically used for executing the method operation executed when the server is taken as an execution main body.
The method disclosed in the embodiment of fig. 1 in the present specification may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
An embodiment of the present specification further provides a computer device, where the computer device includes:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the blockchain proxy signature method as described in the previous embodiments.
Embodiments of the present specification further provide a storage medium storing a computer program, which when executed by a processor implements the block chain proxy signature method described in the foregoing embodiments.
The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are all described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.