Multi-signature method, computer device and storage medium
By generating lock scripts and unlock scripts, constructing and verifying multi-signature transactions, the problem of single multi-signature rules and node code coupling in existing blockchains is solved, and more flexible and efficient multi-signature processing is achieved.
Patent Information
- Application Number
- CN202111167254.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-04
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-10-04
AI Technical Summary
The existing multi-signature rules of non-bitcoin blockchains are single and coupled with node code. When expanding rules, the node code needs to be modified and forked processing is added, and there is insufficient flexibility.
By generating lock scripts, multi-signature public keys and addresses, unsigned transfer transactions are constructed, broadcast to user clients, obtain signature data, generate unlock scripts, verify signature data, form complete transactions, and verify through the Bitcoin script engine to achieve multiple transactions Signature flexibility.
It realizes flexibility for multi-signatures, avoids modification of node code, simplifies the process of extending rules, and improves the flexibility and scalability of the system.
Smart Images

Figure CN113902441B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a multi-signature method, a computer device, and a storage medium. Background Art
[0002] In non-Bitcoin blockchains, the multi-signature rule is single and bound to the node code. When the rule needs to be expanded, the node code needs to be modified, the node needs to update the program and add corresponding fork processing. Summary of the invention
[0003] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a multi-signature method, computer device and storage medium with greater flexibility.
[0004] In a first aspect, the present invention provides a multi-signature method applicable to a client, wherein the current blockchain is a non-Bitcoin blockchain, and the method comprises:
[0005] Generate a locking script according to the first public key of the current user, the pre-configured second public keys of each first user, and the pre-configured multi-signature rule, generate a first multi-signature public key according to the locking script, and generate a first multi-signature address according to the first multi-signature public key;
[0006] Generate an unsigned first transfer transaction; wherein the transaction initiator address of the unsigned first transfer transaction is a first multi-signature address;
[0007] Constructing a first Bitcoin temporary transaction according to the unsigned first transfer transaction; wherein the first Bitcoin temporary transaction has only one first input UTXO, and the first input UTXO includes the hash value of the first transfer transaction;
[0008] The unsigned first transfer transaction is broadcasted to the client of each first user, so that the client of the first user: constructs a first Bitcoin temporary transaction according to the unsigned first transfer transaction and generates first signature data according to the first Bitcoin temporary transaction, the locking script, and the held private key;
[0009] Generate an unlocking script according to the first signature data returned by the client of each first user;
[0010] Generate second signature data of the unsigned first transfer transaction according to the locking script, the unlocking script, and the Bitcoin signature verification identifier;
[0011] Generate a complete first transfer transaction based on the unsigned first transfer transaction and the second signature data;
[0012] Send the complete first transfer transaction to the blockchain network for blockchain nodes to:
[0013] According to the Bitcoin signature verification mark, it is determined that the complete first transfer transaction is a transaction that needs to be verified by calling the Bitcoin script engine;
[0014] Generate a second multi-signature public key based on the locking script in the complete first transfer transaction, and determine whether the first multi-signature public key is the same as the second multi-signature public key; generate a second multi-signature address based on the first multi-signature public key in the complete first transfer transaction, and determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address;
[0015] When the above judgments are all yes, a second Bitcoin temporary transaction is generated; wherein the second Bitcoin temporary transaction has only one second input UTXO, and the second input UTXO includes the hash value of the first transfer transaction;
[0016] Call the Bitcoin script engine, the locking script in the complete first transfer transaction, and the unlocking script in the complete first transfer transaction to verify whether the first signature data in the locking script conforms to the multi-signature rule: when the verification is successful, execute the complete first transfer transaction.
[0017] In a second aspect, the present invention provides a multi-signature method applicable to a blockchain node, wherein the current blockchain is a non-Bitcoin blockchain, and the method comprises:
[0018] Receive a complete first transfer transaction; wherein the complete first transfer transaction is generated by the second client of the second user according to the unsigned first transfer transaction and the second signature data of the unsigned first transfer transaction, the second signature data is generated according to the locking script, the unlocking script, and the Bitcoin signature verification identifier, the unlocking script is generated according to each first signature data, the first signature data is generated by the first client of the first user according to the unsigned first transfer transaction after receiving the unsigned first transfer transaction, and the first Bitcoin temporary transaction is generated according to the first Bitcoin temporary transaction, the locking script, and the held private key, the first Bitcoin temporary transaction is also generated by the second client according to the unsigned first transfer transaction, the unsigned first transfer transaction is generated by the second client, the transaction initiator address of the unsigned first transfer transaction is the first multi-signature address, the first multi-signature address is generated according to the first multi-signature public key, the first multi-signature public key is generated according to the locking script, and the locking script is generated according to the first public key of the second user, the pre-configured second public keys of each first user, and the pre-configured multi-signature rule;
[0019] According to the Bitcoin signature verification mark, it is determined that the complete first transfer transaction is a transaction that needs to be verified by calling the Bitcoin script engine;
[0020] Generate a second multi-signature public key based on the locking script in the complete first transfer transaction, and determine whether the first multi-signature public key is the same as the second multi-signature public key; generate a second multi-signature address based on the first multi-signature public key in the complete first transfer transaction, and determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address;
[0021] When the above judgments are all yes, a second Bitcoin temporary transaction is generated; wherein the second Bitcoin temporary transaction has only one second input UTXO, and the second input UTXO includes the hash value of the first transfer transaction;
[0022] Call the Bitcoin script engine, the locking script in the complete first transfer transaction, and the unlocking script in the complete first transfer transaction to verify whether the first signature data in the locking script conforms to the multi-signature rule: when the verification is successful, execute the complete first transfer transaction.
[0023] In a third aspect, the present invention also provides a device comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors so that the one or more processors execute the multi-signature method provided according to various embodiments of the present invention.
[0024] In a fourth aspect, the present invention further provides a storage medium storing a computer program, wherein the computer program enables a computer to execute the multi-signature method provided according to each embodiment of the present invention.
[0025] The multi-signature method, computer device and storage medium provided by many embodiments of the present invention generate a locking script according to the public key and multi-signature rule of each user, generate a first multi-signature public key according to the locking script, generate a first multi-signature address according to the first multi-signature public key; generate an unsigned first transfer transaction; construct a first Bitcoin temporary transaction according to the unsigned first transfer transaction; broadcast the first Bitcoin temporary transaction to the client of each first user, and receive a number of returned first signature data; generate an unlocking script according to each first signature data; generate the second signature data of the unsigned first transfer transaction according to the locking script, the unlocking script, and the Bitcoin signature verification identifier; generate a complete first transfer transaction according to the unsigned first transfer transaction and the second signature data; and send the complete first transfer transaction to the blockchain network, so that the implementation of multi-signature is more flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0027] Figure 1 A flowchart of a multi-signature method provided by one embodiment of the present invention.
[0028] Figure 2 A flowchart of another multi-signature method provided by an embodiment of the present invention.
[0029] Figure 3 A schematic diagram of the structure of a device provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0030] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0031] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0032] Figure 1 The following is a flowchart of a multi-signature method provided by one embodiment of the present invention. Figure 1 As shown, in this embodiment, the present invention provides a multi-signature method applicable to a client, the current blockchain is a non-Bitcoin blockchain, and the method includes:
[0033] S10: Generate a locking script according to the first public key of the current user, the pre-configured second public keys of each first user, and the pre-configured multi-signature rule, generate a first multi-signature public key according to the locking script, and generate a first multi-signature address according to the first multi-signature public key;
[0034] S13: Generate an unsigned first transfer transaction; wherein the transaction initiator address of the unsigned first transfer transaction is a first multi-signature address;
[0035] S14: construct a first Bitcoin temporary transaction according to the unsigned first transfer transaction; wherein the first Bitcoin temporary transaction has only one first input UTXO, and the first input UTXO includes the hash value of the first transfer transaction;
[0036] S15: broadcasting the unsigned first transfer transaction to the clients of each first user, so that the clients of the first users can: construct a first temporary Bitcoin transaction according to the unsigned first transfer transaction and generate first signature data according to the first temporary Bitcoin transaction, the locking script, and the held private key;
[0037] S16: Generate an unlocking script according to the first signature data returned by the client of each first user;
[0038] S17: Generate second signature data of the unsigned first transfer transaction according to the locking script, the unlocking script, and the Bitcoin signature verification identifier;
[0039] S18: Generate a complete first transfer transaction according to the unsigned first transfer transaction and the second signature data;
[0040] S19: Send the complete first transfer transaction to the blockchain network for the blockchain nodes to:
[0041] According to the Bitcoin signature verification mark, it is determined that the complete first transfer transaction is a transaction that needs to be verified by calling the Bitcoin script engine;
[0042] Generate a second multi-signature public key based on the locking script in the complete first transfer transaction, and determine whether the first multi-signature public key is the same as the second multi-signature public key; generate a second multi-signature address based on the first multi-signature public key in the complete first transfer transaction, and determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address;
[0043] When the above judgments are all yes, a second Bitcoin temporary transaction is generated; wherein the second Bitcoin temporary transaction has only one second input UTXO, and the second input UTXO includes the hash value of the first transfer transaction;
[0044] Call the Bitcoin script engine, the locking script in the complete first transfer transaction, and the unlocking script in the complete first transfer transaction to verify whether the first signature data in the locking script conforms to the multi-signature rule: when the verification is successful, execute the complete first transfer transaction.
[0045] Specifically, the locking script includes an OP_CHECKMULTISIG field; a first multi-signature public key is generated according to the locking script; generating a first multi-signature address according to the first multi-signature public key includes "hashing the locking script to generate multiple first multi-signature public keys; hashing the first multi-signature public key to generate a first multi-signature address", generating a complete first transfer transaction according to the unsigned first transfer transaction and the second signature data includes "generating a complete first transfer transaction according to the unsigned first transfer transaction, the second signature data, and the first multi-signature public key", calling the Bitcoin script engine to verify the script to be verified: when the verification is successful, executing the complete first transfer transaction includes "hashing the locking script in the complete first transfer transaction to generate a second multi-signature public key; determining whether the first multi-signature public key and the second multi-signature public key are the same; hashing the first multi-signature public key in the complete first transfer transaction to generate a second multi-signature address; determining whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address; determining whether each first signature data in the locking script complies with the multi-signature rule; and when the above judgments are all yes, executing the complete first transfer transaction" as an example;
[0046] Assume that the current user is A, the first users are B and C, and the pre-configured multi-signature rule is that at least two private key signatures from ABC are required to use the assets in the multi-signature address;
[0047] The client of user A to user C executes step S10 and generates locking script S1 according to pub(A), pub(B), pub(C), and 2 / 3, where S1=2<pub(A)><pub(B)><pub(C)> 3OP_CHECKMULTISIG; Hash S1 to generate a first multi-signature public key P, P = hash(S1); Hash P to generate a first multi-signature address X, X = hash(P);
[0048] User A's client generates a transfer transaction tx0, and the transaction recipient address of tx0 is X;
[0049] User A's client sends tx0 to the blockchain network;
[0050] When the blockchain node successfully executes tx0, it transfers the token specified by tx0 to X. Those skilled in the art should understand that the above tx0 can also be generated by different clients according to actual needs. For example, user A can entrust other clients, or a centralized client with better performance can generate it. If it is entrusted to other clients other than user B or user C, X should be sent to the above other clients so that the above other clients can generate the correct tx0.
[0051] User A's client executes step S13 to generate an unsigned transfer transaction tx1, wherein the transaction initiator address of the unsigned tx1 is X;
[0052] The client of user A executes step S14 to construct a temporary Bitcoin transaction tx2 according to the unsigned tx1; wherein tx2 has only one input UTXO, and the input UTXO includes hash(tx1); those skilled in the art should understand that the input UTXO makes tx1 correspond to tx2;
[0053] User A's client executes step S15 and broadcasts the unsigned tx1 to B and C;
[0054] B and C also construct a temporary Bitcoin transaction tx2 based on the unsigned tx1, and both believe that tx1 is correct. Taking B as an example, B generates signature data based on tx2, S1, and pri(B)<Signature B> And return it to A; similarly, C generates signature data based on tx2, S1, and pri(C)<Signature C> And return it to A; those skilled in the art should understand that user A's client can also generate signature data<Signature A> ;
[0055] User A's client executes step S16, according to<Signature B> ,<Signature C> Generate unlocking script S2, S2 = OP_0<Signature B><Signature C> ; It should be understood by those skilled in the art that if<Signature A> And receive first<Signature B> , then S2=OP_0<Signature B><Signature A> ;
[0056] User A's client executes step S17 to generate the signature data of unsigned tx1 according to S1, S2, and btcscript;
[0057] The client of user A executes step S18 to generate a complete tx1 based on the unsigned tx1 and the signature data of the unsigned tx1;
[0058] User A's client executes step S19 and sends the complete tx1 to the blockchain network;
[0059] The blockchain node determines that the complete tx1 is a transaction that needs to call the Bitcoin script engine for verification based on the btcscript in the complete tx1;
[0060] The blockchain node generates a multi-signature public key P' based on S1 in the complete tx1, and determines whether P and P' are the same; generates X' based on P of the complete tx1, and determines whether the transaction initiator address X of the complete tx1 is the same as X';
[0061] When the above judgments are all yes, the blockchain node generates a temporary Bitcoin transaction tx3; tx3 has only one input UTXO, and the input UTXO includes hash(tx1);
[0062] The blockchain node calls the Bitcoin script engine, completes S1 in tx1, and completes S2 in tx1 to verify whether the signature data in the locking script complies with the multi-signature rules, that is, executes OP_0<Signature B><Signature C> 2<pub(A)><pub(B)><pub(C)> 3OP_CHECKMULTISIG, when the execution result is true, it means that the multi-signature rules are met and the complete tx1 is executed.
[0063] Those skilled in the art should understand that when any of the above judgments is not yes, the execution of tx1 fails. When there are insufficient tokens specified by tx1 in X, the execution of tx1 fails.
[0064] In more embodiments, the method of generating a first multi-signature public key according to a locking script and generating a first multi-signature address according to the first multi-signature public key can also be configured according to actual needs, for example, configured as "hashing the locking script three times to generate a first multi-signature public key, and hashing the first multi-signature public key to generate a first multi-signature address"; accordingly, the corresponding steps of "generating a second multi-signature public key according to the locking script in the complete first transfer transaction, and determining whether the first multi-signature public key is the same as the second multi-signature public key; generating a second multi-signature address according to the first multi-signature public key in the complete first transfer transaction, and determining whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address" need to be configured; the same technical effect can be achieved.
[0065] In more embodiments, the client of user a may also configure the conditions for generating the unsigned first transfer transaction according to actual needs; for example, the client of user a generates the unsigned first transfer transaction only when it detects that the number of tokens in X is greater than 0; the same technical effect may be achieved.
[0066] In more embodiments, the Bitcoin standard script used can also be configured as other standard scripts according to actual needs to achieve the same technical effect.
[0067] The above embodiment makes the implementation of multi-signature more flexible. For example, the pre-configured multi-signature rule is modified to: the private key signature of address A and one of the private key signatures of B and C are required to control the assets of X. The locking script S1' can be directly modified, S1'=<pu b(A)> OP_CHECKSIGVERIFY 1<pub(B)><pub(C)> 2OP_CHECKMULTISIG; Generate P', X' and unlock script S2' according to S1', S2'=OP_0<Si gnature B><Signature A> , or, OP_0<Signature C><Signature A> .
[0068] Figure 2 A flowchart of another multi-signature method provided by an embodiment of the present invention. Figure 2 As shown, in this embodiment, the present invention provides a multi-signature method applicable to a blockchain node, and the current blockchain is a non-Bitcoin blockchain. The method includes:
[0069] S21: receiving a complete first transfer transaction; wherein the complete first transfer transaction is generated by the second client of the second user according to the unsigned first transfer transaction and the second signature data of the unsigned first transfer transaction, the second signature data is generated according to the locking script, the unlocking script, and the Bitcoin signature verification identifier, the unlocking script is generated according to each first signature data, the first signature data is generated by the first client of the first user according to the unsigned first transfer transaction after receiving the unsigned first transfer transaction, and the first Bitcoin temporary transaction is generated according to the first Bitcoin temporary transaction, the locking script, and the private key held, the first Bitcoin temporary transaction is also generated by the second client according to the unsigned first transfer transaction, the unsigned first transfer transaction is generated by the second client, the transaction initiator address of the unsigned first transfer transaction is the first multi-signature address, the first multi-signature address is generated according to the first multi-signature public key, the first multi-signature public key is generated according to the locking script, and the locking script is generated according to the first public key of the second user, the pre-configured second public keys of the first users, and the pre-configured multi-signature rule;
[0070] S221: judging, according to the Bitcoin signature verification identifier, that the complete first transfer transaction is a transaction that needs to be verified by calling the Bitcoin script engine;
[0071] S222: Generate a second multi-signature public key according to the locking script in the complete first transfer transaction, and determine whether the first multi-signature public key is the same as the second multi-signature public key; generate a second multi-signature address according to the first multi-signature public key in the complete first transfer transaction, and determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address;
[0072] S223: When the above judgments are all yes, a second temporary Bitcoin transaction is generated; wherein the second temporary Bitcoin transaction has only one second input UTXO, and the second input UTXO includes the hash value of the first transfer transaction;
[0073] S224: Call the Bitcoin script engine, the locking script in the complete first transfer transaction, and the unlocking script in the complete first transfer transaction to verify whether each first signature data in the locking script complies with the multi-signature rule: when the verification is successful, execute the complete first transfer transaction.
[0074] The multi-signature principle of the above embodiment can be referred to Figure 1 The method shown will not be repeated here.
[0075] Figure 3 A schematic diagram of the structure of a device provided in one embodiment of the present invention.
[0076] like Figure 3 As shown, as another aspect, the present application also provides a device, including one or more central processing units (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0077] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
[0078] In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing any of the above methods. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311.
[0079] As another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application.
[0080] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs a specified function or operation, or can be realized by a combination of dedicated hardware and computer instructions.
[0081] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor. For example, each of the units may be a software program arranged in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0082] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.
Claims
1. A multi-signature method, characterized in that: The current blockchain is a non-Bitcoin blockchain, and the method is applicable to a client, and the method includes: generating a locking script according to a first public key of a current user, a preconfigured second public key of each first user, and a preconfigured multi-signature rule, generating a first multi-signature public key according to the locking script, and generating a first multi-signature address according to the first multi-signature public key; Generate an unsigned first transfer transaction; wherein the transaction initiator address of the unsigned first transfer transaction is the first multi-signature address; Constructing a first temporary Bitcoin transaction according to the unsigned first transfer transaction; wherein the first temporary Bitcoin transaction has only one first input UTXO, and the first input UTXO includes a hash value of the first transfer transaction; Broadcasting the unsigned first transfer transaction to the client of each of the first users, so that the client of the first user can: construct the first temporary Bitcoin transaction according to the unsigned first transfer transaction and generate first signature data according to the first temporary Bitcoin transaction, the locking script, and the held private key; Generate an unlocking script according to the first signature data returned by the client of each of the first users; Generate second signature data of the unsigned first transfer transaction according to the locking script, the unlocking script, and the Bitcoin signature verification identifier; Generate a complete first transfer transaction according to the unsigned first transfer transaction and the second signature data; The complete first transfer transaction is sent to the blockchain network for the blockchain node to: Determining, according to the Bitcoin signature verification identifier, that the complete first transfer transaction is a transaction that requires invoking a Bitcoin script engine for verification; Generate a second multi-signature public key according to the locking script in the complete first transfer transaction, and determine whether the first multi-signature public key is the same as the second multi-signature public key; generate a second multi-signature address according to the first multi-signature public key in the complete first transfer transaction, and determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address; When the above judgments are all yes, a second temporary Bitcoin transaction is generated; wherein the second temporary Bitcoin transaction has only one second input UTXO, and the second input UTXO includes the hash value of the first transfer transaction; Calling the Bitcoin script engine, the locking script in the complete first transfer transaction, and the unlocking script in the complete first transfer transaction to verify whether each of the first signature data in the locking script complies with the multi-signature rule: when the verification is successful, executing the complete first transfer transaction.
2. The method according to claim 1, characterized in that Before generating the unsigned first transfer transaction, the method further includes: generating a second transfer transaction; wherein the transaction recipient address of the second transfer transaction is the first multi-signature address; The second transfer transaction is sent to the blockchain network, so that when the blockchain node successfully executes the second transfer transaction, the token specified in the second transfer transaction is transferred to the first multi-signature address.
3. The method according to claim 1, characterized in that The generating a first multi-signature public key according to the locking script, and generating a first multi-signature address according to the first multi-signature public key comprises: hashing the locking script to generate a first multi-signature public key; hashing the first multi-signature public key to generate a first multi-signature address; Generating a complete first transfer transaction according to the unsigned first transfer transaction and the second signature data comprises: generating a complete first transfer transaction according to the unsigned first transfer transaction, the second signature data, and the first multi-signature public key; The generating a second multi-signature public key according to the locking script in the complete first transfer transaction, and determining whether the first multi-signature public key is the same as the second multi-signature public key; generating a second multi-signature address according to the first multi-signature public key in the complete first transfer transaction, and determining whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address comprises: hashing the locking script in the complete first transfer transaction to generate the second multi-signature public key; Determining whether the first multi-signature public key is the same as the second multi-signature public key; Hash the first multi-signature public key in the complete first transfer transaction to generate a second multi-signature address; Determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address.
4. The method according to claim 1, characterized in that The locking script includes an OP_CHECKMULTISIG field.
5. A multi-signature method, characterized in that: The current blockchain is a non-bitcoin blockchain, and the method is applicable to a blockchain node, and the method includes: receiving a complete first transfer transaction; wherein the complete first transfer transaction is generated by a second client of a second user according to an unsigned first transfer transaction and second signature data of the unsigned first transfer transaction, the second signature data is generated according to a locking script, an unlocking script, and a bitcoin signature verification identifier, the unlocking script is generated according to each first signature data, the first signature data is generated by a first client of a first user according to the unsigned first transfer transaction after receiving the unsigned first transfer transaction, and is generated according to the first bitcoin temporary transaction, the locking script, and a held private key, the first bitcoin temporary transaction is also generated by the second client according to the unsigned first transfer transaction, the unsigned first transfer transaction is generated by the second client, the transaction initiator address of the unsigned first transfer transaction is a first multi-signature address, the first multi-signature address is generated according to a first multi-signature public key, the first multi-signature public key is generated according to the locking script, and the locking script is generated according to the first public key of the second user, the pre-configured second public keys of each first user, and a pre-configured multi-signature rule; Determining, according to the Bitcoin signature verification identifier, that the complete first transfer transaction is a transaction that requires invoking a Bitcoin script engine for verification; Generate a second multi-signature public key according to the locking script in the complete first transfer transaction, and determine whether the first multi-signature public key is the same as the second multi-signature public key; generate a second multi-signature address according to the first multi-signature public key in the complete first transfer transaction, and determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address; When the above judgments are all yes, a second temporary Bitcoin transaction is generated; wherein the second temporary Bitcoin transaction has only one second input UTXO, and the second input UTXO includes the hash value of the first transfer transaction; Calling the Bitcoin script engine, the locking script in the complete first transfer transaction, and the unlocking script in the complete first transfer transaction to verify whether each of the first signature data in the locking script complies with the multi-signature rule: when the verification is successful, executing the complete first transfer transaction.
6. The method according to claim 5, characterized in that Before receiving the complete first transfer transaction, the method further includes: receiving a second transfer transaction; wherein the second transfer transaction is generated by the second client, and the transaction recipient address of the second transfer transaction is the first multi-signature address; When the second transfer transaction is successfully executed, the token specified by the second transfer transaction is transferred to the first multi-signature address.
7. The method according to claim 5, characterized in that The first multi-signature address is generated by hashing the first multi-signature public key, the first multi-signature public key is generated by hashing the locking script, and the complete first transfer transaction is generated according to the unsigned first transfer transaction, the second signature data, and the first multi-signature public key; The generating a second multi-signature public key according to the locking script in the complete first transfer transaction, and determining whether the first multi-signature public key is the same as the second multi-signature public key; generating a second multi-signature address according to the first multi-signature public key in the complete first transfer transaction, and determining whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address comprises: hashing the locking script in the complete first transfer transaction to generate the second multi-signature public key; Determining whether the first multi-signature public key is the same as the second multi-signature public key; Hash the first multi-signature public key in the complete first transfer transaction to generate a second multi-signature address; Determine whether the transaction initiator address of the complete first transfer transaction is the same as the second multi-signature address.
8. The method according to claim 5, characterized in that The locking script includes an OP_CHECKMULTISIG field.
9. A computer device, characterized in that: The device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Chained structure data storage, verification and implementation method, system and device and medium
CN111159288A
Blockchain-implemented systems and methods for secure access control
CN111712845A