Clean up paper/file system wallet docs (#9340)
* Add filesystem wallet page * Move validator paper wallet instructions to validator page * Remove paper wallet staking section * Add steps for multiple fs and paper wallets * Add keypair convention page and better multi-wallet example
This commit is contained in:
parent
6b988155e1
commit
c78b658a92
|
@ -10,11 +10,12 @@
|
|||
* [Paper Wallet Usage](paper-wallet/paper-wallet-usage.md)
|
||||
* [Hardware Wallets](remote-wallet/README.md)
|
||||
* [Ledger Hardware Wallet](remote-wallet/ledger.md)
|
||||
* [File System Wallet](file-system-wallet/README.md)
|
||||
* [Support / Troubleshooting](wallet/support.md)
|
||||
* [Command Line Guide](cli/README.md)
|
||||
* [Install the Solana Command Line Tool Suite](cli/install-solana-cli-tools.md)
|
||||
* [Command Line Conventions](cli/conventions.md)
|
||||
* [Choose a Cluster](cli/choose-a-cluster.md)
|
||||
* [Generate Keys](cli/generate-keys.md)
|
||||
* [Send and Receive Tokens](cli/transfer-tokens.md)
|
||||
* [Delegate Stake](cli/delegate-stake.md)
|
||||
* [Manage Stake Accounts](cli/manage-stake-accounts.md)
|
||||
|
|
|
@ -9,3 +9,10 @@ known as the CLI. We use the command-line because it is the first place the
|
|||
Solana core team deploys new functionality. The command-line interface is not
|
||||
necessarily the easiest to use, but it provides the most direct, flexible, and
|
||||
secure access to your Solana accounts.
|
||||
|
||||
## Getting Started
|
||||
To get started using the Solana Command Line (CLI) tools:
|
||||
- [Install the Solana Tools](install-solana-cli-tools.md)
|
||||
- [Choose a Cluster](choose-a-cluster.md)
|
||||
- [Create a Wallet](../wallet/cli-wallets.md)
|
||||
- [Check out our CLI conventions](conventions.md)
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
# Using Solana CLI
|
||||
|
||||
Before running any Solana CLI commands, let's go over some conventions that
|
||||
you will see across all commands. First, the Solana CLI is actually a collection
|
||||
of different commands for each action you might want to take. You can view the list
|
||||
of all possible commands by running:
|
||||
|
||||
```bash
|
||||
solana --help
|
||||
```
|
||||
|
||||
To zoom in on how to use a particular command, run:
|
||||
|
||||
```bash
|
||||
solana <COMMAND> --help
|
||||
```
|
||||
|
||||
where you replace the text `<COMMAND>` with the name of the command you want
|
||||
to learn more about.
|
||||
|
||||
The command's usage message will typically contain words such as `<AMOUNT>`,
|
||||
`<ACCOUNT_ADDRESS>` or `<KEYPAIR>`. Each word is a placeholder for the *type* of
|
||||
text you can execute the command with. For example, you can replace `<AMOUNT>`
|
||||
with a number such as `42` or `100.42`. You can replace `<ACCOUNT_ADDRESS>` with
|
||||
the base58 encoding of your public key, such as
|
||||
`9grmKMwTiZwUHSExjtbFzHLPTdWoXgcg1bZkhvwTrTww`.
|
||||
|
||||
## Keypair conventions
|
||||
|
||||
Many commands using the CLI tools require a value for a `<KEYPAIR>`. The value
|
||||
you should use for the keypair depend on what type of
|
||||
[command line wallet you created](../wallet/cli-wallets.md).
|
||||
|
||||
For example, the way to display any wallet's address
|
||||
(also known as the keypair's pubkey), the CLI help document shows:
|
||||
```bash
|
||||
solana-keygen pubkey <KEYPAIR>
|
||||
```
|
||||
|
||||
Below, we show how to resolve what you should put in `<KEYPAIR>` depending
|
||||
on your wallet type.
|
||||
|
||||
#### Paper Wallet
|
||||
|
||||
In a paper wallet, the keypair is securely derived from the seed words and
|
||||
optional passphrase you entered when the wallet was create. To use a paper wallet
|
||||
keypair anywhere the `<KEYPAIR>` text is shown in examples or help documents,
|
||||
enter the word `ASK` and the program will prompt you to enter your seed words
|
||||
when you run the command.
|
||||
|
||||
To display the wallet address of a Paper Wallet:
|
||||
```bash
|
||||
solana-keygen pubkey ASK
|
||||
```
|
||||
#### File System Wallet
|
||||
|
||||
With a file system wallet, the keypair is stored in a file on your computer.
|
||||
Replace `<KEYPAIR>` with the complete file path to the keypair file.
|
||||
|
||||
For example, if the file system keypair file location is
|
||||
`/home/solana/my_wallet.json`, to display the address, do:
|
||||
```bash
|
||||
solana-keygen pubkey /home/solana/my_wallet.json
|
||||
```
|
||||
|
||||
#### Hardware Wallet
|
||||
|
||||
If you chose a hardware wallet, use your
|
||||
[keypair URL](../remote-wallet/README.md#specify-a-hardware-wallet-key),
|
||||
such as `usb://ledger?key=0`.
|
||||
```bash
|
||||
solana-keygen pubkey usb://ledger?key=0
|
||||
```
|
|
@ -1,90 +0,0 @@
|
|||
# Generate a Keypair and its Public Key
|
||||
|
||||
In this section, we will generate a keypair, query it for its public key,
|
||||
and verify you control its private key. Before you begin, you will need
|
||||
to:
|
||||
|
||||
* [Install the Solana Tool Suite](install-solana-cli-tools.md)
|
||||
* [Choose a Command-line wallet](../wallet/cli-wallets.md)
|
||||
|
||||
## Generate an FS Wallet Keypair
|
||||
|
||||
Use Solana's command-line tool `solana-keygen` to generate keypair files. For
|
||||
example, run the following from a command-line shell:
|
||||
|
||||
```bash
|
||||
mkdir ~/my-solana-wallet
|
||||
solana-keygen new -o ~/my-solana-wallet/my-keypair.json
|
||||
```
|
||||
|
||||
If you view the file, you will see a long list of numbers, such as:
|
||||
|
||||
```text
|
||||
[42,200,155,187,52,228,32,9,179,129,192,196,149,41,177,47,87,228,5,19,70,82,170,6,142,114,68,85,124,34,165,216,110,186,177,254,198,143,235,59,173,59,17,250,142,32,66,162,130,62,53,252,48,33,148,38,149,17,81,154,95,178,163,164]
|
||||
```
|
||||
|
||||
This file contains your **unencrypted** keypair. In fact, even if you specify
|
||||
a password, that password applies to the recovery seed phrase, not the file. Do
|
||||
not share this file with others. Anyone with access to this file will have access
|
||||
to all tokens sent to its public key. Instead, you should share only its public
|
||||
key. To display its public key, run:
|
||||
|
||||
```bash
|
||||
solana-keygen pubkey ~/my-solana-wallet/my-keypair.json
|
||||
```
|
||||
|
||||
It will output a string of characters, such as:
|
||||
|
||||
```text
|
||||
ErRr1caKzK8L8nn4xmEWtimYRiTCAZXjBtVphuZ5vMKy
|
||||
```
|
||||
|
||||
This is the public key corresponding to the keypair in `~/my-solana-wallet/my-keypair.json`.
|
||||
To verify you hold the private key for a given public key, use `solana-keygen verify`:
|
||||
|
||||
```bash
|
||||
solana-keygen verify <PUBKEY> ~/my-solana-wallet/my-keypair.json
|
||||
```
|
||||
|
||||
where `<PUBKEY>` is the public key output from the previous command.
|
||||
The command will output "Success" if the given public key matches the
|
||||
the one in your keypair file, and "Failed" otherwise.
|
||||
|
||||
## Generate a Paper Wallet Seed Phrase
|
||||
|
||||
See [Creating a Paper Wallet](../paper-wallet/paper-wallet-usage.md#creating-a-paper-wallet).
|
||||
|
||||
To verify you control the private key of that public key, use `solana-keygen verify`:
|
||||
|
||||
```bash
|
||||
solana-keygen verify <PUBKEY> ASK
|
||||
```
|
||||
|
||||
where `<PUBKEY>` is the keypair's public key 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.
|
||||
|
||||
## Generate a Hardware Wallet Keypair
|
||||
|
||||
Keypairs are automatically derived when you query a hardware wallet with a
|
||||
[keypair URL](../remote-wallet/README.md#specify-a-hardware-wallet-key).
|
||||
|
||||
Once you have your keypair URL, use `solana-keygen pubkey` to query the hardware
|
||||
wallet for the keypair's public key:
|
||||
|
||||
```bash
|
||||
solana-keygen pubkey <KEYPAIR>
|
||||
```
|
||||
|
||||
where `<KEYPAIR>` is the keypair URL.
|
||||
|
||||
To verify you control the private key of that public key, use `solana-keygen verify`:
|
||||
|
||||
```bash
|
||||
solana-keygen verify <PUBKEY> <KEYPAIR>
|
||||
```
|
||||
|
||||
The command will output "Success" if the given public key matches the
|
||||
the one at your keypair URL, and "Failed" otherwise.
|
|
@ -155,11 +155,3 @@ prebuilt binaries:
|
|||
```bash
|
||||
solana-install init
|
||||
```
|
||||
|
||||
# Connect to a Cluster
|
||||
|
||||
After you have installed the command line tools, to interact with a live Solana
|
||||
cluster, you need to
|
||||
[configure your local tools to connect to a cluster](choose-a-cluster.md)
|
||||
|
||||
{% page-ref page="choose-a-cluster.md" %}
|
||||
|
|
|
@ -1,94 +1,79 @@
|
|||
# Send and Receive Tokens
|
||||
This page decribes how to receive and send SOL tokens using the command line
|
||||
tools with a command line wallet such as a [paper wallet](../paper-wallet/README.md),
|
||||
a [file system wallet](../file-system-wallet/README.md), or a
|
||||
[hardware wallet](../remote-wallet/README.md). Before you begin, make sure
|
||||
you have created a wallet and have access to its address (pubkey) and the
|
||||
signing keypair. Check out our
|
||||
[conventions for entering keypairs for different wallet types](../cli/conventions.md#keypair-conventions).
|
||||
|
||||
## Receive Tokens
|
||||
|
||||
To receive tokens, you will need an address for others to send tokens to. In
|
||||
Solana, an address is the public key of a keypair. There are a variety
|
||||
of techniques for generating keypairs. The method you choose will depend on how
|
||||
you choose to store keypairs. Keypairs are stored in wallets. Before receiving
|
||||
tokens, you will need to [choose a wallet](../wallet/cli-wallets.md) and
|
||||
[generate keys](generate-keys.md). Once completed, you should have a public key
|
||||
for each keypair you generated. The public key is a long string of base58
|
||||
characters. Its length varies from 32 to 44 characters.
|
||||
|
||||
### Using Solana CLI
|
||||
|
||||
Before running any Solana CLI commands, let's go over some conventions that
|
||||
you will see across all commands. First, the Solana CLI is actually a collection
|
||||
of different commands for each action you might want to take. You can view the list
|
||||
of all possible commands by running:
|
||||
|
||||
```bash
|
||||
solana --help
|
||||
```
|
||||
|
||||
To zoom in on how to use a particular command, run:
|
||||
|
||||
```bash
|
||||
solana <COMMAND> --help
|
||||
```
|
||||
|
||||
where you replace the text `<COMMAND>` with the name of the command you want
|
||||
to learn more about.
|
||||
|
||||
The command's usage message will typically contain words such as `<AMOUNT>`,
|
||||
`<ACCOUNT_ADDRESS>` or `<KEYPAIR>`. Each word is a placeholder for the *type* of
|
||||
text you can execute the command with. For example, you can replace `<AMOUNT>`
|
||||
with a number such as `42` or `100.42`. You can replace `<ACCOUNT_ADDRESS>` with
|
||||
the base58 encoding of your public key. For `<KEYPAIR>`, it depends on what type
|
||||
of wallet you chose. If you chose an fs wallet, that path might be
|
||||
`~/my-solana-wallet/my-keypair.json`. If you chose a paper wallet, use the
|
||||
keyword `ASK`, and the Solana CLI will prompt you for your seed phrase. If
|
||||
you chose a hardware wallet, use your keypair URL, such as `usb://ledger?key=0`.
|
||||
|
||||
### Test-drive your Public Keys
|
||||
## Testing your Wallet
|
||||
|
||||
Before sharing your public key with others, you may want to first ensure the
|
||||
key is valid and that you indeed hold the corresponding private key.
|
||||
|
||||
Try and *airdrop* yourself some play tokens on the developer testnet, called
|
||||
Devnet:
|
||||
In this example, we will create a second wallet in addition to your first wallet,
|
||||
and then transfer some tokens to it. This will confirm that you can send and
|
||||
receive tokens on your wallet type of choice.
|
||||
|
||||
This test example uses our Developer Testnet, called devnet. Tokens issued
|
||||
on devnet have **no** value, so don't worry if you lose them.
|
||||
|
||||
#### Airdrop some tokens to get started
|
||||
|
||||
First, *airdrop* yourself some play tokens on the devnet.
|
||||
|
||||
```bash
|
||||
solana airdrop 10 <RECIPIENT_ACCOUNT_ADDRESS> --url http://devnet.solana.com
|
||||
solana airdrop 10 <RECIPIENT_ACCOUNT_ADDRESS> --url https://devnet.solana.com
|
||||
```
|
||||
|
||||
where you replace the text `<RECIPIENT_ACCOUNT_ADDRESS>` with your base58-encoded
|
||||
public key.
|
||||
public key/wallet address.
|
||||
|
||||
#### Check your balance
|
||||
|
||||
Confirm the airdrop was successful by checking the account's balance.
|
||||
It should output `10 SOL`:
|
||||
|
||||
```bash
|
||||
solana balance <ACCOUNT_ADDRESS> --url http://devnet.solana.com
|
||||
solana balance <ACCOUNT_ADDRESS> --url https://devnet.solana.com
|
||||
```
|
||||
|
||||
Next, prove that you own those tokens by transferring them. The Solana cluster
|
||||
will only accept the transfer if you sign the transaction with the private
|
||||
key corresponding to the sender's public key in the transaction.
|
||||
#### Create a second wallet address
|
||||
|
||||
First, we will need a public key to receive our tokens. Create a second
|
||||
We will need a new address to receive our tokens. Create a second
|
||||
keypair and record its pubkey:
|
||||
|
||||
```bash
|
||||
solana-keygen new --no-passphrase --no-outfile
|
||||
```
|
||||
|
||||
The output will contain the public key after the text `pubkey:`. Copy the
|
||||
public key. We will use it in the next step.
|
||||
The output will contain the address after the text `pubkey:`. Copy the
|
||||
address. We will use it in the next step.
|
||||
|
||||
```text
|
||||
============================================================================
|
||||
pubkey: GKvqsuNcnwWqPzzuhLmGi4rzzh55FhJtGizkhHaEJqiV
|
||||
============================================================================
|
||||
```
|
||||
|
||||
You can also create a second (or more) wallet of any type:
|
||||
[paper](../paper-wallet/paper-wallet-usage.md#creating-multiple-paper-wallet-addresses),
|
||||
[file system](../file-system-wallet/README.md#creating-multiple-file-system-wallet-addresses),
|
||||
or [hardware](../remote-wallet/README.md#multiple-addresses-on-a-single-hardware-wallet).
|
||||
|
||||
#### Transfer tokens from your first wallet to the second address
|
||||
|
||||
Next, prove that you own the airdropped tokens by transferring them.
|
||||
The Solana cluster will only accept the transfer if you sign the transaction
|
||||
with the private keypair corresponding to the sender's public key in the
|
||||
transaction.
|
||||
|
||||
```bash
|
||||
solana transfer --from <KEYPAIR> <RECIPIENT_ACCOUNT_ADDRESS> 5--url http://devnet.solana.com --fee-payer <KEYPAIR>
|
||||
solana transfer --from <KEYPAIR> <RECIPIENT_ACCOUNT_ADDRESS> 5 --url https://devnet.solana.com --fee-payer <KEYPAIR>
|
||||
```
|
||||
|
||||
where you replace `<KEYPAIR>` with the path to a keypair in your wallet,
|
||||
and replace `<RECIPIENT_ACCOUNT_ADDRESS>` with the output of `solana-keygen new` above.
|
||||
where you replace `<KEYPAIR>` with the path to a keypair in your first wallet,
|
||||
and replace `<RECIPIENT_ACCOUNT_ADDRESS>` with the address of your second
|
||||
wallet.
|
||||
|
||||
Confirm the updated balances with `solana balance`:
|
||||
|
||||
|
@ -99,6 +84,58 @@ solana balance <ACCOUNT_ADDRESS> --url http://devnet.solana.com
|
|||
where `<ACCOUNT_ADDRESS>` is either the public key from your keypair or the
|
||||
recipient's public key.
|
||||
|
||||
#### Full example of test transfer
|
||||
```bash
|
||||
$ solana-keygen new --outfile my_solana_wallet.json # Creating my first wallet, a file system wallet
|
||||
Generating a new keypair
|
||||
For added security, enter a passphrase (empty for no passphrase):
|
||||
Wrote new keypair to my_solana_wallet.json
|
||||
==========================================================================
|
||||
pubkey: DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK # Here is the address of the first wallet
|
||||
==========================================================================
|
||||
Save this seed phrase to recover your new keypair:
|
||||
width enhance concert vacant ketchup eternal spy craft spy guard tag punch # If this was a real wallet, never share these words on the internet like this!
|
||||
==========================================================================
|
||||
|
||||
$ solana airdrop 10 DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://devnet.solana.com # Airdropping 10 SOL to my wallet's address/pubkey
|
||||
Requesting airdrop of 10 SOL from 35.233.193.70:9900
|
||||
10 SOL
|
||||
|
||||
$ solana balance DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://devnet.solana.com # Check the address's balance
|
||||
10 SOL
|
||||
|
||||
$ solana-keygen new --no-outfile # Creating a second wallet, a paper wallet
|
||||
Generating a new keypair
|
||||
For added security, enter a passphrase (empty for no passphrase):
|
||||
====================================================================
|
||||
pubkey: 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv # Here is the address of the second, paper, wallet.
|
||||
====================================================================
|
||||
Save this seed phrase to recover your new keypair:
|
||||
clump panic cousin hurt coast charge engage fall eager urge win love # If this was a real wallet, never share these words on the internet like this!
|
||||
====================================================================
|
||||
|
||||
$ solana transfer --from my_solana_wallet.json 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv 5 --url https://devnet.solana.com --fee-payer my_solana_wallet.json # Transferring tokens to the public address of the paper wallet
|
||||
3gmXvykAd1nCQQ7MjosaHLf69Xyaqyq1qw2eu1mgPyYXd5G4v1rihhg1CiRw35b9fHzcftGKKEu4mbUeXY2pEX2z # This is the transaction signature
|
||||
|
||||
$ solana balance DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://devnet.solana.com
|
||||
4.999995 SOL # The sending account has slightly less than 5 SOL remaining due to the 0.000005 SOL transaction fee payment
|
||||
|
||||
$ solana balance 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv --url https://devnet.solana.com
|
||||
5 SOL # The second wallet has now received the 5 SOL transfer from the first wallet
|
||||
|
||||
```
|
||||
|
||||
## Receive Tokens
|
||||
|
||||
To receive tokens, you will need an address for others to send tokens to. In
|
||||
Solana, the wallet address is the public key of a keypair. There are a variety
|
||||
of techniques for generating keypairs. The method you choose will depend on how
|
||||
you choose to store keypairs. Keypairs are stored in wallets. Before receiving
|
||||
tokens, you will need to [create a wallet](../wallet/cli-wallets.md).
|
||||
Once completed, you should have a public key
|
||||
for each keypair you generated. The public key is a long string of base58
|
||||
characters. Its length varies from 32 to 44 characters.
|
||||
|
||||
## Send Tokens
|
||||
|
||||
If you already hold SOL and want to send tokens to someone, you will need
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
# File System Wallet
|
||||
|
||||
This document describes how to create and use a file system wallet with the
|
||||
Solana CLI tools. A file system wallet exists as an unencrypted keypair file
|
||||
on your computer system's filesystem.
|
||||
|
||||
{% hint style="info" %}
|
||||
File system wallets are the **least secure** method of storing SOL tokens.
|
||||
Storing large amounts of tokens in a file system wallet is **not recommended**.
|
||||
{% endhint %}
|
||||
|
||||
## Before you Begin
|
||||
Make sure you have
|
||||
[installed the Solana Command Line Tools](../cli/install-solana-cli-tools.md)
|
||||
|
||||
## Generate a File System Wallet Keypair
|
||||
|
||||
Use Solana's command-line tool `solana-keygen` to generate keypair files. For
|
||||
example, run the following from a command-line shell:
|
||||
|
||||
```bash
|
||||
mkdir ~/my-solana-wallet
|
||||
solana-keygen new --outfile ~/my-solana-wallet/my-keypair.json
|
||||
```
|
||||
|
||||
This file contains your **unencrypted** keypair. In fact, even if you specify
|
||||
a password, that password applies to the recovery seed phrase, not the file. Do
|
||||
not share this file with others. Anyone with access to this file will have access
|
||||
to all tokens sent to its public key. Instead, you should share only its public
|
||||
key. To display its public key, run:
|
||||
|
||||
```bash
|
||||
solana-keygen pubkey ~/my-solana-wallet/my-keypair.json
|
||||
```
|
||||
|
||||
It will output a string of characters, such as:
|
||||
|
||||
```text
|
||||
ErRr1caKzK8L8nn4xmEWtimYRiTCAZXjBtVphuZ5vMKy
|
||||
```
|
||||
|
||||
This is the public key corresponding to the keypair in
|
||||
`~/my-solana-wallet/my-keypair.json`. The public key of the keypair file is
|
||||
your *wallet address*.
|
||||
|
||||
## Verify your Address against your Keypair file
|
||||
|
||||
To verify you hold the private key for a given address, use
|
||||
`solana-keygen verify`:
|
||||
|
||||
```bash
|
||||
solana-keygen verify <PUBKEY> ~/my-solana-wallet/my-keypair.json
|
||||
```
|
||||
|
||||
where `<PUBKEY>` is replaced with your wallet address.
|
||||
The command will output "Success" if the given address matches the
|
||||
the one in your keypair file, and "Failed" otherwise.
|
||||
|
||||
## Creating Multiple File System Wallet Addresses
|
||||
You can create as many wallet addresses as you like. Simply re-run the
|
||||
steps in [Generate a File System Wallet](#generate-a-file-system-wallet-keypair)
|
||||
and make sure to use a new filename or path with the `--outfile` argument.
|
||||
Multiple wallet addresses can be useful if you want to transfer tokens between
|
||||
your own accounts for different purposes.
|
|
@ -52,9 +52,20 @@ solana-keygen new --no-outfile
|
|||
|
||||
{% hint style="warning" %}
|
||||
If the `--no-outfile` flag is **omitted**, the default behavior is to write the
|
||||
keypair to `~/.config/solana/id.json`
|
||||
keypair to `~/.config/solana/id.json`, resulting in a
|
||||
[file system wallet](../file-system-wallet/README.md)
|
||||
{% endhint %}
|
||||
|
||||
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.
|
||||
|
||||
{% hint style="info" %}
|
||||
For added security, increase the seed phrase word count using the `--word-count`
|
||||
argument
|
||||
|
@ -92,8 +103,12 @@ validation.
|
|||
solana-keygen pubkey ASK --skip-seed-phrase-validation
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
{% hint style="info" %}
|
||||
Copy the derived public key to a USB stick for easy usage on networked computers
|
||||
Copy the derived address to a USB stick for easy usage on networked computers
|
||||
{% endhint %}
|
||||
|
||||
{% hint style="info" %}
|
||||
|
@ -109,87 +124,18 @@ solana-keygen pubkey --help
|
|||
|
||||
## Verifying the Keypair
|
||||
|
||||
A keypair can be verified by following a variation on the
|
||||
[offline signing](../offline-signing/README.md) procedure with a dummy transaction.
|
||||
To verify you control the private key of a paper wallet address, use
|
||||
`solana-keygen verify`:
|
||||
|
||||
### Create and Sign a Dummy Transaction
|
||||
|
||||
Use offline signing to acquire the signature of a dummy transaction that can
|
||||
be verified in the next step. A 0 Lamport [transfer](../cli/usage.md#solana-transfer)
|
||||
is used to prevent inadvertent loss of funds. Additionally, an improbable _blockhash_
|
||||
value is specified, as well as using the address of the _system program_ for the `TO`
|
||||
argument, to ensure the transaction would be rejected by the _cluster_ should
|
||||
it be submitted in error.
|
||||
|
||||
Command
|
||||
|
||||
```text
|
||||
solana transfer 11111111111111111111111111111111 0 --sign-only \
|
||||
--keypair ASK --blockhash 11111111111111111111111111111111
|
||||
```bash
|
||||
solana-keygen verify <PUBKEY> ASK
|
||||
```
|
||||
|
||||
Prompt for seed phrase
|
||||
|
||||
```text
|
||||
[keypair] seed phrase:
|
||||
[keypair] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
|
||||
Recovered pubkey `AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi`. Continue? (y/n): y
|
||||
```
|
||||
|
||||
Output
|
||||
|
||||
```text
|
||||
Blockhash: 11111111111111111111111111111111
|
||||
Signers (Pubkey=Signature):
|
||||
AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi=3uZndChSmPoYfaCihC993E7EAHKDsuu53Ge6Dk1K6ULwhJkgcgiHNm9J1Geqq2azW6PKxQTFjC8rMm5bGxRcYWA
|
||||
|
||||
{"blockhash":"11111111111111111111111111111111","signers":["AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi=3uZndChSmPoYfaCihC993E7EAHKDsuu53Ge6Dk1K6ULwhJkgcgiHNm9J1Geqq2azW6PKxQTFjC8rMm5bGxRcYWA"]}
|
||||
```
|
||||
|
||||
### Verify the Signature
|
||||
|
||||
Using the _Signers_ output from the [previous step](#create-and-sign-a-dummy-transaction)
|
||||
to reconstruct the transaction, this time specifying the _pubkey_ and _signature_
|
||||
as in the submission step of [offline signing](../offline-signing/README.md). That is, the `--from` and
|
||||
`--fee-payer` are explicitly set to the _pubkey_ rather than being taken from
|
||||
the keypair (which is not queried this time).
|
||||
|
||||
Command
|
||||
|
||||
```text
|
||||
solana transfer 11111111111111111111111111111111 0 --sign-only --from AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi \
|
||||
--signer AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi=3uZndChSmPoYfaCihC993E7EAHKDsuu53Ge6Dk1K6ULwhJkgcgiHNm9J1Geqq2azW6PKxQTFjC8rMm5bGxRcYWA \
|
||||
--blockhash 11111111111111111111111111111111 --fee-payer AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi
|
||||
```
|
||||
|
||||
Output
|
||||
|
||||
```text
|
||||
Blockhash: 11111111111111111111111111111111
|
||||
Signers (Pubkey=Signature):
|
||||
AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi=3uZndChSmPoYfaCihC993E7EAHKDsuu53Ge6Dk1K6ULwhJkgcgiHNm9J1Geqq2azW6PKxQTFjC8rMm5bGxRcYWA
|
||||
|
||||
{"blockhash":"11111111111111111111111111111111","signers":["AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi=3uZndChSmPoYfaCihC993E7EAHKDsuu53Ge6Dk1K6ULwhJkgcgiHNm9J1Geqq2azW6PKxQTFjC8rMm5bGxRcYWA"]}
|
||||
```
|
||||
|
||||
### An Example of Failure
|
||||
|
||||
To simulate an error the [verification step](#verify-the-signature) is repeated,
|
||||
but with a corrupted _signature_ (the last letter is changed from "A" to "B").
|
||||
|
||||
Command
|
||||
|
||||
```text
|
||||
solana transfer 11111111111111111111111111111111 0 --sign-only --from AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi \
|
||||
--signer AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi=3uZndChSmPoYfaCihC993E7EAHKDsuu53Ge6Dk1K6ULwhJkgcgiHNm9J1Geqq2azW6PKxQTFjC8rMm5bGxRcYWB \
|
||||
--blockhash 11111111111111111111111111111111 --fee-payer AjTz9EX6vXB6EboKpFm7SwrbDannb6icjvEE632D3rfi
|
||||
```
|
||||
|
||||
Output (Error)
|
||||
|
||||
```text
|
||||
Error: BadParameter("Transaction construction failed, incorrect signature or public key provided")
|
||||
```
|
||||
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.
|
||||
|
||||
## Checking Account Balance
|
||||
|
||||
|
@ -200,10 +146,11 @@ To retrieve public keys securely from a paper wallet, follow the
|
|||
Public keys can then be typed manually or transferred via a USB stick to a
|
||||
networked machine.
|
||||
|
||||
Next, configure the `solana` CLI tool to connect to a particular cluster:
|
||||
Next, configure the `solana` CLI tool to
|
||||
[connect to a particular cluster](../cli/choose-a-cluster.md):
|
||||
|
||||
```bash
|
||||
solana config set --url <CLUSTER URL> # (i.e. http://devnet.solana.com)
|
||||
solana config set --url <CLUSTER URL> # (i.e. https://api.mainnet-beta.solana.com)
|
||||
```
|
||||
|
||||
Finally, to check the balance, run the following command:
|
||||
|
@ -212,83 +159,12 @@ Finally, to check the balance, run the following command:
|
|||
solana balance <PUBKEY>
|
||||
```
|
||||
|
||||
In order to check a list of public keys quickly, append public keys to a file,
|
||||
one per line, like so:
|
||||
|
||||
`public_keys.txt`
|
||||
```bash
|
||||
7hTw3XhprjT2DkVxVixtig9eZwHTZ2rksTSYN7Jh5niZ
|
||||
9ufAiSyboCZmmEsoStgLYQfnx9KfqP1ZtDK8Wr1j8SJV
|
||||
# ...
|
||||
```
|
||||
|
||||
And run the following command:
|
||||
```bash
|
||||
while read PUBLIC_KEY;
|
||||
do echo "$PUBLIC_KEY: $(solana balance "$PUBLIC_KEY" | tail -n1)";
|
||||
done < public_keys.txt
|
||||
```
|
||||
|
||||
## Running a Validator
|
||||
|
||||
In order to run a validator, you will need to specify an "identity keypair"
|
||||
which will be used to fund all of the vote transactions signed by your validator.
|
||||
Rather than specifying a path with `--identity <PATH>` you can pass
|
||||
`ASK` to securely input the funding keypair.
|
||||
|
||||
```bash
|
||||
solana-validator --identity ASK --ledger ...
|
||||
|
||||
[identity] seed phrase: 🔒
|
||||
[identity] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
|
||||
```
|
||||
|
||||
You can use this input method for your voting keypair as well:
|
||||
|
||||
```bash
|
||||
solana-validator --identity ASK --authorized-voter ASK --ledger ...
|
||||
|
||||
[identity] seed phrase: 🔒
|
||||
[identity] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
|
||||
[authorized-voter] seed phrase: 🔒
|
||||
[authorized-voter] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
|
||||
```
|
||||
|
||||
Refer to the following page for a comprehensive guide on running a validator:
|
||||
{% page-ref page="../running-validator/README.md" %}
|
||||
|
||||
## Delegating Stake
|
||||
|
||||
Solana CLI tooling supports secure keypair input for stake delegation. To do so,
|
||||
first create a stake account with some SOL. Use the special `ASK` keyword to
|
||||
trigger a seed phrase input prompt for the stake account and use
|
||||
`--keypair ASK` to securely input the funding keypair.
|
||||
|
||||
```bash
|
||||
solana create-stake-account ASK 1 --keypair ASK
|
||||
|
||||
[stake_account] seed phrase: 🔒
|
||||
[stake_account] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
|
||||
[keypair] seed phrase: 🔒
|
||||
[keypair] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
|
||||
```
|
||||
|
||||
Then, to delegate that stake to a validator, use `--keypair ASK` to
|
||||
securely input the funding keypair.
|
||||
|
||||
```bash
|
||||
solana delegate-stake --keypair ASK <STAKE_ACCOUNT_PUBKEY> <VOTE_ACCOUNT_PUBKEY>
|
||||
|
||||
[keypair] seed phrase: 🔒
|
||||
[keypair] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
|
||||
```
|
||||
|
||||
Refer to the following page for a comprehensive guide on delegating stake:
|
||||
{% page-ref page="../running-validator/validator-stake.md" %}
|
||||
|
||||
---
|
||||
|
||||
{% page-ref page="../api-reference/cli.md" %}
|
||||
## 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.
|
||||
|
||||
## Support
|
||||
|
||||
|
|
|
@ -49,6 +49,26 @@ For example, a fully qualified URL for a Ledger device might be:
|
|||
usb://ledger/BsNsvfXqQTtJnagwFWdBS7FBXgnsK8VZ5CmuznN85swK?key=0/0
|
||||
```
|
||||
|
||||
### Multiple Addresses on a Single Hardware Wallet
|
||||
You can derive as many wallet addresses as you like. To view them, simply
|
||||
iterate the `ACCOUNT` and/or `CHANGE` number when specifying the URL path.
|
||||
Multiple wallet addresses can be useful if you want to transfer tokens between
|
||||
your own accounts for different purposes.
|
||||
|
||||
For example, a first address can be viewed with:
|
||||
```bash
|
||||
solana-keygen pubkey usb://ledger?key=0
|
||||
```
|
||||
A second address can be viewed with:
|
||||
```bash
|
||||
solana-keygen pubkey usb://ledger?key=1
|
||||
```
|
||||
A third address:
|
||||
```bash
|
||||
solana-keygen pubkey usb://ledger?key=2
|
||||
```
|
||||
...and so on.
|
||||
|
||||
## Manage Multiple Hardware Wallets
|
||||
|
||||
It is sometimes useful to sign a transaction with keys from multiple hardware
|
||||
|
|
|
@ -74,15 +74,25 @@ solana-keygen pubkey ~/validator-keypair.json
|
|||
|
||||
> Note: The "validator-keypair.json” file is also your \(ed25519\) private key.
|
||||
|
||||
Your validator identity keypair uniquely identifies your validator within the
|
||||
network. **It is crucial to back-up this information.**
|
||||
### Paper Wallet identity
|
||||
|
||||
If you don’t back up this information, you WILL NOT BE ABLE TO RECOVER YOUR
|
||||
VALIDATOR if you lose access to it. If this happens, YOU WILL LOSE YOUR
|
||||
ALLOCATION OF LAMPORTS TOO.
|
||||
You can create a paper wallet for your identity file instead of writing the
|
||||
keypair file to disk with:
|
||||
|
||||
To back-up your validator identify keypair, **back-up your
|
||||
"validator-keypair.json” file to a secure location.**
|
||||
```bash
|
||||
solana-keygen new --no-outfile
|
||||
```
|
||||
|
||||
The corresponding identity public key can now be viewed by running:
|
||||
|
||||
```bash
|
||||
solana-keygen pubkey ASK
|
||||
```
|
||||
and then entering your seed phrase.
|
||||
|
||||
See [Paper Wallet Usage](../paper-wallet/paper-wallet-usage.md) for more info.
|
||||
|
||||
-------
|
||||
|
||||
### Vanity Keypair
|
||||
|
||||
|
@ -94,6 +104,18 @@ solana-keygen grind --starts-with e1v1s
|
|||
|
||||
Depending on the string requested, it may take days to find a match...
|
||||
|
||||
------
|
||||
|
||||
Your validator identity keypair uniquely identifies your validator within the
|
||||
network. **It is crucial to back-up this information.**
|
||||
|
||||
If you don’t back up this information, you WILL NOT BE ABLE TO RECOVER YOUR
|
||||
VALIDATOR if you lose access to it. If this happens, YOU WILL LOSE YOUR
|
||||
ALLOCATION OF LAMPORTS TOO.
|
||||
|
||||
To back-up your validator identify keypair, **back-up your
|
||||
"validator-keypair.json” file or your seed phrase to a secure location.**
|
||||
|
||||
## More Solana CLI Configuration
|
||||
|
||||
Now that you have a keypair, set the solana configuration to use your validator
|
||||
|
@ -176,6 +198,13 @@ solana-validator --identity ~/validator-keypair.json --vote-account ~/vote-accou
|
|||
To force validator logging to the console add a `--log -` argument, otherwise
|
||||
the validator will automatically log to a file.
|
||||
|
||||
> Note: You can use a
|
||||
[paper wallet seed phrase](../paper-wallet/paper-wallet-usage.md)
|
||||
for your `--identity` and/or
|
||||
`--vote-account` keypairs. To use these, pass the respective argument as
|
||||
`solana-validator --identity ASK ... --vote-account ASK ...` and you will be
|
||||
prompted to enter your seed phrases and optional passphrase.
|
||||
|
||||
Confirm your validator connected to the network by opening a new terminal and
|
||||
running:
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ To use a Command Line Wallet, you must first [install the Solana CLI tools](../c
|
|||
A *file system wallet*, aka an FS wallet, is a directory in your computer's
|
||||
file system. Each file in the directory holds a keypair.
|
||||
|
||||
### FS Wallet Security
|
||||
### File System Wallet Security
|
||||
|
||||
An FS wallet is the most convenient and least secure form of wallet. It is
|
||||
convenient because the keypair is stored in a simple file. You can generate as
|
||||
A file system wallet is the most convenient and least secure form of wallet. It
|
||||
is convenient because the keypair is stored in a simple file. You can generate as
|
||||
many keys as you would like and trivially back them up by copying the files. It
|
||||
is insecure because the keypair files are **unencrypted**. If you are the only
|
||||
user of your computer and you are confident it is free of malware, an FS wallet
|
||||
|
@ -28,6 +28,8 @@ keypairs are stored on your computer as files, a skilled hacker with physical
|
|||
access to your computer may be able to access it. Using an encrypted hard
|
||||
drive, such as FileVault on MacOS, minimizes that risk.
|
||||
|
||||
{% page-ref page="../file-system-wallet/README.md" %}
|
||||
|
||||
## Paper Wallet
|
||||
|
||||
A *paper wallet* is a collection of *seed phrases* written on paper. A seed
|
||||
|
|
|
@ -81,7 +81,7 @@ go to the main page of the wallet from which you want to send some SOL tokens:
|
|||
- Under "Recipient Address":
|
||||
- If you already have the receiving address you are going to send to,
|
||||
tap "Paste"
|
||||
- If you are transferring to another Trust Wallet user, you can use the apps'
|
||||
- If you are transferring to another Trust Wallet user, you can use the app's
|
||||
QR code reader by tapping the square icon to the right of the "Paste" button.
|
||||
- Under "Amount", enter the amount of SOL you want to send, or tap "Max"
|
||||
to send **all** of the SOL in your wallet to the new address
|
||||
|
|
Loading…
Reference in New Issue