Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: wsxdrfv on June 25, 2018, 09:24:40 AM



Title: How to make wallet address sanity check algorithm?
Post by: wsxdrfv on June 25, 2018, 09:24:40 AM
As title, How to make coin's wallet address sanity check algorithm?

To block user's trial of send coin to wrong address or other coin's address.



Title: Re: How to make wallet address sanity check algorithm?
Post by: NeuroticFish on June 25, 2018, 03:01:11 PM
As title, How to make coin's wallet address sanity check algorithm?

To block user's trial of send coin to wrong address or other coin's address.

One easy way is to put something specific at the start of the wallet address.
For example if the wallet is ABCABCABC make it become wsxdrfvcoinABCABCABC, then you always check for that start.
Or, since a wallet comes from a big number, you add something in front making it bigger, like if the large number for wallet has 20 digits you add 45*10^20 to it (so you add 45 in front). Again, at send you check if that rule is kept for the recipient address.

Edit: if you want to make it even more complicated you can add some sort of checksum at the end


Title: Re: How to make wallet address sanity check algorithm?
Post by: odolvlobo on June 25, 2018, 05:40:55 PM
An address already has sanity checks -- the version byte and the checksum. Beyond those, the options are limited.

One solution is to disallow direct entry of an address alone and only allow use of BIP 21 (https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki)


Title: Re: How to make wallet address sanity check algorithm?
Post by: bob123 on June 26, 2018, 11:43:20 AM
As title, How to make coin's wallet address sanity check algorithm?

To block user's trial of send coin to wrong address or other coin's address.

Are we supposed to build your online service?

You seem to know almost nothing about IT/coding/bitcoin/server/googline/computers..

It is literally the FIRST RESULT on google: Bitcoin address checksum (http://lmgtfy.com/?iie=1&q=bitcoin+address+checksum)


P.s. Make sure to message me when your service will be online. I am looking for fast and easy money.


Title: Re: How to make wallet address sanity check algorithm?
Post by: Coding Enthusiast on June 26, 2018, 01:46:39 PM
♯♯♯ or other coin's address.

You can not prevent that, because the only thing you can check is whether the address is valid or not. And if the address follows the same structure (eg. LTC's old multi sig, or BCH's addresses) it will be valid.
You can ask the user to confirm he wants to send for example bitcoin to the address he  just gave you but that won't prevent much.