Skip to content

Instantly share code, notes, and snippets.

@learntheropes
learntheropes / derive-pubkey.cjs
Last active February 5, 2026 18:43
derive publickey from seed phrase - this script derives the pubkey stored in the db from the seed phrase backup without revealing any private or confidential info
// From the terminal in the save directory where this script is saved:
// npm i bip39 bip32 @bitcoinerlab/secp256k1
// MNEMONIC="your mnemonic here" node derive-pubkey.cjs
const bip39 = require('bip39')
const BIP32Factory = require('bip32').default
const ecc = require('@bitcoinerlab/secp256k1')
const bip32 = BIP32Factory(ecc)
gh api -H "Accept: application/vnd.github+json" "/orgs/p2pay/secret-scanning/alerts?per_page=100" --jq 'length'