Skip to content

Commit f33df83

Browse files
authored
Merge pull request #51 from gorazdko/update_docs
updating docs
2 parents b0dd8c5 + d924ecd commit f33df83

36 files changed

+98
-105
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@ The following files contain everything you need to set up your *LetheKit* hardwa
1616
* The [Lethekit Installation Instructions](doc/installation.md) show how to install LetheKit in your Arduino development environment.
1717
* The [Seedtool Installation Instructions](seedtool/doc/build.md) show to install Seedtool on your *LetheKit* using the Arduino IDE.
1818
* The [Seedtool Application Instuctions](seedtool/README.md) describe how to generate and recover
19-
[BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD wallet master seeds in [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) and [SLIP-39](https://github.com/satoshilabs/slips/blob/master/slip-0039.md) formats.
19+
[BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD wallet master seeds in [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) and [SSKR](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md) formats.
2020

2121
## Status - Late Alpha
2222

2323
*LetheKit* is currently under active development and in the late alpha testing phase. It should not be used for production tasks until it has had further testing and auditing.
2424

25-
### Known Issues
26-
27-
#### ⚠️ Warning: Lack of Round-trip Compatibility between BIP-39 and SLIP-39
25+
### ⚠️ Warning: Lack of Round-trip Compatibility between BIP-39 and SLIP-39
2826

2927
At first glance, BIP-39 and SLIP-39 both appear to be means of converting a binary seed to a set of backup words and back. You might assume you could simply convert a BIP-39 backup to a binary seed, from that binary seed to SLIP-39, and then use the SLIP-39 backup to recover the same wallet as the original BIP-39 backup, but this is **NOT** the case. This is because the SLIP-39 algorithm that SatoshiLabs uses in their Trezor wallet does not derive the master secret in the same way as their BIP-39 algorithm does.
3028

31-
Currently Blockchain Commons is investigating an alternative to SLIP-39 that allows round-trips with BIP-39. We want to ensure that the same seed will result in the same derived keys using either BIP-39 or our alternative approach.
29+
Currently Blockchain Commons and LetheKit implement an alternative to SLIP-39, called [Shamir Secret Key Recovery](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md) (**SSKR**), that allows round-trips with BIP-39. We want to ensure that the same seed will result in the same derived keys using either BIP-39 or our alternative approach.
3230

3331
As SLIP-39 is not round-trip compatible with BIP-39, and SLIP-39 is under the control of SatoshiLabs and does not appear to be a fully community-controlled standard, Blockchain Commons is no longer endorsing SLIP-39.
3432

@@ -48,7 +46,8 @@ This table below also establishes provenance (repository of origin, permalink, a
4846
| bip39 | [https://github.com/ksedgwic/bip39](https://github.com/ksedgwic/bip39) | 9b8fa3c7d145c39558c2534f6cf40879477d93a1 | 2018 Chris Howe | [MIT License](https://github.com/ksedgwic/bip39/blob/master/LICENSE) |
4947
| TRNG-for-ATSAMD51J19A-Adafruit-Metro-M4- | [https://github.com/SapientHetero/TRNG-for-ATSAMD51J19A-Adafruit-Metro-M4-](https://github.com/SapientHetero/TRNG-for-ATSAMD51J19A-Adafruit-Metro-M4-) | 17d5e36cd922ce7df8047d9c89633dca9b5ae122 | 2019 Ron Sutton | [MIT License](https://github.com/SapientHetero/TRNG-for-ATSAMD51J19A-Adafruit-Metro-M4-/blob/master/LICENSE.txt) |
5048
| libwally-core | [https://github.com/ElementsProject/libwally-core](https://github.com/ElementsProject/libwally-core) | e0d0634aea716d813744326ea6c7590eb9fc381c | Jon Griffiths (Blockstream) 2016 | [BSD/MIT license](https://github.com/ElementsProject/libwally-core/blob/master/LICENSE) |
51-
| Library-arduino-cbor | [https://github.com/jjtara/Library-Arduino-Cbor](https://github.com/jjtara/Library-Arduino-Cbor) | 996bf4a853513ee1fb94286691209a067c915bfb | jjtara 20014 | [Apache license](https://github.com/jjtara/Library-Arduino-Cbor/blob/master/LICENSE) |
49+
| Library-arduino-cbor | [https://github.com/jjtara/Library-Arduino-Cbor](https://github.com/jjtara/Library-Arduino-Cbor) | 996bf4a853513ee1fb94286691209a067c915bfb | jjtara 2014 | [Apache license](https://github.com/jjtara/Library-Arduino-Cbor/blob/master/LICENSE) |
50+
| ArduinoSTL | [https://github.com/mike-matera/ArduinoSTL](https://github.com/mike-matera/ArduinoSTL) | 7411816e2d8f49d96559dbaa47e327816dde860c | Mike Matera 1999 | [GNU LGPL](https://github.com/mike-matera/ArduinoSTL/blob/master/LICENSE) |
5251

5352
### Dependencies
5453

@@ -60,7 +59,8 @@ The following internal Blockchain Commons projects are leveraged by *LetheKit*:
6059

6160
- [BlockchainCommons/bc-crypto-base](https://github.com/blockchaincommons/bc-crypto-base) — Well-Reviewed and Audited Cryptographic Functions for Use in Blockchain Commons Software Projects
6261
- [BlockchainCommons/bc-shamir](https://github.com/BlockchainCommons/bc-shamir) - C Implementation of Shamir Secret Sharing for use in Blockchain Commons Software Projects
63-
- [BlockchainCommons/bc-slip39](https://github.com/BlockchainCommons/bc-slip39) - C Implementation of SLIP-39 Shamir Secret Sharing standard.
62+
- [BlockchainCommons/bc-bytewords](https://github.com/BlockchainCommons/bc-bytewords) - C library for encoding and decoding Bytewords.
63+
- [BlockchainCommons/bc-sskr](https://github.com/BlockchainCommons/bc-sskr) - Implementation of Shamir Secret Key Recovery (SSKR)
6464

6565
### Derived from ...
6666

@@ -107,6 +107,7 @@ The following people directly contributed to this repository. You can add your n
107107
| ----------------- | ------------------- | ------------------------------------------------- | ------------------------------------- | -------------------------------------------------- |
108108
| Christopher Allen | Principal Architect | [@ChristopherA](https://github.com/ChristopherA) | \<[email protected]\> | FDFE 14A5 4ECB 30FC 5D22 74EF F8D3 6C91 3574 05ED |
109109
| Ken Sedgwick | Project Lead | [@ksedgwic](https://github.com/ksedgwic) | \<[email protected]\> | 4695 E5B8 F781 BF85 4326 9639 BBFC E515 8602 5550 |
110+
| Gorazd Kovacic | Project Maintainer | [@gorazdko](https://github.com/gorazdko) | \<[email protected]\> | 41F0 EA16 99A7 4C1E 2FA4 1B53 8CF9 6BC3 FF9D BBCE |
110111

111112
## Responsible Disclosure
112113

seedtool/README.md

Lines changed: 55 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,12 @@
1-
# Warning! There is a problem with LetheKit/seedtool BIP39/SLIP39 interoperability.
2-
3-
### The following is being tracked as [Issue #38](https://github.com/BlockchainCommons/bc-lethekit/issues/38):
4-
5-
#### What is the problem?
6-
7-
The LetheKit seedtool application generates new wallets using dice
8-
entropy to create BIP39 and SLIP39 recovery mnemonics. The BIP39 and
9-
SLIP39 mnemonics represent valid wallets, but they are not the same
10-
wallet.
11-
12-
This is a serious problem. If both BIP39 and SLIP39 backups are
13-
created at the same time and funds are placed in the BIP39 wallet the
14-
SLIP39 backup will fail to recover the same wallet and the funds would
15-
be lost.
16-
17-
#### Why is this the case?
18-
19-
Andrew Kozlik explains it well in this [GitHub comment]
20-
(https://github.com/iancoleman/slip39/issues/1#issuecomment-563213494)
21-
22-
#### How can matching BIP39 and SLIP39 backups be made?
23-
24-
Andrew Kozlik explains (above) that in principle, SLIP39 shares which
25-
are 59 words long could match a BIP39 mnemonic. In practice SLIP39
26-
shares of this length are non-standard and unlikely to be supported by
27-
any devices or applications. The extreme length is also significantly
28-
painful to record and enter.
29-
30-
#### Impact on LetheKit/seedtool:
31-
32-
The desired feature of (standard) matching BIP39 and SLIP39 backups is
33-
not possible.
34-
35-
The conversion of a BIP39 backup into a SLIP39 backup is not possible.
36-
37-
The conversion of a SLIP39 backup into a BIP39 backup is not possible.
38-
39-
LetheKit/seedtool can generate valid BIP39 and SLIP39 wallets but
40-
should not allow generation of both at the same time or suggest it
41-
can convert between the two.
42-
43-
LetheKit can restore SLIP39 backups, but a mechanism to export the
44-
master secret (likely via QR code) would need to be added.
45-
46-
## The original (invalid) directions follow:
47-
481
# Seedtool Application Instructions
492

503
The *seedtool* utility allows you to generate and recover
514
[BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)
525
HD wallet master seeds using
536
[BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki)
547
and
55-
[SLIP-39](https://github.com/satoshilabs/slips/blob/master/slip-0039.md)
56-
formats.
8+
[SSKR](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md)
9+
formats. In addition, it supports viewing XPUB keys and addresses in different formats.
5710

5811
## Compile and Upload Instruction
5912

@@ -67,31 +20,32 @@ There are three ways to insert a key into the *seedtool*:
6720

6821
### Key Generation with Dice
6922

70-
By rolling dice and typing the values, you can gather enough auditable entropy to generate a secure master seed. Rolling 50 dice gathers
23+
By rolling dice and typing the values, you can gather enough auditable entropy to generate a secure master seed. Rolling 50 dice gathers
7124
roughly 128 bits of entropy.
7225

7326
![Generate Seed](doc/images/generate-seed.png)
7427

7528
### BIP-39 Key Recovery
7629

7730
You can insert a key into the *seedtool* by entering its BIP-39
78-
recovery mnemonic passphrase. From there you can generate SLIP-39
31+
recovery mnemonic passphrase. From there you can generate SSKR
7932
shares.
8033

8134
![BIP-39 Restore](doc/images/bip39-restore.png)
8235

83-
### SLIP-39 Key Recovery
36+
### SSKR Recovery
8437

85-
If you possess enough shares of a SLIP-39 set, you can recover the
38+
If you possess enough shares of a SSKR set, you can recover the
8639
master seed with *seedtool*. From there you can generate the BIP-39
8740
mnemonic passphrase which will allow you to use it with most wallets.
8841

89-
![SLIP-39 Recovery Menu](doc/images/slip39-restore-menu.png) ![SLIP-39 Share Entry](doc/images/slip39-share-restore.png)
42+
![SSKR Recovery Menu](doc/images/sskr-restore-menu.png) ![SSKR Share Entry](doc/images/sskr-share-restore.png)
9043

9144
## Functions with a Seed
9245

9346
Once you have a seed through any of the prior flows, you can create
94-
BIP-39 and SLIP-39 mnemonic passphrases.
47+
BIP-39 and SSKR mnemonic passphrases. In addition you can view extended public
48+
keys, wallet addresses etc.
9549

9650
![Seed Present Menu](doc/images/seed-present.png)
9751

@@ -102,12 +56,48 @@ offline fashion (e.g., hammering into metal).
10256

10357
![BIP-39 View](doc/images/bip39-view.png)
10458

105-
### SLIP-39 Generation
59+
### SSKR Generation
10660

107-
SLIP-39 requires some configuration choices to determine total number of shares
61+
SSKR requires some configuration choices to determine total number of shares
10862
and the required number of shares present to recover.
10963

110-
![SLIP-39 Generation Config](doc/images/config-slip39.png) ![SLIP-39 Share View](doc/images/slip39-share-view.png)
64+
![SSKR Generation Config](doc/images/config-sskr.png) ![SSKR Share View](doc/images/sskr-share-view.png)
65+
66+
You can choose among different formats:
67+
![SSKR Share Format](doc/images/sskr-share-format.png)
68+
![SSKR Share View UR](doc/images/sskr-share-view-ur.png) ![SSKR Share View QRUR](doc/images/sskr-share-view-qrur.png)
69+
70+
### Displaying XPUBs
71+
72+
Extended public keys (XPUBs) can be shown in different formats (base58, UR, QR) with different
73+
options (slip132, with derivation path). Derivation path can be manually set.
74+
75+
![XPUB BASE58](doc/images/xpub_base58.png)
76+
![XPUB OPTIONS](doc/images/xpub_options.png)
77+
![XPUB UR](doc/images/xpub_ur.png)
78+
79+
![XPUB OPTIONS](doc/images/xpub_qr_text.png)
80+
![XPUB OPTIONS](doc/images/xpub_qrur.png)
81+
![XPUB DERIVATION](doc/images/xpub_derivation.png)
82+
83+
### Displaying Seed
84+
85+
You can choose to export seed in UR or QR-UR format.
86+
87+
![seed ur](doc/images/seed_ur.png)
88+
![seed qrur](doc/images/seed_qrur.png)
89+
90+
91+
### Displaying Addresses
92+
93+
![ADDR TEXT](doc/images/address_bech32.png) ![ADDR ur](doc/images/address_ur.png)
94+
![ADDR qr](doc/images/address_qr.png) ![ADDR qrur](doc/images/address_qrur.png)
95+
![ADDR format](doc/images/address_format.png)
96+
97+
A wallet can be exported in the 4 different formats (text, QR, UR and QR-UR):
98+
99+
![wallet export](doc/images/wallet_export.png) ![wallet export text](doc/images/wallet_export_text.png)
100+
![wallet export text](doc/images/wallet_export_qr.png) ![wallet export text](doc/images/wallet_export_qrur.png)
111101

112102
## Common Workflows
113103

@@ -124,20 +114,20 @@ To execute this flow with *seedtool*:
124114
1. Generate a new master seed using 50+ die rolls.
125115
2. Record your master BIP-39 backup in a secure manner (hammer into metal).
126116
This BIP-39 backup may be restored into most other wallets for common use.
127-
3. Optionally create a SLIP-39 sharded backup set which can serve as
117+
3. Optionally create a SSKR sharded backup set which can serve as
128118
long-term cold storage.
129119

130-
### Generate a SLIP-39 Backup Set for an Existing Wallet
120+
### Generate a SSKR Backup Set for an Existing Wallet
131121

132122
If you've already got a wallet in use, and have the BIP-39 backup for
133-
it, you can generate a SLIP-39 backup set as well:
123+
it, you can generate a SSKR backup set as well:
134124
1. Restore your seed in *seedtool* using your BIP-39 backup.
135-
2. Create a SLIP-39 sharded backup.
125+
2. Create a SSKR sharded backup.
136126

137-
### Recover a Master Seed from SLIP-39 Backup Shards
127+
### Recover a Master Seed from SSKR Backup Shards
138128

139129
If you need to recover your master seed and have enough shards from a
140-
SLIP-39 backup set:
141-
1. Recover the master seed from the SLIP-39 shards.
130+
SSKR backup set:
131+
1. Recover the master seed from the SSKR shards.
142132
2. Create a BIP-39 mnemonic which may then be directly restored into
143133
most wallets for use.

seedtool/VALIDATE.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,45 @@
2121
12 owner
2222

2323

24-
#### Restore SLIP39 (2 out of 3)
24+
#### Restore SSK (2 out of 3)
25+
26+
Note: Each generation of SSKR shares (using the same binary seed) leads to different combination of words.
27+
However, the restoration of these words should always lead back to the same binary seed.
2528

2629
Share #1
27-
1 hour 6 source 11 overall 16 brother
28-
2 aluminum 7 mobil 12 welcome 17 helpful
29-
3 academic 8 early 13 custody 18 adult
30-
4 acid 9 tenant 14 tadpole 19 huge
31-
5 cargo 10 vampire 15 idea 20 home
30+
1 tuna 6 gyro 11 zone 16 runs 21 waxy 26 buzz
31+
2 acid 7 able 12 jazz 17 dark 22 zone 27 horn
32+
3 epic 8 acid 13 draw 18 menu 23 body 28 luau
33+
4 gyro 9 able 14 pool 19 luau 24 veto 29 tiny
34+
5 cost 10 news 15 jump 20 hard 25 meow
3235
33-
hour aluminum academic acid cargo
34-
source mobil early tenant vampire
35-
overall welcome custody tadpole idea
36-
brother helpful adult huge home
36+
Share #2
37+
1 tuna 6 gyro 11 whiz 16 scar 21 gala 26 zone
38+
2 acid 7 able 12 very 17 also 22 huts 27 cost
39+
3 epic 8 acid 13 stub 18 jowl 23 what 28 into
40+
4 gyro 9 acid 14 join 19 idea 24 knob 29 ugly
41+
5 cost 10 help 15 inky 20 yawn 25 song
3742

43+
Share #3
44+
1 tuna 6 gyro 11 visa 16 fuel 21 rock 26 cook
45+
2 acid 7 able 12 join 17 iris 22 ugly 27 slot
46+
3 epic 8 acid 13 yurt 18 judo 23 soap 28 next
47+
4 gyro 9 also 14 echo 19 fizz 24 safe 29 guru
48+
5 cost 10 axis 15 heat 20 cost 25 dice
3849

39-
Share #2
40-
1 hour 6 scramble 11 flea 16 genre
41-
2 aluminum 7 sheriff 12 jury 17 spider
42-
3 academic 8 taught 13 artwork 18 organize
43-
4 agency 9 teammate 14 album 19 jury
44-
5 beyond 10 reward 15 else 20 move
4550

46-
hour aluminum academic agency beyond
47-
scramble sheriff taught teammate reward
48-
flea jury artwork album else
49-
genre spider organize jury move
51+
## Validation with seedtool
5052

53+
```bash
54+
$ seedtool --version
55+
0.9.0
5156

52-
Share #3
53-
1 hour 6 wisdom 11 boundary 16 wavy
54-
2 aluminum 7 chest 12 envelope 17 observe
55-
3 academic 8 cause 13 crisis 18 behavior
56-
4 always 9 chubby 14 intend 19 punish
57-
5 alien 10 hand 15 bumpy 20 isolate
58-
59-
hour aluminum academic always alien
60-
wisdom chest cause chubby hand
61-
boundary envelope crisis intend bumpy
62-
wavy observe behavior punish isolate
57+
$ seedtool --in sskr "tuna acid epic gyro cost gyro able acid also axis visa join yurt echo heat fuel iris judo fizz cost rock ugly soap safe dice cook slot next guru" "tuna acid epic gyro cost gyro able acid acid help whiz very stub join inky scar also jowl idea yawn gala huts what knob song zone cost into ugly"
58+
8d969eef6ecad3c29a3a629280e686cf
59+
60+
$ seedtool --in dice 123456
61+
8d969eef6ecad3c29a3a629280e686cf
6362

63+
$ seedtool --in dice 123456 | seedtool --in hex --out bip39
64+
mirror reject rookie talk pudding throw happy era myth already payment owner
65+
```
56.5 KB
Loading
50.5 KB
Loading

seedtool/doc/images/address_qr.png

59.3 KB
Loading
56.8 KB
Loading

seedtool/doc/images/address_ur.png

58.9 KB
Loading
-80.7 KB
Binary file not shown.
53.2 KB
Loading

0 commit comments

Comments
 (0)