Seed phrase and .PEM file

Hello. There is one phrase of 24 words. ( xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx) In fact, this is a private (signed) key. 1) How do I translate this phrase into an ordinary mathematical private key? How do I create a .PEM (file) after that. Actually knowing the Principal of the account; Public Key; Seed phrase must be recreated identity.pem

This is for me for tests, since there are bound cycles in tokens .

Hi Safik

You can use the keysmith tool, keysmith private-key will create the .pem file from a seed phrase file:

1 Like

Thank you Ori. It works.

I don’t understand the reason. Public key and Principal do not match those on https://nns.ic0.app/. I double-checked everything. I even created a second account. The picture has not changed, the Principal and Public key do not match.

I see what you’re aiming at now. So the backup seed phrase generated by Internet Identity (used in the NNS app) isn’t the private key seed phrase that keysmith uses. The private key for your Internet Identity is never actually exposed, since it never leaves the hardware security module (eg yubikey or your phone’s secure enclave).

At the moment I don’t think there exists a way to move control of identities between the nns app and the command line tools, unfortunately.

1 Like

Good. That is, in order to use cycles, you need to: create a new account (public-private key) using the keysmith, converting ICP into cycles in the new account. And forget about this old account created in NNS. Thanks for the information.