From 8d6d178a47b6e2cf4e9ca72749d49a02f4359891 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Thu, 30 Dec 2021 11:24:26 -0700 Subject: [PATCH] Use Bip44TransparentAccountKeyPath() for Bip44AccountChains keypath construction. --- src/zcash/address/bip44.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/zcash/address/bip44.cpp b/src/zcash/address/bip44.cpp index 075c2491f..1dd5679bd 100644 --- a/src/zcash/address/bip44.cpp +++ b/src/zcash/address/bip44.cpp @@ -50,11 +50,7 @@ std::optional> libzcash::Bip44AccountChains::DeriveEx auto childKey = external.Derive(addrIndex); if (!childKey.has_value()) return std::nullopt; - auto hdKeypath = "m/44'/" - + std::to_string(bip44CoinType) + "'/" - + std::to_string(accountId) + "'/" - + "0/" - + std::to_string(addrIndex); + auto hdKeypath = Bip44TransparentAccountKeyPath(bip44CoinType, accountId) + "/0/" + std::to_string(addrIndex); return std::make_pair(childKey.value().key, hdKeypath); } @@ -63,11 +59,7 @@ std::optional> libzcash::Bip44AccountChains::DeriveIn auto childKey = internal.Derive(addrIndex); if (!childKey.has_value()) return std::nullopt; - auto hdKeypath = "m/44'/" - + std::to_string(bip44CoinType) + "'/" - + std::to_string(accountId) + "'/" - + "1/" - + std::to_string(addrIndex); + auto hdKeypath = Bip44TransparentAccountKeyPath(bip44CoinType, accountId) + "/1/" + std::to_string(addrIndex); return std::make_pair(childKey.value().key, hdKeypath); }