Skip to content

Instantly share code, notes, and snippets.

import { Wallet, verifyMessage, Mnemonic, randomBytes } from "ethers";
function generateWallet() {
const entropy = randomBytes(16);
const mnemonic = Mnemonic.fromEntropy(entropy);
const wallet = Wallet.fromPhrase(mnemonic.phrase);
return { wallet, phrase: mnemonic.phrase };
}