[Rust] descriptor-encrypt: Encrypt any descriptor such that only authorized spenders can decrypt

Jun 4 - Mar 25, 2026

  • The [descriptor-encrypt library](https://github.com/joshdoman/descriptor-encrypt) introduces a novel method to improve the privacy and security of Bitcoin wallet descriptors through deterministic encryption.

This advanced technique ensures that only those with the authorized set of keys, which are necessary for fund expenditure, can decrypt the descriptor. The library supports all descriptor types, including those utilizing miniscript, by mirroring the wallet's spending policy in its encryption mechanism. For example, a descriptor requiring a 2-of-3 key policy for transactions will need the same two out of three keys for decryption, perfectly aligning decryption requirements with spending policies.

Encryption is executed via a dual-layer process where a master encryption key, derived from the wallet descriptor, is split into shards using recursive Shamir secret sharing, reflecting the descriptor's structure. These shards are then encrypted according to their corresponding keys within this structure. The library offers a standard encryption mode and a full-secrecy mode, which provides greater privacy at the expense of slower decryption times due to the complexity of trying all share and key combinations. Before encryption, descriptors are processed with a tag-based variable-length encoding scheme to efficiently manage data storage, dividing the descriptor into an unencrypted "template" that outlines the structure and an encrypted "payload" containing sensitive information. This method not only minimizes data storage needs but also enables public backup strategies without exposing key or balance information, fostering benefits like simplified inheritance processes and enhanced privacy against potential hacks.

Despite its technological complexity and demands on computational resources for large descriptors, the descriptor-encrypt project's implementation in Rust makes it adaptable for various platforms and languages. It does not prescribe a specific storage location for encrypted descriptors, suggesting that public blockchains could serve as viable storage solutions, provided appropriate indexing mechanisms for recovery are in place. Demonstrated through a command-line tool and a Web Assembly port for browser usage, the library positions itself as a comprehensive solution for Bitcoin wallet backups, aiming to significantly enhance cryptographic privacy within potentially insecure public storage environments.

Additionally, an interesting aspect of the project's development highlighted in communication includes the creator's acknowledgment of winning second place at a hackathon, underscoring their humility and proficiency in competitive programming environments. This achievement emphasizes the individual's contribution and potential within the tech community.

Regarding the long-term storage of these encrypted descriptors, especially considering scenarios such as inheritance, there's a vision for them to be stored either alongside each seed phrase, which would keep the wallet's activity and balance hidden from unauthorized individuals, or online in a publicly recognized location. The latter would facilitate heirs finding the descriptors with just the seed phrases, eliminating the need for additional recovery details. An ideal user experience would involve a standard protocol enabling users to import master extended public keys locally and recover all funds controlled by those keys, necessitating a data availability layer and an open-source indexer for locating encrypted descriptors. While the Bitcoin blockchain is viewed as a likely candidate for the industry-standard data availability layer, openness to other solutions remains.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback