From 08087dab4201c4fbf6c1e59482cace364c547331 Mon Sep 17 00:00:00 2001 From: amani1104 Date: Sun, 11 Aug 2024 18:50:33 +0000 Subject: [PATCH] Fix script --- babylon_mnemonic_to_keys.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/babylon_mnemonic_to_keys.py b/babylon_mnemonic_to_keys.py index 9dcd969..0cca76a 100644 --- a/babylon_mnemonic_to_keys.py +++ b/babylon_mnemonic_to_keys.py @@ -1,22 +1,19 @@ from bip_utils import Bip39SeedGenerator, Bip32Slip10Ed25519 -#Ed25519 from radix_engine_toolkit import * from getpass import getpass network_id = 0x01 -print ("Enter a mnemonic string:") -pw = getpass() +pw = getpass("Enter a mnemonic string: ") MNEMONIC = pw print('\n') - # Seed phrase created in Babylon wallet seed_bytes = Bip39SeedGenerator(MNEMONIC).Generate() slip10_ctx = Bip32Slip10Ed25519.FromSeedAndPath( - seed_bytes, "m/44'/1022'/1'/525'/1460'/0'" + seed_bytes, "m/44'/1022'/1'/525'/1460'/1'" ) # Get private and public keys as hex @@ -25,13 +22,10 @@ # Convert to RET types private_key_bytes: bytes = int(private_key_hex, 16).to_bytes(32, "big") -private_key: PrivateKey = PrivateKey.new_ed25519(list(private_key_bytes)) +private_key: PrivateKey = PrivateKey.new_ed25519(private_key_bytes) public_key: PublicKey = private_key.public_key() - -#print(public_key) -#print(private_key) -print("Private Key Bytes (you'll need this later :)): ",private_key_bytes) +print("Private Key Bytes (you'll need this later :)): ", private_key_bytes) print('\n') account: Address = derive_virtual_account_address_from_public_key(