Hot answers tagged

13

If you are using Stellar JS SDK, the following method will work for you. import StellarBase from 'stellar-base' if (StellarBase.StrKey.isValidEd25519SecretSeed('SB....4A')) { //secret key is valid } if (StellarBase.StrKey.isValidEd25519PublicKey('GA....6C')) { //public key is valid }


12

If you're just interested in checking whether it's a well-formed key, you can use the following algorithm: Verify that the string starts with "S" Base-32 decode the S... string to get the raw bytes. You will end up with 35 bytes. Ignore the first byte since it represents the "S". Calculate the CRC-16 checksum of the next 32 bytes. These bytes represent the ...


4

While this is a valid concern (and I am actually part of the SDF Team so your concern has been heard), this is not the best place to post this message. In the future the Stellar Public Slack is the best place to voice these concerns -- in fact there is a #scam channel there.


3

You can use StrKey.decodeStellarAccountId() wrapped with a try-catch block. If the expression throws an exception, the account id is invalid.


2

Storing the public key is no problem at all. It's public so there's no security concern. If you meant secret keys then you might want to rethink whether you really need it -- I doubt you do just for federation. N/A Federation just lets others look up your address using your friendly id (or a source account + a memo). There's no reason why multiple anchors ...


1

That is a scam email you received. Please do not interact with it or give your secret key.


1

Here is a simple method for elucidsoft SDK: bool IsAccountIdValid(string accountId) { if (!String.IsNotNullOrEmpty(encoded) && encoded.Length != 56) return false; try { var decoded = StrKey.DecodeStellarAccountId(accountId); if (decoded.Length !== 32) return false; return true; } catch { return false; ...


Only top voted, non community-wiki answers of a minimum length are eligible