Crypto Academy Season 3 | Advanced course - Task 5: Multisig Wallet(Electrum)-- "m of n" Combinations by @sapwood

in hive-108451 •  3 years ago 

Hi all. Today I will be attempting prof @sapwood’s course on multi-sig wallets.

1) What is a Multi-Sig wallet? How is it different from a single key wallet? What are the different uses of Multi-sig wallets?

A multi-sig wallet is a crypto wallet that has more than one private key. Usually, these private keys are managed by different personnel. No transaction can be made from a wallet unless the specified number of signatures is not received.

Whenever you make a crypto transfer from your wallet, you end up using your private key to sign and broadcast the transaction. Without the private key, the transaction cannot be made. Most of us have already used a single key wallet(Wallets with only one private key like that of Metamask, etc). In a multi-sig wallet, two or more than two private keys need to sign a transaction for it to go through.

In the case of a single key wallet, a single private key can control the transfer of the funds. However, in the case of multi-sig wallets, multiple private keys control the funds in a single wallet.

Multi-sig wallets are mainly used to increase the security of the funds that you hold in your wallet. Here are some of its use cases.
1- Enhanced security: Multi-sig wallets increase the security of the funds inside a wallet. We have all seen news of various crypto hacks. In the past, several crypto exchanges have also fallen victims to hacks.
One of the most recent attacks was on an ERC20 token called Bondly. In the case of Bondly, the CEO controlled all the funds with a single private key and these funds were wiped out by the attacker in addition to a number of other things.
They have migrated to a multi-sig wallet. If this was done earlier, the funds of this org would not have been lost. This is because the attacker would have had to get his hands on more than one private keys to be able to steal funds in multi-sig wallets. All reputed exchanges make use of multi-sig wallets to secure their funds.

2- Sense of democracy: Multi-sig wallets bring a sense of democracy as well. When an organization holds a huge amount of funds in its crypto wallet, trusting a single person to do the right thing would be risky. For example, if the funds are supposed to be used for a good cause, then more than one person needs to have a say in the final decision.
In the case of a multi-sig wallet, the leader would still need support from the other private key holders of the wallet to be able to use the funds somewhere.

3- Escrow: An escrow is usually a middle man who would hold the funds until a business deal has been finalized/delivered. One of the examples that I can think of is Fiverr. Here, freelancers, as well as recruiters, use Fiverr(company) as the escrow. Until the freelancer delivers on his promise, the money would not be transferred to his bank account.

If for some reason he absconds, then the money would be returned to the recruiter. A multi-sig wallet could be used in the same way.

In this case, the freelancer, recruiter, and the middle man all three would hold a private key of a 2 of 3 multi-sig wallet. Only after the middle man verifies the work, the funds can be transferred to the freelancer as the middle man and the freelancer can use either key to sign the transaction.

If the freelancer fails to deliver, then the middle man and the recruiter can use their private keys to get their funds back. In both these cases, a multi-sig wallet ensures that the right party receives their funds.

2) Download, install and set up a 2-of-3 BTC Multisig wallet? What is the difference between Seed Key and MPK? Would you share your seed key of MPK with your co-signer and Why?

Here are the steps that you need to follow to set up a 2-of-3 multisig wallet on Electrum:
1- Go to the official website of electrum, https://www.electrum.org, and download the wallet that is compatible with your OS. They have different installers for different OS.


1.PNG
Setting wallet name

2- Install the wallet application and open it. You will now be given an option to create a new wallet. Provide the name of the wallet and click on next.

2.PNG
Select multi-sig option

3- On the next screen choose multi-signature wallet and click on next.

3.PNG
Specify the number of cosigners

4- In this screen, you can choose the total number of co-signers and the minimum required to sign a transaction. I have chosen 2-of-3.

4.PNG
Create new seed phrase

5- In the next screen, choose to create a new seed and click on next.


5.PNG
Seed phrase

6- On the next screen, you will be given your seed phrase. Make sure that you note it down in a safe place and don’t share it with anyone. If you ever lose your private key, the seed phrase can be used to restore your wallet.

7- This screen would request you to enter your seed phrase. You need to enter it in the exact same order and click on next.


6.PNG
MPK

8- On this screen, your master public key is displayed. This is the key that you would be sharing with your cosigners to create the multi-sig wallet.

9- Once you have shared this key with your cosigners, click on the next button. You would then need to enter the master public key of the other two cosigners and click on next.


8.PNG
Set a password

10- Finally, set a password for your wallet file. This is an added layer of security to keep the thieves at bay.

The cosigners would also need to follow all the above steps in their own system.
Now, if you receive any BTC after creating a new receive address, you will be able to see the transaction on all three wallets that we just set up.

Seed phrase Vs MPK

1- Seed Phrase: A seed phrase is a set of 12, 18, or even 24 random words that can be used to restore your wallet on any other system. In a centralized world, if you forget the password to your account, you would either hit the forgot password button or call the customer care number.

In the decentralized crypto world, there is no centralized authority that can restore your private keys. This is why we need a seed phrase that can be used to restore your wallet. The most common usage of the seed phrase is when your laptop accidentally breaks down or you lose your private keys. In either one of these scenarios, only a seed phrase can restore your funds.

2- MPK or Master Public Key: This is the key that gets generated when you try to set up a multi-sig wallet. The MPK is exchanged with the cosigners. This helps the BTC wallet to know who the other cosigners of the wallet are.

Sharing a seed phrase or MPK

The seed phrase is highly confidential and should not be shared with anyone. Anyone who has access to your seed phrase can wipe out all your crypto from your wallet. This is why it is always advised to not store the seed phrase online. Keeping it safely in the form of a paper is the safest way to do this.

The MPK on the other hand needs to be shared with your cosigners. Make sure that they set up their multi-sig wallet with the MPK that you gave them and not someone else’s

3)How many different m of n combinations Multisig wallet can you construct in Electrum? How do you export seed and private keys in a multi-sig wallet?

The number of m of n combinations that we can construct on Electrum varies from device to device. On mobile devices, the app does not allow you to have more than 5 cosigners. So, if you are going to have a mobile device as a cosigner, you can have a maximum of 15 combinations.

This number increases to 119 on computers as it allows users to have up to 15 cosigners.

Exporting seed and private keys:

1- On the mobile app, click on the wallet name.


1627772564953.jpg
You can take a backup from this screen

2- This would open up a page that has the seed phrase(hidden) and a button called export backup. By clicking on that button, you would be able to export the private keys. Exporting the seed phrase is not possible. You need to click on show now and note down the phrase.

3- On the desktop application, you need to click on the wallets tab.

4- You would now see several options in the drop-down menu including seed phrase and private key.

5- If you click on the seed phrase option, you would get a prompt to enter your wallet password. On successful authentication, you will be able to see your seed phrase.


Screenshot (10).png
Export option on desktop wallet

6- To export the private key, you would need to click on the export option inside the private key button. This would export the key to a file.

4) Perform a real transaction using 2-of-3 multi-sig wallet.

To send funds out of your wallet, do the following on a multi-sig wallet.
1- Click on the pay button and fill it with the details of the receiver and the amount that you want to send.


Screenshot 2021-08-01 at 3.42.40 AM.png
This is the advanced screen and the transaction is still unsigned

2- You can then click on the pay button. On the next screen, you can either directly sign the transaction or click on the advanced option to see and edit the details.

Screenshot 2021-08-01 at 3.49.00 AM.png
Partially signed

3- After you click on the sign option, The transaction would show as partially signed. Until the minimum cosigners don’t sign, the broadcast option won’t be seen.

1627772564950.jpg
Only sign option is seen

4- To let other cosigners signee this transaction, you can either click on the export option and send the file to others or we can use a QR code and scan if we have it set up on the mobile.

1627772564946.jpg
Broadcast option came up only after I signed

5- I did it on my phone. As soon as I clicked on the sign button, the broadcast option also showed up. After clicking on the broadcast button, the transaction would enter the mempool and would eventually be picked up in a later block.

Please note that the transaction might stay in the mempool for a while due to Bitcoin’s slow block rate. However, you can set a higher fee if you want the transaction to be confirmed quickly.

5) What is the difference between receiving address and change address? Demonstrate your experience with change address?

1- Receiving address: This is the address that has been solely created for receiving crypto from other users. If you click on receive in the Electrum wallet, you would be given one of the receiving addresses of the wallet.

2- Change address: Supposed you don’t send all your BTC in a single transaction. In the actual transaction, you send the entire amount. The part that you seent the receiver reaches his/her wallet. The remaining change is returned back into your Electrum wallet. However, this doesn’t go back to the same address from which you sent the BTC. It goes into the change address which is solely created for receiving change.


image.png
The receiving and change addresses of my wallet

The best example that I can think about for this is a vegetable vendor scenario. Suppose you buy vegetables for 90 INR and you end up paying 100 INR to the vendor. Hee would then return a change of 10 INR to you. Most of the time, I keep this change in my pocket and do not open my wallet again. The change also belongs to me. However, I keep it in a different location.

Conclusion:

The whole concept of change address was new to me. I had not seen this and this assignment definitely helped me understand it better. Additionally, I had only heard about multi-sig wallets but never knew that I could create and use one by myself. This assignment gave me my first hands-on for all these new things. Looking forward to newer assignments next week.

Here is the BTC transaction ID of my transaction : 0f18ec4c8d6debabe799bb75bce45ee69f4482facd0432316b4b6b53cf8a309d

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
Loading...

You have been upvoted by @sapwood, a Country Representative from INDIA. We are voting with the Steemit Community Curator @steemcurator07 account to support the newcomers coming into Steemit.

Engagement is essential to foster a sense of community. Therefore we would request our members to visit each other's post and make insightful comments.

Thank you