Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
- name: Build with default features
run: cargo build --verbose
- name: Build
run: cargo build --features accesssecret --verbose
run: cargo build --features accesssecret --features toolhelper --verbose
- name: Run tests
run: cargo test --features accesssecret --verbose
run: cargo test --features accesssecret --features toolhelper --verbose
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resolver = "2"
members = [
"secretstore",
"seedstore",
"seedstore-tool",
]

exclude = []
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ Steps to mitigate the risks:

- enforce restricted permissions on the file
- encorce strong password
- seedstore tool (for prompting for and saving secret)
- version 1.0, with format guarantee
- (later) breaking challenge bounty


## Usage Example
## Usage -- Example usage of the code

Reading secret from file:

Expand All @@ -58,7 +57,7 @@ use seedstore::SeedStoreCreator;
See the [example programs](seedstore/examples).


## Usage Guide
## Usage -- Building

`SeedStore` is a simple Rust library. To compile it, use the usual Rust commands.

Expand All @@ -75,6 +74,26 @@ cargo run --example create_seedstore
_MSRV_: Rust 1.81 (due to `fs::exists`)


## Usage -- Tool

`seedstore-tool` is a command-line utility to create or check secret files.
Here are some sample calls to get started:

```
cargo r -p seedstore-tool -- --help
```

Check existing secret file; type 'password' for encryption password, twice:
```
cargo r -p seedstore-tool -- --file seedstore/sample_secret.sec
```

Create a new secret, enter secret information to store:
```
cargo r -p seedstore-tool -- --set --file /tmp/newfile
```


## Data Format

The data format of the secret file is documented here: [Data_Format.md](Data_Format.md)
Expand Down
2 changes: 1 addition & 1 deletion secretstore/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "secretstore"
version = "0.3.3"
version = "0.3.4"
description = "Store a secret (such as a private key) in an encrypted file"
license = "MIT"
edition = "2021"
Expand Down
8 changes: 8 additions & 0 deletions seedstore-tool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "seedstore-tool"
version = "0.3.4"
edition = "2021"

[dependencies]
bip39 = "2.1.0"
seedstore = { version = "0.3.4", path = "../seedstore", features = ["toolhelper"] }
10 changes: 10 additions & 0 deletions seedstore-tool/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! `seedstore-tool` is a command-line utility to create or check secret files.

use seedstore::SeedStoreTool;
use std::env;

/// Top-level executable implementation for seedstore-tool.
fn main() {
let args: Vec<String> = env::args().collect();
SeedStoreTool::run(&args);
}
7 changes: 5 additions & 2 deletions seedstore/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "seedstore"
version = "0.3.3"
version = "0.3.4"
description = "Store bitcoin secret material (BIP39 mnemonic entropy, or similar) in an encrypted file"
license = "MIT"
edition = "2021"
Expand All @@ -9,11 +9,14 @@ edition = "2021"
default = []
# Allow direct access to secret material
accesssecret = []
# Helpers for seedstore-tool
toolhelper = ["rpassword"]

[dependencies]
bip39 = { version = "2.1.0", features = ["zeroize"] }
bitcoin = "0.32.5"
secretstore = { version = "0.3.3", path = "../secretstore" }
rpassword = { version = "7.4.0", optional = true }
secretstore = { version = "0.3.4", path = "../secretstore" }
zeroize = "1.8.1"

[dev-dependencies]
Expand Down
5 changes: 5 additions & 0 deletions seedstore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
mod keystore;
mod seedstore;

#[cfg(feature = "toolhelper")]
mod tool;

#[cfg(test)]
mod compat_backtest;
#[cfg(test)]
Expand All @@ -24,3 +27,5 @@ mod test_seedstore;
// re-exports
pub use crate::keystore::{KeyStore, KeyStoreCreator};
pub use crate::seedstore::{ChildSpecifier, SeedStore, SeedStoreCreator};
#[cfg(feature = "toolhelper")]
pub use crate::tool::SeedStoreTool;
Loading