Skip to content

REDB backend #702

@danielabrozzoni

Description

@danielabrozzoni

Summer of Bitcoin Project Proposal

Description

Wallets built with the bdk_wallet library currently have two implementations of the WalletPersister trait: sqlite and file_store. It would be useful to add an alternative storage back-end implementation using redb, a pure-Rust key-value store.

Expected Outcomes

  • Create a new bdk_redb crate similar to the bdk_file_store crate.
  • Add an implementation of the WalletPersister trait for the new bdk_redb data store.
  • Add tests in bdk_redb and bdk_wallet to confirm data is accurately stored and retrieved.
  • Add a new bdk_wallet feature called redb that enables the the bdk_redb implementation of WalletPersister.
  • Create an example similar to example_wallet_esplora_blocking that demonstrates using bdk_redb instead of file_store.

Resources

Skills Required

  • Experience with git. Guide
  • Experience with rust. First seven chapters of the book
  • Able to setup a local core node in regtest and testnet mode.
  • Familiarity with database technologies like SQL and SQLite.

Mentor(s)
@notmandatory

Difficulty
Hard

Competency Test

  • Install rust, compile and run all bdk examples and tests.
  • Setup a local Bitcoin Core node daemon in regtest mode.
  • Setup a local regtest esplora API server using the mempool.space version of electrs.
  • Make a wallet with example_wallet_esplora_blocking example wallet and receive and send regtest bitcoin.

Original Description

Discussed in #691

Originally posted by casey July 30, 2022
redb is a pure-Rust key-value store, and would be a good candidate for an alternative back-end. It is secure against data loss in some cases which sled probably isn't. It is still alpha quality, and the on-disk format has not been finalized, so it might not be quite ready yet, but could be good to watch for the future.

I mention this because I had issues building a binary on a Linux box due to the SQLite backend, and I don't personally believe that sled is mature enough to be used for production workloads, so another option would be nice.

Metadata

Metadata

Assignees

Labels

summer-of-bitcoinSummer of Bitcoin Project Proposal

Type

No type

Projects

Status

Needs Review

Relationships

None yet

Development

No branches or pull requests

Issue actions