library for validating bitcoin private and public keys I am building a python script that gets a string and determines if it is a valid bitcoin private key or public key, and if so it returns its type/format (base58, BIP32, HexaDecimal etc.) and its derivations (public key from private key and address from public key).
Is there any free library that I can use its code inside mine, to get those details?
I have tried to do so myself but there are a lot of formats of keys and mathematical computations for validation and derivation the keys.
Thank you.
No sane application should EVER attempt to validate a private key by attempting to pass it to an external API. That's a ridiculously easy way to lose all your funds if the API operator is malicious, compromised, or someone is eavesdropping on your communication with said API.
You should do this yourself, preferably using a well tested, community supported, open source library for your choice of language - most major languages have such libraries.
If this is too much work, you should reconsider building something like this. Do not compromise on safety, especially if you intend for other people to trust this code with their funds.