2

I have a wallet created with Daedalus and have the 24-word mnemonic available. I would like to use the same wallet with cardano-cli in order to build and submit more complicated transactions directly through the cardano-node. I need to get my hands on the signing (private) key and verification (public) key.

I found the old, now archived cardano-cli repo which actually describes the procedure. However, the wallet subcommand is no longer available in the latest cardano-cli.

https://github.com/input-output-hk/cardano-cli/blob/master/USAGE.md#recovering-a-wallet

2 Answers 2

5

cardano-cli does not support mnemonic derivation natively, so you'd have to use cardano-wallet software:

  1. Install cardnao-wallet or cardano-addresses and put the executables in your $PATH. I will be using cardano-wallet for this demo, but cardano-address would work exactly the same.
  2. Run the following:
    <YOUR_24_WORD_MNEMONMIC> | cardano-wallet key from-recovery-phrase Shelley > root.xprv This will create an extended root private key from the mnemonic under the name root.xprv
  3. Run the following:
    cat root.xprv | cardano-wallet key child 1852H/1815H/0H \
    | tee acct.xprv | cardano-wallet key public --with-chain-code > acct.xpub
    This will create two files: acct.xprv (your extended account private key - will be used to further derive your payment/staking private/public keys) and acct.xpub (your extended account public key - use this to verify that it is the same as the "wallet public key" in Daedalus in the next step)
  4. Fire up Daedalus and go to More > Settings > Wallet Public Key. View your public key and ensure that it is the same as the acct.xpub you derived in the previous step:

enter image description here

  1. If the keys match, you may now use the acct.xprv to further derive the address-specific payment/stake keypairs.
  2. Run the following:
    cat acct.xprv | cardano-wallet key child <DERIVATION_PATH>, where the DERIVATION_PATH is the following:
  • 0/n for payment keypairs
  • 1/n for change-address payment keypairs
  • 2/0 for the account-level staking keypair

Running the above command will output the extended signing key for each address index (n). To convert these keys into cardano-cli compatible non-extended signing keys, refer to this Q/A. You can also use cardano-cli to derive non-extended verification keys from each non-extended signing key.

Note: If you've used this wallet on Daedalus frequently, you likely have UTXOs in a few payment and change addresses, so you would have to derive key-pairs for all addresses that UTXOs reside in. Alternatively, you can create a new wallet (new mnemonic) on Deadalus, transfer all the funds there, and then you'll have them all sitting at a single address, likely either at 0/0 or 0/1.

Comment if you have any questions or if you need any further clarification. Hope this helps!

0
0

If you're using CNtools, you can recover a deadalus wallet using your mnemonic seed phrase.

From the CNtools menu, you would select Wallet > Import > Mnemonic then enter your seed phrase. Your wallet will be restored and you can access your private keys in $CNODE_HOME/priv/wallet/[WALLET_NAME]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.