Skip to content

Commit ffbc2c2

Browse files
author
Lucien Grondin
committed
rename and simplify section about the major system.
1 parent fc53320 commit ffbc2c2

File tree

2 files changed

+8
-60
lines changed

2 files changed

+8
-60
lines changed

README.md

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ mnemonic=($(create-mnemonic 128))
3636
$ echo "${mnemonic[@]}"
3737

3838
$ mnemonic-to-seed "${mnemonic[@]}" > seed
39-
$ pegged-entropy {1..38} > seed
39+
$ dc -e "$((RANDOM))P" > seed
4040

4141
$ xkey -s /N < seed
4242
$ ykey -s /N < seed
@@ -301,34 +301,15 @@ The passphrase can also be given with the `BIP39_PASSPHRASE` environment variabl
301301

302302
<a name=major />
303303

304-
#### Major system
304+
#### Memory Techniques
305305

306-
As an alternative to bip-39, bitcoin-bash-tools includes a function
307-
called `pegged-entropy` wich prompts decimal numbers from 0 to 99
308-
and uses them to generate a byte stream that can then be used as input
309-
for `bip32`. The generated extended key can then be used by `bip85`
310-
to produce all sorts of entropy for various applications.
306+
An alternative to bip-39 is to use [memory techniques](https://artofmemory.com/).
311307

312-
The numbers are between 0 to 99 to facilitate the use of the so-called
313-
[major system](https://en.wikipedia.org/wiki/Mnemonic_major_system).
314-
315-
To memorize the sequential order of the numbers, either the
316-
[method of loci](https://en.wikipedia.org/wiki/Method_of_loci) or the
317-
[peg system](https://en.wikipedia.org/wiki/Method_of_loci) can be used.
318-
319-
The function takes as argument the pegs to use. For the method of loci,
320-
a sequence of integers can be used.
321-
322-
$ pegged-entropy {1..10}
323-
324-
Pegs do not have to be secret, so they can be saved in a file or in
325-
a variable in plain text.
326-
Here is an exemple from http://thememoryinstitute.com/the-peg-system.html :
327-
328-
$ pegs=(Bun Shoe Tree Door Hive Sticks Heaven Gate Vine Hen)
329-
$ pegged-entropy "${pegs[@]}"
330-
331-
This function will escape non-printable characters when writing to a terminal.
308+
Once you've become familiar with these techniques, you can generate a seed in
309+
several ways, you just have to make sure you remember your choice of encoding.
310+
For instance, if you've memorized a long number in decimal, you could either
311+
use its representation in ASCII or a byte stream generated from it with dc's
312+
`P` command.
332313

333314
<a name=addresses />
334315

bitcoin.sh

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -623,39 +623,6 @@ isPublic() ((
623623
$1 == BIP32_MAINNET_PUBLIC_VERSION_CODE
624624
))
625625

626-
pegged-entropy()
627-
if (( ${#@} == 0 ))
628-
then
629-
echo "no peg was provided" >&2
630-
return 1
631-
elif test ! -t 0
632-
then
633-
echo "$FUNCNAME will only read input from a terminal" >&2
634-
return 2
635-
else
636-
local peg
637-
local -i i c
638-
{
639-
for peg in "$@"
640-
do
641-
read -p "$peg $((++i))/${#@}: "
642-
if ((REPLY > 99 || REPLY < 0))
643-
then
644-
echo "input out of range" >&2
645-
return 2
646-
fi
647-
# https://stackoverflow.com/questions/9134638/using-read-without-triggering-a-newline-action-on-terminal
648-
echo -en "\033[1A\033[2K" >&2
649-
((c += REPLY))
650-
printf "%02d" "$REPLY"
651-
done
652-
echo " P"
653-
echo "checksum is $((c % 100))" >&2
654-
} |
655-
dc |
656-
escape-output-if-needed
657-
fi
658-
659626
bip32()
660627
if
661628
local header_format='%08X%02X%08X%08X'

0 commit comments

Comments
 (0)