ilap / slip39-js

The javascript implementation of the SLIP39 for Shamir's Secret-Sharing for Mnemonic Codes.
MIT License
69 stars 27 forks source link

Implement extendable backup flag #26

Closed onvej-sl closed 4 months ago

onvej-sl commented 4 months ago

This pull request implements a recent revision of the SLIP-39 specification. The highest bit of the iteration exponent has been repurposed for a new "extendable backup flag". Setting the flag indicates that the random identifier is not used as salt in the encryption of the master secret. This makes it possible to create multiple sets of shares, such that each set of shares uses a different identifier and each set of shares leads to the same master secret for every passphrase. This is a desirable property, which unfortunately was not considered in the initial specification. It allows users to start working with their wallet by creating a single-share (1-of-1) scheme and later upgrade to a multi-share scheme while maintaining the same encrypted master secret and passphrases. Existing SLIP-39 shares remain valid. New shares created using the revised specification use a different checksum customization string and are not compatible with older implementations.

ilap commented 4 months ago

LGTM