I am trying to derive my accounts of different blockchains via BIP44 standard to have deterministic account hierarchy. I was able to generate keys for BTC,ETH and other blockchains, but not for monero yet.
I'm using the monerojs library from node.js and the only method I've found that allows me to insert a seed to derive my wallet is the following: [https://moneroecosystem.org/monero-javascript/global.html#createWalletKeys]
But when I go to insert in the parameters the 32byte "seedOffset" generated by these lines of code:
const seed = bip39.mnemonicToSeedSync(mnemonic);
const masterNode = bip32.fromSeed(seed);
const path = `m/44'/128'/0'/0/0`;
const child = masterNode.derivePath(path);
let wallet = await monerojs.createWalletKeys({
networkType: MoneroNetworkType.STAGENET,
seedOffset: child.privateKey
});
If I run the console returns me:
if (config.getSeedOffset() !== undefined) throw new MoneroError("Cannot provide seedOffset when creating random wallet");
^
MoneroError: Cannot provide seedOffset when creating random wallet
at Function.createWallet (C:\Users\alexc\OneDrive\Documenti\GitHub\ECDSA-sign\node_modules\monero-javascript\src\main\js\wallet\MoneroWalletKeys.js:63:55)
at Object.module.exports.createWalletKeys (C:\Users\alexc\OneDrive\Documenti\GitHub\ECDSA-sign\node_modules\monero-javascript\index.js:286:87)
Any advice on how to manage this thing and derive in the best way one or more Monero accounts from the same seed as MasterNode BIP44?
seed
and convert to Monero mnumonic words, then pass those Monero words into the constructor of the wallet function.