Skip to content

Commit 3c5e295

Browse files
committed
Build deps automatically, further refinement of display size
o Avoid UTF-8 symbols w/ varying sizes in .txt output
1 parent fe92a73 commit 3c5e295

File tree

11 files changed

+67
-56
lines changed

11 files changed

+67
-56
lines changed

GNUmakefile

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ BUNDLEID ?= ca.kundert.perry.SLIP39
1919
APIISSUER ?= 5f3b4519-83ae-4e01-8d31-f7db26f68290
2020
APIKEY ?= 5H98J7LKPC
2121

22-
# PY[3] is the target Python interpreter. It must have pytest installed.
23-
PY3 ?= $(shell which python3 2>/dev/null && echo python3 || echo python )
22+
# PY[3] is the target Python interpreter; require 3.9+. Detect if it is named python3 or python.
23+
PY3 ?= $(shell python3 --version >/dev/null 2>&1 && echo python3 || echo python )
2424

2525
VERSION = $(shell $(PY3) -c 'exec(open("slip39/version.py").read()); print( __version__ )')
2626

@@ -29,8 +29,8 @@ PYTESTOPTS = -vv # --capture=no --log-cli-level=INFO
2929

3030
PY3TEST = $(PY3) -m pytest $(PYTESTOPTS)
3131

32-
# VirtualEnv: Build them in ~/src/python-slip39-1.2.3/
33-
LOCAL ?= ~/src/
32+
# VirtualEnv: Build them in eg. ~/src/python-slip39-1.2.3/
33+
VENV_LOCAL ?= ~/src/
3434

3535
GHUB_NAME = python-slip39
3636
GHUB_REPO = [email protected]:pjkundert/$(GHUB_NAME)
@@ -72,18 +72,36 @@ build-check:
7272
|| ( echo "\n*** Missing Python modules; run:\n\n $(PY3) -m pip install --upgrade pip setuptools wheel build\n" \
7373
&& false )
7474

75+
deps: deps-txt
76+
7577
build: clean wheel app
7678

7779

80+
#
81+
# org-mode products.
82+
#
83+
# deps-txt: All of the .txt files needed to build
84+
#
85+
%.txt: %.org
86+
emacs $< --batch -f org-ascii-export-to-ascii --kill
87+
88+
GUI_TXT = $(patsubst %.org,%.txt,$(wildcard slip39/gui/*.org))
89+
90+
deps-txt: $(GUI_TXT) slip39/gui/SLIP-39.txt
91+
92+
slip39/gui/SLIP-39.txt:
93+
toilet --font ascii12 SLIP-39 > $@
94+
@echo " Safe & Effective (tm) Crypto Wallet Backup and Recovery" >> $@
95+
7896
#
7997
# VirtualEnv build, install and activate
8098
#
8199

82-
venv: $(LOCAL)/$(VENV_NAME)
83-
venv-activate: $(LOCAL)/$(VENV_NAME)-activate
100+
venv: $(VENV_LOCAL)/$(VENV_NAME)
101+
venv-activate: $(VENV_LOCAL)/$(VENV_NAME)-activate
84102

85103

86-
$(LOCAL)/$(VENV_NAME):
104+
$(VENV_LOCAL)/$(VENV_NAME):
87105
@echo; echo "*** Building $@ VirtualEnv..."
88106
@rm -rf $@ && $(PY3) -m venv $(VENV_OPTS) $@ \
89107
&& cd $@ && git clone $(GHUB_REPO) $(GHUB_BRCH) \
@@ -92,7 +110,7 @@ $(LOCAL)/$(VENV_NAME):
92110
# Activate a given VirtualEnv, and go to its python-slip39 installation
93111
# o Creates a custom venv-activate.sh script in the venv, and uses it start
94112
# start a sub-shell in that venv, with a CWD in the contained python-slip39 installation
95-
$(LOCAL)/$(VENV_NAME)-activate: $(LOCAL)/$(VENV_NAME)
113+
$(VENV_LOCAL)/$(VENV_NAME)-activate: $(VENV_LOCAL)/$(VENV_NAME)
96114
@echo; echo "*** Activating $@ VirtualEnv"
97115
@[ -s $</venv-activate.sh ] || ( \
98116
echo "PS1='[\u@\h \W)]\\$$ '"; \
@@ -106,7 +124,7 @@ $(LOCAL)/$(VENV_NAME)-activate: $(LOCAL)/$(VENV_NAME)
106124

107125
wheel: dist/slip39-$(VERSION)-py3-none-any.whl
108126

109-
dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
127+
dist/slip39-$(VERSION)-py3-none-any.whl: build-check deps FORCE
110128
$(PY3) -m build
111129
@ls -last dist
112130

@@ -142,7 +160,7 @@ app-pkg-upload: dist/SLIP-39-$(VERSION).pkg.upload-package
142160
#
143161
# Build the windows .msi installer
144162
#
145-
dist/slip39-$(VERSION)-win64.msi:
163+
dist/slip39-$(VERSION)-win64.msi: deps
146164
$(PY3) setup.py bdist_msi
147165

148166
#
@@ -453,7 +471,8 @@ dist/SLIP-39.app-checkids: SLIP-39.spec
453471
# - Find each dependent key, and look at its SHA fingerprint, and then see if you have
454472
# that one in your System keychain, downloading all the named keys from apple 'til
455473
# you find the one with the matching fingerprint. Grr... Repeat 'til check-signature works.
456-
dist/SLIP-39.app: SLIP-39-macOS.spec \
474+
dist/SLIP-39.app: deps \
475+
SLIP-39-macOS.spec \
457476
SLIP-39.metadata/entitlements.plist \
458477
images/SLIP-39.icns
459478
@echo "\n\n*** Rebuilding $@, version $(VERSION)..."
@@ -529,6 +548,7 @@ SLIP-39-win32.spec: SLIP-39.py
529548
@echo "!!! Regenerated $@: must be manually corrected!"
530549
false # Make the build fail if we've regenerated the .spec
531550

551+
532552
#
533553
# macOS Icons
534554
#

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ pytest
55
setuptools
66
wheel
77
pyinstaller >= 4.9
8+
cx_Freeze >= 6.10

slip39/gui/SLIP-39-CRYPTO.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ displayed, for information purposes only, to illustrate *which* Wallets
66
are derived from this Seed. The cryptocurrencies supported, and the
77
standard BIP-44 derivation paths (Trezor compatible) displayed are:
88

9-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109
BTC m/84'/0'/0'/0/0 (Bech32)
1110
ETH m/44'/60'/0'/0/0
1211
LTC m/44'/2'/0'/0/0
1312
DOGE m/44'/3'/0'/0/0
14-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

slip39/gui/SLIP-39-G-NAME.org

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ The default Group names and their intended usages are:
1010
| Second | A 1-card group stored in the First safe place |
1111
| Fam | A smaller group of Family members |
1212
| Fren | A larger group of Friends; increase Needed |
13-
1413
#+END_ABSTRACT
1514

1615
* 1-Card Groups

slip39/gui/SLIP-39-G-NAME.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ Name each Group according to "who" or "where" you plan to distribute it.
22

33
The default Group names and their intended usages are:
44

5-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
First A 1-card group stored in the First safe place
76
Second A 1-card group stored in the First safe place
87
Fam A smaller group of Family members
98
Fren A larger group of Friends; increase Needed
10-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
119

1210

1311
1 1-Card Groups
14-
═══════════════
12+
===============
1513

1614
Useful for the direct owners of the Seed. Just one Card for these
1715
groups must be collected; ensure that 2+ of these Groups are created,
@@ -23,27 +21,27 @@ The default Group names and their intended usages are:
2321

2422

2523
2 Multi-Card Groups
26-
═══════════════════
24+
===================
2725

2826
If you have a group of people (or places) that may be lost or
2927
destroyed, or where some Mnemonics (cards) may be found and fall into
3028
hostile hands, use a multi-card group.
3129

3230

3331
2.1 Hostile Groups
34-
──────────────────
32+
~~~~~~~~~~~~~~~~~~
3533

3634
The more /hostile/ (untrustworthy) the group (ie. the more likely that
37-
any card(s) may be stolen by an attacker) make the Group's
35+
any card(s) may be stolen by an attacker) -- make the Group's
3836
Needed/#-in-Group ratio larger. Then, the attacker must collect more
3937
cards to defeat the Group.
4038

4139

4240
2.2 Fragile Groups
43-
──────────────────
41+
~~~~~~~~~~~~~~~~~~
4442

4543
The more /fragile/ (unreliable) the group (ie. the more likely that
46-
any card(s) may be lost or destroyed) make the Group's
44+
any card(s) may be lost or destroyed) -- make the Group's
4745
Needed/#-in-Group ratio smaller. Thus, more cards may be
4846
lost/destroyed before the Group can no longer be recovered (an *other*
4947
Group(s) must be colledted, instead, to recover the Seed).

slip39/gui/SLIP-39-G.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Decrease "# Needed", the less Fragile/Unreliable the Group is.
66

77

88
1 1-Card Groups
9-
═══════════════
9+
===============
1010

1111
Useful for the direct owners of the Seed. Just one Card for these
1212
groups must be collected; ensure that 2+ of these Groups are created,
@@ -18,27 +18,27 @@ Decrease "# Needed", the less Fragile/Unreliable the Group is.
1818

1919

2020
2 Multi-Card Groups
21-
═══════════════════
21+
===================
2222

2323
If you have a group of people (or places) that may be lost or
2424
destroyed, or where some Mnemonics (cards) may be found and fall into
2525
hostile hands, use a multi-card group.
2626

2727

2828
2.1 Hostile Groups
29-
──────────────────
29+
~~~~~~~~~~~~~~~~~~
3030

3131
The more /hostile/ (untrustworthy) the group (ie. the more likely that
32-
any card(s) may be stolen by an attacker) make the Group's
32+
any card(s) may be stolen by an attacker) -- make the Group's
3333
Needed/#-in-Group ratio larger. Then, the attacker must collect more
3434
cards to defeat the Group.
3535

3636

3737
2.2 Fragile Groups
38-
──────────────────
38+
~~~~~~~~~~~~~~~~~~
3939

4040
The more /fragile/ (unreliable) the group (ie. the more likely that
41-
any card(s) may be lost or destroyed) make the Group's
41+
any card(s) may be lost or destroyed) -- make the Group's
4242
Needed/#-in-Group ratio smaller. Thus, more cards may be
4343
lost/destroyed before the Group can no longer be recovered (an *other*
4444
Group(s) must be colledted, instead, to recover the Seed).

slip39/gui/SLIP-39-LO.txt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
Select an appropriate level of Controls detail.
22

3-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4-
Basic Basic SLIP-39 Mnemonic creation
3+
Basic SLIP-39 Mnemonic creation
54
Extra Enhanced SLIP-39 creation and recover
65
Pro Conversion of BIP-39 Mnemonics to SLIP-39
7-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
86

97

108
1 Basic
11-
═══════
9+
=======
1210

1311
A basic SLIP-39 Mnemonic creation interface.
1412

1513

1614
2 Extra
17-
═══════
15+
=======
1816

1917
Greater control over the Mnemonic creation process.
2018

2119

2220
2.1 Extra Seed Entropy
23-
──────────────────────
21+
~~~~~~~~~~~~~~~~~~~~~~
2422

2523
Probably most importantly, Extra Entropy can be supplied. Any data
2624
supplied (Dice rolls, for example, add about 2.5 bits of entropy per
@@ -36,14 +34,14 @@ Select an appropriate level of Controls detail.
3634

3735

3836
2.2 SLIP-39
39-
───────────
37+
~~~~~~~~~~~
4038

4139
Supports input of existing SLIP-39 mnemonics to recover the original
4240
Seed.
4341

4442

4543
3 Pro
46-
═════
44+
=====
4745

4846
Advanced SLIP-39 creation and recovery, and conversion of BIP-39
4947
Mnemonics to SLIP-39.
@@ -52,7 +50,7 @@ Select an appropriate level of Controls detail.
5250

5351

5452
3.1 BIP-39
55-
──────────
53+
~~~~~~~~~~
5654

5755
Conversion of existing, fragile BIP-39 12- or 24-word Mnemonic phrases
5856
into SLIP-39 is supported.
@@ -63,7 +61,7 @@ Select an appropriate level of Controls detail.
6361

6462

6563
3.1.1 Not Trezor Compatible
66-
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
64+
---------------------------
6765

6866
Unfortunately, the Trezor only implements 128-bit (20 word) and
6967
256-bit (33-word) Mnemonics, so the BIP-39 Seed converted to SLIP-39

slip39/gui/SLIP-39-SD.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
Create (or recover) Seed Data.
1+
Create (or recover) Seed Data for your SLIP-39 Mnemonic.
22

3-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
43
Random Create SLIP-39 Mnemonic creation from secure Entropy
54
SLIP-39 (Extra) Recover Seed from SLIP-39 Mnemonics
65
BIP-39 (Pro) Recover Seed from BIP-39 Mnemonics
76
Fixed (Pro) Hex data may be supplied for the Seed
8-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

slip39/gui/SLIP-39-WALLET.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Supply a password to produce an encrypted Ethereum JSON wallet or
2-
Bitcoin, BIP-38 Paper Wallet.
2+
Bitcoin, ... BIP-38 Paper Wallet.
33

44
If you import these SLIP-39 Mnemonics directly into your Trezor hardware
5-
wallet you do /not/ need Paper Wallets: you have access to /all/ of
5+
wallet -- you do /not/ need Paper Wallets: you have access to /all/ of
66
the wallets, in every cryptocurrency supported by the Trezor.
77

88
These are intended to support the importing of /individual/, single
@@ -13,32 +13,32 @@ recoverable "Safe Portable Crypto Accounts" (below).
1313

1414

1515
1 Password
16-
══════════
16+
==========
1717

18-
If you lose or forget this Paper Wallet password you cannot import
18+
If you lose or forget this Paper Wallet password -- you cannot import
1919
these wallets into compatible software Cryptocurrency wallets!
2020
Remember; the Seed can still be recovered by collecting sufficient
2121
numbers of Mnemonics (cards), and then new Paper Wallets can be
2222
issued.
2323

2424

2525
1.1 Hint
26-
────────
26+
~~~~~~~~
2727

2828
A small (<10 character) hint about what (or where) the Paper Wallet
2929
Password is.
3030

3131

3232
2 Safe Portable Crypto Accounts
33-
═══════════════════════════════
33+
===============================
3434

3535
If you want to issue temporary Paper Wallets (to carry cryptocurrency
3636
with you to give to someone or buy something), then Paper Wallets
3737
derived from your account are a good idea.
3838

3939

4040
2.1 Custom Derivation Path
41-
──────────────────────────
41+
~~~~~~~~~~~~~~~~~~~~~~~~~~
4242

4343
Use the `SLIP-39' App to recover your Seed, select the desired
4444
Cryptocurrency (eg. `BTC'), and then enter a Paper Wallet Password,
@@ -50,11 +50,9 @@ recoverable "Safe Portable Crypto Accounts" (below).
5050
Derive", this would result in 3 paper wallets being produced, at the
5151
following standard BTC Bech32 derivation paths:
5252

53-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5453
m/84'/0'/1'/0/0 bc1q8pqnqs573vx3qdp0xp6qdqzvnvy8px24rxh9lp
5554
m/84'/0'/1'/0/0 bc1qwtc58u4mmnxa29u8j07e6lmqpnrs38vefy3y24
5655
m/84'/0'/1'/0/0 bc1qg9s8qzm0lcetfv6umhlm3evtca5zsqv7elqd5s
57-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5856

5957
You could load these wallets with funds, write the amount on the
6058
front, and fold them over twice (to hide the PRIVATE KEY, while

slip39/gui/SLIP-39.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
""""" """""""" """""" "" """"" """"
99

1010

11+
Safe & Effective (tm) Crypto Wallet Backup and Recovery

0 commit comments

Comments
 (0)