Skip to content

Commit 8a0e197

Browse files
committed
Add Beta support for BNB, CRO
o Fix PDF output from python -m slip39, borken when printing added
1 parent db7c5c8 commit 8a0e197

File tree

12 files changed

+401
-335
lines changed

12 files changed

+401
-335
lines changed

App.pdf

0 Bytes
Binary file not shown.

README.org

Lines changed: 154 additions & 152 deletions
Large diffs are not rendered by default.

README.pdf

71 Bytes
Binary file not shown.

README.txt

Lines changed: 147 additions & 143 deletions
Large diffs are not rendered by default.

SLIP-39-macOS.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ coll = COLLECT(exe,
5050
app = BUNDLE(coll,
5151
name='SLIP-39.app',
5252
icon='images/SLIP-39.icns',
53-
version='8.1.2',
53+
version='8.2.0',
5454
info_plist={
55-
'CFBundleVersion':'8.1.2',
55+
'CFBundleVersion':'8.2.0',
5656
'CFBundlePackageType':'APPL',
5757
'LSApplicationCategoryType':'public.app-category.finance',
5858
'LSMinimumSystemVersion':'10.15.0',

slip39/api.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,21 @@ class Account( hdwallet.HDWallet ):
148148
"""Supports producing Legacy addresses for Bitcoin, and Litecoin. Doge (D...) and Ethereum (0x...)
149149
addresses use standard BIP44 derivation.
150150
151-
| Crypto | Semantic | Path | Address |
152-
| | | | < |
153-
|--------+----------+------------------+---------|
154-
| ETH | Legacy | m/44'/60'/0'/0/0 | 0x... |
155-
| BNB | Legacy | m/44'/60'/0'/0/0 | 0x... |
156-
| CRO | Bech32 | m/44'/60'/0'/0/0 | crc1... |
157-
| BTC | Legacy | m/44'/ 0'/0'/0/0 | 1... |
158-
| | SegWit | m/44'/ 0'/0'/0/0 | 3... |
159-
| | Bech32 | m/84'/ 0'/0'/0/0 | bc1... |
160-
| LTC | Legacy | m/44'/ 2'/0'/0/0 | L... |
161-
| | SegWit | m/44'/ 2'/0'/0/0 | M... |
162-
| | Bech32 | m/84'/ 2'/0'/0/0 | ltc1... |
163-
| DOGE | Legacy | m/44'/ 3'/0'/0/0 | D... |
151+
| Crypto | Semantic | Path | Address | Support |
152+
|--------+----------+------------------+---------+---------|
153+
| ETH | Legacy | m/44'/60'/0'/0/0 | 0x... | |
154+
| BNB | Legacy | m/44'/60'/0'/0/0 | 0x... | Beta |
155+
| CRO | Bech32 | m/44'/60'/0'/0/0 | crc1... | Beta |
156+
| BTC | Legacy | m/44'/ 0'/0'/0/0 | 1... | |
157+
| | SegWit | m/44'/ 0'/0'/0/0 | 3... | |
158+
| | Bech32 | m/84'/ 0'/0'/0/0 | bc1... | |
159+
| LTC | Legacy | m/44'/ 2'/0'/0/0 | L... | |
160+
| | SegWit | m/44'/ 2'/0'/0/0 | M... | |
161+
| | Bech32 | m/84'/ 2'/0'/0/0 | ltc1... | |
162+
| DOGE | Legacy | m/44'/ 3'/0'/0/0 | D... | |
164163
165164
"""
166-
CRYPTO_NAMES = dict( # Currently supported
165+
CRYPTO_NAMES = dict( # Currently supported (in order of visibility)
167166
ethereum = 'ETH',
168167
bitcoin = 'BTC',
169168
litecoin = 'LTC',
@@ -172,17 +171,18 @@ class Account( hdwallet.HDWallet ):
172171
binance = 'BNB',
173172
)
174173
CRYPTOCURRENCIES = set( CRYPTO_NAMES.values() )
174+
CRYPTOCURRENCIES_BETA = set( ('BNB', 'CRO') )
175175

176176
ETHJS_ENCRYPT = set( ('ETH', 'CRO', 'BNB') ) # Can be encrypted w/ Ethereum JSON wallet
177177
BIP38_ENCRYPT = CRYPTOCURRENCIES - ETHJS_ENCRYPT # Can be encrypted w/ BIP-38
178178

179179
CRYPTO_FORMAT = dict(
180180
ETH = "legacy",
181-
BNB = "legacy",
182-
CRO = "bech32",
183181
BTC = "bech32",
184182
LTC = "bech32",
185183
DOGE = "legacy",
184+
CRO = "bech32",
185+
BNB = "legacy",
186186
)
187187

188188
# Any locally-defined python-hdwallet cryptocurrencies, and any that may require some

slip39/generator/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def main( argv=None ):
8585
help="Use the supplied 128-, 256- or 512-bit hex value as the secret seed; '-' (default) reads it from stdin (eg. output from slip39.recover)" )
8686
ap.add_argument( '-f', '--format', action='append',
8787
default=[],
88-
help=f"Specify crypto address formats: {', '.join( Account.FORMATS )}; default {', '.join( f'{c}:{Account.address_format(c)}' for c in sorted(Account.CRYPTOCURRENCIES))}" )
88+
help=f"Specify crypto address formats: {', '.join( Account.FORMATS )}; default: " +', '.join(
89+
f'{c}:{Account.address_format(c)}' for c in Account.CRYPTO_NAMES.values()
90+
))
8991
ap.add_argument( '-c', '--cryptocurrency', action='append',
9092
default=[],
9193
help="A crypto name and optional derivation path (default: \"ETH:{Account.path_default('ETH')}\"), optionally w/ ranges, eg: ETH:../0/-" )

slip39/gui/SLIP-39-CRYPTO.org

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,28 @@ On each SLIP-39 card, up to 2 Wallet addresses and QR codes will be displayed, f
88
purposes only, to illustrate *which* Wallets are derived from this Seed. The cryptocurrencies
99
supported, and the standard BIP-44 derivation paths (Trezor compatible) displayed are:
1010

11-
| BTC | m/84'/0'/0'/0/0 (Bech32) |
12-
| ETH | m/44'/60'/0'/0/0 |
13-
| LTC | m/44'/2'/0'/0/0 |
14-
| DOGE | m/44'/3'/0'/0/0 |
11+
* Cryptocurrencies Supported
12+
13+
| Crypto | Semantic | Path | Address | Support |
14+
|--------+----------+------------------+---------+---------|
15+
| ETH | Legacy | m/44'/60'/0'/0/0 | 0x... | |
16+
| BNB | Legacy | m/44'/60'/0'/0/0 | 0x... | Beta |
17+
| CRO | Bech32 | m/44'/60'/0'/0/0 | crc1... | Beta |
18+
| BTC | Legacy | m/44'/ 0'/0'/0/0 | 1... | |
19+
| | SegWit | m/44'/ 0'/0'/0/0 | 3... | |
20+
| | Bech32 | m/84'/ 0'/0'/0/0 | bc1... | |
21+
| LTC | Legacy | m/44'/ 2'/0'/0/0 | L... | |
22+
| | SegWit | m/44'/ 2'/0'/0/0 | M... | |
23+
| | Bech32 | m/84'/ 2'/0'/0/0 | ltc1... | |
24+
| DOGE | Legacy | m/44'/ 3'/0'/0/0 | D... | |
25+
26+
27+
** Cryptocurrencies In Beta Testing
28+
29+
The BNB and CRO wallet addresses are also supported, if desired (currently in Beta testing
30+
quality). Generated Paper Wallets should be /tested/ to ensure that generated and recovered
31+
private keys are valid.
32+
33+
34+
1535
#+END_ABSTRACT

slip39/gui/SLIP-39-CRYPTO.txt

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,37 @@
1-
Cryptocurrencies Wallet addresses to display, and Paper Wallets to
2-
produce (if password supplied).
1+
#+BEGIN_ABSTRACT Cryptocurrencies Wallet addresses to display, and Paper
2+
Wallets to produce (if password supplied).
33

44
On each SLIP-39 card, up to 2 Wallet addresses and QR codes will be
55
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-
BTC m/84'/0'/0'/0/0 (Bech32)
10-
ETH m/44'/60'/0'/0/0
11-
LTC m/44'/2'/0'/0/0
12-
DOGE m/44'/3'/0'/0/0
9+
10+
1 Cryptocurrencies Supported
11+
============================
12+
13+
Crypto Semantic Path Address Support
14+
------------------------------------------------------
15+
ETH Legacy m/44'/60'/0'/0/0 0x...
16+
BNB Legacy m/44'/60'/0'/0/0 0x... Beta
17+
CRO Bech32 m/44'/60'/0'/0/0 crc1... Beta
18+
BTC Legacy m/44'/ 0'/0'/0/0 1...
19+
SegWit m/44'/ 0'/0'/0/0 3...
20+
Bech32 m/84'/ 0'/0'/0/0 bc1...
21+
LTC Legacy m/44'/ 2'/0'/0/0 L...
22+
SegWit m/44'/ 2'/0'/0/0 M...
23+
Bech32 m/84'/ 2'/0'/0/0 ltc1...
24+
DOGE Legacy m/44'/ 3'/0'/0/0 D...
25+
26+
27+
1.1 Cryptocurrencies In Beta Testing
28+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29+
30+
The BNB and CRO wallet addresses are also supported, if desired
31+
(currently in Beta testing quality). Generated Paper Wallets should
32+
be /tested/ to ensure that generated and recovered private keys are
33+
valid.
34+
35+
36+
37+
#+END_ABSTRACT

slip39/gui/main.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ def groups_layout(
126126
LO = LAYOUT_OPTIONS[controls] if controls is not None else LAYOUT
127127
LO_REC = LO != LAYOUT_OPTIONS[0] # True iff LO == Recover or Pro
128128
LO_PRO = LO == LAYOUT_OPTIONS[-1] # True iff LO == Pro
129+
130+
CRYPTO_DISPLAY = list(
131+
symbol
132+
for symbol in Account.CRYPTO_NAMES.values() # Retains desired ordering (vs. CRYPTOCURRENCIES set)
133+
if LO_PRO or symbol not in Account.CRYPTOCURRENCIES_BETA
134+
)
135+
129136
layout = [
130137
[
131138
sg.Frame( '1. Name(s) and formats of SLIP-39 Cards for output PDF File(s)', [
@@ -271,8 +278,7 @@ def groups_layout(
271278
for c in c_row
272279
]
273280
for c_row in chunker(
274-
list( Account.CRYPTO_NAMES.values() ), # Retain ordering vs. CRYPTOCURRENCIES set
275-
int( round( math.sqrt( len( Account.CRYPTOCURRENCIES )) + .5 ))
281+
CRYPTO_DISPLAY, int( round( math.sqrt( len( CRYPTO_DISPLAY )) + .25 ))
276282
)
277283
], visible=LO_REC )
278284
] + [
@@ -1169,8 +1175,9 @@ def main( argv=None ):
11691175
help="A group name[[<require>/]<size>] (default: <size> = 1, <require> = half of <size>, rounded up, eg. 'Frens(3/5)' )." )
11701176
ap.add_argument( '-c', '--cryptocurrency', action='append',
11711177
default=[],
1172-
help="A crypto name and optional derivation path ('../<range>/<range>' allowed); defaults:"
1173-
f" {', '.join( f'{c}:{Account.path_default(c)}' for c in Account.CRYPTOCURRENCIES)}" )
1178+
help="A crypto name and optional derivation path ('../<range>/<range>' allowed); defaults:" + ', '.join(
1179+
f'{c}:{Account.path_default(c)}' for c in Account.CRYPTO_NAMES.values()
1180+
))
11741181
ap.add_argument( '-p', '--path',
11751182
default=None,
11761183
help="Modify all derivation paths by replacing the final segment(s) w/ the supplied range(s), eg. '.../1/-' means .../1/[0,...)")

0 commit comments

Comments
 (0)