Skip to content

Instantly share code, notes, and snippets.

@earthchie
Last active May 23, 2021 05:03
Show Gist options
  • Save earthchie/36061fc9994b536309c98735b07d825e to your computer and use it in GitHub Desktop.
Save earthchie/36061fc9994b536309c98735b07d825e to your computer and use it in GitHub Desktop.
ตามหา private key และ path ของกระเป๋าที่สูญหาย จาก mnemonic keys
const ethers = require('ethers');
const mnemonic = `critic seek crop move student season draw fiscal put prevent message cereal`
const target = `0xB1aB1cdC94e4edC8a7cc3187D5CCE0169de7505c`;
let i = -1;
let wallet;
console.log('searching...')
do {
i++;
wallet = ethers.Wallet.fromMnemonic(mnemonic, `m/44'/60'/0'/0/${i}`);
} while (wallet.address != target);
console.log(`FOUND! at m/44'/60'/0'/0/${i}\nprivate key:`, wallet._signingKey().privateKey);
@earthchie
Copy link
Author

วิธีใช้

  1. แก้บรรทัดที่ 3 เป็น mnemonic key ที่ใช้ (seed words)
  2. แก้บรรทัดที่ 4 เป็นที่อยู่กระเป๋าที่ตามหา
  3. ติดตั้ง ethers.js
npm i ethers
  1. รันคำสั่งค้นหา
node app.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment