How to recover principal ID from seed phrase

From command line, What is the command to recover principal ID on a new machine using the 24 words seed phrase generated during “dfx identity new __” I’ve checked documentation and not clear about how it’s done on new machine.

Hey, you can use quill to achieve that

quill public-ids --seed-file <path_to_seed_file>

2 Likes

Thanks so much. Could you elaborate how this works? I have the seed phrase I copied during ID creation. Is there a specific way to save it? Like a specific file extension as this isn’t a pem file in itself. I’ve tried and it doesn’t seem to work.

You should be able to just save it in a txt file. Make sure the path is correct :slight_smile:

I get this message tha command not found. What am I doing wrong?
free_will5@DESKTOP-NIBTLAT:~$ quill public-ids --seed-file “\wsl.localhost\Ubuntu-22.04\home\free_will5\seed1.txt”
Command ‘quill’ not found, did you mean:
command ‘quilt’ from deb quilt (0.66-2.1)

GitHub - dfinity/quill: Governance & ledger toolkit for cold wallets just follow the install instructions.

2 Likes

I successfully installed and still got error message: results
send Sends a signed message or a set of messages
sns Commands for interacting with a Service Nervous System’s Ledger
& Governance canisters
transfer Signs an ICP transfer transaction
update-node-provider Update node provider details
free_will5@DESKTOP-NIBTLAT:~$ quill public-ids --seed-file \home\free_will5\seed\seed1.txt
Error: Couldn’t read seed file

Caused by:
No such file or directory (os error 2)
free_will5@DESKTOP-NIBTLAT:~$

seems like you got the file path wrong. try specifying the path relative to the current directory. ideally you’re executing the command in the same folder your seed1.txt lives, so in \home\free_will5\seed\ you type quill public-ids --seed-file seed1.txt

1 Like

Thanks so much. This command dfx identity import --seed-file imports identity into .config folder with it’s pem file.

2 Likes

What are the standards and parameters used in the derivation from seed phrase to the identity’s key?

For example: Is the seed phrase BIP39 compliant (checksummed)? Is the identity’s key ECDSA/secp256k1? Is BIP44 used and what is the derivation path?

Does @dfinity/agent-js support reproducing the same identity from the seed phrase?

EDIT: Found the answer in the source code. Answer is yes to everything.