An offline Bitcoin key generator for use with air-gapped wallets
Install the package globally for native command line use.
git clone https://github.com/masonicGIT/bitcoin-cli
cd bitcoin-cli
npm install -g
The following model will assume a maximum of 3 cosigners on the wallet with a requirement of 2 signatures from any 2 cosigners to create a valid transaction. The third cosginer is assumed to be not a primary signatory, but an escrow agent who is provisioned to provide a signature in the case of an emergency when 1 of the other 2 cosigners are not available.
Perform Offline
-
Generate three key pairs on three different air-gapped machines.
Enter your password as prompted. This will generate a keypair for import with the Electrum Wallet. The key file will be saved wherever you run the program.
$ bitcoin-cli wallet create Enter password: **** Confirm password: ****
Type
ls
to view the keyfile generated$ ls xpub661MyMwAqRbcGmH2PKakwGL7ZaGur4GTvMfGqbwj3q7hioDCLSg9xDVhiNSykNTyGBqR1KctpQen8aiZWDQS54ndyoMQBEayjJ93eQR9yz4.key
The keyfile generated will contain a public key as well as an encrypted private key. It will resemble the following:
xpub661MyMwAqRbcGmH2PKakwGL7ZaGur4GTvMfGqbwj3q7hioDCLSg9xDVhiNSykNTyGBqR1KctpQen8aiZWDQS54ndyoMQBEayjJ93eQR9yz4 {"iv":"Ut6lqOOEAoP/unzVX3ayuA==","v":1,"iter":10000,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","salt":"yvMQ+qQar54=","ct":"C2TNqG8G7/ShCtltNxwWyDE4wqSgwabO/J2TUMSwgvEQGnIpKunkRyZqzvxggoMH9VpXXpbFzsOm8QXpJUib3782/st0nbjFi9aSBq+PODdz+3mJGBjr3tpfRB6zn0htDbrtn2aT8c/S/bjTQ5O5hDepy4Bvej8="}
Generate each key separately on a unique machine and set the key onto a USB for safe offline storage.
Perform Online
-
Install and open Electrum
Select
multi-signature wallet
and click nextSet a
3 cosigners
and2 signatures
wallet and click nextSelect
use public or private keys
and click nextEnter the 1st cosigners public key and click next
Confirm that the public key is the same one as previously entered, then click next.
Enter the 2nd cosigners public key and click next
Enter the escrow agents public key and click next
Wait for the wallet to be generated
On this screen you should receieve a warning indicated that your wallet is
watch-only
.