4

I use cardano-address cli export extended private key, but i want to use it with cardano-cli command, how to convert it?

2

Yes, if you have created your cardano-wallet wallet using a mnemonic, you can restore a private key from it.

An excellent tool for this is cardano-addresses.

  1. Generate your root private key.
cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
root_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983
  1. Generate your payment verification key for the first address. Notice here, the /0/0 is the address index, increase the last digit to generate your other addresses.
cardano-address key child 1852H/1815H/0H/0/0 < root.xsk | cardano-address key public --with-chain-code > addr.xvk
addr_xvk1grvg8qzmkmw2n0dm4pd0h3j4dv6yglyammyp733eyj629dc3z28v6wk22nfmru6xz0vl2s3y5xndyd57fu70hrt84c6zkvlwx6fdl7ct9j7yc

You should be able to use your payment key to sign a transaction using cardano-cli.

  1. Create your payment address to double check it is correct.
cardano-address address payment --network-tag testnet < addr.xvk > payment.addr
addr_test1vp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f7guscp6v
1
  • Sign payment key (xxx.skey) generated by cardano-cli is a json file, in your case addr.xvk file is not a json file, is there any command line tool i can use to convert addr.xvk to a standard json file to meet the cardano-cli 's demand ?
    – mackie
    Jun 3 at 3:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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