What if I want to check in Solidity if an address exist on my Etherum blockchain?
When looking at the solidity.readthedocs there is a function balance
which could be used / misused to check if the address is valid / has balance:
address x = 0x4e5d039c5516b69a4b6b1f006cbf4e10accb5cfa; // this is an example address which does not have valid checksum....
if (x.balance > 0) // Return true when valid ??
Is this possible ?
I found also some references on how-to-find-out-if-an-ethereum-address-is-a-contract, but I'm not sure that will help.
There isn't a guaranteed way. The closest you can get to is to verify the address is in the correct format (20 byte hex) and is not a contract address (which you linked to). From there, the address is considered a valid EOA account. Of course, you could still send ether to valid address that someone mistyped, so even checking the balance of that address wouldn't yield the result you're looking for (also, it's perfectly fine for the address to be correct and just have no ether in it). Most wallets support checksums which give you a little more protection, but still not guaranteed to mean that the address is in use.
If you're working with a private blockchain and have full control over account creation, you could hypothetically store each account created in a mapping in an AccountManager contract and use modifiers in your contract to check that list.