How do I generate an xPub using stellar SDK ? could anyone show me the format of a stellar extended public key ?
2 Answers
You can't generate xPub
for Stellar keys according to SEP-0005. Stellar is using SLIP-0010 (as defined in SEP-0005). From "Master key generation" section:
ed25519 curve the private keys are no longer multipliers for the group generator; instead the hash of the private key is the multiplier. For this reason, our scheme for ed25519 does not support public key derivation and uses the produced hashes directly as private keys.
There are proposals for generating HD keys with a possibility to generate extended public keys for ed25519
like:
- https://chain.com/docs/1.2/protocol/specifications/chainkd
- https://cardanolaunch.com/assets/Ed25519_BIP.pdf
However these are not supported by Stellar.
Why Stellar selected SLIP-0010 over other solutions?
SLIP-0010 is supported in hardware wallets like Ledger or Trezor. We wanted a solution that is compatible with them.
-
Hi, thanks for this answer! However, both links in this post are dead, is anyone able to update them to new locations?– sisouSep 25, 2021 at 22:00
I think there is no API to generate it from Stellar SDK
This link help you to generate xPub https://iancoleman.io/bip39/?#english