Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slip39: Implement extendable backups #9059

Merged
merged 1 commit into from
May 22, 2024
Merged

slip39: Implement extendable backups #9059

merged 1 commit into from
May 22, 2024

Conversation

onvej-sl
Copy link
Contributor

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.

@SomberNight SomberNight changed the title Implement extendable backups slip39: Implement extendable backups May 22, 2024
@SomberNight
Copy link
Member

related: trezor/python-shamir-mnemonic#48

@SomberNight
Copy link
Member

Looks good. Thx.

@SomberNight SomberNight merged commit 0b456e9 into spesmilo:master May 22, 2024
14 checks passed
@onvej-sl onvej-sl deleted the slip39-extendable branch May 22, 2024 13:31
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 23, 2025
Summary:
This implements recovery of a wallet from a Shamir's secret-sharing scheme.

Current limitations:
 - we can only recover a wallet from an existing set of mnemonic shares, we don't generate new ones
 - the mnemonic shares are not saved to storage (wallet file), so users can't see their "seed" via the "Wallet > Show" seed menu (the action is disabled in the GUI)
 - we don't autodetect the seed type, the user needs to click the option button and select "slip39" explicitely

This is a backport of [[spesmilo/electrum#6917 | electrum#6917]] and [[spesmilo/electrum#9059 | electrum#9059]]

Depends on D17576

Test Plan:
`python test_runner.py`

Import a wallet from a SLIP39 share, test that it works (receive a send a transaction), close it and reopen it and test again (make sure the wallet file has all the info needed to open the wallet). Test the derivation path scanner.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17577
Fabcien pushed a commit to Bitcoin-ABC/ElectrumABC that referenced this pull request Jan 24, 2025
Summary:
This implements recovery of a wallet from a Shamir's secret-sharing scheme.

Current limitations:
 - we can only recover a wallet from an existing set of mnemonic shares, we don't generate new ones
 - the mnemonic shares are not saved to storage (wallet file), so users can't see their "seed" via the "Wallet > Show" seed menu (the action is disabled in the GUI)
 - we don't autodetect the seed type, the user needs to click the option button and select "slip39" explicitely

This is a backport of [[spesmilo#6917 | electrum#6917]] and [[spesmilo#9059 | electrum#9059]]

Depends on D17576

Test Plan:
`python test_runner.py`

Import a wallet from a SLIP39 share, test that it works (receive a send a transaction), close it and reopen it and test again (make sure the wallet file has all the info needed to open the wallet). Test the derivation path scanner.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants