cardano-crypto
cardano-crypto copied to clipboard
Cardano xPrv to Crypto.PubKey.Ed25519.SecretKey
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 ?