Tutorial 7 (extra) - Private key management

From RunWiki
Revision as of 02:52, 2 April 2023 by Zhell (talk | contribs)
Jump to: navigation, search

When you publish transactions on Mainnet and Testnet you use private keys. Even for people who have been in Bitcoin for a long time, managing keys is a challenge. The more we abstract away key management with services like PayMail, the better a user experience people will have.

You’re a developer though and you’re using the RUN library, so you’re going to need to learn about private keys and how to manage them. You’ll need a way to save them securely and find them when you need them.

Getting Started

One solid option is a password manager called, Enpass. Download the app on your computer.

Enpass has apps available on Linux, Mac, and Windows. It also works on Android and iOS and has extensions for all the popular web browsers.

The free version for desktops can store unlimited keys and also sync with a cloud service. If you eventually decide to pay for premium to get TouchID or unlock Windows Hello, the pricing is reasonable: $12, one-time. That makes it more affordable than a subscription service like 1password.

You’ll get along just fine with the free version of Enpass for managing your Bitcoin keys.

Setting up the password manager

After the download finishes, open the app and click I am a New User. Type a good Master Password:

/image

You’ll want to strike a balance between security and speed:

The Master Password is all you’ll need to get access to your other passwords and keys. That is a blessing and a curse. It is cool because you’ll be secure on websites and wallets when you create strong passwords for each of them independently and you don’t have to keep all those individually in your head. However, you want the Master Password to be secure because if someone surreptitiously gets access, they’ll have everything. So a longer password with more words and complex special characters is better. That said, you will be typing in the Master Password manually. You want it to be something you can type quickly. When you use a password manager day-to-day, you’ll see why you’d want to pay for premium. With TouchID, your fingerprint grants you access lickety-split without typing the Master Password. Once you’ve chosen your Master Password, click Continue. A new page will let you type it in again to confirm it. Click Continue again.

Once you’re in, the app will show you the Quick Setup panel. You can turn off the convenience features for now and then later enable them if you need them. Click ✔️ to accept.

Adding a password quickly

The quickest way to add a password is to use the keyboard shortcut, Command-Shift-N:

/image

The keyboard shortcut is the same as navigating the menu for File ▸ New Login.

A panel will slide in for Choose Template. Click the Default template:

/image

The panel will slide in for Add:

/image

Copy and paste the following fields:

Title Example: purse
Password L2H2cTHmhf3dRFQjejo3dQCt7N6tNJrKeFbx8LfrinJ7DWDzPDpS

Click Save. And that’s it! You’ve securely locked away your private key.

Here’s what’s happening:


  1. The Title is the search keyword. You want make it descriptive for your use case. If you’re working through a tutorial, you would use tutorial name: wallet name, something like, Pay Server on Testnet: owner. It is a best practice to add both names because then your key will be discoverable later.
  2. The Password is the private key. If you think about it, a private key is a password. It must remain secret at all times. If someone else had your private key, they would be able to spend your money or change the ownership of your jigs. The password manager will keep it safe for you.

That’s all you need to know. In the rest of this tutorial, we’ll go over some convenient power user features that can help you as you manage more, but that is enough to get you going for now.

Managing all the keys

Adding all kinds of keys

A password manager app can suit you nicely for all the keys you have in a Bitcoin life:


  • An owner controls your jigs.
  • A purse controls your bitcoin money.
  • An API Key connects you to a server.
  • Some seed words restore your Money Button or Handcash wallets.

All of them are good candidates to store in the password manager app.

Using your address as the Username

Pro tip: Use your address or public key or as the Username:

/image

The Username is not hidden behind dots:

/image

Both addresses and public keys are sharable with other people after all. So, that’s just fine for them to be visible in the Username field.

By putting your address in the Username field and your private key in the Password field, you keep them tied together.

As you’re busily building apps, you can double check to make sure you’ve got the right one by looking at both the Title for the wallet description and the Username for the place you expect to receive money or jigs.

It also makes it easy to copy and paste when you need to give it to someone who wants to send you bitcoin or a jig:

/image

Click Copy to get your key handily into the clipboard and paste it into another app.

You’ll likely find yourself copying and pasting the address or public key into the WhatsOnChain Block Explorer to see confirmed transactions and discover how RUN works by stepping through your transactions.

Where to go from here

Now that you’ve got a good system of managing your keys, you’re unstoppable. You can take unlimited tutorials 😉 and you’ll always be able to resume your RUN sessions.


Now head over to the documention about Jigs or find something interesting in all the wiki pages