Derive transparent (t-addr) keys from the HD seed and add BIP39 mnemonic seed phrases that are byte-for-byte compatible with SilentDragonXLite, so the same 24 words recover the same shielded and transparent addresses in either wallet. HD transparent keys: - Derive t-keys from the seed at m/44'/coin'/0'/0/i (were random CKeys). - CHDChain gains a version-gated transparent counter; existing wallets load unchanged. GenerateNewKey routes through DeriveNewChildKey when enabled (-hdtransparent, default on). - Restore from a seed hex via -hdseed with gap-limit pre-derivation; birthday pinned to genesis so the rescan is not clipped. BIP39 seed phrases: - Wire the vendored trezor BIP39 lib (src/crypto/bip39) into the build, fix its BIP39_WORDS guard, and disable the insecure mnemonic cache. - Match SDXLite exactly: English wordlist, empty passphrase, PBKDF2 64-byte seed, coin type 141, ZIP-32 m/32'/141'/i' and BIP44 m/44'/141'/0'/0/i. Store the 32-byte entropy and expand to the 64-byte seed on demand. - Restore via -mnemonic, create via -usemnemonic, reveal via z_exportmnemonic. Verified by gtests including a known-answer BIP39 seed vector and z/t address derivation checks (src/gtest/test_hdtransparent.cpp, test_mnemonic_compat.cpp). Docs in doc/hd-transparent-keys.md and doc/seed-phrase.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
65 lines
1.9 KiB
Makefile
65 lines
1.9 KiB
Makefile
# Copyright (c) 2016-2024 The Hush developers
|
|
# Released under the GPLv3
|
|
TESTS += hush-gtest
|
|
bin_PROGRAMS += hush-gtest
|
|
|
|
# tool for generating our public parameters
|
|
# NOTE: the original test list used an invalid automake form (comment after a trailing
|
|
# backslash, and `zcash_gtest_SOURCES +=` with no prior `=`), which is why the whole
|
|
# gtest harness was disabled via a `#include`. Minimal valid set: the harness + the
|
|
# Re-add other gtest sources here as they are revived.
|
|
hush_gtest_SOURCES = \
|
|
gtest/main.cpp \
|
|
gtest/utils.cpp \
|
|
gtest/test_randomx_preverify.cpp \
|
|
gtest/test_hdtransparent.cpp \
|
|
gtest/test_mnemonic_compat.cpp
|
|
|
|
hush_gtest_CPPFLAGS = $(AM_CPPFLAGS) -DMULTICORE -fopenmp -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DSTATIC $(BITCOIN_INCLUDES)
|
|
hush_gtest_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
|
|
# Mirror dragonxd_LDADD's working library set/order (the old list used a non-existent
|
|
# $(LIBBITCOIN_UNIVALUE) so univalue was never linked, and omitted LIBHUSH/LIBRANDOMX/libcc).
|
|
hush_gtest_LDADD = -lgtest -lgmock \
|
|
$(LIBBITCOIN_SERVER) \
|
|
$(LIBCURL) \
|
|
$(LIBBITCOIN_COMMON) \
|
|
$(LIBUNIVALUE) \
|
|
$(LIBBITCOIN_UTIL) \
|
|
$(LIBBITCOIN_CRYPTO) \
|
|
$(LIBZCASH) \
|
|
$(LIBHUSH) \
|
|
$(LIBLEVELDB) \
|
|
$(LIBMEMENV) \
|
|
$(LIBSECP256K1) \
|
|
$(LIBRANDOMX)
|
|
if ENABLE_WALLET
|
|
hush_gtest_LDADD += $(LIBBITCOIN_WALLET)
|
|
endif
|
|
|
|
hush_gtest_LDADD += \
|
|
$(BOOST_LIBS) \
|
|
$(BOOST_UNIT_TEST_FRAMEWORK_LIB) \
|
|
$(BDB_LIBS) \
|
|
$(SSL_LIBS) \
|
|
$(CRYPTO_LIBS) \
|
|
$(EVENT_PTHREADS_LIBS) \
|
|
$(EVENT_LIBS) \
|
|
$(LIBBITCOIN_CRYPTO) \
|
|
$(LIBZCASH_LIBS)
|
|
|
|
if TARGET_DARWIN
|
|
hush_gtest_LDADD += libcc.dylib $(LIBSECP256K1)
|
|
endif
|
|
if TARGET_WINDOWS
|
|
hush_gtest_LDADD += libcc.dll $(LIBSECP256K1)
|
|
endif
|
|
if TARGET_LINUX
|
|
hush_gtest_LDADD += libcc.so $(LIBSECP256K1)
|
|
endif
|
|
|
|
hush_gtest_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
|
|
hush-gtest-expected-failures: hush-gtest FORCE
|
|
./hush-gtest --gtest_filter=*DISABLED_* --gtest_also_run_disabled_tests
|