
Bitcoin developer Craig Uncooked has proposed a standardized backup format to cut back confusion when customers get well wallets secured by a number of signing keys.
In a Dec. 1 submit to the Bitcoin Improvement Mailing Listing, Uncooked recognized an inconsistency that may make two backups containing an identical pockets directions seem totally different throughout restoration.
The issue stems from how pockets purposes write output descriptors, which comprise the directions software program must assemble Bitcoin addresses and decide how funds might be spent.
For instance, a two-of-three multisig pockets descriptor can specify three public keys or directions for deriving them, alongside a spending rule requiring any two corresponding signing keys to authorize a transaction.
Cosigners can evaluate these descriptors throughout restoration to determine whether or not their backups comprise the identical pockets directions.
Nonetheless, variations in how pockets software program writes these directions can complicate verification.
Beneath BIP 380, descriptors carry an eight-character checksum calculated from their textual content to assist detect errors. Pockets purposes can use both an apostrophe or the letter h to signify the identical sort of key derivation step, however the checksum calculation treats them as totally different characters.
Because of this, two legitimate descriptors can generate an identical Bitcoin addresses and spending guidelines whereas carrying totally different checksums.
How the proposed customary simplifies pockets restoration
Uncooked’s proposal addresses the inconsistency by establishing widespread formatting guidelines that pockets purposes might apply earlier than displaying, exporting, or evaluating descriptors.
In his revealed take a look at vectors, Uncooked demonstrated how two descriptors for a similar two-of-three multisig pockets produced totally different checksums.
One descriptor used apostrophes and generated the checksum xmwawk45, whereas the opposite used the letter h and generated tj77jlvt. The descriptors additionally listed the identical three key expressions in numerous orders.
Regardless of these variations, each produced an identical Bitcoin scripts as a result of their sortedmulti() development kinds the derived public keys when producing every script.
Uncooked’s proposed format replaces the apostrophes with h and arranges the normalized key expressions in keeping with their textual content. Making use of these guidelines produces an identical descriptor strings with the identical checksum, jecfc8v2, with out requiring key derivation or altering the pockets’s underlying scripts.
The proposed format makes the 2 take a look at strings match whereas preserving the scripts they produce.
This can be a particular two-of-three take a look at vector from an unnumbered draft. The comparability covers descriptor textual content and doesn’t set up signing-key management, backup completeness or equivalence throughout structurally totally different descriptors.
Pockets purposes adopting the proposal might due to this fact evaluate normalized descriptors throughout restoration, eliminating formatting variations that may in any other case increase questions concerning the consistency of particular person backups.
Nonetheless, matching checksums alone wouldn’t set up that two descriptors are an identical, that cosigners management the mandatory non-public keys or that their backups comprise all the pieces required to get well their funds.
The proposed format additionally doesn’t remove each distinction between descriptors that produce equal scripts. As an illustration, one descriptor might specify a public key instantly whereas one other derives the identical key from an prolonged public key.
As of Dec. 3, Uncooked’s proposal stays an unnumbered draft. Its implementation would depend upon pockets builders adopting the formatting guidelines, whereas purposes would proceed accepting legitimate descriptors written in present codecs.