mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
When Ed25519 support was added to ripple-lib, a way to specify whether a seed should be used to derive a "classic" secp256k1 keypair or a "new" Ed25519 keypair was needed, and the requirements were that: 1. previously seeds would, correctly, generate a secp256k1 keypair. 2. users would not have to know about whether the seed was used to generate a secp256k1 or an Ed25519 keypair. To address these requirements, the decision was made to encode the type of key within the seed and a custom encoding was designed. The encoding uses a token type of 1 and prefixes the actual seed with a 2 byte header, selected to ensure that all such keypairs will, when encoded, begin with the string "sEd". This custom encoding is non-standard and was not previously documented; as a result, it is not widely supported and other sofware may treat such keys as invalid. This can make it difficult for users that have stored such a seed to use wallets or other tooling that is not based on ripple-lib. This commit adds support to rippled for automatically detecting and properly handling such seeds.