How to generate not a wallet, but a mnemonic phrase itself? In JS, Python. Not in a wallet application. No information about this.
1 Answer
Using Ethers.js you can do this:
import { Wallet, utils } from 'ethers';
const wallet = Wallet.fromMnemonic(
utils.entropyToMnemonic(utils.randomBytes(32))
)
console.log('wallet.address:', wallet.address)
console.log('wallet.mnemonic.phrase:', wallet.mnemonic.phrase)
console.log('wallet.privateKey:', wallet.privateKey)
Source: Github