Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions babylon_mnemonic_to_keys.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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(
Expand Down