# Difference between wallet addresses and those generated with cardano-cli address build

**URL:** <https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046>\
**Category:** Misc Dev Talk\
**Created:** [26 December 2022 22:55 UTC](https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046 "2022-12-26T22:55:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_l\_p](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@p\_l\_p](https://forum.cardano.org/u/p_l_p)\
**Post date:** [26 December 2022 22:55 UTC](https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046/1 "2022-12-26T22:55:02Z")

</div>

Hi, I have been going through some tutorials and came accros something I have not been able to figure out.

I generated a wallet using the cardano-wallet tool and deposited from a faucet on the first unused address.

```auto
  "id": "addr_test1qzu0llpjvjgh0425kzdvdadsakz2fn5xqtyqw2hxhvyyj3ykhkdfx00zjqujm3f6rnxc3hgqj66e53glqk7y8cclw6lsr74ste",
  "state": "unused"

```

I wanted to transfer tADA out of this wallet by building a raw transaction.  
I generated the root key using the same passphrase used when creating the wallet, and derived the .skey and .vkey for the derivation path corresponding to this address above.

I was then able to build a raw transaction signed with .skey and successfully transfer funds from the address.

The part I don’t understand is the following.  
I generated the payment address from the .vkey using the method shown in other tutorials, expecting it will match the address from which I got .vkey in the first place (above). But instead I got a completely different value and length.

```auto
$ cardano-cli address build --testnet-magic 2 --payment-verification-key-file keys/tn.pay-0.vkey
addr_test1vzu0llpjvjgh0425kzdvdadsakz2fn5xqtyqw2hxhvyyj3q29xwed

```

Why do the address vary in length?  
The addresses are not equivalent, one contains funds and the other one doesn’t.

Why couldn’t go go full circle and generate the address back?  
Does this mean that a .skey is not unique to one address?

Thanks.

---

<div class="post-metadata">

**Author:** ![rdlrt](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/rdlrt/32/9098_2.png) [@rdlrt](https://forum.cardano.org/u/rdlrt)\
**Post date:** [27 December 2022 01:13 UTC](https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046/2 "2022-12-27T01:13:57Z")

</div>

The one created via wallet used payment + stake key to create a shelley address that can take part in staking. The one you created via CLI was simply using payment key - often called as enterprise addresses.  
You might want to check [this CIP](https://cips.cardano.org/cips/cip19/#shelleyaddresses) for types of addresses and their formations

---

<div class="post-metadata">

**Author:** ![p\_l\_p](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@p\_l\_p](https://forum.cardano.org/u/p_l_p)\
**Post date:** [27 December 2022 12:53 UTC](https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046/3 "2022-12-27T12:53:45Z")

</div>

Thanks for the info, helped find the information I needed to recreate the address in full.

I do have a follow up question though.  
I can recreate the address with derivation path 1852H/1815H/0H/0/0, but I have been unable to do the same with other addresses.

```auto
{
  "derivation_path": [
    "1852H",
    "1815H",
    "0H",
    "0",
    "0"
  ],
  "id": "addr_test1qqu7y6fmy924snn6qzr5ym3l954lwgpp0nkfstkf58su6hh3gkv3u9u7nxrquw2er7fcp0ptkkzkq6hhh04629h340ms64nzkj",
  "state": "used"
}

cardano-wallet key child 1852H/1815H/0H/0/0 < tn.root.prv > tn.pay.prv
cardano-wallet key public --without-chain-code < tn.pay.prv > tn.pay.pub
cardano-wallet key child 1852H/1815H/0H/2/0 < tn.root.prv > tn.stake.prv
cardano-wallet key public --without-chain-code < tn.stake.prv > tn.stake.pub
cardano-cli address build --testnet-magic 2 \
                          --payment-verification-key $(cat tn.pay.pub) \
                          --stake-verification-key $(cat tn.stake.pub)
addr_test1qqu7y6fmy924snn6qzr5ym3l954lwgpp0nkfstkf58su6hh3gkv3u9u7nxrquw2er7fcp0ptkkzkq6hhh04629h340ms64nzkj

```

But this did **not** work:

```auto
{
  "derivation_path": [
    "1852H",
    "1815H",
    "0H",
    "0",
    "1"
  ],
  "id": "addr_test1qquvzfjj6ggfesd3fweegvy0el79t77dty59fu587jj6y583gkv3u9u7nxrquw2er7fcp0ptkkzkq6hhh04629h340mshl3tl3",
  "state": "used"
}

cardano-wallet key child 1852H/1815H/0H/0/1 < tn.root.prv > tn.pay.prv
cardano-wallet key public --without-chain-code < tn.pay.prv > tn.pay.pub
cardano-wallet key child 1852H/1815H/0H/2/1 < tn.root.prv > tn.stake.prv
cardano-wallet key public --without-chain-code < tn.stake.prv > tn.stake.pub
cardano-cli address build --testnet-magic 2 \
                          --payment-verification-key $(cat tn.pay.pub) \
                          --stake-verification-key $(cat tn.stake.pub)
addr_test1qquvzfjj6ggfesd3fweegvy0el79t77dty59fu587jj6y5peha8sjvacr09yanyqxgctuv85ye5fpg3s077yufz3ewvqc2zg0e

```

Any idea why?

Thanks

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [27 December 2022 13:04 UTC](https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046/4 "2022-12-27T13:04:35Z")

</div>

> [@p\_l\_p](#):
>
> Any idea why?

> [@p\_l\_p](#):
>
> `cardano-wallet key child 1852H/1815H/0H/2/1 < tn.root.prv > tn.stake.prv`

That’s not how it is done. All addresses in an account use the stake address `m/1852'/1815'/0'/2/0`. After all, the reason for this is that they all contribute to the same stake, so they should all use the same stake address.

With

```auto
cardano-wallet key child 1852H/1815H/0H/0/1 < tn.root.prv > tn.pay.prv
cardano-wallet key public --without-chain-code < tn.pay.prv > tn.pay.pub
cardano-wallet key child 1852H/1815H/0H/2/0 < tn.root.prv > tn.stake.prv
cardano-wallet key public --without-chain-code < tn.stake.prv > tn.stake.pub
cardano-cli address build --testnet-magic 2 \
                          --payment-verification-key $(cat tn.pay.pub) \
                          --stake-verification-key $(cat tn.stake.pub)

```

you should get the correct result.

(Of course, you don’t have to recreate the stake key all the time. Just save it. It’s the same for all addresses.)

---

<div class="post-metadata">

**Author:** ![p\_l\_p](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@p\_l\_p](https://forum.cardano.org/u/p_l_p)\
**Post date:** [27 December 2022 13:18 UTC](https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046/5 "2022-12-27T13:18:31Z")

</div>

Thanks for your reply and apologies for the noob questions, I have just started learning!

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [27 December 2022 13:21 UTC](https://forum.cardano.org/t/difference-between-wallet-addresses-and-those-generated-with-cardano-cli-address-build/112046/6 "2022-12-27T13:21:43Z")

</div>

> [@p\_l\_p](#):
>
> I have just started learning!

Please keep on asking!
