1

Let assume that I do not want to check literally if specific cryptocurrency address is correct (I mean I have to deal with many cryptocurry addresses that I know of which cryptcurrency).

Does checking on balance with public APIs for that specific address (BTC, Litecoin, Doge and so on...) would give me error message for invalid addresses?

I just want to make my life easier and skip writing function to check for correctness on each cryptocurrency seperately.

  • Does the API make any guarantees to check the validity of the address? If it doesn't you shouldn't be relying on it. – Murch Aug 19 '16 at 6:19
0

A fresh address is a completely new number that the world has never seen before. Therefore, it will have no data recorded about it on any public block explorer API. However, an API may still be used to determine if a newly generated address is valid, depending on how the API handles address that it has not seen in a block nor a transaction.

I would advise against misusing an API for this purpose, for two reasons:

First, it is wasteful from a programming standpoint, since you could more quickly validate an address locally. It's a matter of CPU time vs network time, not to mention causing additional work for the other end of the API.

Second, you would be pre-announcing the existence of your addresses prior to using them. I do not know your purposes, so cannot tell you what problems this may cause. However, since it is not necessary for you to do, it's best just to avoid it in the first place.

0

Using a public API can verify that an address is valid, but only if the address is known to the Bitcoin (or Litecoin, Dogecoin, etc) network.

This will not work for cold storage addresses that have not yet been exposed to any network peers (because they are invisible to the network until used).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.