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

in SteemitCryptoAcademy3 years ago (edited)


images.jpeg
Source

Introduction

In the crypto world, digital wallets are very important as they serve the purposes of storing cryptocurrencies and also allows for sending and receiving of cryptocurrencies. Most of these wallets needs just a single signature to effect transactions. But revolution has greatly penetrated the crypto world. One of the revolution is the emergence of multiple signature wallet.

3W72119s5BjVs3Hye1oHX44R9EcpQD5C9xXzj68nJaq3CeFGHg4aXRoSVKBjAah2jfmhpobj1ieDNV9hazM4y1pgK3cN2fQ3NkvnE8p4sNkk847PojWAMt.png

1. Multi-Sig Wallet.

Multi-Sig wallet is the crypto wallet which makes use 2 or more signatures before transactions can pull through. This simply means that before transactions are broadcasted, several other signatures are required. These several other signatures required to access or allow transaction broadcast are otherwise known as cryptographic signatures. Cryptographic signatures are unique and case sensitive private keys.

Multi-Sig wallets are combined in the m and n order where;
m = The number of signatures needed to for a successful broadcast of transactions

n = The number of persons that have their signature in the wallet. These persons could be referred to as cosigners.

The m of n combination could be 2 of 3, meaning that atleast 2 out of 3 cosigners need to authorize the transaction before it pulls through, the combination could also be 3 of 5, meaning that atleast 3 out of 5 signatures of cosigners is required to broadcast a transaction, and the m of n combination continues.

Let's say three friends, Mary, Adams and Alex decides to save their crypto in one wallet, and they set up a 2 of 3 multi-sig wallet where each of them holds one key and 2 out the 3 of them must authorize any transaction before it is broadcasted. If they want to make transfer from the wallet, Mary will initiate the transfer and sign it with her key, send the transaction to Adams to also sign with his key. Adams could also send the transaction to Alex thought it is not really necessary because a minimum of 2 signatures has already authorized the transaction and it's ready for broadcast.

How Multi-Sig Wallet Is Different To Single Key Wallet

There are several differences between Multi-Sig wallet and Single key wallet which I have listed below.

Multi-Sig WalletSingle Key Wallet
Security is optimum. If there is attack on keys, the attacker or hacker will have to break through several keys before getting to the funds in the wallet which is not an easy task.The security here is not too strong because if the attacker succeeds in breaking through the single key, the wallet will be at risk.
The authority of different keys is required before transactions can pull throughJust a single key is required for transactions to pull through
In a firm or establishment, unilateral spending of funds from the wallet or account is minimizedOne person can unilaterally spend funds from the account or wallet
Decision making before transactions are broadcasted is distributed among cosignersDecisions are made by just one person.
Risks are shared among cosignersOne person bears all the risk.
An average user finds it difficult to use the wallet as it is not really simplified.An average user can use the wallet because it is simplified.

Different Uses Of Multi-Sig Wallet

Optimum Security: Multi-Sig wallet is used to give more security to funds or assets. If I set up a 2 of 3 multi-sig wallet, then I save each private key in a safe place, if my device is stolen, it will be difficult for the person that stole my device to access my funds because one signature cannot let him broadcast transactions.
Also, hackers who use phishing links will find it difficult to succeed in hacking a multi-sig wallet because if they succeed in hacking a particular key in a particular device, they still won't be able to access the funds in the wallet because another signature(s) is/are required.

Escrow: Two parties for example can sign a transaction using a 2 of 3 multi-sig wallet. A trusted third party can be involved in the transaction to serve as an arbiter in the case of misunderstanding between the two transacting parties.

If I want to buy some goods from Alex, I will first deposit the funds into the multi-sig wallet where neither me nor Alex will be able to take out the funds without reaching a consensus. If the transaction goes smoothly, then we both sign and complete the transaction.
But if there's some misunderstanding, Mike will now step in as third party to settle the dispute and ensure the goods or funds gets to the party that deserve it.

Two-Factor Authentication: A multi-sig wallet user can create a two-factor authentication and use it to access his or her funds in the wallet. But this is not advisable with 2 of 2 multi-sig wallet because if one out of the two keys gets missing, the remaining one cannot give complete access to the wallet. But if it is a 2 of 3 multi-sig wallet, two-factor authentication is ideal.

Multilateral Making Of Decisions: In organizations for example, multi-sig wallet helps spending of funds to be on the agreement of two or more members of the organization as opposed to one single person always spending the funds because it is only that person that has the authority to the wallet.

Account Partnership: Multi-Sig wallet allows family or friends or acquaintance to save their funds in one wallet and not have any fear of one person spending the funds without the consent of others because different signatures will be needed before spending is allowed.

3W72119s5BjVs3Hye1oHX44R9EcpQD5C9xXzj68nJaq3CeFGHg4aXRoSVKBjAah2jfmhpobj1ieDNV9hazM4y1pgK3cN2fQ3NkvnE8p4sNkk847PojWAMt.png

2. The Setup Of 2 Of 3 Btc Multisig Wallet On Electrum


elect.png

First I visited the official website of Electrum which is https://www.electrum.org/, clicked on Download and the clicked on windows installer.


wa.png

As it was successfully downloaded, I got it installed in my PC.
I named the wallet as Wallet-1 and then clicked on Next.


elect 2.png

Then I selected Multi-signature Wallet and the clicked on next.


elect 3.png

On the next field, I will have to chose my m and n wallet combination. So since I want to create a 2 of 3 multi-sig wallet, I will move the slider to 3 for number of cosigners and also move the slider to 2 for number of signatures. Then I hit the Next button.


elect 4.png

I then clicked on Create New Seed and hit Next


elect 5.png

The seed phrase were displayed so I wrote them down in my diary in the order which it is displayed. Writing it in order is very important.
Then I clicked on Next.


elect 6.png

I retyped my seed for confirmation


elect 7.png

The Master Public Key (MPK) was now displayed and I wrote it down in my diary. Then I clicked next.


elect 8.png

At this stage, I need to add a cosigner. The cosigners must have also undergone the above processes.
So I clicked on Enter Cosigner Key


elect 9.png

Then I pasted the cosigner's MPK and then hit the Next button.


elect 10.png

Then I added the next cosigner and clicked on Next


elect 11.png

Pasted the third cosigner's MPK and clicked on Next


elect 12.png

Here, I will have to create a password to encrypt my wallet keys, though its optional. So after creating and confirming the password, I clicked on Next.


elect 13.png

The wallet setup is successful.


elect 14.png

I must confirm that the receiving address of all the cosigners are similar to each other. So I set the expiration date of the receiving address of all the the cosigners to Never. Then I clicked on New Address so as to reveal my Receiving Address and compare it with other cosigners Receiving Address.


wallet _1.png

Here is the second cosigner's Receiving Address


wallet 2.png

And Here is the third cosigner's Receiving Address

So all the three wallets have the same receiving addresses which is;

bc1qzpsy0jh0l4nwjdwftpfutn2m8vn8g9pg787us0z875t3v7tmuvesukg2vu

As all the the Receiving Address are the same, it means that my 2 of 3 multi-sig wallet setup is valid and good to go.

Difference between Seed Key and Master Public Key (MPK)

Seed Key also known as mnemonic phrase or seed phrase is a set of words that ranges between 12 to 24 words used for wallet recovery and re-importation incase a device stops functioning or gets stolen. The Electrum wallet makes use of seed key comprising of 12 words which can be used to authorize a transaction.
Seed phrase must be completely private, not to be stored online or attempted to be committed to memory. Best option for saving seed phrase is to write it in a diary and keep it in a very safe place.

Master Public Key (MPK) is a set of alphanumeric key that enhances multi-sig wallet setup in the Electrum wallet. This key is meant to be shared to other cosigners to be able to complete a multi-sig wallet setup.

Would I Share The Seed Key Or Mpk With My Co-Signer And Why?

I won't share my Seed Key with my cosigners because seed key is a non-shareable key. It is meant to be known and seen by only myself. Sharing my seed key with my cosigners is risky because they could re-import my wallet to their own device(s).

And yes I will always share my Master Public Key with my cosigners because it is shareable and my cosigners need it for the complete setup of a multi-signature wallet.

3W72119s5BjVs3Hye1oHX44R9EcpQD5C9xXzj68nJaq3CeFGHg4aXRoSVKBjAah2jfmhpobj1ieDNV9hazM4y1pgK3cN2fQ3NkvnE8p4sNkk847PojWAMt.png

3 How Many Different "m of n Combinations" Multisig Wallet You Can Construct In Electrum

On Electrum wallet, construction of m combination equals 15, and construction of n combination equals 15


m and n.png

From the m and n sliders in the screenshot above, adjusting the m slider from left to right starts with a minimum number of 1 and ends at a maximum number of 15.
Also, adjusting the n slider starts with a minimum number of 2 and ends at a maximum number of 15.

So combining both the m of n will take the format below

m of nm of n CombinationFinal combination
For m = 1 to 2 and n = 21 of 2 and 2 of 22
For m = 1 to 3 and n = 31 of 3, 2 of 3 and 3 of 33
For m = 1 to 4 and n = 41 of 4, 2 of 4, 3 of 4 and 4 of 44
For m = 1 to 5 and n = 51 of 5, 2 of 5, 3 of 5, 4 of 5 and 5 of 55
For m = 1 to 6 and n = 61 of 6, 2 of 6, 3 of 6, 4 of 6, 5 of 6 and 6 of 66
For m = 1 to 7 and n = 71 of 7, 2 of 7, 3 of 7, 4 of 7, 5 of 7, 6 of 7 and 7 of 77
For m = 1 to 8, n = 81 of 8, 2 of 8, 3 of 8, 4 of 8, 5 of 8, 6 of 8, 7 of 8 and 8 of 88
For m = 1 to 9 and n = 91 of 9, 2 of 9, 3 of 9, 4 of 9, 5 of 9, 6 of 9, 7 of 9, 8 of 9 and 9 of 99
For m = 1 to 10 and n = 101 of 10, 2 of 10, 3 of 10, 4 of 10, 5 of 10, 6 of 10, 7 of 10, 8 of 10, 9 of 10 and 10 of 1010
For m = 1 to 11 and n = 111 of 11, 2 of 11, 3 of 11, 4 of 11, 5 of 11, 6 of 11, 7 of 11, 8 of 11, 9 of 11, 10 of 11 and 11 of 1111
For m = 12 and n = 121 of 12, 2 of 12, 3 of 12, 4 of 12, 5 of 12, 6 of 12, 7 of 12, 8 of 12, 9 of 12, 10 of 12,11 of 12, and 12 of 1212
For m = 1 to 13 and n = 131 of 13, 2 of 13, 3 of 13, 4 of 13, 5 of 13, 6 of 13, 7 of 13, 8 of 13, 9 of 13, 10 of 13, 11 of 13, 12 of 13 and 13 of 1313
For m = 1 to 14 and n = 141 of 14, 2 of 14, 3 of 14, 4 of 14, 5 of 14, 6 of 14, 7 of 14, 8 of 14, 9 of 14, 10 of 14, 11 of 14, 12 of 14, 13 of 14 and 14 of 1414
For m = 1 to 15 and n = 151 of 15, 2 of 15, 3 of 15, 4 of 15, 5 of 15, 6 of 15, 7 of 15, 8 of 15, 9 of 15, 10 of 15, 11 of 15, 12 of 15, 13 of 15, 14 of 15 and 15 of 1515
119

So summation of all the m and n combination will give a grand total of 119 combinations.

Exporting My Wallet's Seed Keys In Electrum


seed.png

To be able to export my seed keys, I'll click on Wallet then click on Seed.


seed 2.png

Provide my wallet password


seed 3.png

And here my seed keys are displayed which I exported them manually to my diary.

Exporting my Wallet's Private Keys in Electrum


seed export.png

To be able to export my private keys, I'll as well click on Wallet. Then select Private Keys and then Export


seed export 2.png

Type in my password


seed export 3.png

I clicked OK after reading the warning message.


seed export 4.png

My private keys were displayed and I selected JSON as the format I want it to be exported then I clicked on Export.


seed export 5.png

I successfully exported my private keys

3W72119s5BjVs3Hye1oHX44R9EcpQD5C9xXzj68nJaq3CeFGHg4aXRoSVKBjAah2jfmhpobj1ieDNV9hazM4y1pgK3cN2fQ3NkvnE8p4sNkk847PojWAMt.png

4. Real Transaction To Another Address Using My 2 Of 3 Multi-Sig Wallet In Electrum

Below are the steps to which I performed a real 2 of 3 multi-sig transaction using the Electrum wallet.


real trans 1.png

From my wallet, I clicked on file


real trans 2.png

Then selected my preferred wallet


real trans 4.png

My wallet is funded with 0.2533 mBTC. I click on Send, pasted the BTC wallet address I want to send BTC to. Typed in a description for the transaction and also the amount I wish to send which 0.173 mBTC. Then I clicked on Pay.


real trans 5.png

I authorized the transaction by providing my wallet password.


real trans 6.png

Here the transaction has been partially signed. So I have to exported the transaction file so that the cosigner wallet can make use of it. I could alternatively have it copied to my clipboard or scanned via QR Code


real trans 7.png

I saved the file as Trans 1.


real trans 10.png

From my cosigner wallet, I clicked on Tools, then clicked on Load Transaction and then click on From File


real trans 9.png

I then clicked on the previously imported file and hit Open.


real trans 11.png

When the file opened, I clicked on Sign. Note from the screenshot above that the transaction status was still partially signed before now.


real trans 12.png

I provided the cosigner wallet password and then click OK.


real trans 13.png

Then I clicked Broadcast.


real trans 14.png

And the transaction was successfully broadcasted. So my unspent transaction output (UTXO) was 0.2533 mBTC. I sent 0.173 mBTC to another BTC wallet. Since Electrum wallet doesn't send fractions of BTC, it allowed my 0.2533 mBTC to be sent as a whole while depositing the partial amount that remained which is 0.076 mBTC in another address known as the Change Address.


real trans 15.png

Here's the transaction details from Blockchain Explorer.

3W72119s5BjVs3Hye1oHX44R9EcpQD5C9xXzj68nJaq3CeFGHg4aXRoSVKBjAah2jfmhpobj1ieDNV9hazM4y1pgK3cN2fQ3NkvnE8p4sNkk847PojWAMt.png

5. What is the Difference Between Receiving Address and Change Address

The Receiving Address is the path through which incoming funds or assets gets to the wallet. Every payment made to the Electrum wallet has its way through the Receiving Address. Receiving address is always denoted by the green color in the Electrum wallet

The Change Address is the address generated automatically to accommodate the partial amounts that remained after the whole amount in the wallet has been spent. Just like change is being given to a buyer by a seller after a particular purchase of goods, the Change address serves as the change collector in the Electrum Wallet. The Change address is always denoted by the yellow color.


adress.png

Just like when I transacted here, the partial remains of 0.076 mBTC automatically found its way to the Change address because my unspent transaction output (UTXO) which is is 0.2335 mBTC cannot be sent or spent partially. It is only spent as a whole.

Conclusion.

Hot wallets are always at the verge of being attacked. But if multiple signature are assigned to these cold wallets, the risk of attacked can be managed and curtailed because the attacker will have to pass through two or more gateways before accessing the funds in the wallet.

Electrum wallet has proven to be a unique and sensitive Bitcoin wallet that allows for multiple signatures before broadcasting of funds can pull through.

Therefore joint accounts, business enterprise accounts and family accounts, and even personal accounts can be better created if oriented with multiple signature wallets.

Thanks for having me
cc:
Prof. @sapwood