I'm not sure if i'm doing this correctly but when I try to import the secret key from an existing keypair it doesn't work for me, though I tried converting it to base58 it still doesn't work. Any help is appreciated !
this is how I generated the keypair and the secret key :
mnemo = Mnemonic("english")
seed = mnemo.to_seed(mnemonic)
keypair = Keypair.from_seed(seed[:32])
secret_key = Keypair.secret()
^^^ this throws the error :
pyo3_runtime.PanicException: called Result::unwrap() on an Err value: signature::Error { source: Some(Keypair must be 64 bytes in length) }
I'm not sure if i'm doing this correctly but when I try to import the secret key from an existing keypair it doesn't work for me, though I tried converting it to base58 it still doesn't work. Any help is appreciated !
this is how I generated the keypair and the secret key : mnemo = Mnemonic("english") seed = mnemo.to_seed(mnemonic) keypair = Keypair.from_seed(seed[:32]) secret_key = Keypair.secret()
when I try to import :
private_key_base58 = base58.b58encode(secret_key).decode('utf-8')
keypair = Keypair.from_base58_string(private_key_base58)
^^^ this throws the error : pyo3_runtime.PanicException: called
Result::unwrap()
on anErr
value: signature::Error { source: Some(Keypair must be 64 bytes in length) }