Skip to content

Commit dca9cf0

Browse files
authored
Merge pull request #30 from wolfmcnally/master
Replace SLIP-39 with SSKR
2 parents 4bacb67 + 4845143 commit dca9cf0

34 files changed

+476
-568
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
[submodule "deps/bc-shamir"]
55
path = deps/bc-shamir
66
url = https://github.com/blockchaincommons/bc-shamir.git
7-
[submodule "deps/bc-slip39"]
8-
path = deps/bc-slip39
9-
url = https://github.com/blockchaincommons/bc-slip39.git
107
[submodule "deps/bc-bip39"]
118
path = deps/bc-bip39
129
url = https://github.com/blockchaincommons/bc-bip39.git
@@ -20,3 +17,6 @@
2017
[submodule "deps/bc-ur"]
2118
path = deps/bc-ur
2219
url = https://github.com/BlockchainCommons/bc-ur.git
20+
[submodule "deps/bc-sskr"]
21+
path = deps/bc-sskr
22+
url = https://github.com/BlockchainCommons/bc-sskr.git

MANUAL.md

Lines changed: 144 additions & 174 deletions
Large diffs are not rendered by default.

Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ distclean:
5252
rm -f autoscan.log
5353
rm -f configure.scan configure.status config.log
5454
rm -f config.log config.status config.h
55-
rm -rf libs
55+
rm -rf deps/*
56+
rm -rf sysroot

README.md

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ $ seedtool --count 32 --in cards 6c9s8c7c9c4cah6c2sjs7d5c2s4c4dqs
4646
7df301924511326d7350be14c9e7176d98e945f9ad0ed034726ad4ee0de59c25
4747
```
4848

49-
### Generate a 16-byte seed and encode it using SLIP-39 as 3 shares, 2 of which are required for recovery
49+
### Generate a 16-byte seed and encode it using SSKR as 3 shares, 2 of which are required for recovery
5050

5151
```
52-
$ seedtool --out slip39 --group 2-of-3
53-
forward enlarge academic acid earth anxiety believe aluminum identify various forecast airline taste tactics oasis frost patrol chest texture mental
54-
forward enlarge academic agency dress episode penalty animal trip paid cover blessing spark smart coal fluff starting mortgage friendly rival
55-
forward enlarge academic always distance memory both rhythm enforce costume spider mouse script wrote that favorite auction literary organize gross
52+
$ seedtool --out sskr --group 2-of-3
53+
tuna acid epic gyro edge twin able acid able yoga nail wand keno paid ruin jazz keys acid time film pool skew flew luck ruby song owls soap obey
54+
tuna acid epic gyro edge twin able acid acid yell omit mild webs warm epic flew liar view fuel deli fund glow skew dull knob claw gray surf wand
55+
tuna acid epic gyro edge twin able acid also visa wave bulb hope drum quad duty need tied vast barn kick task gray tent crux owls easy jolt toil
5656
```
5757

5858
### Recover the above seed using 2 of the 3 shares
5959

6060
```
61-
$ seedtool --in slip39
62-
forward enlarge academic acid earth anxiety believe aluminum identify various forecast airline taste tactics oasis frost patrol chest texture mental
63-
forward enlarge academic always distance memory both rhythm enforce costume spider mouse script wrote that favorite auction literary organize gross
61+
$ seedtool --in sskr
62+
tuna acid epic gyro edge twin able acid able yoga nail wand keno paid ruin jazz keys acid time film pool skew flew luck ruby song owls soap obey
63+
tuna acid epic gyro edge twin able acid also visa wave bulb hope drum quad duty need tied vast barn kick task gray tent crux owls easy jolt toil
6464
^D
65-
d17043174fc3a461ecb7d97c167c8ba1
65+
8a7e9c3c0d783371d80e1192e5f6217d
6666
```
6767

6868
### Generate a seed, encode it as UR, transform it to upper case, display it on the console, and encode it to a QR Code in the file "seedqrcode.png"
@@ -125,7 +125,7 @@ See [`MANUAL.md`](MANUAL.md) for details, many more examples, and version histor
125125

126126
* [`bc-crypto-base`](https://github.com/blockchaincommons/bc-crypto-base)
127127
* [`bc-shamir`](https://github.com/blockchaincommons/bc-shamir)
128-
* [`bc-slip39`](https://github.com/blockchaincommons/bc-slip39)
128+
* [`bc-sskr`](https://github.com/blockchaincommons/bc-sskr)
129129
* [`bc-bip39`](https://github.com/blockchaincommons/bc-bip39)
130130
* [`bc-ur`](https://github.com/blockchaincommons/bc-ur)
131131
* [`GNU argp`](https://www.gnu.org/software/libc/manual/html_node/Argp.html)
@@ -215,18 +215,6 @@ This table below also establishes provenance (repository of origin, permalink, a
215215
| randombytes.c | [dsprenkels/randombytes](https://github.com/dsprenkels/randombytes/blob/master/randombytes.c) | [6db39aa](https://github.com/dsprenkels/randombytes/commit/6db39aaae6bb9ab97beca00d81bcfe935c56c88d) | 2017-2019 [Daan Sprenkels](https://github.com/dsprenkels/) | [MIT](https://github.com/dsprenkels/randombytes/commit/73ae9b4fce2e62babdd6a480b53ad449dd745ed9) |
216216
| randombytes.h | [dsprenkels/randombytes](https://github.com/dsprenkels/randombytes/blob/master/randombytes.h) | [19fd002](https://github.com/dsprenkels/randombytes/commit/19fd002d9b7b001b333a671186a91231b60d821b) | 2017-2019 [Daan Sprenkels](https://github.com/dsprenkels/) | [MIT](https://github.com/dsprenkels/randombytes/commit/73ae9b4fce2e62babdd6a480b53ad449dd745ed9) |
217217

218-
### Known Issues
219-
220-
#### ⚠️ Warning: Lack of Round-trip Compatibility between BIP-39 and SLIP-39
221-
222-
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.
223-
224-
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.
225-
226-
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.
227-
228-
* This issue is being tracked [here](https://github.com/BlockchainCommons/bc-lethekit/issues/38).
229-
230218
### Tool Dependencies
231219

232220
To build `seedtool` you'll need to use the following tools:

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ make check
2222
make install
2323
popd
2424

25-
pushd deps/bc-slip39
25+
pushd deps/bc-sskr
2626
./configure --prefix ${SYSROOT}
2727
make check
2828
make install

configure

Lines changed: 24 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for bc-seedtool-cli 0.7.1.
3+
# Generated by GNU Autoconf 2.69 for bc-seedtool-cli 0.8.0.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -577,8 +577,8 @@ MAKEFLAGS=
577577
# Identity of this package.
578578
PACKAGE_NAME='bc-seedtool-cli'
579579
PACKAGE_TARNAME='bc-seedtool-cli'
580-
PACKAGE_VERSION='0.7.1'
581-
PACKAGE_STRING='bc-seedtool-cli 0.7.1'
580+
PACKAGE_VERSION='0.8.0'
581+
PACKAGE_STRING='bc-seedtool-cli 0.8.0'
582582
PACKAGE_BUGREPORT=''
583583
PACKAGE_URL=''
584584

@@ -1232,7 +1232,7 @@ if test "$ac_init_help" = "long"; then
12321232
# Omit some internal or obsolete options to make the list less imposing.
12331233
# This message is too long to be a string in the A/UX 3.1 sh.
12341234
cat <<_ACEOF
1235-
\`configure' configures bc-seedtool-cli 0.7.1 to adapt to many kinds of systems.
1235+
\`configure' configures bc-seedtool-cli 0.8.0 to adapt to many kinds of systems.
12361236
12371237
Usage: $0 [OPTION]... [VAR=VALUE]...
12381238
@@ -1293,7 +1293,7 @@ fi
12931293

12941294
if test -n "$ac_init_help"; then
12951295
case $ac_init_help in
1296-
short | recursive ) echo "Configuration of bc-seedtool-cli 0.7.1:";;
1296+
short | recursive ) echo "Configuration of bc-seedtool-cli 0.8.0:";;
12971297
esac
12981298
cat <<\_ACEOF
12991299
@@ -1375,7 +1375,7 @@ fi
13751375
test -n "$ac_init_help" && exit $ac_status
13761376
if $ac_init_version; then
13771377
cat <<\_ACEOF
1378-
bc-seedtool-cli configure 0.7.1
1378+
bc-seedtool-cli configure 0.8.0
13791379
generated by GNU Autoconf 2.69
13801380
13811381
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1962,7 +1962,7 @@ cat >config.log <<_ACEOF
19621962
This file contains any messages produced by compilers while
19631963
running configure, to aid debugging if configure makes a mistake.
19641964
1965-
It was created by bc-seedtool-cli $as_me 0.7.1, which was
1965+
It was created by bc-seedtool-cli $as_me 0.8.0, which was
19661966
generated by GNU Autoconf 2.69. Invocation command line was
19671967
19681968
$ $0 $@
@@ -3617,13 +3617,13 @@ else
36173617

36183618
fi
36193619

3620-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for slip39_word_for_string in -lbc-slip39" >&5
3621-
$as_echo_n "checking for slip39_word_for_string in -lbc-slip39... " >&6; }
3622-
if ${ac_cv_lib_bc_slip39_slip39_word_for_string+:} false; then :
3620+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sskr_generate in -lbc-sskr" >&5
3621+
$as_echo_n "checking for sskr_generate in -lbc-sskr... " >&6; }
3622+
if ${ac_cv_lib_bc_sskr_sskr_generate+:} false; then :
36233623
$as_echo_n "(cached) " >&6
36243624
else
36253625
ac_check_lib_save_LIBS=$LIBS
3626-
LIBS="-lbc-slip39 $LIBS"
3626+
LIBS="-lbc-sskr $LIBS"
36273627
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36283628
/* end confdefs.h. */
36293629
@@ -3633,36 +3633,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36333633
#ifdef __cplusplus
36343634
extern "C"
36353635
#endif
3636-
char slip39_word_for_string ();
3636+
char sskr_generate ();
36373637
int
36383638
main ()
36393639
{
3640-
return slip39_word_for_string ();
3640+
return sskr_generate ();
36413641
;
36423642
return 0;
36433643
}
36443644
_ACEOF
36453645
if ac_fn_c_try_link "$LINENO"; then :
3646-
ac_cv_lib_bc_slip39_slip39_word_for_string=yes
3646+
ac_cv_lib_bc_sskr_sskr_generate=yes
36473647
else
3648-
ac_cv_lib_bc_slip39_slip39_word_for_string=no
3648+
ac_cv_lib_bc_sskr_sskr_generate=no
36493649
fi
36503650
rm -f core conftest.err conftest.$ac_objext \
36513651
conftest$ac_exeext conftest.$ac_ext
36523652
LIBS=$ac_check_lib_save_LIBS
36533653
fi
3654-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bc_slip39_slip39_word_for_string" >&5
3655-
$as_echo "$ac_cv_lib_bc_slip39_slip39_word_for_string" >&6; }
3656-
if test "x$ac_cv_lib_bc_slip39_slip39_word_for_string" = xyes; then :
3654+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bc_sskr_sskr_generate" >&5
3655+
$as_echo "$ac_cv_lib_bc_sskr_sskr_generate" >&6; }
3656+
if test "x$ac_cv_lib_bc_sskr_sskr_generate" = xyes; then :
36573657
cat >>confdefs.h <<_ACEOF
3658-
#define HAVE_LIBBC_SLIP39 1
3658+
#define HAVE_LIBBC_SSKR 1
36593659
_ACEOF
36603660

3661-
LIBS="-lbc-slip39 $LIBS"
3661+
LIBS="-lbc-sskr $LIBS"
36623662

36633663
else
36643664

3665-
echo "### Error! libbc-slip39 must be installed first."
3665+
echo "### Error! libbc-sskr must be installed first."
36663666
exit -1
36673667

36683668
fi
@@ -3717,43 +3717,6 @@ else
37173717

37183718
fi
37193719

3720-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bytewords_encode in -lbc-bytewords" >&5
3721-
$as_echo_n "checking for bytewords_encode in -lbc-bytewords... " >&6; }
3722-
if ${ac_cv_lib_bc_bytewords_bytewords_encode+:} false; then :
3723-
$as_echo_n "(cached) " >&6
3724-
else
3725-
ac_check_lib_save_LIBS=$LIBS
3726-
LIBS="-lbc-bytewords $LIBS"
3727-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3728-
/* end confdefs.h. */
3729-
3730-
/* Override any GCC internal prototype to avoid an error.
3731-
Use char because int might match the return type of a GCC
3732-
builtin and then its argument prototype would still apply. */
3733-
#ifdef __cplusplus
3734-
extern "C"
3735-
#endif
3736-
char bytewords_encode ();
3737-
int
3738-
main ()
3739-
{
3740-
return bytewords_encode ();
3741-
;
3742-
return 0;
3743-
}
3744-
_ACEOF
3745-
if ac_fn_c_try_link "$LINENO"; then :
3746-
ac_cv_lib_bc_bytewords_bytewords_encode=yes
3747-
else
3748-
ac_cv_lib_bc_bytewords_bytewords_encode=no
3749-
fi
3750-
rm -f core conftest.err conftest.$ac_objext \
3751-
conftest$ac_exeext conftest.$ac_ext
3752-
LIBS=$ac_check_lib_save_LIBS
3753-
fi
3754-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bc_bytewords_bytewords_encode" >&5
3755-
$as_echo "$ac_cv_lib_bc_bytewords_bytewords_encode" >&6; }
3756-
37573720
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for argp_parse in -largp" >&5
37583721
$as_echo_n "checking for argp_parse in -largp... " >&6; }
37593722
if ${ac_cv_lib_argp_argp_parse+:} false; then :
@@ -5035,7 +4998,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
50354998
# report actual input values of CONFIG_FILES etc. instead of their
50364999
# values after options handling.
50375000
ac_log="
5038-
This file was extended by bc-seedtool-cli $as_me 0.7.1, which was
5001+
This file was extended by bc-seedtool-cli $as_me 0.8.0, which was
50395002
generated by GNU Autoconf 2.69. Invocation command line was
50405003
50415004
CONFIG_FILES = $CONFIG_FILES
@@ -5097,7 +5060,7 @@ _ACEOF
50975060
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
50985061
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
50995062
ac_cs_version="\\
5100-
bc-seedtool-cli config.status 0.7.1
5063+
bc-seedtool-cli config.status 0.8.0
51015064
configured by $0, generated by GNU Autoconf 2.69,
51025065
with options \\"\$ac_cs_config\\"
51035066
@@ -5807,3 +5770,4 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
58075770
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
58085771
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
58095772
fi
5773+

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.69])
5-
AC_INIT([bc-seedtool-cli], [0.7.1])
5+
AC_INIT([bc-seedtool-cli], [0.8.0])
66
AC_CONFIG_SRCDIR([src/seedtool.cpp])
77
AC_CONFIG_HEADERS([src/config.h])
88

@@ -21,8 +21,8 @@ AC_CHECK_LIB([bc-shamir], [split_secret], [], [
2121
echo "### Error! libbc-shamir must be installed first."
2222
exit -1
2323
])
24-
AC_CHECK_LIB([bc-slip39], [slip39_word_for_string], [], [
25-
echo "### Error! libbc-slip39 must be installed first."
24+
AC_CHECK_LIB([bc-sskr], [sskr_generate], [], [
25+
echo "### Error! libbc-sskr must be installed first."
2626
exit -1
2727
])
2828
AC_CHECK_LIB([bc-bip39], [bip39_mnemonic_from_word], [], [

deps/argp-standalone

deps/bc-bip39

Submodule bc-bip39 updated 1 file

deps/bc-crypto-base

0 commit comments

Comments
 (0)