cxadams on Nostr: Quick tip to convert a nostr nsec private key (e.g. from Damus) to hex (e.g. for ...
Quick tip to convert a nostr nsec private key (e.g. from Damus) to hex (e.g. for nos2x), using Node:
npm install bech32-converting
nostr.mjs (fill in your nsec key):
import converter from "bech32-converting"
let sec = converter('nsec').toHex('nsec1...')
console.log(sec)
node --experimental-modules nsec.mjs
lnbc50u1p3e7t7upp5g3tzexzr8rnre902u6xacp2j3zcam9pf69gdhhx7vet9e9tq820sdq0dehhxarjyp6xjuqcqzpgxqyz5vqsp5h8g6zxf9m0edvq9jmg60p69dsa3l87mt665qx7cp78gc8y4w82zs9qyyssqkqvl2vmmjg5mzr77atmajr6pvfm5dcmwjsvv7m3qmpccg4stfhtjpqwupwcvr7yd4mzukakgfez9pyt9gpygzauhulsqt5nq0s2aqxgq0z750u
npm install bech32-converting
nostr.mjs (fill in your nsec key):
import converter from "bech32-converting"
let sec = converter('nsec').toHex('nsec1...')
console.log(sec)
node --experimental-modules nsec.mjs
lnbc50u1p3e7t7upp5g3tzexzr8rnre902u6xacp2j3zcam9pf69gdhhx7vet9e9tq820sdq0dehhxarjyp6xjuqcqzpgxqyz5vqsp5h8g6zxf9m0edvq9jmg60p69dsa3l87mt665qx7cp78gc8y4w82zs9qyyssqkqvl2vmmjg5mzr77atmajr6pvfm5dcmwjsvv7m3qmpccg4stfhtjpqwupwcvr7yd4mzukakgfez9pyt9gpygzauhulsqt5nq0s2aqxgq0z750u