4

Mymonero and simplewallet use different numbers of seed words.

Are they compatible?

Can seed words created by Mymonero be used to recover a wallet with simplewallet?

Can seed words created by simplewallet be used to recover a wallet with Mymonero?

5

MyMonero uses 13 word mnemonic seeds and simplewallet uses 25 word mnemonic seeds.

MyMonero can recover a wallet created in either format.

Currently simplewallet can only recover wallets with 25 word mnemonic seeds but there is code available to recover 13 word mnemonic seed wallets in case MyMonero ever disappears:

int main(int ac, const char* av[]) {

// get command line options
xmreg::CmdLineOptions opts {ac, av};

auto help_opt = opts.get_option<bool>("help");

// if help was chosen, display help text and finish
if (*help_opt)
{
    return 0;
}

// default language for the mnemonic
// representation of the private spend key
string language {"English"};

// get 13 word mnemonic seed from MyMonero
auto mnemonic_opt = opts.get_option<string>("mnemonic");

// get the program command line options, or
// some default values for quick check
string mnemonic_str = mnemonic_opt
                      ? *mnemonic_opt
                      : "slid otherwise jeers lurk swung tawny zodiac tusks twang cajun swagger peaches tawny";

cout << "\n"
     << "Mnemonic seed    : " << mnemonic_str << endl;


// change the MyMonero 13 word mnemonic seed
// to its 16 byte hexadecimal version
xmreg::secret_key16 hexadecimal_seed;

// use modified words_to_bytes function.
xmreg::ElectrumWords::words_to_bytes(mnemonic_str, hexadecimal_seed, language);

cout << "\n"
     << "Hexadecimal seed : " << hexadecimal_seed << endl;


// take the 16 byte hexadecimal_seed, and
// and perform Keccak hash on it. It will
// produce 32 byte hash.
crypto::hash hash_of_seed;

cn_fast_hash(hexadecimal_seed.data, sizeof(hexadecimal_seed.data), hash_of_seed);

cout << "\n"
     << "Hash of seed     : " << hash_of_seed<< endl;


// having the hashed seed, we can proceed
// with generation of private and public spend keys.
// the keccak hash of the seed is used as a seed
// to generate the spend keys.
crypto::public_key public_spend_key;
crypto::secret_key private_spend_key;

crypto::generate_keys(public_spend_key, private_spend_key,
                      xmreg::get_key_from_hash<crypto::secret_key>(hash_of_seed),
                      true);

cout << "\n"
     << "Private spend key: " << private_spend_key << "\n"
     << "Public spend key : " << public_spend_key  << endl;

// now we get private and public view keys.
// to do this, we keccak hash the hash_of_seed again
crypto::hash hash_of_hash;
cn_fast_hash(hash_of_seed.data, sizeof(hash_of_seed.data), hash_of_hash);

crypto::public_key public_view_key;
crypto::secret_key private_view_key;


crypto::generate_keys(public_view_key, private_view_key,
                      xmreg::get_key_from_hash<crypto::secret_key>(hash_of_hash),
                      true);

cout << "\n"
     << "Private view key : " << private_view_key << "\n"
     << "Public view key  : " << public_view_key  << endl;



// having all keys, we can get the corresponding monero address
cryptonote::account_public_address address {public_spend_key, public_view_key};


cout << "\n"
     << "Monero address   : " << address << endl;


cout << "\nEnd of program." << endl;

return 0;

https://github.com/moneroexamples/mymonero-keys

According to fluffyponyza:

When we first decided to create a mnemonic system the spec we came up with was: take the seed from the mnemonic, hash it for the spend key, hash it twice for the view key. Somewhere during the simplewallet implementation we forgot about that, and just used the mnemonic seed as the spendkey directly.

This proved to be a blessing in disguise, though, as we'd not realized that people might want to retrieve their seed. Using our original design this wouldn't have been possible, as we didn't store the seed in the wallet file.

Much later on when we were creating MyMonero (a different group of developers, I'm the only common link between the two) we decided that a 13 word seed would be much easier for people to remember, but because we wanted it to match simplewallet's implementation we made sure that we followed the spec as it was originally.

At some point in the future we'll add support in the command-line wallet for four types of derivation and let advanced users choose derivations with a command-line switch:

  1. short mnemonic, spendkey is seed
  2. short mnemonic, spendkey is hashed seed (MyMonero)
  3. long mnemonic, spendkey is seed (current simplewallet)
  4. long mnemonic, spendkey is hashed seed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.