Disclosure of Invention
The application provides a method and a device for generating a multi-signature wallet, which are used for solving the problem that a multi-signature address is difficult to apply in the prior art.
In a first aspect, the present application provides a method of generating a multi-sign wallet, the method comprising:
acquiring the number of participants of the multiple signature addresses;
generating a public-private key pair of an initiator, wherein the public-private key pair comprises a public key and a private key;
receiving a public key of each participant;
generating a multi-signature address according to the public key of each participant and the public key of the initiator, and sending notification information to the terminal of each participant, wherein the notification information comprises the multi-signature address, the public key of the initiator and the public keys of all participants;
and the terminal of the participant receives the notification information, verifies ownership of the public key of the participant, and adds the multi-signature address into the multi-signature wallet if the verification is passed.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the multiple signature address conforms to a BIP48 protocol.
With reference to the first aspect, in a second possible implementation manner of the first aspect, the public key of each participant and the public key of the initiator generate the multiple signature addresses through hash operation.
With reference to the first aspect, in a third possible implementation manner of the first aspect, the step of verifying ownership of the public key of the participant includes:
receiving a password input by a user, and judging whether the password is the same as a local password;
if the private keys are the same, the private keys of the participants are obtained, and a target public key is generated according to the private keys of the participants;
and judging whether the target public key is the same as the public key of the participator, and if so, passing the verification.
With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the step of generating a public-private key pair of the initiator includes: and generating public and private key pairs conforming to the BIP44 protocol according to the running elliptic curve encryption algorithm.
In a second aspect, the present application provides an apparatus for generating a multi-sign wallet, the apparatus comprising:
an acquisition unit for acquiring the number of participants of the multiple signature addresses;
the first generation unit is used for generating a public and private key pair of an initiator, wherein the public and private key pair comprises a public key and a private key;
a receiving unit for receiving a public key of each participant;
a second generating unit, configured to generate a multiple signature address according to a public key of each participant and a public key of an initiator, and send notification information to a terminal of each participant, where the notification information includes the multiple signature address, the public key of the initiator, and the public keys of all participants;
and the joining unit is used for receiving the notification information by the terminal of the participant, verifying ownership of the public key of the participant, and joining the multi-signature address into the multi-signature wallet if the verification is passed.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the multiple signature address conforms to the BIP48 protocol.
With reference to the second aspect, in a second possible implementation manner of the second aspect, the public key of each participant and the public key of the initiator generate the multiple signature addresses through hash operation.
With reference to the second aspect, in a third possible implementation manner of the second aspect, the step of verifying ownership of the public key of the participant includes:
receiving a password input by a user, and judging whether the password is the same as a local password;
if the private keys are the same, the private keys of the participants are obtained, and a target public key is generated according to the private keys of the participants;
and judging whether the target public key is the same as the public key of the participator, and if so, passing the verification.
With reference to the second aspect, in a fourth possible implementation manner of the second aspect, the step of generating a public-private key pair of the initiator includes: and generating public and private key pairs conforming to the BIP44 protocol according to the running elliptic curve encryption algorithm.
According to the technical scheme, the method and the device for generating the multi-signature wallet comprise the following steps: acquiring the number of participants of the multiple signature addresses; generating a public-private key pair of an initiator, wherein the public-private key pair comprises a public key and a private key; receiving a public key of each participant; generating a multi-signature address according to the public key of each participant and the public key of the initiator, and sending notification information to the terminal of each participant, wherein the notification information comprises the multi-signature address, the public key of the initiator and the public keys of all participants; and the terminal of the participant receives the notification information, verifies ownership of the public key of the participant, and adds the multi-signature address into the multi-signature wallet if the verification is passed. In the embodiment of the application, the multiple signature addresses can be automatically pushed to the terminals of the participants, so that the management difficulty can be reduced, and the usability of the multiple signature addresses can be greatly improved.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure. The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
The existing multiple signature address creation mode has the defects of higher technical threshold and needs to master certain code knowledge. Meanwhile, there is a problem in that it is difficult to distribute and manage the control private key. Therefore, how to solve the usability of multiple signature addresses becomes a urgent problem in the industry.
Referring to fig. 1, for a first embodiment of a method for generating a multi-signature wallet provided in the present application, it is noted that the method of the embodiment of the present application is applied in the field of cryptocurrency wallets, and the method includes a process of generating a multi-signature address and adding the multi-signature address to the multi-signature wallet, and specifically, the method includes:
s100, acquiring the number of participants of the multiple signature addresses; specifically, the sponsor may set the number of participants who generate the multiple signature addresses through the terminal of the sponsor, for example, the number of participants may be two, three, four, etc. The terminal may be a mobile terminal, such as a cell phone.
S200, generating a public and private key pair of an initiator, wherein the public and private key pair comprises a public key and a private key; it should be noted that the private key of the initiator is stored in the terminal of the initiator.
S300, receiving the public key of each participant. Specifically, the generation process of the public and private key pair of the participant is the same as that of the public and private key pair of the initiator, the public and private key pair of the participant is generated at the terminal of the participant, the public key of the participant is sent to the terminal of the initiator, and the private key of the participant is stored at the terminal of the participant.
S400, generating a multi-signature address according to the public key of each participant and the public key of the initiator, and sending notification information to the terminal of each participant, wherein the notification information comprises the multi-signature address, the public key of the initiator and the public keys of all participants;
it should be noted that, in the embodiment of the present application, after the public key of each participant, the public key of the initiator, and the number of people are processed, a multiple signature address is generated. The multi-signed address may be used for receipt of a digital asset. The security of the digital asset corresponding to the multi-signature address can be ensured through the multi-signature address generated by the public key of a plurality of persons. And after the generation of the multiple signature addresses is finished, automatically sending notification information to the terminals of all the participants. The notification information comprises the multiple signature addresses, the public keys of the sponsor and the public keys of all participants, and the public keys of the sponsor and the public keys of all participants are sent to the terminals of each participant, so that the participants can conveniently record and generate the public keys of the multiple signature addresses, the mutual management of all the participants and the sponsor is facilitated, and the availability of the multiple signature addresses is improved.
S500, the terminal of the participant receives the notification information, the ownership of the public key of the participant is verified, and if the verification is passed, the multi-signature address is imported into the multi-signature wallet. In the embodiment of the application, the private key stored in the participant terminal is used for completing the verification of the ownership of the public key of the participant, and specifically, the private key is stored in the security sandbox. The embodiment of the application can enable the digital asset to be transferred at different terminals at any time by means of the private key. It should also be noted that the multi-sign wallet is pre-existing.
From the above embodiments, a first embodiment of a method of generating a multi-signature wallet of the present application, the method comprising: acquiring the number of participants of the multiple signature addresses; generating a public-private key pair of an initiator, wherein the public-private key pair comprises a public key and a private key; receiving a public key of each participant; generating a multi-signature address according to the public key of each participant and the public key of the initiator, and sending notification information to the terminal of each participant, wherein the notification information comprises the multi-signature address, the public key of the initiator and the public keys of all participants; and the terminal of the participant receives the notification information, verifies ownership of the public key of the participant, and adds the multi-signature address into the multi-signature wallet if the verification is passed. In the embodiment of the application, the multiple signature addresses can be automatically pushed to the terminals of the participants, so that the management difficulty can be reduced, and the usability of the multiple signature addresses can be greatly improved.
A second embodiment of a method of generating a multi-signature wallet is provided herein, the multi-signature address conforming to BIP48 protocol. Specifically, the method conforms to the bip48 specification, and all operations of a user are based on the principle of cryptography.
In a third embodiment of a method for generating a multi-signature wallet provided by the present application, a public key of each participant and a public key of an initiator generate a multi-signature address through a hash operation. Specifically, the hash operation is to convert an input with an arbitrary length (also called as pre-mapped pre-image) into an output with a fixed length through a hash algorithm, and the output is a hash value. Simply stated, a function of compressing messages of arbitrary length to a message digest of a fixed length.
Referring to fig. 2, in a fourth embodiment of a method for generating a multi-signature wallet provided in the present application, the step of verifying ownership of a public key of a participant includes:
s501, receiving a password input by a user, and judging whether the password is the same as a local password;
s502, if the private keys are the same, acquiring the private keys of the participants, and generating a target public key according to the private keys of the participants;
s503, judging whether the target public key is the same as the public key of the participant, and if so, passing the verification.
Specifically, the private key is stored in the secure sandbox, and the local password is set by the user and is used for verifying whether the user can open the secure sandbox. If the password input by the user is the same as the local password, the safe sandbox can be opened, and the private key of the participant in the safe sandbox is obtained. In some embodiments, the private key of the participant is utilized to multiply m by G through an elliptic curve to generate a corresponding target public key, the target public key is used for comparing with the public key of the participant in the notification information sent through the terminal of the initiator, if the target public key is identical to the public key of the participant, the multiple signature address can be added into the multiple signature wallet after verification is passed; if the target public key and the participant's public key are different, the verification fails and the multi-signature address cannot be added to the multi-signature wallet.
From the above embodiments, a fourth embodiment of a method of generating a multi-signature wallet of the present application, a third embodiment of a method of generating a multi-signature wallet, the step of verifying ownership of a public key of a participant comprises: receiving a password input by a user, and judging whether the password is the same as a local password; if the private keys are the same, the private keys of the participants are obtained, and a target public key is generated according to the private keys of the participants; and judging whether the target public key is the same as the public key of the participator, and if so, passing the verification. In the embodiment of the application, the security when the participant can operate the multi-signature address can be ensured by verifying the ownership of the public key of the participant through the private key.
In a fifth embodiment of the method for generating a multi-signature wallet provided by the present application, the step of generating a public-private key pair of an initiator includes: and generating public and private key pairs conforming to the BIP44 protocol according to the running elliptic curve encryption algorithm.
Referring to fig. 3, the present application provides an apparatus for generating a multi-signature wallet, the apparatus comprising:
an acquisition unit 100 for acquiring the number of persons participating in the multiple signature addresses;
a first generating unit 200, configured to generate a public-private key pair of an initiator, where the public-private key pair includes a public key and a private key;
a receiving unit 300 for receiving a public key of each participant;
a second generating unit 400, configured to generate a multiple signature address according to the public key of each participant and the public key of the initiator, and send notification information to the terminal of each participant, where the notification information includes the multiple signature address, the public key of the initiator, and the public keys of all participants;
and the joining unit 500 is used for receiving the notification information by the terminal of the participant, verifying ownership of the public key of the participant, and joining the multi-signature address into the multi-signature wallet if the verification is passed.
In another embodiment of the loading apparatus of the present application, the multiple signature addresses conform to the BIP48 protocol.
In another embodiment of the loading apparatus of the promiscuous mode block grouping provided herein, the public key of each participant and the public key of the sponsor generate the multi-signed address through a hash operation.
In another embodiment of the loading device of the present application, the step of verifying ownership of the public key of the participant includes:
receiving a password input by a user, and judging whether the password is the same as a local password;
if the private keys are the same, the private keys of the participants are obtained, and a target public key is generated according to the private keys of the participants;
and judging whether the target public key is the same as the public key of the participator, and if so, passing the verification.
In another embodiment of the loading device of the promiscuous mode block grouping provided in the present application, the step of generating the public-private key pair of the initiator includes: and generating public and private key pairs conforming to the BIP44 protocol according to the running elliptic curve encryption algorithm.
In a specific implementation, the application further provides a computer storage medium, where the computer storage medium may store a program, where the program may include some or all of the steps in each embodiment of the process prompting method for digital asset address transfer provided by the present invention when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
It will be apparent to those skilled in the art that the techniques of embodiments of the present invention may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in essence or what contributes to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present invention.
The same or similar parts between the various embodiments in this specification are referred to each other. In particular, for embodiments of secure network middleware for identity authentication and methods and apparatus for implementing the same, the description is relatively simple as it is substantially similar to the method embodiments, and reference should be made to the description of the method embodiments for the matters.
The above-described embodiments of the present application are not intended to limit the scope of the present application.