Hello everyone, welcome to week 5 of Crypto academy's season 3. In today's lecture, professor @sapwood while teaching on the topic "Multisig Wallet(Electrum) - "m of n" Combinations" explained to us how a multisig wallet works using Electrum wallet. Below is my response to the assignment he gave after the class.
Question 1: WHAT IS A MULTI-SIG WALLET? HOW IS IT DIFFERENT FROM A SINGLE KEY WALLET? WHAT ARE THE DIFFERENT USES OF A MULTISIG WALLET?
Multi-sig wallet are defined as those wallets in which every transaction carried out in its network requires more than one signature for it to be signed and broadcasted. Multi-sig wallets are decentralized wallets, thus, each user has his own private key that gives him access to the wallet. Unlike single decentralized wallet that involves only one signature (private key), multi-sig wallets provides the user a Master Public Key (MPK) which he is expected to share with his co-signers. It is this MPK that enables the co-signers to also sign on a transaction before the transaction can be completed in the network.
To better understand this, it's best to think of a multi-sign wallet as a Joint account. In the banking sector, if during the set up of the joint account that it was agreed that before a withdrawal can be made, a certain number of co-signers must sign, the bank honors that agreement. If in the future a number of co-signer(s) less than the agreed number comes to withdraw from the account, the transaction won't be completed, untill the number of co-signers are complete. Same thing applies to multi-sig wallets.
While creating a multi-sign wallet, the user will be asked to select the total number of co-signers who will be allowed to sign a transaction from the wallet. This number is normally denoted as "n". Also, the user will be asked to choose the number of signatures required for a transaction to be processed. This number is denoted as "m".
Based on this agreement, a transaction may require 2 out of 3 signers for it to be approve. Where m = 2 and n = 3. Other ratios of "m" of "n" includes 2 of 2, 2 of 3, 3 of 5, 5 of 7, etc. where the smaller number is "m" and the larger one "n".
Both a single-key wallet and a multi-sig wallet can be a decentralized wallet. The major different between the two is the number of persons who approves a transaction. In single key wallet, only the owner of the wallet has access to the wallets private keys. Thus, he/she alone can initiate and sign a transaction within the network. The user doesn't require to have a Master public key.
In the case of multi-sig wallets, all transactions must be signed by more than one signer. Also, each of the co-signers of the wallet must have access to the MPKs of other co-signers wallet in other to be able to sign and broadcast a transaction within the network.
Below are some of the uses of Multi-sig wallets:
1) Improved Security:
Multi-sig wallets offers a higher level of security than that offered by a single keyed wallet. This is because, before a transaction can be approved multiple keys are required. It is not surprising why businesses prefer to use this kind of wallet.
For instance, businesses can select some of its members to be signatories to the wallet. Thus, before a transaction can be performed in that wallet, all the co-signers must be involved.
Individuals also are not left out. They can create multi-sign wallet for their personal use. Just like a 2-FA, all the individual needs to do is to set it up on different devices such as phones, laptops and so on. Thus, before a transaction is carried out, the user must sign the transaction through his several devices.
2) Joint Account
A group of persons (family, friends, businesses etc) can decide to create a multi-sig wallet so that it can serve as their decentralized joint account for their cryptocurrencies. Just like a bank joint bank account, some of them (if not all) will be required to sign before a transaction can be carried out in the wallet.
3) Escrow Services:
Multi-sig wallets can also be used to conduct escrow services. Here the buyer, seller and the escrow agent (arbitrator) acts as co-signers of the wallet. Assuming the business was conducted successful, both the buyer and the seller can sign on the transaction (as 2 out of 3 signatures are required for a transaction to be approved). In the case were a dispute arises during the transaction, probably one of the parties wasn't being honest, the buyer and the arbitrator or the seller and the arbitrator can sign on the transaction (depending on who is at fault).
Question 2: DOWNLOAD, INSTALL & SET UP A 2-of-3 BTC MULTISIG WALLET(ELECTRUM)? WHAT IS THE DIFFERENCE BETWEEN SEED KEY AND MPK? WOULD YOU SHARE THE SEED KEY OR MPK WITH YOUR CO-SIGNER AND WHY?
For the Android version, go to play store and download Electrum multi-sig wallet. After downloading, install the app.
Click on "open" to launch the Wallet App.
Below, are the steps I took to set up 2 of 3 BTC Electrum multi-sig wallet
After launching the app, I chose the name for my wallet, after which I clicked on "Next".
After clicking on "Next", a page pops up asking you to chose the type of wallet you want to create. I selected Multi-signature wallet.
A page pops up asking me to select the number of cosigners and also the number of signatures required to approve a transaction. I chose "m" as 2 and "n" as 3. After which I clicked on "Next".
After that, I was asked if I wanted to create a new seed or input an old one, I selected "Create a new Seed". Then I clicked on next.
A page containing my twelve seed phrases came up. I was instructed to write it down. (It's worth noting that all co-signers have a seed phrase unique to them). After writing it down in my notebook, I clicked on next.
I was asked to confirm if I saved the seed phrases by re-entering them. After entering them, I clicked on "Next".
After confirming my seed phrases, my Master Public Key was displayed. This key is the MPK which I can share with my co-signers so as to enable them sign a transaction that is to be carried out in this multi-sig Wallet.
Here, I will be asked to put in my co-signers Master public keys. To fulfil this I will reach out to my cosigner's and ask them to send me their Master public key (MPK).
Note:- The co-signers are to follow the steps above so as to generate their own master keys. These three Master public keys must be shared amongst the co-signers, and the three must be secured by each of the co-signers (if possible, offline). Only the master public key should be shared. Other informations like the seed phrases should be kept personal.
When they have sent it, input the MPK of the second co-signer (2/3), and then click "Next".
After that, I will be asked to input the MPK of the third co-signer (3/3), and then click "Next".
Finally, I will be asked to create a password for the wallet. After clicking on next, another page pops up asking me to re-enter my password. I did and then clicked on Next.
With the steps above, I have created the multi-sig wallet. This is shown below.
To check if the wallet addresses are the same in the three co-sign wallet, follow the steps below.
Click on "Recieve"
Set the Expire After Duration (represented by a stopwatch) to "Never".
Click on "Request" then on the wallet address.
I compared the three of them they are all the same. Each address are the same as the one shown above.
The seed key or seems phrase consist of 12-word phrases uniquely combined which serves as a security key to a user's Wallet account. This key is sometimes referred to as seed phrase as it can be used to recover the wallet if eventually the owner loses it. It is available for both single keyed and multi-sig wallet.
While creating a multi-sig wallet, each of the co-signers receive different seed keys, and they are all expected to keep it a secret from the remaining co-signers. It is their own seed key that makes it possible for them to sign a transaction, so it's should be kept private and safe.
MASTER PUBLIC KEY (MPK)
The master public key is a unique set of alphanumeric characters. Just as it's name implies, it is a public key, thus, the co-signers can send it across to one another during the creation of the multi-sig wallet, as without these master public keys, it will be impossible to set up a multi-sig wallet. It's worth noting that the MPK alone cannot be used to sign a transaction. Thus, the user should have no fear in sharing it with his co-signers.
Note:- In Electrum multi-sig wallet, MPKs normally starts with the letter "Z"
No, I won't share my Seed Key. I will only share my Master Public Key with my co-signers.
Looking at the set up, for a multi-sig wallet, you will notice that to set up the wallet, the users are required to share their Master Public Key amongst themselves. This implies that MPK can't be what is used to approve a transaction, as if it was, each of the co-signer's can approve a transaction on his own as he holds the MPK of others.
This is where the seed key comes in. They seed key is like the master security of each of the co-signers Wallet. It is also what enables each of them to sign a transaction independently. Just like any wallet, anyone who has the seed key of a wallet can take control of the wallet anytime he wishes. This is I why I won't share my seed key with them.
Question 3: HOW MANY DIFFERENT "M OF N COMBINATIONS" MULTISIG WALLETS YOU CAN CONSTRUCT IN ELECTRUM? HOW DO YOU EXPORT YOUR SEED & PRIVATE KEY(ELECTRUM) IN A MULTI-SIG WALLET?
The maximum number of M and N combination in Electrum is totally dependent on if the wallet was created using and Android version or using Windows version.
For this assignment I created the multi-sig wallet using the Electrum I downloaded through Google play. The Android version allows the maximum of 5 signature per wallet. This implies 5 of 5 combinations. For a 5 of 5 combination, each of the 5 co-signers must have one (1) private keys and four MPKs from other co-signers in other to validate a transaction. This is shown below.
When I carried out a research, I realized that for wallets created using Windows, the Electrum wallet allows up to 15 co-signers. That implies 15 of 15 combination. For a 15 of 15 combination, each of the 5 co-signers must have 1 private keys and 14 MPKs from other co-signers in other to validate a transaction. This is shown below.
Exporting Seed Key
These are the steps to follow to export the seed key in Electrum (Android Version).
Click on the name of the wallet
When the page opens, under Seed, click on "Tap to Show"
When you do, a menu pops up asking you if you want to display your keys. Click on "Ok".
When you do, your seed keys will be revealed to you.
You can export the seed key by coping it.
Exporting Private key
These are the steps to follow to export the private key.
Click on the three dots (representing menu) on the top right side of the page
Click on "Addresses"
Click on the "Receiving" button, and then on the first wallet as shown below.
When the page opens, under private key, click on "Tap to Show"
When you to, a menu pops up asking you if you want to decrypt your keys. Click on "Ok".
When you do, your private keys will be revealed to you.
You can export the private key by clicking on it and then copying it.
Question 4: PERFORM A REAL TRANSACTION (SEND BTC) TO ANOTHER ADDRESS USING A 2 of 3 MULTISIG WALLETS? (YOU CAN PERFORM A MICRO-TRANSACTION FOR THIS TASK, ALSO SEND A PARTIAL AMOUNT TO DEMONSTRATE YOUR EXPERIENCE WITH CHANGE ADDRESS
Login into the Electrum wallet.
Click on send and fill in informations such as the wallet address you want to send to by clicking on the paste button as shown below.
Type in the number of mBTC you wish to transfer. For this example, I have 1.25127mBTC and I wish to transfer 1.10, as shown below.
After filling the required information, I clicked on "Pay'.
A page pops up, containing the full details of my transaction, so I clicked okay to confirm.
Here I was asked if I really want to send my BTC to address, I clicked on "Ok"
Below is my transaction receipt.
After this, I noticed a notification saying that the transaction was unpaid yet as it was partly signed (1/2).
Remember that the transaction was made from a 2 of 3 multi-sig wallets, which means that one more co-signer apart from the initator needs to sign on the transaction.
For the second signature follow the following steps.
To complete the transaction, Sign the transaction using another co-signer's wallet.
To do so, I logged in on my second device. Then using my second device, I scanned the QR code of the transaction on the first device by clicking on "scan" on the second device.
When I did, an option an option to sign the transaction came up, I clicked on it. When I did, the status of the transaction changed from partly signed to signed.
After the signing, an option to "broadcast" the transaction came up, I clicked on it. Immediately I saw a prompt telling me that my payment has been sent.
I also saw that the details of the completed transaction is recorded on both wallets, as shown below..
The 0.146mBTC remaining from the transaction was sent to a change address as shown in the screenshot below.
Question 5: WHAT IS THE DIFFERENCE BETWEEN RECEIVING ADDRESS & CHANGE ADDRESS? DEMONSTRATE YOUR EXPERIENCE WITH A CHANGE ADDRESS?
Receiving address is a multi-sig wallet address common to all the co-signers, which any of the co-signers can give out in other to receive cryptocurrency (i.e BTC in the case of Electrum). It is from the receiving address or addresses that the asset to be sent out from the multi-sig wallet comes from.
After a transaction has been performed in a Multi-sig wallet, the amount of cryptocurrency (e.g BTC) obtained from the receiving address(es) that is remaining after the transaction (i.e the unspent transaction output UTXO) won't be sent back to the receiving address, rather it will be sent to a "change address". This transfer is done automatically before the whole transaction is concluded.
For instance, in the transaction I carried out in Question 4, I had a total of 1.25127mBTC. I sent 1.1mBTC to another address. The remaining 0.146mBTC (after the transaction fees) was automatically sent to one of the Change addresses in the wallet.
The BTC saved in the change address is not lost, rather, it will be used in future transactions.
When compared to other cryptocurrency wallets, multi-Sig wallets definitely scales higher. This type of wallet has a broader usage than a single keyed wallet. They also offer a higher level of security than single keyed wallet because they require more than one signature before a transaction can be broadcasted.
Thank you professor @sapwood for this wonderful lesson.