Cardano xPrv to Crypto.PubKey.Ed25519.SecretKey

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
haskell
Domain
cryptography

Research direction

Start with the shown toXPub and xPubGetPublicKey entry points and trace how XPrv and Ed25519.SecretKey are represented. Determine whether a supported conversion is possible without changing the key semantics, then document the expected behavior and validate it with the relevant cryptographic tests if available.

Written by the indexing model from the issue text.

Description

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 ?

Dominant language
C
Stars
68
Forks
45
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IntersectMBO/cardano-crypto

All issues in IntersectMBO/cardano-crypto

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.