delvingbitcoin

File Format for Recovering Descriptor Wallets

Original Postby rustaceanrob

Posted on: September 5, 2024 18:13 UTC

The primary concern raised involves enhancing the wallet recovery experience for users or their heirs, emphasizing the need for a more intuitive way to handle the recovery process than the current methods which may involve manual insertion of descriptors from txt or json files into future wallet software.

The proposed solution is the development of a standardized file format that could encapsulate all necessary wallet data and metadata in a single, easily transferable file. This file format would support drag-and-drop functionality into wallet software, simplifying the recovery process significantly.

A detailed specification for this file format, referred to as WDEF (Wallet Descriptor Export File), has been outlined. The WDEF format aims to standardize the storage, exportation, and sharing of output descriptors, which are essential for recovering funds from bitcoin wallets that utilize multiple signers, non-standard derivation paths, or when the recoverer lacks understanding of how to use seed phrases. Currently, there is a lack of uniformity in how descriptors are stored and shared, with variations between .txt and JSON formats leading to potential issues in parsing these files by future wallet software. The WDEF format seeks to alleviate these concerns by providing a unified structure that can be easily handled by both current and future software, thereby reducing the burden on developers and increasing the likelihood of successful fund recovery by heirs without requiring manual data entry.

The specification includes details about the structure of WDEF files, which consist of multiple records. Each record contains a type, length, value, and a checksum to ensure data integrity. The types of records include information such as the wallet name, description, additional info for fund recovery, recovery height, and descriptors for receiving and spending bitcoins. The proposal emphasizes the importance of having a single, required Name record per file, optional but unique Description, any number of Info entries, an optional RecoveryHeight, and at least one descriptor record. The file also starts with a specific identifier and version number to prevent misinterpretation by the decoding software.

Moreover, the document outlines the encoding and decoding processes for these files, ensuring they can be created and read effectively while adhering to the specified requirements. If these requirements are not met, the encoding or decoding process will fail, highlighting the importance of following the standardized format closely. It's suggested that files conforming to this standard bear the .wdef extension to differentiate them from other file types.

This initiative is backed by a reference implementation in Rust, which serves as an experimental platform for testing and refining the proposed file format. Feedback from the community is sought to further improve the recovery process and make the proposed standard more robust and universally applicable.