Skip to content

Commit 2520cfc

Browse files
committed
Support for BIP-39 "Backup"
1 parent b67af16 commit 2520cfc

22 files changed

+360
-221
lines changed

README.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ wallet.
111111
#+LATEX: }
112112

113113
The account owner might store their First and Second group data in their home and office safes.
114-
These are 1/1 groups (1 required, and only 1 member, so each of these are3 1-card groups.)
114+
These are 1/1 groups (1 required, and only 1 member, so each of these are 1-card groups.)
115115

116116
If the Seed needs to be recovered, collecting the First and Second cards from the home and
117117
office safe is sufficient to recover the Seed, and re-generate all of the HD Wallet accounts.

slip39/api.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ def random_secret(
719719
return RANDOM_BYTES( seed_length )
720720

721721

722-
Details = namedtuple( 'Details', ('name', 'group_threshold', 'groups', 'accounts') )
722+
Details = namedtuple( 'Details', ('name', 'group_threshold', 'groups', 'accounts', 'using_bip39') )
723723

724724

725725
def enumerate_mnemonic( mnemonic ):
@@ -790,15 +790,18 @@ def create(
790790
name: str,
791791
group_threshold: int,
792792
groups: Dict[str,Tuple[int, int]],
793-
master_secret: bytes = None, # Default: 128-bit Seed Entropy
793+
master_secret: bytes = None, # Default: generate 128-bit Seed Entropy
794794
passphrase: bytes = b"",
795795
using_bip39: bool = False, # Produce wallet Seed from master_secret Entropy using BIP-39 generation
796796
iteration_exponent: int = 1,
797797
cryptopaths: Optional[Sequence[Union[str,Tuple[str,str]]]] = None, # default: ETH, BTC at default paths
798798
strength: int = 128,
799-
) -> Tuple[str,int,Dict[str,Tuple[int,List[str]]], Sequence[Sequence[Account]]]:
799+
) -> Tuple[str,int,Dict[str,Tuple[int,List[str]]], Sequence[Sequence[Account]], bool]:
800800
"""Creates a SLIP-39 encoding for supplied master_secret Entropy, and 1 or more Cryptocurrency
801-
accounts. Returns the details, in a form directly compatible with the layout.produce_pdf API.
801+
accounts. Returns the Details, in a form directly compatible with the layout.produce_pdf API.
802+
803+
The master_secret Seed Entropy is discarded (because it is, of course, always recoverable from
804+
the SLIP-39 mnemonics).
802805
803806
Creates accountgroups derived from the Seed Entropy. By default, this is done in the SLIP-39
804807
standard, using the master_secret Entropy directly. If a passphrase is supplied, this is also
@@ -879,7 +882,7 @@ def create(
879882
for line,_ in organize_mnemonic( mnem, label=f"{ordinal(mn_n+1)} " ):
880883
log.info( f"{line}" )
881884

882-
return Details(name, group_threshold, groups, accts)
885+
return Details(name, group_threshold, groups, accts, using_bip39)
883886

884887

885888
def mnemonics(

slip39/gui/SLIP-39-AS-BIP.org

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
#+OPTIONS: toc:nil title:nil author:nil
33

44
#+BEGIN_ABSTRACT
5-
SLIP-39 support for Hardware Wallets that require BIP-39 Mnemonics for Seed recovery, such as to
6-
your Ledger Nano. Recover your BIP-39 Mnemonic phrase from these SLIP-39 cards using the GUI (or
7-
command-line) whenever you need it, to restore your Cryptocurrency accounts to your hardware wallet.
5+
SLIP-39 Mnemonics can be used directly on a Trezor "Model T" to backup/restore the Seed.
6+
7+
Also supports other Hardware Wallets that require a BIP-39 Mnemonic for Seed recovery, such as to
8+
your Ledger Nano. Recover your BIP-39 Seed Phrase from these SLIP-39 cards using the GUI (or
9+
command-line) whenever you need it, to restore your Crypto accounts to your hardware wallet.
810

911
| Controls | Description |
1012
|----------+----------------------------------------------------------------------|
11-
| Basic | Generate SLIP-39 Cards, "Using BIP-39" to recover hardware wallet |
12-
| Recover | Use SLIP-39/BIP-39 to recover Seed Entropy, "Using BIP-39" on wallet |
13+
| Backup | Already using a BIP-39 Seed Phrase? Back it up using SLIP-39 Cards |
14+
| Create | Generate SLIP-39 Cards, even if using BIP-39 on your hardware wallet |
15+
| Recover | Use SLIP-39/BIP-39 to recover Seed, supports using BIP-39 on wallet |
1316
| Pro | Convert existing BIP-39 Seed to SLIP-39 for "Paper Wallet" backup |
1417
#+END_ABSTRACT
1518

@@ -18,9 +21,7 @@ command-line) whenever you need it, to restore your Cryptocurrency accounts to y
1821
To support older or less expensive existing hardware wallets that *only* support BIP-39 recovery,
1922
*or* to backup existing BIP-39 Mnemonic phrases to SLIP-39 (to avoid moving all of your old
2023
BIP-39 Seed derived wallets to new SLIP-39 Seed derived wallets), click the "Using BIP-39"
21-
checkbox.
22-
23-
This will do two things:
24+
checkbox (this is the default). This will do two things:
2425

2526
** Output BIP-39 Mnemonics
2627

slip39/gui/SLIP-39-AS-BIP.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
SLIP-39 support for Hardware Wallets that require BIP-39 Mnemonics for
2-
Seed recovery, such as to your Ledger Nano. Recover your BIP-39
3-
Mnemonic phrase from these SLIP-39 cards using the GUI (or command-line)
4-
whenever you need it, to restore your Cryptocurrency accounts to your
5-
hardware wallet.
1+
SLIP-39 Mnemonics can be used directly on a Trezor "Model T" to
2+
backup/restore the Seed.
3+
4+
Also supports other Hardware Wallets that require a BIP-39 Mnemonic for
5+
Seed recovery, such as to your Ledger Nano. Recover your BIP-39 Seed
6+
Phrase from these SLIP-39 cards using the GUI (or command-line) whenever
7+
you need it, to restore your Crypto accounts to your hardware wallet.
68

79
Controls Description
810
--------------------------------------------------------------------------------
9-
Basic Generate SLIP-39 Cards, "Using BIP-39" to recover hardware wallet
10-
Recover Use SLIP-39/BIP-39 to recover Seed Entropy, "Using BIP-39" on wallet
11+
Backup Already using a BIP-39 Seed Phrase? Back it up using SLIP-39 Cards
12+
Create Generate SLIP-39 Cards, even if using BIP-39 on your hardware wallet
13+
Recover Use SLIP-39/BIP-39 to recover Seed, supports using BIP-39 on wallet
1114
Pro Convert existing BIP-39 Seed to SLIP-39 for "Paper Wallet" backup
1215

1316

@@ -18,9 +21,8 @@ hardware wallet.
1821
*only* support BIP-39 recovery, *or* to backup existing BIP-39
1922
Mnemonic phrases to SLIP-39 (to avoid moving all of your old BIP-39
2023
Seed derived wallets to new SLIP-39 Seed derived wallets), click the
21-
"Using BIP-39" checkbox.
22-
23-
This will do two things:
24+
"Using BIP-39" checkbox (this is the default). This will do two
25+
things:
2426

2527

2628
1.1 Output BIP-39 Mnemonics

slip39/gui/SLIP-39-CRYPTO.org

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
#+BEGIN_ABSTRACT
55
Cryptocurrencies Wallet addresses to display, and the Paper Wallets to produce (if a password is
6-
supplied). The cryptocurrencies supported, and the standard BIP-44 derivation paths (Trezor
7-
compatible) displayed are:
8-
9-
| Controls | Crypto | Semantic | Path | Address | Support |
10-
|----------+--------+----------+-------------------+---------+---------|
11-
| Basic | ETH | Legacy | m/44'/ 60'/0'/0/0 | 0x... | |
12-
| Basic | BTC | Bech32 | m/84'/ 0'/0'/0/0 | bc1... | |
13-
| | | SegWit | m/44'/ 0'/0'/0/0 | 3... | |
14-
| | | Legacy | m/44'/ 0'/0'/0/0 | 1... | |
15-
| Recover | LTC | Bech32 | m/84'/ 2'/0'/0/0 | ltc1... | |
16-
| | | SegWit | m/44'/ 2'/0'/0/0 | M... | |
17-
| | | Legacy | m/44'/ 2'/0'/0/0 | L... | |
18-
| Recover | DOGE | Legacy | m/44'/ 3'/0'/0/0 | D... | |
19-
| Pro | BNB | Legacy | m/44'/ 60'/0'/0/0 | 0x... | Beta |
20-
| Pro | CRO | Bech32 | m/44'/ 60'/0'/0/0 | crc1... | Beta |
21-
| Pro | XRP | Legacy | m/44'/144'/0'/0/0 | r... | Beta |
6+
supplied). The cryptocurrencies supported, and the standard BIP-44 derivation paths (Trezor,
7+
Ledger, etc. compatible) displayed are:
8+
9+
| Controls | Crypto | Semantic | Path | Address | Support |
10+
|-----------+--------+----------+-------------------+---------+---------|
11+
| (default) | ETH | Legacy | m/44'/ 60'/0'/0/0 | 0x... | |
12+
| (default) | BTC | Bech32 | m/84'/ 0'/0'/0/0 | bc1... | |
13+
| | | SegWit | m/44'/ 0'/0'/0/0 | 3... | |
14+
| | | Legacy | m/44'/ 0'/0'/0/0 | 1... | |
15+
| Recover | LTC | Bech32 | m/84'/ 2'/0'/0/0 | ltc1... | |
16+
| | | SegWit | m/44'/ 2'/0'/0/0 | M... | |
17+
| | | Legacy | m/44'/ 2'/0'/0/0 | L... | |
18+
| Recover | DOGE | Legacy | m/44'/ 3'/0'/0/0 | D... | |
19+
| Pro | BNB | Legacy | m/44'/ 60'/0'/0/0 | 0x... | Beta |
20+
| Pro | CRO | Bech32 | m/44'/ 60'/0'/0/0 | crc1... | Beta |
21+
| Pro | XRP | Legacy | m/44'/144'/0'/0/0 | r... | Beta |
2222

2323
On each SLIP-39 card, up to 2 Wallet addresses and QR codes will be displayed, for information
2424
purposes only, to illustrate *which* Wallets are derived from this Seed.

slip39/gui/SLIP-39-CRYPTO.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
Cryptocurrencies Wallet addresses to display, and the Paper Wallets to
22
produce (if a password is supplied). The cryptocurrencies supported,
3-
and the standard BIP-44 derivation paths (Trezor compatible) displayed
4-
are:
5-
6-
Controls Crypto Semantic Path Address Support
7-
-----------------------------------------------------------------
8-
Basic ETH Legacy m/44'/ 60'/0'/0/0 0x...
9-
Basic BTC Bech32 m/84'/ 0'/0'/0/0 bc1...
10-
SegWit m/44'/ 0'/0'/0/0 3...
11-
Legacy m/44'/ 0'/0'/0/0 1...
12-
Recover LTC Bech32 m/84'/ 2'/0'/0/0 ltc1...
13-
SegWit m/44'/ 2'/0'/0/0 M...
14-
Legacy m/44'/ 2'/0'/0/0 L...
15-
Recover DOGE Legacy m/44'/ 3'/0'/0/0 D...
16-
Pro BNB Legacy m/44'/ 60'/0'/0/0 0x... Beta
17-
Pro CRO Bech32 m/44'/ 60'/0'/0/0 crc1... Beta
18-
Pro XRP Legacy m/44'/144'/0'/0/0 r... Beta
3+
and the standard BIP-44 derivation paths (Trezor, Ledger, etc.
4+
compatible) displayed are:
5+
6+
Controls Crypto Semantic Path Address Support
7+
------------------------------------------------------------------
8+
(default) ETH Legacy m/44'/ 60'/0'/0/0 0x...
9+
(default) BTC Bech32 m/84'/ 0'/0'/0/0 bc1...
10+
SegWit m/44'/ 0'/0'/0/0 3...
11+
Legacy m/44'/ 0'/0'/0/0 1...
12+
Recover LTC Bech32 m/84'/ 2'/0'/0/0 ltc1...
13+
SegWit m/44'/ 2'/0'/0/0 M...
14+
Legacy m/44'/ 2'/0'/0/0 L...
15+
Recover DOGE Legacy m/44'/ 3'/0'/0/0 D...
16+
Pro BNB Legacy m/44'/ 60'/0'/0/0 0x... Beta
17+
Pro CRO Bech32 m/44'/ 60'/0'/0/0 crc1... Beta
18+
Pro XRP Legacy m/44'/144'/0'/0/0 r... Beta
1919

2020
On each SLIP-39 card, up to 2 Wallet addresses and QR codes will be
2121
displayed, for information purposes only, to illustrate *which* Wallets

slip39/gui/SLIP-39-CS.org

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
#+BEGIN_ABSTRACT
55
Select the desired SLIP-39 card size.
66

7-
| Controls | Card Size | Width | Height | |
8-
|----------+-----------+--------+--------+---------|
9-
| Basic | Business | 3-1/2" | 2" | Default |
10-
| Basic | Credit | 3-3/8" | 2-1/4" | |
11-
| Basic | Index | 5" | 3" | |
12-
| Recover | Half | 8" | 4.5" | |
13-
| Recover | Third | 8" | 3-3/8" | |
14-
| Recover | Quarter | 8" | 2-5/8" | |
15-
| Pro | Photo | 5-1/2" | 3-1/5" | |
7+
| Controls | Card Size | Width | Height |
8+
|-----------+-----------+--------+--------|
9+
| (default) | Business | 3-1/2" | 2" |
10+
| All | Credit | 3-3/8" | 2-1/4" |
11+
| All | Index | 5" | 3" |
12+
| Recover | Half | 8" | 4.5" |
13+
| Recover | Third | 8" | 3-3/8" |
14+
| Recover | Quarter | 8" | 2-5/8" |
15+
| Pro | Photo | 5-1/2" | 3-1/5" |
1616

1717
#+END_ABSTRACT
1818

@@ -23,5 +23,5 @@ orientation, to fit the most Cards on the selected paper.
2323

2424
** Paper Wallets
2525

26-
However, if Cryptocurrency "Paper Wallet" are printed, the selected Paper will always
27-
be printed in Portrait orientation.
26+
If Cryptocurrency "Paper Wallet" are printed, the selected Paper will always be printed in Portrait
27+
orientation.

slip39/gui/SLIP-39-CS.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Select the desired SLIP-39 card size.
22

3-
Controls Card Size Width Height
4-
----------------------------------------------
5-
Basic Business 3-1/2" 2" Default
6-
Basic Credit 3-3/8" 2-1/4"
7-
Basic Index 5" 3"
8-
Recover Half 8" 4.5"
9-
Recover Third 8" 3-3/8"
10-
Recover Quarter 8" 2-5/8"
11-
Pro Photo 5-1/2" 3-1/5"
3+
Controls Card Size Width Height
4+
--------------------------------------
5+
(default) Business 3-1/2" 2"
6+
All Credit 3-3/8" 2-1/4"
7+
All Index 5" 3"
8+
Recover Half 8" 4.5"
9+
Recover Third 8" 3-3/8"
10+
Recover Quarter 8" 2-5/8"
11+
Pro Photo 5-1/2" 3-1/5"
1212

1313

1414
1 Orientation
@@ -21,5 +21,5 @@ Select the desired SLIP-39 card size.
2121
1.1 Paper Wallets
2222
~~~~~~~~~~~~~~~~~
2323

24-
However, if Cryptocurrency "Paper Wallet" are printed, the selected
25-
Paper will always be printed in Portrait orientation.
24+
If Cryptocurrency "Paper Wallet" are printed, the selected Paper will
25+
always be printed in Portrait orientation.

slip39/gui/SLIP-39-LO.org

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,28 @@
44
#+BEGIN_ABSTRACT
55
Select an appropriate level of Controls detail.
66

7-
| Basic | SLIP-39 Mnemonic creation, "Using BIP-39" wallet support |
8-
| Recover | Enhanced SLIP-39 creation and SLIP-39/BIP-39 recovery |
9-
| Pro | Advanced Seeds, conversion of BIP-39 Seed to SLIP-39 |
7+
| Backup | Create SLIP-39 Mnemonics from existing BIP-39 Seed Phrase |
8+
| Create | SLIP-39 Mnemonic creation, "Using BIP-39" wallet support |
9+
| Recover | Enhanced SLIP-39 creation and SLIP-39/BIP-39 recovery |
10+
| Pro | Advanced Seeds, conversion of BIP-39 Phrase + passphrase to SLIP-39 |
1011
#+END_ABSTRACT
1112

12-
* Basic
13+
* Backup
14+
15+
The simplest mode, to "back up" a BIP-39 Seed Phrase Mnemonic to SLIP-39 Mnemonic Card Groups.
16+
17+
Once you print, test recovery and distribute the SLIP-39 Mnemonic Cards, you can safely destroy
18+
your unreliable and insecure BIP-39 Seed Phrase Mnemonic backups; you can securely and reliably
19+
recover your BIP-39 Seed Phrase whenever you need it, by collecting a sufficient number of the
20+
SLIP-39 Cards.
21+
22+
* Create
1323

1424
A basic SLIP-39 Mnemonic creation interface. Default support for [[https://shop.trezor.io/product/trezor-model-t?offer_id=15&aff_id=10388][Trezor "Model T"]] with native
1525
SLIP-39 Mnemonics recovery.
1626

17-
Select "Using BIP-39" for traditional BIP-39 Mnemonic phrase, to use other hardware wallets, such
18-
as the [[https://shop.ledger.com/pages/ledger-nano-x?r=2cd1cb6ae51f][Ledger Nano]].
27+
Select "Using BIP-39" for a traditional BIP-39 Seed Phrase Mnemonic, to use any other hardware
28+
wallets such as the [[https://shop.ledger.com/pages/ledger-nano-x?r=2cd1cb6ae51f][Ledger Nano]] (or even the Trezor "Model T", in BIP-39 Recovery mode).
1929

2030
* Recovery
2131

slip39/gui/SLIP-39-LO.txt

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
Select an appropriate level of Controls detail.
22

3-
Basic SLIP-39 Mnemonic creation, "Using BIP-39" wallet support
4-
Recover Enhanced SLIP-39 creation and SLIP-39/BIP-39 recovery
5-
Pro Advanced Seeds, conversion of BIP-39 Seed to SLIP-39
3+
Backup Create SLIP-39 Mnemonics from existing BIP-39 Seed Phrase
4+
Create SLIP-39 Mnemonic creation, "Using BIP-39" wallet support
5+
Recover Enhanced SLIP-39 creation and SLIP-39/BIP-39 recovery
6+
Pro Advanced Seeds, conversion of BIP-39 Phrase + passphrase to SLIP-39
67

78

8-
1 Basic
9-
=======
9+
1 Backup
10+
========
11+
12+
The simplest mode, to "back up" a BIP-39 Seed Phrase Mnemonic to
13+
SLIP-39 Mnemonic Card Groups.
14+
15+
Once you print, test recovery and distribute the SLIP-39 Mnemonic
16+
Cards, you can safely destroy your unreliable and insecure BIP-39 Seed
17+
Phrase Mnemonic backups; you can securely and reliably recover your
18+
BIP-39 Seed Phrase whenever you need it, by collecting a sufficient
19+
number of the SLIP-39 Cards.
20+
21+
22+
2 Create
23+
========
1024

1125
A basic SLIP-39 Mnemonic creation interface. Default support for
1226
[Trezor "Model T"] with native SLIP-39 Mnemonics recovery.
1327

14-
Select "Using BIP-39" for traditional BIP-39 Mnemonic phrase, to use
15-
other hardware wallets, such as the [Ledger Nano].
28+
Select "Using BIP-39" for a traditional BIP-39 Seed Phrase Mnemonic,
29+
to use any other hardware wallets such as the [Ledger Nano] (or even
30+
the Trezor "Model T", in BIP-39 Recovery mode).
1631

1732

1833
[Trezor "Model T"]
@@ -22,7 +37,7 @@ Select an appropriate level of Controls detail.
2237
<https://shop.ledger.com/pages/ledger-nano-x?r=2cd1cb6ae51f>
2338

2439

25-
2 Recovery
40+
3 Recovery
2641
==========
2742

2843
Greater control over the Mnemonic creation process. Recovery of Seed
@@ -32,7 +47,7 @@ Select an appropriate level of Controls detail.
3247
selecting "BIP-39 Entropy" in Seed Source.
3348

3449

35-
2.1 Extra Seed Randomness
50+
3.1 Extra Seed Randomness
3651
~~~~~~~~~~~~~~~~~~~~~~~~~
3752

3853
Probably most importantly, Extra Seed Entropy can be supplied. Any
@@ -48,22 +63,22 @@ Select an appropriate level of Controls detail.
4863
producing a Master Secret Seed from known data!
4964

5065

51-
2.2 SLIP-39
66+
3.2 SLIP-39
5267
~~~~~~~~~~~
5368

5469
Supports input of existing SLIP-39 mnemonics to recover the original
5570
Seed Entropy.
5671

5772

58-
2.2.1 Recover From Lost SLIP-39 Mnemonic Cards
73+
3.2.1 Recover From Lost SLIP-39 Mnemonic Cards
5974
----------------------------------------------
6075

6176
If you know that some of your original SLIP-39 Mnemonic cards have
6277
been lost, you can re-issue /another/ set of SLIP-39 cards containing
6378
the same, original Seed Entropy.
6479

6580

66-
3 Pro
81+
4 Pro
6782
=====
6883

6984
Advanced SLIP-39 creation and recovery, and recovery (and conversion)
@@ -72,7 +87,7 @@ Select an appropriate level of Controls detail.
7287
Requires licensing.
7388

7489

75-
3.1 BIP-39
90+
4.1 BIP-39
7691
~~~~~~~~~~
7792

7893
Conversion of existing, fragile BIP-39 12- or 24-word Mnemonic phrases

0 commit comments

Comments
 (0)