Multi-signature technology (mulTIsig) means that multiple users simultaneously sign a digital asset. It can be simply understood that multiple people in an account have the right to sign and pay.
If an address can only be signed and paid by a private key, the expression is 1/1; and the multi-signature is expressed as m/n, that is, a total of n private keys can be signed to an account, and when m addresses When you sign, you can pay for a transaction. Therefore, m must be less than or equal to n.
Give a few examples:
Multi-signature 2/3 means that 3 people have the right to sign, and two people can sign the bitcoin in this account;
Multi-signature 1/2 means that 2 people can sign, and two people have private keys, and anyone can control the funds.
The principle of multi-signature technology is not very complicated, but it increases the intervention security of third parties, and can realize many application scenarios that require third-party intervention in real-world scenarios. Unlike traditional third-party interventions, this intervention must be determined in advance of the transaction and cannot be changed afterwards.
ProcessThe following is a demonstration example of the metaverse meta-chain cli command.
Each participant obtains the public key of an address through getpublickey, and the private key corresponding to the public key is used to sign the multi-signature transaction created subsequently, and inform the other participants of the public key;
Each participant individually creates a multi-signature with the same signature constraint (ie the same m, n and public key list) using getnewmulTIsig using its own public key, resulting in the same multi-signature address starting with 3: "Pay to script hash "P2SH (Pay-to-Script-Hash);
A participant initiates a multi-signature transaction using create multi-signature address via createmulTIsigtx; you can view the transaction details using the decoderawtx command;
The m participants sign the multi-signature transaction in turn by signmulTIsigtx, and each participant obtains the partially signed transaction from the previous signing participant by means of the chain;
Multi-signature transactions with enough signatures are broadcast via sendrawtx.
example
The example involves three users: test, testam, and kesalin.
1. Acquire and propagate the public key
Each participant obtains the public key of an address through getpublickey, and the private key corresponding to the public key is used to sign the multi-signature transaction that is subsequently created, and to inform the other members of the public key.
// testam gets the public key command:
./mvs-cli getpublickey testam testam "MCJ6vpdCYsVD34XFC22fhqDLfHo7ZtnyM2"
Output:
{
"address" : "MCJ6vpdCYsVD34XFC22fhqDLfHo7ZtnyM2",
"public-key" : "03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e"
}
// kesalin gets the public key command:
./mvs-cli getpublickey kesalin kesalin MHaKHUFwAdcszvQarCmn1Rkq2uRoPQjZwm
Output:
{
"address" : "MHaKHUFwAdcszvQarCmn1Rkq2uRoPQjZwm",
"public-key" : "03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02"
}
// test Get public key Command:
./mvs-cli getpublickey test 123456 MKXa7mtzNaGCEF9vM2sUmmTS93iDpHYd4m
Output:
{
"address" : "MKXa7mtzNaGCEF9vM2sUmmTS93iDpHYd4m",
"public-key" : "02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9"
}
2. Create a multi-signature
Each participant individually creates a multi-signature with the same signature constraint (ie, the same m, n and public key list) using getnewmultisig using its own public key, resulting in the same multi-signature address starting with 3.
In the example, each participant specifies its own public key by -s and -k specifies the public key of the other participants to create a multi-signature with m:n of 2:3, resulting in the same multi-signature address "39hh1NY9xyTKzawD8zFKXgXa7XBwqck6BR"
// testam creates a multi-signal command:
./mvs-cli getnewmultisig testam testam -m 2 -n 3 -s "03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e" -k "03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02" -k "02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9" -d "multisig test"
Output:
{
"address" : "39hh1NY9xyTKzawD8zFKXgXa7XBwqck6BR",
"description" : "multisig test",
"index" : 1,
"m" : 2,
"Multisig-script": "2 [02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9] [03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e] [03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02] 3 checkmultisig",
"n" : 3,
"public-keys" :
[
"02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9",
"03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e",
"03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02"
],
"self-publickey" : "03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e"
}
// kesalin creates a multi-signal command:
./mvs-cli getnewmultisig kesalin kesalin -m 2 -n 3 -s "03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02" -k "03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e" -k "02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9" -d "multisig test"
Output:
{
"address" : "39hh1NY9xyTKzawD8zFKXgXa7XBwqck6BR",
"description" : "multisig test",
"index" : 1,
"m" : 2,
"Multisig-script": "2 [02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9] [03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e] [03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02] 3 checkmultisig",
"n" : 3,
"public-keys" :
[
"02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9",
"03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e",
"03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02"
],
"self-publickey" : "03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02"
}
// test Create multiple signatures Command:
./mvs-cli getnewmultisig test 123456 -m 2 -n 3 -s "02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9" -k "03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02" -k "03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e" -d "multisig test"
Output:
{
"address" : "39hh1NY9xyTKzawD8zFKXgXa7XBwqck6BR",
"description" : "",
"index" : 1,
"m" : 2,
"Multisig-script": "2 [02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9] [03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e] [03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02] 3 checkmultisig",
"n" : 3,
"public-keys" :
[
"02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9",
"03d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e",
"03f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e02"
],
"self-publickey" : "02729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b9"
}
3. Send coins to multiple signature addresses
Participants send virtual currency to the created multi-signature address according to the contractual requirements.
12Inch Coaxial Speaker,12 Inch Coaxial,12 Inch Neodymium Coaxial Speaker,12 Inch Coaxial Speaker
Guangzhou BMY Electronic Limited company , https://www.bmy-speakers.com