Skip to content

Commit db4d470

Browse files
committed
Update keystore doc
1 parent 0902921 commit db4d470

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

monad-keystore/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
11
# monad-keystore
22

3-
The keystore CLI tool can be used to generate keystore json files for the BLS key and SECP key that are needed to run a validator.
3+
The keystore CLI tool can be used to work with keystore json files for the BLS key and SECP key that are needed to run a validator.
44

5-
### Getting Started
5+
## Supported commands
6+
7+
### Create:
8+
9+
```sh
10+
cargo run --release -- create --keystore-path <path_to_keystore_file> --password "<password>" --key-type [bls|secp]
11+
```
12+
13+
- The `create` command will generate a new random 32 byte IKM that will be encrypted with the password and stored in the keystore file.
14+
- The IKM is used to generate either BLS or SECP key depending on the provided key type. The private key and the public key will be displayed once the key is generated.
15+
- **NOTE: The keystore does not store the type of key that was generated with the IKM. That responsibility is left to the user**
16+
17+
### Recover:
618

719
```sh
8-
cargo run --release -- --mode [create|recover] --key-type [bls|secp] --keystore-path <path_to_output_file>
20+
cargo run --release -- recover --keystore-path <path_to_keystore_file> --password "<password>" [--key-type [bls|secp]]
921
```
1022
23+
- The `recover` command will display the IKM stored in the keystore file (if the password is correct)
24+
- Since the keystore does not store the key type, providing the key type as a parameter will also display the corresponding private and public key.
25+
26+
### Import:
27+
28+
```sh
29+
cargo run --release -- import --ikm <ikm> --keystore-path <path_to_keystore_file> --password "<password>" [--key-type [bls|secp]]
30+
```
31+
32+
- The `import` command will generate a new keystore file with the provided IKM (in hex)
33+
- Since the keystore does not store the key type, providing the key type as a parameter will also display the corresponding private and public key.
34+
1135
### Disclaimer
1236
1337
This tool is currently unaudited, do not use in production.

monad-keystore/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ fn run(args: Args) -> Result<(), String> {
160160
.map_err(|err| format!("unable to recover keystore secret: {:?}", err))?;
161161

162162
println!("Keystore version: {}", version);
163+
println!("Keystore secret: {}", hex::encode(keystore_secret.as_ref()));
163164

164165
if let Some(key_type) = key_type {
165166
// print public key based on key type and version

0 commit comments

Comments
 (0)