Skip to content

feature: Add Caravan wallet format import/export support #205

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vkprogrammer-001
Copy link
Contributor

Description

This PR implements support for importing and exporting wallets in the Caravan wallet format as requested in issue #5.

Changes

  • Added CaravanExport struct to handle Caravan wallet format
  • Implemented methods to export a wallet to Caravan JSON format
  • Added functionality to import Caravan wallet configs and convert to BDK descriptors
  • Added documentation with usage examples
  • Added comprehensive test coverage for all supported multisig types (P2SH, P2WSH, P2SH-P2WSH)

Implementation Details

  • All code is contained in the wallet/export.rs module alongside the existing FullyNoded export functionality
  • Support for different address types required by Caravan (P2SH, P2WSH, P2SH-P2WSH)
  • Handles the mapping between BDK descriptor format and Caravan's JSON configuration format

Testing

The implementation includes tests for:

  • Exporting BDK wallets to Caravan format
  • Importing Caravan configurations to BDK wallets
  • All supported address types (P2SH, P2WSH, P2SH-P2WSH)
  • Network detection (mainnet/testnet)

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Closes #5

@coveralls
Copy link

Pull Request Test Coverage Report for Build 14361745616

Details

  • 260 of 278 (93.53%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 86.75%

Changes Missing Coverage Covered Lines Changed/Added Lines %
wallet/src/wallet/export.rs 260 278 93.53%
Totals Coverage Status
Change from base Build 14270666930: 0.2%
Covered Lines: 7529
Relevant Lines: 8679

💛 - Coveralls

@notmandatory notmandatory moved this to In Progress in BDK Wallet Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Extend wallet::export module to also import/export the Caravan wallet format
3 participants