Checking the official documentation from cardano-wallet I can see that there are options to get wallets from mnemonics and extended public keys, but not private keys.

Even public libs don't have that option. And as far as I know it's not possible to restore a wallet from a private key in Daedalus or Yoroi.

It's a somewhat simple functionality that I can't find any info about!

1 Answer 1


A robust way to do that is to use cardano-wallet CLI.

First of all, run cardano-wallet serve and cardano-node.

Root Key

The command that helps us writing a root private key into a file should look like this:

cardano-wallet recovery-phrase generate --size 18 \ 
    | cardano-wallet key from-recovery-phrase Shelley > secretKey.prv

It results in private key creation that might look like this:


Derivation Path

m / purpose' / coin_type' / account_index' / role / address_index

If you tap a 20th receiving address in Daedalus wallet you'll see the following path:

m / 1852H / 1815H / 0H / 0 / 19

where 1852 is a hardened Shelley-era address type, and 1815 is hardened ADA's index.

Account Keys

According to this scheme let's create account private key and account public key:

cat secretKey.prv \
    | cardano-wallet key child 1852H/1815H/0H \
    | tee account.prv \
    | cardano-wallet key public --with-chain-code > account.pub

These results are:




Create a wallet

cardano-wallet wallet create from-public-key < 128-bit hash of acct pub key >

Additional reading

If you need more details on Cardano CLI, please read my Medium stories:

  • 1
    That's for sure helpful. So I'd just start from the second step since I already have the private key. However, the question was geared towards achieving the same result programmatically, without the necessity of running a node or bash commands.
    – Tengu
    Commented Oct 6, 2021 at 15:49
  • It entirely depends on the framework for the language in which you are developing. Many frameworks are in development at the moment. I personally use Swift – there are no any Cardano libs for Swift, except this one: thecardanofund.com/product/cardano-swift-sdk
    – Andy Jazz
    Commented Oct 6, 2021 at 16:58

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.