onionwire/src/lib.rs
rust-dev (hermes) 467510f096
All checks were successful
ci / test (pull_request) Successful in 5m48s
ci / sdk (pull_request) Successful in 1m34s
android-ci / android (pull_request) Successful in 12m4s
ci / fuzz (pull_request) Successful in 18m24s
store: a wallet catalogue in the encrypted db
Wallets were only ever a file in $ONIONWIRE_HOME/wallet plus the
single-row wallet_child config for the one the child is currently
pointed at, so a created wallet was not remembered and a second create
had nowhere to go.

Add a 'wallets' table (id, name, identity_pubkey, onion_locator,
wallet_filename, created_at) and CRUD on Store: create_wallet,
get_wallet_by_id, list_wallets, delete_wallet. wallet_filename is
UNIQUE so a second wallet cannot silently reuse the first one's file,
and identity_pubkey is deliberately not unique (identity is the roster
key, a wallet is a file; the locator may rotate or be empty).

No new crate: the store is already rusqlite + SQLCipher with a raw
PRAGMA key, and sqlx has no SQLCipher path, so a second pool would be a
second unencrypted way in.

Tests: 5 store cases in tests/store.rs (round-trip, coexistence across
a reopen, duplicate filename, delete, blank label/filename) plus the
at_rest upgrade case in src/store.rs.
2026-09-21 10:21:48 -04:00

25 lines
466 B
Rust

pub mod backup;
pub mod cuprate;
pub mod dispatch;
pub mod file;
pub mod frame;
pub mod hs;
pub mod loc;
pub mod node;
pub mod outbox;
pub mod pay;
pub mod profile;
pub mod qr;
pub mod ratchet;
pub mod ratelimit;
pub mod sanitize;
pub mod session;
mod store;
pub mod tui;
pub mod wallet;
pub mod wallet_child;
pub use store::{
Friend, FriendProfile, Message, NewWallet, Payment, PaymentWrite, SelfIdentity, Store,
WalletRecord, resolve_store_passphrase,
};