#descriptor #bitcoin #electrum

bin+lib electrum2descriptors

Converts electrum xpubs (like vpub, ypub...) into output descriptors

9 unstable releases

0.5.0 Aug 23, 2024
0.4.4 Nov 11, 2022
0.4.2 Jan 26, 2022
0.4.1 Sep 10, 2021
0.1.0 Oct 28, 2020

#6 in #electrum

Download history 3/week @ 2024-07-02 36/week @ 2024-07-23 17/week @ 2024-07-30 4/week @ 2024-08-06 2/week @ 2024-08-13 147/week @ 2024-08-20 18/week @ 2024-08-27 13/week @ 2024-09-10 21/week @ 2024-09-17 15/week @ 2024-09-24 38/week @ 2024-10-01 1/week @ 2024-10-08

87 downloads per month

MIT license

42KB
829 lines

electrum2descriptors

crates.io rustc

Converts slip-0132 extended keys (like the vpub, ypub, yprv, etc. used by Electrum) into output descriptors

This project consists of a library and an executable.

The work of @ulrichard in this project was sponsored by SEBA Bank AG

Usage library

For the library interface read the docs. With the library, you can also convert from descriptor to slip-0132 and to electrum wallet files.

Usage binary

$ cargo install electrum2descriptors
$ electrum2descriptors vpub5VXaSncXqxLbdmvrC4Y8z9CszPwuEscADoetWhfrxDFzPUbL5nbVtanYDkrVEutkv9n5A5aCcvRC9swbjDKgHjCZ2tAeae8VsBuPbS8KpXv
["wpkh(tpubD9ZjaMn3rbP1cAVwJy6UcEjFfTLT7W6DbfHdS3Wn48meExtVfKmiH9meWCrSmE9qXLYbGcHC5LxLcdfLZTzwme23qAJoRzRhzbd68dHeyjp/0/*)", "wpkh(tpubD9ZjaMn3rbP1cAVwJy6UcEjFfTLT7W6DbfHdS3Wn48meExtVfKmiH9meWCrSmE9qXLYbGcHC5LxLcdfLZTzwme23qAJoRzRhzbd68dHeyjp/1/*)"]

or

git clone https://github.com/RCasatta/electrum2descriptors
cd electrum2descriptors
cargo run -- vpub5VXaSncXqxLbdmvrC4Y8z9CszPwuEscADoetWhfrxDFzPUbL5nbVtanYDkrVEutkv9n5A5aCcvRC9swbjDKgHjCZ2tAeae8VsBuPbS8KpXv
["wpkh(tpubD9ZjaMn3rbP1cAVwJy6UcEjFfTLT7W6DbfHdS3Wn48meExtVfKmiH9meWCrSmE9qXLYbGcHC5LxLcdfLZTzwme23qAJoRzRhzbd68dHeyjp/0/*)", "wpkh(tpubD9ZjaMn3rbP1cAVwJy6UcEjFfTLT7W6DbfHdS3Wn48meExtVfKmiH9meWCrSmE9qXLYbGcHC5LxLcdfLZTzwme23qAJoRzRhzbd68dHeyjp/1/*)"]

can also convert electrum wallet files to descriptors

$ cargo run -- tests/wallets/default_segwit 
["wpkh(tprv8cvkZzx9zA7EfFDbH945mK23r7hg6EHXUk79wVUSRukwyctFS1AdpSpkZcykAMDveCj8RA3R4jwFTKMwMbWexJox8NMqq7YphJLDumfCSfu/0/*)", "wpkh(tprv8cvkZzx9zA7EfFDbH945mK23r7hg6EHXUk79wVUSRukwyctFS1AdpSpkZcykAMDveCj8RA3R4jwFTKMwMbWexJox8NMqq7YphJLDumfCSfu/1/*)"]

Dependencies

~7.5MB
~95K SLoC