I'm looking to developing on Solana but...I love to understand what I'm Working on. I've take a look at the documentation, and I can't unuderstand how solana-keygen
work. I've try so hard to reproduce the same public address from the same mnemonic but nothing seems to work. Anyone that know exactly how address is generated? If you have your private key how you derive the public without using @solana/web3 library.
import * as Bip39 from 'bip39'
import { Keypair } from "@solana/web3.js";
const seed: Buffer Bip39.mnemonicToSeedSync("title spell imitate observe kidney ready interest border inject quiz misery motor")
const derivedSeed = ed25519.derivePath("m/44'/501'/0'/0'", seed.toString('hex')).key;
const keyPair = Keypair.fromSeed(derivedSeed)
console.log(keyPair.publicKey.toString())
This code work good, so if I go to https://solflare.com/access
and try to insert mnemonic
I can see the address.
But, in fact, solana-keygen
return me this address with that mnemonic: nsaayLiawKPiui9fWYCpRdYkdKeqj2fNn9u8LjauEkn
This is a sample wallet. Feel free to experiment with this parameters.
Please, do not fund this wallet.
How it's possible to get the same address that solana-keygen
give me?
I've try to pass all possible parameters on ed25519, pbkd2,
but it seems that I'm missing something on the process.