-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
# Keychain | ||
# Keychain | ||
|
||
This section will show you how to manage the `keychain`. | ||
|
||
## Definition | ||
|
||
Keychain means a `seed` plus an optional list of `passphrases`. | ||
|
||
## Store | ||
|
||
The `keychian` it's stored in a file called `keechain`. It's encrypted using AES-256 in CBC mode and XChaCha20Poly1305: `XChaCha20Poly1305(AES256CBC(keychain))`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
# Change password | ||
|
||
```rust,no_run | ||
# use smartvaults_sdk::prelude::*; | ||
# | ||
# #[tokio::main] | ||
# async fn main() { | ||
let client = ...; // The client that you before constructed | ||
client.change_password( | ||
|| Ok(String::from("current-password")), // Current password | ||
|| Ok(String::from("new-password")), // New password | ||
|| Ok(String::from("new-password")), // Confirmation of new password | ||
)?; | ||
# } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
# Secrets | ||
|
||
```rust,no_run | ||
# use smartvaults_sdk::prelude::*; | ||
# | ||
# #[tokio::main] | ||
# async fn main() { | ||
let client = ...; // The client that you before constructed | ||
let secp = Secp256k1::new(); | ||
let network: Network = client.network(); | ||
let keychain: Keychain = client.keychain(); | ||
let secrets: Secrets = keychain.secrets(network, &secp)?; | ||
println!("Entropy: {}", secrets.entropy); | ||
println!("Mnemonic: {}", secrets.mnemonic); | ||
if let Some(passphrase) = &secrets.passphrase { | ||
println!("Passphrase: {}", passphrase); | ||
} | ||
println!("Seed (hex): {}", secrets.seed_hex); | ||
println!("Root Key (BIP32): {}", secrets.root_key); | ||
println!("Fingerprint: {}", secrets.fingerprint); | ||
# } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Wipe | ||
|
||
Delete the `keychain` | ||
|
||
```rust,no_run | ||
# use smartvaults_sdk::prelude::*; | ||
# | ||
# #[tokio::main] | ||
# async fn main() { | ||
let client = ...; // The client that you before constructed | ||
// Delete the keychain | ||
client.wipe("your-password")?; | ||
# } | ||
``` |