Want to generate a bunch of wallets but your are lazy as fuck?
// MIT Licensed © 2022 [email protected]
import { ethers } from "ethers";
(async () => {
const { phrase } = ethers.Wallet.createRandom().mnemonic;
const dataTable = [];
console.log("Passphrase:", phrase);
for (let i = 0; i < 10; i++) {
const wallet = ethers.Wallet.fromMnemonic(phrase, `m/44'/60'/0'/0/${i}`);
dataTable.push({
path: `m/44'/60'/0'/0/${i}`,
address: await wallet.getAddress(),
priv: wallet.privateKey,
});
}
console.table(dataTable);
})();
Result:
Passphrase: melt security creek dish mistake together travel mimic material rural ladder rebel
┌─────────┬────────────────────┬──────────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────┐
│ (index) │ path │ address │ priv │
├─────────┼────────────────────┼──────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ 0 │ "m/44'/60'/0'/0/0" │ '0x844860d5EbdC124d134d5E711a63f25B1507D85f' │ '0x13cab34ee16ca9713857c83dc14ea173a031690ec5b0b7dedd709f3b65db0012' │
│ 1 │ "m/44'/60'/0'/0/1" │ '0x7858B3bc07F57751eA4002A3a7D7d02576Ef0f3f' │ '0x1df9c216a0d541e3e9fa531154217c2b28d6448ae9064f010772084bb1a4eef8' │
│ 2 │ "m/44'/60'/0'/0/2" │ '0x94b5139520b34aA447649509B63DA161B6113f04' │ '0xa009048e0cd82a67277f81dee53101f135796767ba651f59468eab3b341c528f' │
│ 3 │ "m/44'/60'/0'/0/3" │ '0xebD634310C48eB3E47d118C0E587399b85744Dac' │ '0x4128a9d2bdff47d9bfab85491aca867fd993627ccf771c15ea31887df0653c13' │
│ 4 │ "m/44'/60'/0'/0/4" │ '0x773b76FF4Dbaf0194778A2B780c1DeE1f70d49b6' │ '0xb39f3f7697232488122e034c1b98d8423e0b3cdd01722b07b9f63ce8fa2bffad' │
│ 5 │ "m/44'/60'/0'/0/5" │ '0x1A2Db59EDD8F550a50544B2db29668C79b0acA1e' │ '0xb03a863d5f7f3db91ba00e3f8319a017a62d9c1574a08b87297cea370f51fb1a' │
│ 6 │ "m/44'/60'/0'/0/6" │ '0x3c5fc70b4B177c36dCB5612060717cE8f1BE19ab' │ '0xb0fb0f52a0e2c117a8cb78536d1d5312dff145292a50ee1c8f1e30eba18579f9' │
│ 7 │ "m/44'/60'/0'/0/7" │ '0x96a3286D7D25F0fcb3d4b3CD4b0465309D144692' │ '0xb38df8e348cf43fcf556ddb3830316e6555e71399a95e5f669f671c102856018' │
│ 8 │ "m/44'/60'/0'/0/8" │ '0x49af6e202d16345D5A2F6c5a68818635781c06Fe' │ '0x8c99728da37a66a6b5835a1d91de93dccb3df8ab12d9dc2b078b2ef446687b4b' │
│ 9 │ "m/44'/60'/0'/0/9" │ '0x61c954f8AA649ACE23dB18bAf7EDb5210F2ce923' │ '0xf9b1895e29f58145b6223abfca248c0f9908b09a50a0a7dd74e7037a9e72fd56' │
└─────────┴────────────────────┴──────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────┘