Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cardano xPrv to Crypto.PubKey.Ed25519.SecretKey #79

Open
volodyad opened this issue Oct 14, 2021 · 0 comments
Open

Cardano xPrv to Crypto.PubKey.Ed25519.SecretKey #79

volodyad opened this issue Oct 14, 2021 · 0 comments

Comments

@volodyad
Copy link

Ib cardano we have next methods

Generate extended public key from private key
toXPub :: HasCallStack => XPrv -> XPub
toXPub (XPrv ekey) = XPub pub (ChainCode cc)
  where (_,r)     = B.splitAt 64 $ convert ekey
        (pub, cc) = B.splitAt 32 r

Return the Ed25519 public key associated with a XPub context
xPubGetPublicKey :: XPub -> Ed25519.PublicKey
xPubGetPublicKey (XPub pub _) =
    throwCryptoError $ Ed25519.publicKey pub

How can we get Ed25519.SecretKey from XPrv ?
Ed25519.SecretKey expects 32 bytes, how to map first XPriv 64 bytes to Ed25519.SecretKey ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant