<blockquote>
<p>Does anyone knows how to move from payment verification and signing
keys to a public address or a mnemonic phrase useful to register my
wallet on Cardano-Wallet-Server?</p>
</blockquote>
<p>I think you're not able to make that kind of derivation since we are dealing with addr.xsk (from derivation path <code>root.xsk -&gt; acct.xsk -&gt; addr.xsk</code>). And wallet needs to know about root and acct keys.
You can however use <a href="https://github.com/input-output-hk/cardano-addresses" rel="nofollow noreferrer">cardano-addresses</a> to create all those keys and generate address with them, and then use <code>cardano-cli key convert-cardano-address-key</code> to convert them into format that is readable by <code>cardano-cli</code> if you wish:</p>
<ol>
<li>Generate mnemonics</li>
</ol>
<pre><code>$ cardano-address recovery-phrase generate --size 24 &gt; mnemonics.txt
</code></pre>
<p>Using these mnemonics you can already restore the wallet on cardano-wallet server.</p>
<ol start="2">
<li>Create root.xsk</li>
</ol>
<pre><code>$ cardano-address key from-recovery-phrase Shelley &lt; mnemonics.txt &gt; root.xsk
</code></pre>
<p>(BTW, at this point you can already figure out what will be wallet id)</p>
<pre><code>$ cardano-address key walletid &lt; root.xsk
</code></pre>
<ol start="3">
<li>Derive addr.xsk and stake.xsk</li>
</ol>
<pre><code>$ cardano-address key child 1852H/1815H/0H/0/0 &lt; root.xsk &gt; addr.xsk  
$ cardano-address key child 1852H/1815H/0H/2/0 &lt; root.xsk &gt; stake.xsk
</code></pre>
<ol start="4">
<li>Generate public/verification keys:</li>
</ol>
<pre><code>$ cardano-address key public --without-chain-code &lt; addr.xsk &gt; payment.vkey
$ cardano-address key public --without-chain-code &lt; stake.xsk &gt; stake.vkey
</code></pre>
<ol start="5">
<li>Generate wallet address:</li>
</ol>
<pre><code>$ cardano-address address payment --network-tag preprod &lt; payment.vkey \
  | cardano-address address delegation $(cat stake.vkey) &gt; payment.addr
</code></pre>
<p>addr.xsk -&gt; <code>1852H/1815H/0H/0/0</code>, so this is going to be first address on the wallet, next in the sequence would be <code>1852H/1815H/0H/0/1</code> etc. (stake.xsk stays the same)</p>
<p>The address can be also generated with <code>cardano-cli</code>:</p>
<pre><code>cardano-cli address build \
 --payment-verification-key-file payment.vkey \
 --stake-verification-key-file stake.vkey \
 --out-file paymentCli.addr \
 --testnet-magic 1 # preprod
</code></pre>
<p>You'll notice that <code>payment.addr</code> == <code>paymentCli.addr</code>.</p>
<ol start="6">
<li>Now, if you'd like to spend from the address also with <code>cardano-cli</code>:</li>
</ol>
<p>Convert xsk:</p>
<pre><code>$ cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file addr.xsk --out-file payment.skey
$ cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file stake.xsk --out-file stake.skey
</code></pre>
<p>Now, you can spend the address using cardano-cli (with payment.skey or stake.skey), e.g.:</p>
<pre><code>$ cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 1

$ cardano-cli query protocol-parameters \
   --testnet-magic 1 \
   --out-file protocol.json

$ cardano-cli transaction build  \
    --babbage-era  \
    --testnet-magic 1 \
    --tx-in &quot;3f546b8d958d65b9e0f93030ac4afdc95b92c0dfdadaad1a063bf7024ee0378d#0&quot;  \
    --tx-out &quot;addr_test1qzfdywms54mk9hclupc3yhu8yev6w92swndcaewvxx53ux0vwaztjw0fjsgfmvdqtq3tn4df0ja9tgvxmmapehnmjcxq8u7f98+1000000&quot; \
     --change-address $(cat payment.addr) \
--protocol-params-file protocol.json  \
--out-file body.tx


$ cardano-cli transaction sign \
   --tx-body-file body.tx \
   --testnet-magic 2 \
   --signing-key-file payment.skey \
   --out-file signed.tx

$ cardano-cli transaction submit --tx-file signed.tx --testnet-magic 1
</code></pre>

CC BY-SA 4.0
2022-11-30T12:42:55.153Z
2022-11-30T12:42:55.153Z
piotr-iohk
<p>I created a Wallet with Cardano-Cli following this instructions:</p>
<pre><code>cardano-cli address key-gen   --verification-key-file vkf.payment --signing-key-file  skf.payment
</code></pre>
<p>After that I derived the address of that wallet</p>
<p>What I need to do now is to register this wallet on the Cardano-Wallet server, to feed the PA&gt;B. But the Cardano-Wallet-Server requires a pub key hash or a nemonic phrase wallet recovery, to generate the <code>WALLET_ID</code>.</p>
<p>But the cardano-cli offers none of them.</p>
<p>Does anyone knows how to move from payment verification and signing keys to a public address or a mnemonic phrase useful to register my wallet on Cardano-Wallet-Server?</p>
<p>Thanks in advance.</p>

<cardano-cli><wallet><cardano-address>
Cardano-Wallet register a wallet generated by Cardano-cli
# Cardano-Wallet register a wallet generated by Cardano-cli

(Asked by: username_0 on 2022-11-29)

I created a Wallet with Cardano-Cli following this instructions:
cardano-cli address key-gen   --verification-key-file vkf.payment --signing-key-file  skf.payment

After that I derived the address of that wallet
What I need to do now is to register this wallet on the Cardano-Wallet server, to feed the PA>B. But the Cardano-Wallet-Server requires a pub key hash or a nemonic phrase wallet recovery, to generate the WALLET_ID.
But the cardano-cli offers none of them.
Does anyone knows how to move from payment verification and signing keys to a public address or a mnemonic phrase useful to register my wallet on Cardano-Wallet-Server?
Thanks in advance.

**Tags:** cardano-cli, wallet, cardano-address

---

## 1 answers

### Answer by username_1 on 2022-11-30. Score: 1 | Accepted answer

Does anyone knows how to move from payment verification and signing
keys to a public address or a mnemonic phrase useful to register my
wallet on Cardano-Wallet-Server?

I think you're not able to make that kind of derivation since we are dealing with addr.xsk (from derivation path root.xsk -> acct.xsk -> addr.xsk). And wallet needs to know about root and acct keys.
You can however use cardano-addresses to create all those keys and generate address with them, and then use cardano-cli key convert-cardano-address-key to convert them into format that is readable by cardano-cli if you wish:

Generate mnemonics

$ cardano-address recovery-phrase generate --size 24 > mnemonics.txt

Using these mnemonics you can already restore the wallet on cardano-wallet server.

Create root.xsk

$ cardano-address key from-recovery-phrase Shelley < mnemonics.txt > root.xsk

(BTW, at this point you can already figure out what will be wallet id)
$ cardano-address key walletid < root.xsk


Derive addr.xsk and stake.xsk

$ cardano-address key child 1852H/1815H/0H/0/0 < root.xsk > addr.xsk  
$ cardano-address key child 1852H/1815H/0H/2/0 < root.xsk > stake.xsk


Generate public/verification keys:

$ cardano-address key public --without-chain-code < addr.xsk > payment.vkey
$ cardano-address key public --without-chain-code < stake.xsk > stake.vkey


Generate wallet address:

$ cardano-address address payment --network-tag preprod < payment.vkey \
  | cardano-address address delegation $(cat stake.vkey) > payment.addr

addr.xsk -> 1852H/1815H/0H/0/0, so this is going to be first address on the wallet, next in the sequence would be 1852H/1815H/0H/0/1 etc. (stake.xsk stays the same)
The address can be also generated with cardano-cli:
cardano-cli address build \
 --payment-verification-key-file payment.vkey \
 --stake-verification-key-file stake.vkey \
 --out-file paymentCli.addr \
 --testnet-magic 1 # preprod

You'll notice that payment.addr == paymentCli.addr.

Now, if you'd like to spend from the address also with cardano-cli:

Convert xsk:
$ cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file addr.xsk --out-file payment.skey
$ cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file stake.xsk --out-file stake.skey

Now, you can spend the address using cardano-cli (with payment.skey or stake.skey), e.g.:
$ cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 1

$ cardano-cli query protocol-parameters \
   --testnet-magic 1 \
   --out-file protocol.json

$ cardano-cli transaction build  \
    --babbage-era  \
    --testnet-magic 1 \
    --tx-in "3f546b8d958d65b9e0f93030ac4afdc95b92c0dfdadaad1a063bf7024ee0378d#0"  \
    --tx-out "addr_test1qzfdywms54mk9hclupc3yhu8yev6w92swndcaewvxx53ux0vwaztjw0fjsgfmvdqtq3tn4df0ja9tgvxmmapehnmjcxq8u7f98+1000000" \
     --change-address $(cat payment.addr) \
--protocol-params-file protocol.json  \
--out-file body.tx


$ cardano-cli transaction sign \
   --tx-body-file body.tx \
   --testnet-magic 2 \
   --signing-key-file payment.skey \
   --out-file signed.tx

$ cardano-cli transaction submit --tx-file signed.tx --testnet-magic 1


---

