passphrase-converter
v0.1.1
Published
Convert Pi Network mnemonics to wallet keys and vice versa.
Maintainers
Readme
passphrase-converter (core)
CLI + library that converts Pi Network mnemonics into wallet keys and back again. It exposes two derivation schemes:
- Legacy derivation – encodes the mnemonic entropy directly as the Ed25519 seed (original developer flow).
- Pi BIP44 derivation – derives
m/44'/314159'/0'so public keys match the Pi Wallet app.
Installation
npm install passphrase-converterOr install globally for quick CLI use:
npm install -g passphrase-converterCLI Usage
All commands accept either positional args or --phrase / --secret flags. Mnemonic-based commands output both derivations unless --mode legacy|pi is provided.
# Mnemonic → keys (optional public-key check)
npx passphrase-converter mnemonic-to-keys --phrase "word1 … word24" --expect GABC...XYZ
# Secret key → keys
npx passphrase-converter secret-to-keys --secret "SXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Secret key → mnemonic backup
npx passphrase-converter secret-to-mnemonic --secret "SXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Mnemonic → secret key (prints both derivations)
npx passphrase-converter mnemonic-to-secret --phrase "word1 … word24"Derivation Modes
- Default:
mnemonic-to-keysandmnemonic-to-secretemit both Legacy and Pi BIP44 results in labeled blocks. - Filter: Pass
--mode legacyor--mode pito limit output to a single derivation. - Expected address:
--expectvalidates the derived public key(s) and errors if neither matches.
Environment Variables
Override the Pi derivation path by creating packages/core/.env (or project-level .env) with:
BIP44_PATH="m/44'/314159'/0'"Development
npm install
npm run build # compiles to dist/
npm run typecheck # TS only
npm run dev # ts-node CLI entry for local testingThe package ships with an npm prepare hook, so npm install / npm publish automatically rebuild dist/.
