Skip to content

Commit

Permalink
Fixed docs for missing.coffee. Bumped version to 1.3.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
jambolo committed Jan 16, 2021
1 parent 9fdaafc commit 5002b83
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 18 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,40 @@ Uses Shamir Secret Sharing or XOR method to recreate the original mnemonic phras
| --json, -j | Outputs the words in json format. (optional) |

The shares are read from stdin, one per line and joined using SSS or the XOR method.

## missing
Generates all possible mnemonic phrases, given a partial mnemonic phrase.

#### Command syntax

missing [--language <language>] [--indexes <list>|--end|--any] [--count <N>] [--verbose] [--json] <mnemonic phrase>

#### Options

| Option | Description |
|----------------|-------------|
| --any, -a | Signifies that the missing words in the phrase can be at any location. (optional) |
| --count, -n | Total number of words in the mnemonic phrase. (default is a multiple of 3 and depends on how many are known) |
| --end, -e | Signifies that the last words in phrase are missing. (default) |
| --indexes, -i | List of the possible locations of the missing words. The first location is 1. Use - to end the list if it is not followed by another option. (optional) |
| --json, -j | The possible mnemonics are listed in json format. (optional)
| --language, -l | The wordlist to be used. Currently, only *english* is supported and it is the default. (optional)
| --verbose, -v | Displays helpful information in addition to the results. (optional)

#### Examples:

* All but the last two words of a 12-word mnemonic are known:

missing crisp three spoil enhance dial client moment melt parade aisle

* Two missing words could be anywhere:

missing --any crisp three enhance dial client melt parade aisle analyst case

* The two missing words could be at locations 1, 3, or 7:

missing --indexes 1 3 7 --count 12 crisp three enhance dial client melt parade aisle analyst case

* A count should be specified because eight known words implies a 9-word phrase and this one has 12 words:

missing --count 12 crisp three spoil enhance dial client moment melt:
34 changes: 17 additions & 17 deletions cs/missing.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
#
# Command syntax
#
# missing [--language <language>] [--index <list>|--end|--any] [--count <N>] <mnemonic phrase>
# missing [--language <language>] [--indexes <list>|--end|--any] [--count <N>] [--verbose] [--json] <mnemonic phrase>
#
# Options
#
# --any, -a Signifies that the missing words in the phrase can be at any location. (optional)
# --count, -n Total number of words in the mnemonic phrase. (default is a multiple of 3 and depends on how many
# are known)
# --end, -e Signifies that the last words in phrase are missing. This option is overridden by --any and
# --index. (default)
# --end, -e Signifies that the last words in phrase are missing. (default)
# --indexes, -i List of the possible locations of the missing words. The first location is 1. Use - to end the
# list if it is not followed by another option. This option overrides --end and --any (optional)
# --json, -j Outputs the possible mnemonics in json format. (optional)
# list if it is not followed by another option. (optional)
# --json, -j The possible mnemonics are listed in json format. (optional)
# --language, -l The wordlist to be used. Currently, only *english* is supported and it is the default. (optional)
# --verbose, -v Displays helpful information in addition to the results. (optional)
#
# Examples:
#
# All but the last words of a 12-word mnemonic are known:
# missing crisp three spoil enhance dial client moment melt parade aisle
# All but the last two words of a 12-word mnemonic are known:
# missing crisp three spoil enhance dial client moment melt parade aisle
#
# Missing words could be anywhere in the mnemonic:
# missing --any crisp three enhance dial client melt parade aisle analyst case
# Two missing words could be anywhere:
# missing --any crisp three enhance dial client melt parade aisle analyst case
#
# Words 1, 3, and 7 are missing:
# missing --index 1 3 7 -- three enhance dial client melt parade aisle analyst case
# The two missing words could be at locations 1, 3, or 7:
# missing --indexes 1 3 7 --count 12 crisp three enhance dial client melt parade aisle analyst case
#
# A count must be specified because only 8 of 12 words are listed:
# missing --end --count 12 crisp three spoil enhance dial client moment melt parade
# A count should be specified because eight known words implies a 9-word phrase and this one has 12 words:
# missing --count 12 crisp three spoil enhance dial client moment melt:

yargs = require 'yargs'
Crypto = require 'crypto'
Expand Down Expand Up @@ -115,7 +115,7 @@ args = yargs
type: 'boolean'
alias: 'j'
default: false
describe: 'The phrases are listed in JSON format.'
describe: 'The possible mnemonics are listed in JSON format.'
}
.option 'language', {
type: 'string'
Expand All @@ -127,7 +127,7 @@ args = yargs
.option 'v', {
type: 'count'
alias: 'verbose'
describe: 'Additional information is displayed.'
describe: 'Displays helpful information in addition to the results.'
}
.example [
[
Expand All @@ -139,12 +139,12 @@ args = yargs
'Two missing words could be anywhere.'
]
[
'$0 --indexes 1 3 7 - crisp three enhance dial client melt parade aisle analyst case'
'$0 --indexes 1 3 7 --count 12 crisp three enhance dial client melt parade aisle analyst case'
'The two missing words could be at locations 1, 3, or 7.'
]
[
'$0 --count 12 crisp three spoil enhance dial client moment melt'
'A count should be specified because eight known words implies a 9-word phrase.'
'A count should be specified because eight known words implies a 9-word phrase and this one has 12 words'
]
]
.check (argv) ->
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bip39",
"version": "1.3.0",
"version": "1.3.1",
"description": "BIP 39 Utilities",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 5002b83

Please sign in to comment.