6 #ifndef KAGOME_CRYPTO_DEV_MNEMONIC_PHRASE_HPP 7 #define KAGOME_CRYPTO_DEV_MNEMONIC_PHRASE_HPP 17 static constexpr std::string_view
kWords =
18 "bottom drive obey lake curtain smoke basket hold race lonely fit walk";
21 std::map<std::string, std::pair<Ed25519Seed, Sr25519Seed>, std::less<>>
27 "abf8e5bdbe30c65656c0a3cbd181ff8a56294a69dfedd27982aace4a76909115",
28 "e5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a" 31 "3b7b60af2abcd57ba401ab398f84f4ca54bd6b2140d2503fbcf3286535fe3ff1",
32 "398f0c28f98885e046333d4a41c19cee4c37368a9832c6502f6cfd182e2aef89" 35 "072c02fa1409dc37e03a4ed01703d4a9e6bba9c228a49a00366e9630a97cba7c",
36 "bc1ede780f784bb6991a585e4f6e61522c14e1cae6ad0895fb57b9a205a8f938" 39 "771f47d3caf8a2ee40b0719e1c1ecbc01d73ada220cf08df12a00453ab703738",
40 "868020ae0687dda7d57565093a69090211449845a7e11453612800b663307246" 43 "bef5a3cd63dd36ab9792364536140e5a0cce6925969940c431934de056398556",
44 "786ad0e2df456fe43dd1f91ebca22e235bc162e0bb8d53c633e8c85b2af68b7a" 47 "1441e38eb309b66e9286867a5cd05902b05413eb9723a685d4d77753d73d0a1d",
48 "42438b7883391c05512a938e36c2df0131e088b3756d6aa7a755fbff19d2f842" 54 std::string_view ed25519_seed,
55 std ::string_view sr25519_seed) {
56 std::string mnemonic_phrase{kWords};
57 mnemonic_phrase += junctions;
59 Ed25519Seed::fromHex(ed25519_seed).value(),
60 Sr25519Seed::fromHex(sr25519_seed).value(),
62 return mnemonic_phrase;
71 template <
typename Seed>
72 std::optional<Seed>
find(std::string_view mnemonic_phrase)
const {
73 if constexpr (std::is_same_v<
75 Ed25519Seed> || std::is_same_v<Seed, Sr25519Seed>) {
78 if constexpr (std::is_same_v<Seed, Ed25519Seed>) {
79 return it->second.first;
81 if constexpr (std::is_same_v<Seed, Sr25519Seed>) {
82 return it->second.second;
90 const std::string
bob;
93 const std::string
eve;
98 #endif // KAGOME_CRYPTO_DEV_MNEMONIC_PHRASE_HPP
std::string precompute(std::string_view junctions, std::string_view ed25519_seed, std::string_view sr25519_seed)
static constexpr std::string_view kWords
std::optional< Seed > find(std::string_view mnemonic_phrase) const
std::map< std::string, std::pair< Ed25519Seed, Sr25519Seed >, std::less<> > precomputed
const std::string charlie