You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MANUAL.md
+62-4Lines changed: 62 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,25 @@ $ seedtool --in random --out hex
44
44
06799f71d16fad08ec5407d32d670147
45
45
```
46
46
47
-
An output format `--out` and count `--count` may be specified. Count may be in [1-64] and the default `count` is 16. For the `hex` output format, the count is the number of bytes generated. For other output formats, `count` is the number of "output units" (e.g., bits, cards, die rolls, etc.)
47
+
The `bech32` format can be used in place of `hex`. Bech32 is recognizable by the first 5 characters being `seed1`. Unlike hex, where every possible input is a seed, Bech32 includes error detection.
48
+
49
+
```
50
+
#
51
+
# Generate a 16-byte random seed and display it as Bech32.
An output format `--out` and count `--count` may be specified. Count may be in [1-64] and the default `count` is 16. For the `hex` and `bech32` output formats, the count is the number of bytes generated. For other output formats, `count` is the number of "output units" (e.g., bits, cards, die rolls, etc.)
When the `--in` option is used, seedtool takes one or more arguments and uses them to construct the seed. If no arguments are given on the command line, it reads input from stdin and uses what it reads to construct the seed. In the examples below, the end of input to stdin is marked by `^D` on its own line.
202
220
203
-
When the input format is `hex`, the construction is the identity function (passthrough.)
221
+
When the input format is `hex` or `bech32`, the construction is the identity function (passthrough.)
# Input a Bech32 seed via stdin, receive the same seed back in hex.
235
+
#
236
+
237
+
$ seedtool --in bech32
238
+
seed1gv0pq3wv5733vyzs6de2tjn7vc677gcm
239
+
^D
240
+
431e1045cca7a3161050d372a5ca7e66
214
241
```
215
242
216
243
For the other input formats, each "unit" of the input (bit, digit, card, etc.) is converted to a byte and placed in an array. The SHA256 is then taken of the resulting array, yielding a deterministic seed. This seed is then used to generate a cryptographic seed of `count` bytes.
`bip39` and `slip39` output formats can be combined with the `random` (default) input format. If the `--count N` option is used with the `hex` input format, it results in a seed of `N` bytes being generated and used.
373
+
`bip39` and `slip39` output formats can be combined with the `random` (default) input format. If the `--count N` option is used with the `hex`or `bech32`input formats, it results in a seed of `N` bytes being generated and used.
pumps guest academic academic analysis election admit harvest very webcam acquire answer primary viral venture declare have short bucket pickup pistol squeeze script racism western alarm depend depart lilac zero capacity capture warn
363
390
```
364
391
365
-
`bip39` and `slip39` output formats can be combined with the `hex` input format. The `--count` option is not allowed and the whole hex seed is used. For `bip39` the seed must be 12-32 bytes and even. For `slip39` the seed must be 16-32 bytes and even.
392
+
`bip39` and `slip39` output formats can be combined with the `hex`or `bech32`input formats. The `--count` option is not allowed and the whole hex seed is used. For `bip39` the seed must be 12-32 bytes and even. For `slip39` the seed must be 16-32 bytes and even.
seedtool: The --count option is not available for bech32 input.
433
+
390
434
#
391
435
# The seed you provide must conform to the output format constraints.
392
436
#
@@ -423,6 +467,16 @@ $ seedtool --in bip39
423
467
mechanic royal math burst practice addict noise weekend margin now improve invest
424
468
^D
425
469
8a3796240f6a9606a577c887f2e5c83a
470
+
471
+
#
472
+
# Recover from the same BIP39 mnemonic sequence, providing all
473
+
# the words via stdin, and displaying the result as Bech32.
474
+
#
475
+
476
+
$ seedtool --in bip39 --out bech32
477
+
mechanic royal math burst practice addict noise weekend margin now improve invest
478
+
^D
479
+
seed13gmevfq0d2tqdfthezrl9ewg8g4fq0wc
426
480
```
427
481
428
482
`slip39` can be used as an input format, in which case the original seed is recovered. The SLIP39 shares may be passed on the command line or entered via stdin. If passed on the command line, the shares must each be a single argument (i.e., quoted). If passed via stdin, each share must appear by itself on one line.
0 commit comments