Introduction
Multisig is short for multi-signature, a type of electronic signature that enables two or more users to sign a document as a group. Therefore, a multisignature is created through the combination of multiple signatures. Multisig technology is being used in the cryptocurrency world, but its principles have existed long before Bitcoin was created.
Practical Applications of Multisig Wallets
A. Enhanced Security
By using a multisig wallet, users can prevent issues caused by lost or stolen private keys. Therefore, even if one of the keys encounters problems, the funds remain safe.
Imagine that Alice creates a 2-of-3 multisig address and then stores each private key in a different location or device (for example, mobile phone, laptop, and tablet). Even if her mobile phone is stolen, the thief cannot access her funds with just 1 of the 3 keys. Similarly, phishing attacks and malware are less likely to succeed because hackers are more likely to only access one device and a single key.
On the other hand, if Alice loses one of her private keys, she can still access her funds using the other 2 keys.
x-of-y: This means the wallet address is initially created from "y" private keys and the unlock condition requires "x" private keys to participate in unlocking. For example: "2 of 3" means 2 keys registered out of 3 initial keys are required.
B. Two-Factor Authentication
By creating a multisig wallet that requires two keys, Alice can create a two-factor authentication mechanism to access her funds. For example, she could have one private key stored on her laptop and another key on a mobile device (or even on a piece of paper). This ensures that only people with access to both keys can execute transactions.
However, remember that using multisig technology with two-factor authentication can be dangerous - especially if set up as a 2-of-2 multisig address. If one of the keys is lost, you will not be able to access your funds. Therefore, using a 2-of-3 setup or a third-party 2FA service with backup codes is safer. For trading accounts, using Google Authenticator is recommended.
C. Escrow Transactions
Creating a 2-of-3 multisig wallet can enable escrow transactions between two parties (Alice and Bob) with the appearance of a third party (Charlie) as an arbitrator trusted by both parties in case of disputes.
According to the scenario, Alice first deposits funds, and the funds will be locked (neither user can access them). Then, if Bob provides goods or services as agreed, both can use their keys to sign and complete the transaction.
Charlie, the arbitrator, will only participate if there is a dispute. When a dispute occurs, he can use his key to create a signature that will be given to Alice or Bob depending on Charlie's decision.
D. Decision Making
A board of directors can use multisig wallets to control access to company funds. For example, by setting up a 4-of-6 wallet where each board member holds a key, no single board member can misuse the funds. Only decisions with majority approval can be executed.
Multisig Wallets in Cardano
A. Basic Definition
Cardano's Multisig wallets have the ability to provide and track keys related to multi-party transactions. Such transactions are used to transfer funds from addresses where (usually) multiple users must sign the transaction for the funds to be spent. A similar simple form is a joint bank account where two account holders must approve withdrawals from the account.
Cardano has specific support for multisig schemes: funds at a multisig script address are owned by a monetary script that specifies one or more cryptographic signature combinations that must be present to unlock funds at the address. Similarly, Cardano multisig scripts can also be used to capture stake rights on a specific address, shared among different parties.
B. Cardano Scripts / Shelley Addresses
In the Shelley era, Cardano provides six primitives (partially overlapping) to build monetary scripts summarized in the following grammar:
SCRIPT
= SIGNATURE KEY-HASH
| ALL-OF 1*SCRIPT
| ANY-OF 1*SCRIPT
| N-OF UINT 1*SCRIPT
| AFTER SLOT-NO
| BEFORE SLOT-NO
KEY-HASH = 28OCTET
SLOT-NO = UINT
Therefore, scripts are recursive structures that can contain the scripts themselves. For example: a joint account between two parties specifying that any of the two members can spend from that account would be determined by the pseudocode:
JOINT-ACCOUNT := ANY-OF [SIGNATURE key-hash#1, SIGNATURE key-hash#2]
To spend from such a script, one must provide a witness demonstrating ownership of the key associated with key-hash#1 or key-hash#2 (or possibly both).
C. Derivation from Hierarchical Deterministic Wallets
If readers are not yet familiar with hierarchical deterministic wallets (HD wallet), refer to the articles "what is a blockchain wallet" and "Cardano addresses"
Cardano considers HD derivation paths similar to CIP-1852:
m / purpose' / coin_type' / account_ix' / role / index
However, to associate multisig keys with a wallet:
Cardano reserves purpose=1854' to distinguish multisig wallets from standard wallets.
The coin type remains coin_type=1815' to identify Ada registered in SLIP-0044.
The account index (account_ix) can vary across the entire hard domain.
role=0 is used to identify payment keys, while role=2 identifies stake keys. role=1 is not used for multisig wallets.
The index is placed across the entire soft domain, but according to the following rules:
- Wallets must take multisig key indexes sequentially, starting from 0 and up to 2^31-1
- Wallets must prevent creating new multisig keys before previous keys are seen in scripts on-chain
- Wallets must always provide up to 20 consecutive unused multisig keys
Finally, we can summarize the different paths and their corresponding domains in the following table:
D. Rationale for Creating Multisig Wallets
Multisig keys are within the account scope, allowing wallet owners to easily separate their activities.
However, Cardano uses a different purpose primarily for two reasons:
- It prevents mixing standard wallets with shared wallets, which is undesirable and quickly becomes a maintenance nightmare. In particular, it also allows sharing intermediate account keys with co-signers without revealing any information about non-shared keys in our wallet.
- It makes it easy to extend either "purpose" 1852' or 1854' in a similar way. Adding a new role can be done in both schemes very consistently.
Using a different purpose also fits the use case on hardware wallets, who can still rely on a single root to manage multiple wallet types.
One or more keys can be derived from the root public key through soft derivation. This allows participants to easily share their multisig keys to participate in multisig scripts without having to fetch their hardware device. The device is still required to sign.
E. User-Oriented Encoding
How to create multisig addresses will not be covered in this article as it involves many different technical instructions. Methods for creating such addresses are described in the Shelley design specification - section 3.2 - Addresses and Credentials.
Conclusion
Thus, through this article, we have been able to briefly understand what multisig wallets are and their practical applications. It can be said that multisig wallets or multisig keys will increase safety for users, but it comes with certain understanding requirements from users regarding "multisig".
We can also see how Cardano defines and sets standards for multisig wallets to avoid confusion for users as well as create complications in system management.
In the next article, the author will introduce in more detail how to create addresses or multisig wallets on the Cardano platform for readers.
Sources
Internet, CIP-1854, CIP-1852
