2019-11-26 23:56:11 -05:00
|
|
|
# Paper Wallet Usage
|
|
|
|
|
2019-12-05 21:12:41 -05:00
|
|
|
Solana commands can be run without ever saving a keypair to disk on a machine.
|
|
|
|
If avoiding writing a private key to disk is a security concern of yours, you've
|
|
|
|
come to the right place.
|
2019-11-26 23:56:11 -05:00
|
|
|
|
|
|
|
{% hint style="warning" %}
|
2019-12-05 21:12:41 -05:00
|
|
|
Even using this secure input method, it's still possible that a private key gets
|
|
|
|
written to disk by unencrypted memory swaps. It is the user's responsibility to
|
|
|
|
protect against this scenario.
|
2019-11-26 23:56:11 -05:00
|
|
|
{% endhint %}
|
|
|
|
|
2020-03-04 15:21:42 -08:00
|
|
|
## Before You Begin
|
|
|
|
|
2020-03-26 13:42:05 -06:00
|
|
|
- [Install the Solana command-line tools](../cli/install-solana-cli-tools.md)
|
2020-03-04 15:21:42 -08:00
|
|
|
|
|
|
|
### Check your installation
|
|
|
|
|
|
|
|
Check that `solana-keygen` is installed correctly by running:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana-keygen --version
|
|
|
|
```
|
|
|
|
|
2019-12-19 20:59:07 -05:00
|
|
|
## Creating a Paper Wallet
|
|
|
|
|
|
|
|
Using the `solana-keygen` tool, it is possible to generate new seed phrases as
|
|
|
|
well as derive a keypair from an existing seed phrase and (optional) passphrase.
|
|
|
|
The seed phrase and passphrase can be used together as a paper wallet. As long
|
|
|
|
as you keep your seed phrase and passphrase stored safely, you can use them to
|
|
|
|
access your account.
|
|
|
|
|
|
|
|
{% hint style="info" %}
|
|
|
|
For more information about how seed phrases work, review this
|
|
|
|
[Bitcoin Wiki page](https://en.bitcoin.it/wiki/Seed_phrase).
|
|
|
|
{% endhint %}
|
|
|
|
|
|
|
|
### Seed Phrase Generation
|
|
|
|
|
|
|
|
Generating a new keypair can be done using the `solana-keygen new` command. The
|
|
|
|
command will generate a random seed phrase, ask you to enter an optional
|
|
|
|
passphrase, and then will display the derived public key and the generated seed
|
|
|
|
phrase for your paper wallet.
|
|
|
|
|
2020-01-30 17:20:04 -07:00
|
|
|
After copying down your seed phrase, you can use the
|
|
|
|
[public key derivation](#public-key-derivation) instructions to verify that you
|
|
|
|
have not made any errors.
|
|
|
|
|
2019-12-19 20:59:07 -05:00
|
|
|
```bash
|
|
|
|
solana-keygen new --no-outfile
|
|
|
|
```
|
|
|
|
|
|
|
|
{% hint style="warning" %}
|
|
|
|
If the `--no-outfile` flag is **omitted**, the default behavior is to write the
|
2020-04-06 19:32:02 -06:00
|
|
|
keypair to `~/.config/solana/id.json`, resulting in a
|
|
|
|
[file system wallet](../file-system-wallet/README.md)
|
2019-12-19 20:59:07 -05:00
|
|
|
{% endhint %}
|
|
|
|
|
2020-04-06 19:32:02 -06:00
|
|
|
The output of this command will display a line like this:
|
|
|
|
```
|
|
|
|
pubkey: 9ZNTfG4NyQgxy2SWjSiQoUyBPEvXT2xo7fKc5hPYYJ7b
|
|
|
|
```
|
|
|
|
|
|
|
|
The value shown after `pubkey:` is your *wallet address*.
|
|
|
|
|
|
|
|
**Note:** In working with paper wallets and file system wallets, the terms "pubkey"
|
|
|
|
and "wallet address" are sometimes used interchangably.
|
|
|
|
|
2019-12-19 20:59:07 -05:00
|
|
|
{% hint style="info" %}
|
|
|
|
For added security, increase the seed phrase word count using the `--word-count`
|
|
|
|
argument
|
|
|
|
{% endhint %}
|
|
|
|
|
|
|
|
For full usage details run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana-keygen new --help
|
|
|
|
```
|
|
|
|
|
|
|
|
### Public Key Derivation
|
|
|
|
|
|
|
|
Public keys can be derived from a seed phrase and a passphrase if you choose to
|
|
|
|
use one. This is useful for using an offline-generated seed phrase to
|
|
|
|
derive a valid public key. The `solana-keygen pubkey` command will walk you
|
|
|
|
through entering your seed phrase and a passphrase if you chose to use one.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana-keygen pubkey ASK
|
|
|
|
```
|
|
|
|
|
|
|
|
{% hint style="info" %}
|
|
|
|
Note that you could potentially use different passphrases for the same seed
|
|
|
|
phrase. Each unique passphrase will yield a different keypair.
|
|
|
|
{% endhint %}
|
|
|
|
|
|
|
|
The `solana-keygen` tool uses the same BIP39 standard English word list as it
|
|
|
|
does to generate seed phrases. If your seed phrase was generated with another
|
|
|
|
tool that uses a different word list, you can still use `solana-keygen`, but
|
|
|
|
will need to pass the `--skip-seed-phrase-validation` argument and forego this
|
|
|
|
validation.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana-keygen pubkey ASK --skip-seed-phrase-validation
|
|
|
|
```
|
|
|
|
|
2020-04-06 19:32:02 -06:00
|
|
|
After entering your seed phrase with `solana-keygen pubkey ASK` the console
|
|
|
|
will display a string of base-58 character. This is the *wallet address*
|
|
|
|
associated with your seed phrase.
|
|
|
|
|
2019-12-19 20:59:07 -05:00
|
|
|
{% hint style="info" %}
|
2020-04-06 19:32:02 -06:00
|
|
|
Copy the derived address to a USB stick for easy usage on networked computers
|
2019-12-19 20:59:07 -05:00
|
|
|
{% endhint %}
|
|
|
|
|
|
|
|
{% hint style="info" %}
|
|
|
|
A common next step is to [check the balance](#checking-account-balance) of the
|
|
|
|
account associated with a public key
|
|
|
|
{% endhint %}
|
|
|
|
|
|
|
|
For full usage details run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana-keygen pubkey --help
|
|
|
|
```
|
2020-02-20 14:19:35 -07:00
|
|
|
|
|
|
|
## Verifying the Keypair
|
|
|
|
|
2020-04-06 19:32:02 -06:00
|
|
|
To verify you control the private key of a paper wallet address, use
|
|
|
|
`solana-keygen verify`:
|
2020-02-20 14:19:35 -07:00
|
|
|
|
2020-04-06 19:32:02 -06:00
|
|
|
```bash
|
|
|
|
solana-keygen verify <PUBKEY> ASK
|
2020-02-20 14:19:35 -07:00
|
|
|
```
|
|
|
|
|
2020-04-06 19:32:02 -06:00
|
|
|
where `<PUBKEY>` is replaced with the wallet address and they keyword `ASK` tells the
|
|
|
|
command to prompt you for the keypair's seed phrase. Note that for security
|
|
|
|
reasons, your seed phrase will not be displayed as you type. After entering your
|
|
|
|
seed phrase, the command will output "Success" if the given public key matches the
|
|
|
|
keypair generated from your seed phrase, and "Failed" otherwise.
|
2020-02-20 14:19:35 -07:00
|
|
|
|
2019-12-09 15:35:18 -08:00
|
|
|
## Checking Account Balance
|
|
|
|
|
|
|
|
All that is needed to check an account balance is the public key of an account.
|
|
|
|
To retrieve public keys securely from a paper wallet, follow the
|
2019-12-19 20:59:07 -05:00
|
|
|
[Public Key Derivation](#public-key-derivation) instructions on an
|
2019-12-09 15:35:18 -08:00
|
|
|
[air gapped computer](https://en.wikipedia.org/wiki/Air_gap_\(networking\)).
|
2019-12-19 20:59:07 -05:00
|
|
|
Public keys can then be typed manually or transferred via a USB stick to a
|
2019-12-09 15:35:18 -08:00
|
|
|
networked machine.
|
|
|
|
|
2020-04-06 19:32:02 -06:00
|
|
|
Next, configure the `solana` CLI tool to
|
|
|
|
[connect to a particular cluster](../cli/choose-a-cluster.md):
|
2019-12-09 15:35:18 -08:00
|
|
|
|
|
|
|
```bash
|
2020-04-06 19:32:02 -06:00
|
|
|
solana config set --url <CLUSTER URL> # (i.e. https://api.mainnet-beta.solana.com)
|
2019-12-09 15:35:18 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
Finally, to check the balance, run the following command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana balance <PUBKEY>
|
|
|
|
```
|
|
|
|
|
2020-04-06 19:32:02 -06:00
|
|
|
## Creating Multiple Paper Wallet Addresses
|
|
|
|
You can create as many wallet addresses as you like. Simply re-run the
|
|
|
|
steps in [Seed Phrase Generation](#seed-phrase-generation) or
|
|
|
|
[Public Key Derivation](#public-key-derivation) to create a new address.
|
|
|
|
Multiple wallet addresses can be useful if you want to transfer tokens between
|
|
|
|
your own accounts for different purposes.
|
2020-04-01 11:37:52 -06:00
|
|
|
|
|
|
|
## Support
|
|
|
|
|
|
|
|
Check out our [Wallet Support Page](../wallet/support.md) for ways to get help.
|