Skip to content

Commit 3eef874

Browse files
committed
Apply review comments
1 parent 0293882 commit 3eef874

3 files changed

Lines changed: 44 additions & 16 deletions

File tree

wallet/wallet-cli-commands/src/lib.rs

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ pub enum CreateWalletSubCommand {
5555
/// File path of the wallet file
5656
wallet_path: PathBuf,
5757

58-
/// Specifies whether the seed-phrase should be stored in the wallet file or
58+
/// Specifies whether the seed phrase should be stored in the wallet file or
5959
/// only printed on the screen.
6060
///
61-
/// Not storing the seed-phrase can be seen as a security measure
62-
/// to ensure sufficient secrecy in case that seed-phrase is reused
61+
/// Not storing the seed phrase can be seen as a security measure
62+
/// to ensure sufficient secrecy in case that the seed phrase is reused
6363
/// elsewhere if this wallet is compromised.
64+
///
65+
/// Note: if you decide to store the seed phrase, consider encrypting the wallet with
66+
/// the wallet-encrypt-private-keys command, which will also encrypt the seed phrase.
6467
whether_to_store_seed_phrase: CliStoreSeedPhrase,
6568

66-
/// Mnemonic phrase (12, 15, or 24 words as a single quoted argument).
69+
/// Mnemonic (seed) phrase (12, 15, or 24 words as a single quoted argument).
6770
///
6871
/// If not specified, a new mnemonic phrase will be generated and printed.
6972
mnemonic: Option<String>,
@@ -129,15 +132,18 @@ pub enum RecoverWalletSubCommand {
129132
/// File path of the wallet file
130133
wallet_path: PathBuf,
131134

132-
/// Specifies whether the seed-phrase should be stored in the wallet file or
135+
/// Specifies whether the seed phrase should be stored in the wallet file or
133136
/// only printed on the screen.
134137
///
135-
/// Not storing the seed-phrase can be seen as a security measure
136-
/// to ensure sufficient secrecy in case that seed-phrase is reused
138+
/// Not storing the seed phrase can be seen as a security measure
139+
/// to ensure sufficient secrecy in case that the seed phrase is reused
137140
/// elsewhere if this wallet is compromised.
141+
///
142+
/// Note: if you decide to store the seed phrase, consider encrypting the wallet with
143+
/// the wallet-encrypt-private-keys command, which will also encrypt the seed phrase.
138144
whether_to_store_seed_phrase: CliStoreSeedPhrase,
139145

140-
/// Mnemonic phrase (12, 15, or 24 words as a single quoted argument).
146+
/// Mnemonic (seed) phrase (12, 15, or 24 words as a single quoted argument).
141147
mnemonic: String,
142148

143149
/// Passphrase along the mnemonic
@@ -226,18 +232,32 @@ pub enum OpenWalletSubCommand {
226232
#[derive(Debug, Parser)]
227233
#[clap(rename_all = "kebab-case")]
228234
pub enum WalletManagementCommand {
235+
/// Create a new wallet. This will create a new file without scanning the blockchain.
236+
///
237+
/// Use this command if the seed phrase is brand new and has no associated transactions.
238+
///
239+
/// If, on the other hand, the seed phrase has been used in the past and may have
240+
/// associated transactions, use wallet-recover instead.
229241
#[clap(name = "wallet-create")]
230242
CreateWallet {
231243
#[command(subcommand)]
232244
wallet: CreateWalletSubCommand,
233245
},
234246

247+
/// Recover a wallet. This will create a new wallet file and scan the blockchain for associated
248+
/// transactions.
249+
///
250+
/// Use this command if the seed phrase has been used in the past.
251+
///
252+
/// If, on the other hand, the seed phrase is brand new, consider using wallet-create,
253+
/// which will save you some time (as scanning the entire blockchain is a lengthy process).
235254
#[clap(name = "wallet-recover")]
236255
RecoverWallet {
237256
#[command(subcommand)]
238257
wallet: RecoverWalletSubCommand,
239258
},
240259

260+
/// Open an exiting wallet file.
241261
#[clap(name = "wallet-open")]
242262
OpenWallet {
243263
#[command(subcommand)]
@@ -997,8 +1017,12 @@ pub enum WalletCommand {
9971017
/// This specifies that instead of a (hex encoded) PartiallySignedTransaction
9981018
/// the result should be a (hex encoded) "simple" transaction.
9991019
///
1000-
/// Note that both variants are accepted by account-sign-raw-transaction,
1001-
/// so the presence of this option doesn't matter much.
1020+
/// Producing a "simple" transaction will result in a shorter hex string, but you won't
1021+
/// be able to use it with account-sign-raw-transaction in the cold wallet mode, which
1022+
/// relies on some additional information contained inside PartiallySignedTransaction.
1023+
///
1024+
/// In general, there is no reason in specifying this option unless you care about the size
1025+
/// of the resulting hex string.
10021026
#[arg(long = "only-transaction", default_value_t = false)]
10031027
only_transaction: bool,
10041028
},

wallet/wallet-rpc-daemon/docs/RPC.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,7 +3217,7 @@ string
32173217

32183218
### Method `wallet_create`
32193219

3220-
Create a new wallet, this will skip scanning the blockchain
3220+
Create a new wallet. This will create a new file without scanning the blockchain.
32213221

32223222

32233223
Parameters:
@@ -3265,7 +3265,9 @@ Returns:
32653265

32663266
### Method `wallet_recover`
32673267

3268-
Recover new wallet, this will rescan the blockchain upon creation
3268+
Recover a wallet. This will create a new wallet file and scan the blockchain for associated transactions.
3269+
3270+
Note: mnemonic must be specified when recovering a software wallet.
32693271

32703272

32713273
Parameters:
@@ -3313,7 +3315,7 @@ Returns:
33133315

33143316
### Method `wallet_open`
33153317

3316-
Open an exiting wallet by specifying the file location of the wallet file
3318+
Open an exiting wallet file.
33173319

33183320

33193321
Parameters:

wallet/wallet-rpc-lib/src/rpc/interface.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ trait ColdWalletRpc {
9696
#[method(name = "version")]
9797
async fn version(&self) -> rpc::RpcResult<String>;
9898

99-
/// Create a new wallet, this will skip scanning the blockchain
99+
/// Create a new wallet. This will create a new file without scanning the blockchain.
100100
#[method(name = "wallet_create")]
101101
async fn create_wallet(
102102
&self,
@@ -107,7 +107,9 @@ trait ColdWalletRpc {
107107
hardware_wallet: Option<HardwareWalletType>,
108108
) -> rpc::RpcResult<CreatedWallet>;
109109

110-
/// Recover new wallet, this will rescan the blockchain upon creation
110+
/// Recover a wallet. This will create a new wallet file and scan the blockchain for associated transactions.
111+
///
112+
/// Note: mnemonic must be specified when recovering a software wallet.
111113
#[method(name = "wallet_recover")]
112114
async fn recover_wallet(
113115
&self,
@@ -118,7 +120,7 @@ trait ColdWalletRpc {
118120
hardware_wallet: Option<HardwareWalletType>,
119121
) -> rpc::RpcResult<CreatedWallet>;
120122

121-
/// Open an exiting wallet by specifying the file location of the wallet file
123+
/// Open an exiting wallet file.
122124
#[method(name = "wallet_open")]
123125
async fn open_wallet(
124126
&self,

0 commit comments

Comments
 (0)