|
const WipeableString | phrase (const SeedLanguage &language, const std::string &password="") const override |
| Generates the seed phrase in a specified language.
|
|
const SeedIndices | indices (const std::string &password="") const override |
| Gets the raw numeric values representing the seed (indices)
|
|
MoneroSeed | moneroSeed () const |
| Gets the Monero seed from the Polyseed.
|
|
virtual | ~Seed ()=default |
| Virtual destructor to ensure proper cleanup of derived classes.
|
|
virtual const std::string & | fingerprint () const noexcept |
| Provides a unique fingerprint for the seed.
|
|
virtual const Address & | address () const noexcept |
| Address of the seed.
|
|
virtual const uint64_t | timestamp () const noexcept |
| Gets the seed's creation timestamp.
|
|
virtual const uint64_t | height () const noexcept |
| Gets the blockchain height associated with the seed.
|
|
virtual const Network & | network () const noexcept |
| Gets the network associated with the seed.
|
|
virtual std::shared_ptr< Wallet > | wallet () noexcept |
| Creates a wallet from the seed.
|
|
| Seed (const Seed &)=delete |
|
Seed & | operator= (const Seed &)=delete |
|
| Seed (Seed &&) noexcept=default |
|
Seed & | operator= (Seed &&) noexcept=default |
|
|
static Polyseed | create (const std::array< unsigned char, 19 > &random, Network network=Network::MAIN, uint64_t time=0, const std::string &passphrase="") |
| Creates a Polyseed with specific parameters.
|
|
static Polyseed | create (const std::array< unsigned char, 32 > &random, Network network=Network::MAIN, uint64_t time=0, const std::string &passphrase="") |
| Convinience function to create a Polyseed from random 32 bytes like sha256 or pbkdf2.
|
|
static Polyseed | generate (Network network=Network::MAIN, uint64_t time=0, const std::string &passphrase="") |
| Generates a Polyseed with specific parameters.
|
|
static Polyseed | decode (const std::string &phrase, const Network network=Network::MAIN, const std::string &password="", const std::string &passphrase="") |
| Decodes a Polyseed from a phrase.
|
|
static Polyseed | decode (const std::string &phrase, const SeedLanguage &language, const Network network=Network::MAIN, const std::string &password="", const std::string &passphrase="") |
| Decodes a Polyseed from a phrase.
|
|
static Polyseed | decode (const SeedIndices &indices, const Network network=Network::MAIN, const std::string &password="", const std::string &passphrase="") |
| Decodes a Polyseed from indexes of the words.
|
|
static Polyseed | decode (const std::vector< uint16_t > &values, const Network network=Network::MAIN, const std::string &password="", const std::string &passphrase="") |
| Decodes a Polyseed from indexes of the words.
|
|
static std::vector< uint16_t > | mergeValues (const std::vector< uint16_t > &values1, const std::vector< uint16_t > &values2) |
| Merges two seed values, so you can join multiple SeedQRs to one seed.
|
|
static std::vector< uint16_t > | mergeValues (const std::vector< std::vector< uint16_t > > &values) |
| Merges multiple seed values, so you can join multiple SeedQRs to one seed.
|
|
static std::vector< uint16_t > | mergeAndZeorizeValues (std::vector< uint16_t > &values1, std::vector< uint16_t > &values2, bool del=true) |
| Merges two seed values, so you can join multiple SeedQRs to one seed.
|
|
static std::vector< uint16_t > | mergeAndZeorizeValues (std::vector< std::vector< uint16_t > > &values, bool del=true) |
| Merges multiple seed values, so you can join multiple SeedQRs to one seed.
|
|
static std::vector< uint16_t > | mergeWithPassword (const std::string &password, const std::vector< uint16_t > &values) |
| Merge password with seed values.
|
|
static std::vector< uint16_t > | mergeWithPasswordAndZeorize (std::string &password, std::vector< uint16_t > &values, bool del=true) |
| Merge password with seed values and zeroize password.
|
|
static std::vector< uint16_t > | mergeWithPassword (const WipeableString &password, const std::vector< uint16_t > &values) |
| Merge password with seed values.
|
|
static std::vector< uint16_t > | mergeWithPasswordAndZeorize (const WipeableString &password, std::vector< uint16_t > &values, bool del=true) |
| Merge password with seed values and zeroize values.
|
|
Represents a Polyseed type.
Provides Polyseed generation, encoding, and management
- Note
- Password and Passphrase is somehow unfortunate.
- Password encrypts and decrypts a polyseed, so you can call Polyseed::phrase(lang, "password") or Polyseed::indices("password") to encrypt the seed with a password. And later you provide the same seed phrase and the same password to decrypt it.
- Passphrase is used to offset the seed, and works a bit different. The seed offset passphrase is used after the data from the seed, for that the passphrase is set on creation time and need to be provided always on decoding. So, while you can change your seed phrase with a password, the passphrase will be always the same! With a monero seed you can change the passphrase because the secret key is encoded by the seed phrase while with polyseed the secret key is derived from the seed phrase data and not reversible.
-
if you provide to the user seed offset by passphrase, or encryption by password I suggest asking the user for the fingerprint of the seed and compare it with the fingerprint of the Seeed and if not it doesn't match the passphrase or password are wrong.