Skip to content

Instantly share code, notes, and snippets.

View odudex's full-sized avatar

Odudex odudex

View GitHub Profile
@odudex
odudex / nostr_c_seed_qr.py
Last active February 21, 2023 19:57
Uses Embit and qrcode modules to generate ascii compact seed QR codes from nostr keys.
"""Uses Embit and qrcode modules to convert hex and bech32 keys to BIP39 seed words and vice-versa.
Also generates ascii compact seed QR codes and public keys.
Install Embit:
pip install embit
Exemple: Words as input:
python nostr_c_seed_qr.py picture body actor coil end satoshi fish mom distance proof thank play fantasy friend dinner clump boring ozone review cart virtual toss foot infant
Exemple: Hex key as input:
@odudex
odudex / nostr_seed_trezor.py
Last active March 21, 2024 16:16
Uses Trezor python-mnemonic to convert hex keys to BIP39 seed words and vice-versa
"""Uses Trezor python-mnemonic to convert hex keys to BIP39 seed words and vice-versa
Install Trezor python-mnemonic:
pip install mnemonic
Exemple: Convert hex key to words:
python nostr_seed_trezor.py a4431c0a96a4997ed5ec763fb58b7f532530b9cf916219f3d2e2118f47cb56bb
Seed words: picture body actor coil end satoshi fish mom distance proof thank play fantasy friend dinner clump boring ozone review cart virtual toss foot infant
BIP39 seed numbers: [1315, 200, 22, 363, 589, 1532, 702, 1143, 510, 1379, 1791, 1331, 665, 744, 499, 355, 208, 1269, 1477, 281, 1956, 1838, 728, 923]
Exemple: Convert words to hex key:
@odudex
odudex / dice.py
Last active December 26, 2022 11:24
Compare your devices dice generated seed with the ones generated by this script and check how each word and checksum were calculated
"""Compare your devices dice seed creation with the ones generated by this script
and check how each word and checksum were calculated.
Ex:
python dice.py 565256126243114366655152522264552364231641333461455456111566561236253463223236163643465622462251536
Entropy bytes: b'565256126243114366655152522264552364231641333461455456111566561236253463223236163643465622462251536'
Hashed bytes: 2e364baddcfa80dfc910fc92b634e962d2f844e9e9a210428d8e4d899a6883ae
Hashed bits: 0b10111000110110010010111010110111011100111110101000000011011111110010010001000011111100100100101011011000110100111010010110001011010010111110000100010011101001111010011010001000010000010000101000110110001110010011011000100110011010011010001000001110101110
@odudex
odudex / nostr_seed.py
Last active May 10, 2024 09:43
Uses Embit to convert hex or bech32 keys to BIP39 seed words and vice-versa
"""Uses Embit and qrcode modules to convert hex and bech32 keys to BIP39 seed words and vice-versa.
Also generates ascii compact seed QR codes.
Install Embit:
pip install embit
Exemple: Words as input:
python nostr_c_seed_qr.py picture body actor coil end satoshi fish mom distance proof thank play fantasy friend dinner clump boring ozone review cart virtual toss foot infant
Hex Key: a4431c0a96a4997ed5ec763fb58b7f532530b9cf916219f3d2e2118f47cb56bb
Bech32 key: nsec153p3cz5k5jvha40vwclmtzml2vjnpww0j93pnu7juggc737t26ascxcmgr
BIP39 seed numbers: [1315, 200, 22, 363, 589, 1532, 702, 1143, 510, 1379, 1791, 1331, 665, 744, 499, 355, 208, 1269, 1477, 281, 1956, 1838, 728, 923]