@@ -9,14 +9,17 @@ secure transaction signing.
9
9
- [ Set up a Ledger Nano S with the Solana App] ( ../wallet-guide/ledger-live.md )
10
10
- [ Install the Solana command-line tools] ( ../cli/install-solana-cli-tools.md )
11
11
12
- ## Use Ledger Device with Solana CLI
12
+ ## Use Ledger Nano S with Solana CLI
13
13
14
14
1 . Ensure the Ledger Live application is closed
15
15
2 . Plug your Ledger device into your computer's USB port
16
16
3 . Enter your pin and start the Solana app on the Ledger device
17
17
4 . Press both buttons to advance past the "Pending Ledger review" screen
18
18
5 . Ensure the screen reads "Application is ready"
19
- 6 . On your computer, run:
19
+
20
+ ### View your Wallet ID
21
+
22
+ On your computer, run:
20
23
21
24
``` bash
22
25
solana-keygen pubkey usb://ledger
@@ -25,39 +28,172 @@ solana-keygen pubkey usb://ledger
25
28
This confirms your Ledger device is connected properly and in the correct state
26
29
to interact with the Solana CLI. The command returns your Ledger's unique
27
30
* wallet ID* . When you have multiple Nano S devices connected to the same
28
- computer, you can use your wallet key to specify which Ledger hardware wallet
29
- you want to use. Run the same command again, but this time, with its fully
30
- qualified URL:
31
+ computer, you can use your wallet ID to specify which Ledger hardware wallet
32
+ you want to use. If you only plan to use a single Nano S on your computer
33
+ at a time, you don't need to include the wallet ID. For information on
34
+ using the wallet ID to use a specific Ledger, see
35
+ [ Manage Multiple Hardware Wallets] ( #manage-multiple-hardware-wallets ) .
36
+
37
+ ### View your Wallet Addresses
38
+
39
+ Your Nano S supports an arbitrary number of valid wallet addresses and signers.
40
+ To view any address, use the ` solana-keygen pubkey ` command, as shown below,
41
+ followed by a valid [ keypair URL] ( README.md#specify-a-keypair-url ) .
42
+
43
+ Multiple wallet addresses can be useful if you want to transfer tokens between
44
+ your own accounts for different purposes, or use different keypairs on the
45
+ device as signing authorities for a stake account, for example.
46
+
47
+ All of the following commands will display different addresses, associated with
48
+ the keypair path given. Try them out!
31
49
32
50
``` bash
33
- solana-keygen pubkey usb://ledger/< WALLET_ID>
51
+ solana-keygen pubkey usb://ledger
52
+ solana-keygen pubkey usb://ledger? key=0
53
+ solana-keygen pubkey usb://ledger? key=1
54
+ solana-keygen pubkey usb://ledger? key=2
34
55
```
35
56
36
- where you replace ` <WALLET_ID> ` with the output of the first command.
37
- Confirm it prints the same wallet ID as before.
57
+ You can use other values for the number after ` key= ` as well.
58
+ Any of the addresses displayed by these commands are valid Solana wallet
59
+ addresses. The private portion associated with each address is stored securely
60
+ on the Nano S device, and is used to sign transactions from this address.
61
+ Just make a note of which keypair URL you used to derive any address you will be
62
+ using to receive tokens.
38
63
39
- To learn more about keypair URLs, see
40
- [ Specify A Hardware Wallet Key] ( README.md#specify-a-hardware-wallet-key )
64
+ If you are only planning to use a single address/keypair on your device, a good
65
+ easy-to-remember path might be to use the address at ` key=0 ` . View this address
66
+ with:
67
+ ``` bash
68
+ solana-keygen pubkey usb://ledger? key=0
69
+ ```
41
70
42
- Read more about [ sending and receiving tokens] ( ../cli/transfer-tokens.md ) and
43
- [ delegating stake] ( ../cli/delegate-stake.md ) . You can use your Ledger keypair URL
44
- anywhere you see an option or argument that accepts a ` <KEYPAIR> ` .
71
+ Now you have a wallet address (or multiple addresses), you can share any of
72
+ these addresses publicly to act as a receiving address, and you can use the
73
+ associated keypair URL as the signer for transactions from that address.
74
+
75
+ ### View your Balance
76
+
77
+ To view the balance of any account, regardless of which wallet it uses, use the
78
+ ` solana balance ` command:
79
+ ``` bash
80
+ solana balance SOME_WALLET_ADDRESS
81
+ ```
82
+
83
+ For example, if your address is ` 7cvkjYAkUYs4W8XcXsca7cBrEGFeSUjeZmKoNBvEwyri ` ,
84
+ then enter the following command to view the balance:
85
+ ``` bash
86
+ solana balance 7cvkjYAkUYs4W8XcXsca7cBrEGFeSUjeZmKoNBvEwyri
87
+ ```
88
+
89
+ You can also view the balance of any account address on the Accounts tab in the
90
+ [ Explorer] ( https://explorer.solana.com/accounts )
91
+ and paste the address in the box to view the balance in you web browser.
92
+
93
+ Note: Any address with a balance of 0 SOL, such as a newly created one on your
94
+ Ledger, will show as "Not Found" in the explorer. Empty accounts and non-existent
95
+ accounts are treated the same in Solana. This will change when your account
96
+ address has some SOL in it.
97
+
98
+ ### Send SOL from a Ledger Nano S
99
+
100
+ To send some tokens from an address controlled by your Nano S device, you will
101
+ need to use the device to sign a transaction, using the same keypair URL you
102
+ used to derive the address. To do this, make sure your Nano S is plugged in,
103
+ unlocked with the PIN, Ledger Live is not running, and the Solana App is open
104
+ on the device, showing "Application is Ready".
105
+
106
+ The ` solana transfer ` command is used to specify to which address to send tokens,
107
+ how many tokens to send, and uses the ` --keypair ` argument to specify which
108
+ keypair is sending the tokens, which will sign the transaction, and the balance
109
+ from the associated address will decrease.
110
+
111
+ ``` bash
112
+ solana transfer RECIPIENT_ADDRESS AMOUNT --keypair KEYPAIR_URL_OF_SENDER
113
+ ```
114
+
115
+ Below is a full example. First, an address is viewed at a certain keypair URL.
116
+ Second, the balance of tht address is checked. Lastly, a transfer transaction
117
+ is entered to send ` 1 ` SOL to the recipient address ` 7cvkjYAkUYs4W8XcXsca7cBrEGFeSUjeZmKoNBvEwyri ` .
118
+ When you hit Enter for a transfer command, you will be prompted to approve the
119
+ transaction details on your Ledger device. On the device, use the right and
120
+ left buttons to review the transaction details. If they look correct, click
121
+ both buttons on the "Approve" screen, otherwise push both buttons on the "Reject"
122
+ screen.
123
+
124
+ ``` bash
125
+ ~ $ solana-keygen pubkey usb://ledger? key=42
126
+ CjeqzArkZt6xwdnZ9NZSf8D1CNJN1rjeFiyd8q7iLWAV
127
+
128
+ ~ $ solana balance CjeqzArkZt6xwdnZ9NZSf8D1CNJN1rjeFiyd8q7iLWAV
129
+ 1.000005 SOL
130
+
131
+ ~ $ solana transfer 7cvkjYAkUYs4W8XcXsca7cBrEGFeSUjeZmKoNBvEwyri 1 --keypair usb://ledger? key=42
132
+ Waiting for your approval on Ledger hardware wallet usb://ledger/2JT2Xvy6T8hSmT8g6WdeDbHUgoeGdj6bE2VueCZUJmyN
133
+ ✅ Approved
134
+
135
+ Signature: kemu9jDEuPirKNRKiHan7ycybYsZp7pFefAdvWZRq5VRHCLgXTXaFVw3pfh87MQcWX4kQY4TjSBmESrwMApom1V
136
+ ```
137
+
138
+ After approving the transaction on your device, the program will display the
139
+ transaction signature, and wait for the maximum number of confirmations (32)
140
+ before returning. This only takes a few seconds, and then the transaction is
141
+ finalized on the Solana network. You can view details of this or any other
142
+ transaction by going to the Transaction tab in the
143
+ [ Explorer] ( https://explorer.solana.com/transactions )
144
+ and paste in the transaction signature.
145
+
146
+ ## Advanced Operations
147
+
148
+ ### Manage Multiple Hardware Wallets
149
+
150
+ It is sometimes useful to sign a transaction with keys from multiple hardware
151
+ wallets. Signing with multiple wallets requires * fully qualified keypair URLs* .
152
+ When the URL is not fully qualified, the Solana CLI will prompt you with
153
+ the fully qualified URLs of all connected hardware wallets, and ask you to
154
+ choose which wallet to use for each signature.
155
+
156
+ Instead of using the interactive prompts, you can generate fully qualified
157
+ URLs using the Solana CLI ` resolve-signer ` command. For example, try
158
+ connecting a Ledger Nano-S to USB, unlock it with your pin, and running the
159
+ following command:
160
+
161
+ ``` text
162
+ solana resolve-signer usb://ledger?key=0/0
163
+ ```
164
+
165
+ You will see output similar to:
166
+
167
+ ``` text
168
+ usb://ledger/BsNsvfXqQTtJnagwFWdBS7FBXgnsK8VZ5CmuznN85swK?key=0/0
169
+ ```
170
+
171
+ but where ` BsNsvfXqQTtJnagwFWdBS7FBXgnsK8VZ5CmuznN85swK ` is your ` WALLET_ID ` .
172
+
173
+ With your fully qualified URL, you can connect multiple hardware wallets to
174
+ the same computer and uniquely identify a keypair from any of them.
175
+ Use the output from the ` resolve-signer ` command anywhere a ` solana ` command
176
+ expects a ` <KEYPAIR> ` entry to use that resolved path as the signer for that
177
+ part of the given transaction.
45
178
46
179
### Install the Solana Beta App
47
180
48
181
You're invited to help us test the latest pre-release version of our Ledger app
49
182
on one of the public testnets.
50
183
51
- You can use the command-line to install the latest Solana Ledger app release before it has been validated by
184
+ You can use the command-line to install the latest Solana Ledger app release
185
+ before it has been validated by
52
186
the Ledger team and made available via Ledger Live. Note that because the app
53
187
is not installed via Ledger Live, you will need to approve installation from an
54
188
"unsafe" manager, as well as see the message, "This app is not genuine" each
55
189
time you open the app. Once the app is available on Ledger Live, you can
56
190
reinstall the app from there, and the message will no longer be displayed.
57
191
58
- ** WARNING:** Installing an unsigned Ledger app reduces the security of your Ledger device.
59
- If your client is compromised, an attacker will be able to trick you into signing arbitrary
60
- transactions with arbitrary derivation paths. Only use this installation method if you understand
192
+ ** WARNING:** Installing an unsigned Ledger app reduces the security of your
193
+ Ledger device.
194
+ If your client is compromised, an attacker will be able to trick you into
195
+ signing arbitrary transactions with arbitrary derivation paths.
196
+ Only use this installation method if you understand
61
197
the security implications. We strongly recommend that you use a separate
62
198
Ledger device, with no other wallets/apps sharing the same seed phrase.
63
199
@@ -71,6 +207,8 @@ Ledger device, with no other wallets/apps sharing the same seed phrase.
71
207
5 . An installation window appears and your device will display "Processing..."
72
208
6 . The app installation is confirmed
73
209
210
+ #### Installing the Solana Beta App returns an error
211
+
74
212
If you encounter the following error:
75
213
76
214
``` text
@@ -93,6 +231,40 @@ To fix, check the following:
93
231
2 . Ensure your Ledger device is unlocked and not waiting for you to enter your pin
94
232
3 . Ensure the Ledger Live application is not open
95
233
234
+ ## Troubleshooting
235
+
236
+ ### Keypair URL parameters are ignored in zsh
237
+
238
+ The question mark character is a special character in zsh. If that's not a
239
+ feature you use, add the following line to your ` ~/.zshrc ` to treat it as a
240
+ normal character:
241
+
242
+ ``` bash
243
+ unsetopt nomatch
244
+ ```
245
+
246
+ Then either restart your shell window or run ` ~/.zshrc ` :
247
+
248
+ ``` bash
249
+ source ~ /.zshrc
250
+ ```
251
+
252
+ If you would prefer not to disable zsh's special handling of the question mark
253
+ character, you can disable it explictly with a backslash in your keypair URLs.
254
+ For example:
255
+
256
+ ``` bash
257
+ solana-keygen pubkey usb://ledger\? key=0
258
+ ```
259
+
96
260
## Support
97
261
98
- Check out our [ Wallet Support Page] ( ../wallet-guide/support.md ) for ways to get help.
262
+ Check out our [ Wallet Support Page] ( ../wallet-guide/support.md )
263
+ for ways to get help.
264
+
265
+
266
+
267
+
268
+ Read more about [ sending and receiving tokens] ( ../cli/transfer-tokens.md ) and
269
+ [ delegating stake] ( ../cli/delegate-stake.md ) . You can use your Ledger keypair URL
270
+ anywhere you see an option or argument that accepts a ` <KEYPAIR> ` .
0 commit comments