- Add src/hd_wallet.py with deterministic key derivation (BIP-32/39) - Support P2PKH (BIP-44), P2SH-P2WPKH (BIP-49), P2WPKH (BIP-84), P2TR (BIP-86) - JSON output aligned to Electrum wallet format (keystore, xpub/xprv, derivation path, root fingerprint) - Add tests/test_hd_wallet.py with 34 tests (structure, prefixes, determinism, SecretScan) - Add bip-utils to requirements.txt - Add option 6 to __main__.py menu
36 lines
941 B
Python
36 lines
941 B
Python
import subprocess
|
|
import sys
|
|
|
|
def main():
|
|
print("=== GENERATORE INDIRIZZI BITCOIN ===")
|
|
print("Seleziona il tipo di indirizzo:")
|
|
print("1. P2PK")
|
|
print("2. P2PKH")
|
|
print("3. P2SH")
|
|
print("4. P2WPKH")
|
|
print("5. P2TR")
|
|
print("6. HD Wallet (BIP-44/49/84/86)")
|
|
|
|
choice = input("Inserisci la tua scelta: ").strip()
|
|
|
|
scripts = {
|
|
'1': 'src/p2pk.py',
|
|
'2': 'src/p2pkh.py',
|
|
'3': 'src/p2sh.py',
|
|
'4': 'src/p2wpkh.py',
|
|
'5': 'src/p2tr.py',
|
|
'6': 'src/hd_wallet.py',
|
|
}
|
|
|
|
if choice in scripts:
|
|
try:
|
|
subprocess.run([sys.executable, scripts[choice]], check=True)
|
|
except subprocess.CalledProcessError as e:
|
|
print(f"Errore nell'esecuzione dello script: {e}")
|
|
except KeyboardInterrupt:
|
|
print("\nOperazione interrotta.")
|
|
else:
|
|
print("Scelta non valida.")
|
|
|
|
if __name__ == '__main__':
|
|
main() |