Created
April 8, 2024 05:26
-
-
Save vicariousdrama/3228e06e4f8546b76a4918e2c801bc1f to your computer and use it in GitHub Desktop.
Quick python script to convert a file with a list of npubs into hexadecimal pubkeys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from nostr.key import PublicKey | |
import os | |
import shutil | |
import sys | |
filename = "listofnpubs.txt" | |
if not os.path.exists(filename): | |
sys.exit("File does not exist") | |
with open(filename) as f: | |
Lines = f.readlines() | |
for line in Lines: | |
npub = line.strip() | |
pubkey = PublicKey().from_npub(npub).hex() | |
print(pubkey) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment