3

Yoroi has a feature to export a wallet as a “key” (Options=>Wallet=>Export Wallet=>Export). I guess that it is the public root key, since the description says:

The below you can find your wallet's public key information. Public keys allow seeing the wallet history for the wallet, but does not allow to spend or move the funds in any way (private key is not included)

For testing purposes I created a test wallet and this is the "key" that Yoroi gives me:

95e74df114717de17ebfb24c05f9fd1c8019bb6f1de117eec10a43670a692866b837a4a5f51d62f3dc3d630d075c8e39e5294323ba146c386c48123aeef5438a

So my question is: How is this key encoded? It does not have any default prefix and seems to be quite long.

I guess that, e.g. for use with the cardano-addresses tool, the key maybe just needs to be converted using the bech32 tool, correct? If so, then what prefix must be used?

Thanks.

PS: This question is part of a bigger question, which I split up into sub-questions, as recommended in the original question.

4

After a lot of trial and error, I figured it out myself.

TLDR

The "key" that results from the Yoroi export indeed needs to be encoded with bech32, using the prefix acct_xvk.

Demonstration/Proof

To test this, we need multiple things:

  1. The seed phrase of our test wallet (for this demonstration we store it in the file phrase.prv): maximum vacuum toe conduct jazz tray romance crawl fossil wisdom disease crazy mountain bird discover
  2. The "key" exported by Yoroi (for this demonstration we store it in the file root_yoroi_raw.pub): 95e74df114717de17ebfb24c05f9fd1c8019bb6f1de117eec10a43670a692866b837a4a5f51d62f3dc3d630d075c8e39e5294323ba146c386c48123aeef5438a
  3. The bech32 tool.
  4. The cardano-addresses tool.

We can now test, whether we can get the same results using our seed phrase and the exported key:

./cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
cat root.xsk | ./cardano-address key child 1852H/1815H/0H | ./cardano-address key public --with-chain-code > root.xvk

./bech32 acct_xvk < root_yoroi_raw.pub > root_yoroi.pub

cat root.xvk
cat root_yoroi.pub

This gives the following result:

acct_xvk1jhn5mug5w977zl4lkfxqt70arjqpnwm0rhs30mkppfpkwznf9pntsday5h636chnms7kxrg8tj8rneffgv3m59rv8pkysy36am658zsh2qnm6
acct_xvk1jhn5mug5w977zl4lkfxqt70arjqpnwm0rhs30mkppfpkwznf9pntsday5h636chnms7kxrg8tj8rneffgv3m59rv8pkysy36am658zsh2qnm6

This means, that the key exported by Yoroi, when being bech32 encoded with the prefix acct_xvk matches the extended public root key that can be derived from the seed phrase.

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.