Bitcoin supports scripting since the day one which gives it capabilities beyond just spending outputs in a "standard" way.

One of such use cases is a multi-signature wallet.

It allows to "lock" outputs in a way that can only be spendable if m-of-n signatures are present.

Multisig is often used to secure one's bitcoin or in an environment with multiple coin hodlers (e.g. company owners) where trust is required.

Using a multi-signature wallet is easy but it may be a bit tricky to set it up at first.

How to Create and Use an Offline Bitcoin Wallet aka Cold Storage with Electrum

In the following tutorial, I'll create a test multi-signature wallet with Trezor, fund it with a small amount of bitcoin and then spend the coins using signatures of the necessary number of cosigners.

  Buy Trezor Learn more

I'll be using the latest Electrum 3.1.3 to set up everything but you can use any wallet that supports multisig and Trezor.

  Download Electrum

Create a multisig wallet

Choose the name for your wallet. Anything goes.

Select Multi-signature wallet and proceed to the next step.

Create your desired M-of-N multi-signature wallet.

Creating a 2-of-2 multi-stignature wallet.

For the purpose of the tutorial, I went with 2-of-2 which means 2 signatures out of 2 are needed to spend funds.

Next, add the first cosigner.

Adding the first cosigner.

It can be an external wallet, but for the sake of simplicity let's create a new seed.

Choose seed type.

Creating a standard (legacy) wallet.

I went with Standard because I wasn't sure about the Segwit support in Electrum in combination with Trezor. It should work but I was too lazy to try.

You may copy the master public key for the future reference but you won't really need it in this case.

A master public key (XPUB) of the multisig wallet.

Add the second cosigner.

Adding the second cosigner.

Connect your Trezor, choose Cosign with hardware device and go to the next step.

Make sure you see your Trezor device in the list.

Freedom Node's Trezor is initialized.

Enter the Trezor's PIN.

Electrum asking for Trezor's PIN.

Unlock the wallet with a passphrase if you use one (I strongly recommend you use one).

Entering the Trezor's passphrase.

Send funds to the multisig wallet

Copy the multi-signature's wallet address and send some test funds to it.

Multi-signature wallet's receiving address.

I used another Electrum wallet to make the transaction, but you can use any wallet you like.

Signing a transaction from the standard wallet to multisig.

Sign the transaction and go back to the multisig wallet.

The transactions has been received and confirmed.

The transaction should confirm soon.

Spend from the multisig wallet and co-sign with Trezor

It's time to test whether you can spend from the multisig wallet.

Send the test funds to your ordinary wallet and sign with the first key (in my case encrypted by password).

Spending coins locked in the multisig.

Enter your Trezor PIN.

Entering the Trezor's PIN.

You should be familiar with this process from the Trezor's web wallet.

You'll be prompted for the passphrase if you use one (I do).

Unlocking the Trezor with a passphrase.

When the Trezor is unlocked it's time to confirm the transaction output.

Make sure the intended address is displayed on your Trezor and click Confirm.

Confirming the transaction address on Trezor.

Next, you'll have to confirm the transaction amount and fee.

Click Confirm on the Trezor if it looks legit.

Confirming the transaction amount and mining fee on Trezor.

The second key will cosign the transaction and Electrum will broadcast it on the network.

Payment was successfully sent.

Go back to your regular wallet.

Payment was received and waiting for confirmation.

You should see the new incoming transaction that should confirm soon.

*****

Multisig is a powerful method of utilizing Bitcoin scripts.

It adds extra protection to your coins and with MAST, it will even become more scalable and private as many different conditions can be defined for the same output.

Together with Trezor, a multi-signature environment is easy to set up and use.

  Buy on trezor.io   Get it on Amazon Now

Just make sure you never lose access to your Trezor because you won't be able to spend those coins.

Zap Wallet for Lightning Network is one of the most beautiful software ever written for Bitcoin.

The bummer is, it isn't officially available for Bitcoin mainnet yet. Developers are busy fixing bugs and making sure the wallet is stable enough for production.

However, that doesn't stop you from pointing it to your mainnet LND node in the meantime, thanks to this new pull request that will hopefully be merged in soon.

But before you start, check out my other tutorial on how to install LND on Bitcoin mainnet first if you haven't already.

I run a remote Lightning node on my Linux server and Zap Wallet on Mac OS.

However, the tutorial will work for any kind of setup as long as the operating systems are UNIX-like. Sorry, no Windows.

Please note, that there are still many features that are exclusive to Bitcoin testnet network. Running Zap with mainnet isn't recommended at this point, unless you feel #reckless.

Prerequisites

Make sure you run node.js >= 8, npm >= 5 and yarn:

node -v
npm -v
yarn -v

In a case any of the above is missing or below the specified version, have a look at installation instructions: node.js (npm is included) and yarn.

If you use a package manager for Linux, visit these instructions for node.js instead.

Install Zap Wallet

Create a source folder if you don't have it already:

mkdir ~/source
cd ~/source

Clone the Zap Wallet from the official repository:

git clone https://github.com/LN-Zap/zap-desktop.git
cd zap-desktop

Install Zap dependencies with yarn.

yarn

Be patient, it may take a few minutes to finish.

Run Zap Wallet

Test that everything has been installed correctly:

npm run test

If the above command fails on a "The renderer process is not built yet." error, run this command first:

npm run build-renderer

Run Zap:

npm run dev

Alternatively, you may build a binary package for your OS:

npm run package

The package will be located in ~/source/zap-desktop/release however, I haven't had luck running it without errors.

Allow incoming connections for a remote grpc (optional)

If your Lightning node runs on a different machine as Zap, you will have to make it accept incoming connections.

Go to your server and add the following line to ~/.lnd/lnd.conf:

rpclisten=0.0.0.0:10009

Next, open the port on your firewall:

sudo iptables -A INPUT -p tcp --dport 10009 -j ACCEPT
sudo iptables-save

I only want my node's grpc to be accessible on the local network. But if you want to be able to connect remotely and your server is behind a router, you will have to setup port forwarding on the router too.

When finished, restart your node:

sudo service lnd stop
sudo service lnd start

Connect to your node

Locate admin.macaroon in ~/.lnd/data/chain/bitcoin/mainnet and tls.cert in the ~/.lnd folder. If the LND node runs on a remote server, copy them to your local machine.

Start the wallet if you haven't already and when prompted for Lightning Connection, choose Custom and click Next.

Zap: How will you connect to the Lightning Network?

In the next step, you will have to setup your Connection Details. and point Zap to the TLS certificate (tls.cert) and Macaroon (admin.macaroon). Make sure to use absolute paths to the files.

If LND runs locally add 127.0.0.1:10009 as your host, otherwise choose the server's IP address or host followed by the port.

Zap: Enter the connection details for your Lightning node

Go to the next step and within a few seconds, you will be connected to your node and ready to use Zap.

Dashboard of Zap Wallet

If you've previously opened channels and made some transactions you'll see them in Zap immediately.

Enjoy!

src

Please let us know what you think in the comments section below.