#bitcoin #hardware-wallet #json-format

pubport

A library for parsing hardware wallet export formats

4 releases (2 breaking)

0.5.0 Nov 27, 2025
0.4.1 Nov 27, 2025
0.4.0 Apr 23, 2025
0.3.1 Mar 6, 2025
0.3.0 Mar 5, 2025

#8 in #hardware-wallet

Download history 90/week @ 2025-10-12 182/week @ 2025-10-19 123/week @ 2025-10-26 237/week @ 2025-11-02 249/week @ 2025-11-09 154/week @ 2025-11-16 110/week @ 2025-11-23 66/week @ 2025-11-30 318/week @ 2025-12-07 38/week @ 2025-12-14 82/week @ 2025-12-21 25/week @ 2026-01-04 99/week @ 2026-01-11 211/week @ 2026-01-18 158/week @ 2026-01-25

493 downloads per month

Apache-2.0

76KB
1.5K SLoC

PubPort

Crate Info Apache-2.0 Licensed CI Status Docs

A tool to import a wallet public key with descriptors from many different formats seamlessly

Supported formats

  • Descriptors
  • Electrum
  • Wasabi
  • JSON
  • Bare XPUB
  • BIP380 Key Expressions
    • note: XPUBs only, key expressions with private keys, bare compressed or uncompressed public keys are not supported)

Supported descriptors

  • Single Sig

Examples

Import in generic JSON format used by many wallets

use pubport::Format;

let string = std::fs::read_to_string("test/data/sparrow-export.json").unwrap();
let format = Format::try_new_from_str(&string);

assert!(format.is_ok());

let format = format.unwrap();
assert!(matches!(format, Format::Json(_)));

Import from file containing descriptors

note: need external and internal descriptors, but can be single descriptor or multiple descriptor format

use pubport::Format;

let string = std::fs::read_to_string("test/data/descriptor.txt").unwrap();
let format = Format::try_new_from_str(&string);

assert!(format.is_ok());

let format = format.unwrap();
assert!(matches!(format, Format::Descriptor(_)));

Import from wasabi wallet format

use pubport::Format;

let string = std::fs::read_to_string("test/data/new-wasabi.json").unwrap();
let format = Format::try_new_from_str(&string);

assert!(format.is_ok());

let format = format.unwrap();
assert!(matches!(format, Format::Wasabi(_)));

Import from electrum wallet format

use pubport::Format;

let string = std::fs::read_to_string("test/data/new-electrum.json").unwrap();
let format = Format::try_new_from_str(&string);

assert!(format.is_ok());

let format = format.unwrap();
assert!(matches!(format, Format::Electrum(_)));

Dependencies

~12–18MB
~286K SLoC