Skip to content

Continued discussion on encrypting persisted data #739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rustaceanrob opened this issue Apr 24, 2025 · 0 comments · May be fixed by #756
Open

Continued discussion on encrypting persisted data #739

rustaceanrob opened this issue Apr 24, 2025 · 0 comments · May be fixed by #756
Assignees
Labels
enhancement New feature or request

Comments

@rustaceanrob
Copy link
Collaborator

Describe the enhancement

Per bitcoindevkit/bdk#1948, encrypting to disk is a desirable property for bindings users. In Rust, this is possible by using either rusqlite:bundled-sqlcipher or rusqlite:bundled-sqlcipher-vendored-openssl, which allows for a sqlite connection to be encrypted by using a pragma_update step.

let conn = Connection::open(PATH).unwrap();
conn.pragma_update(None, "MY_KEY", "MY_SECRET").unwrap();

While the bdk_wallet does not ship with this by default, it's trivial to just add the additional "bundled-sqlcipher-vendored-openssl" feature to a rusqlite import, so I would consider this completed.

Use case

Apparently there is some history of viruses/trojans snooping around for wallet.dat files. Either way, @andreasgriffin has at least made a case for encrypting user data multiple times, and it would be nice to have feature parity with Rust in this regard.

Additional context

The minreq client currently ships with rustls, and I recall somehow that the native-tls crate was a problem for bindings? If it was the case that minreq shipped with native-tls and rusqlite shipped with bundled OpenSSL, they should be able to share the OpenSSL implementation, but I will have to research both the binary size changes and if it is possible to link a shared openssl-sys dependency between minreq and rusqlite

@rustaceanrob rustaceanrob added the enhancement New feature or request label Apr 24, 2025
@rustaceanrob rustaceanrob self-assigned this Apr 24, 2025
@rustaceanrob rustaceanrob linked a pull request May 7, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant