Skip to content

Commit

Permalink
Implement recovery from generated secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
lassemoldrup committed Nov 22, 2023
1 parent 75df48b commit 5b5084f
Show file tree
Hide file tree
Showing 4 changed files with 300 additions and 70 deletions.
1 change: 1 addition & 0 deletions recover-id-object/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions recover-id-object/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ edition = "2021"
[dependencies]
clap = { version = "4", features = ["env", "derive"] }
anyhow = "1"
tokio = {version = "1.20", features = ["rt-multi-thread", "macros"]}
tonic = {version = "0.8", features = ["tls", "tls-roots", "tls-webpki-roots"]}
tokio = { version = "1.20", features = ["rt-multi-thread", "macros"] }
tonic = { version = "0.8", features = ["tls", "tls-roots", "tls-webpki-roots"] }
thiserror = "1"

concordium-rust-sdk = { path = "../deps/concordium-rust-sdk", version = "*" }
concordium_base = { path = "../deps/concordium-rust-sdk/concordium-base/rust-src/concordium_base", version = "*" }
key_derivation = { path = "../deps/concordium-rust-sdk/concordium-base/rust-src/key_derivation/", version = "*" }
serde_json = "1.0.96"
serde = "1.0.162"
reqwest = { version = "0.11.17", features = ["json"] }
url = { version = "2.3.1", features = ["serde"] }
http = "0.2.9"
chrono = "0.4.24"


24 changes: 22 additions & 2 deletions recover-id-object/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,25 @@ To build run `cargo build --release`. This produces the binary `target/release/r

## Run

See `--help` for the list of all the options. The tool requires access to the
seed phrase to be used for recovery.
See `--help` for the list of all the options. The tool has two modes: `generate-secrets` and `recover-identity`.

### Generate secrets

`generate-secrets` generates secrets for the recovery requests based on a seed phrase.
It outputs the secrets to standard output.

### Recover identity

`recover-identity` recovers the identity objects based on either a seed phrase or the secrets generated by `generate-secrets`.

To recover with a seed phrase, run:

```bash
recover-id-object --ip-index ... (* other args *) recover-identity --concordium-wallet <path-to-seed-phrase>
```

To recover with the secrets generated by `generate-secrets`, run:

```bash
recover-id-object --ip-index ... (* other args *) recover-identity --prf-key <PRF_KEY> --id-cred-sec <ID_CRED_SEC> --id-index <ID_INDEX>
```
Loading

0 comments on commit 5b5084f

Please sign in to comment.