Bitcoin Forum
December 19, 2018, 08:33:14 AM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to make wallet address sanity check algorithm?  (Read 77 times)
wsxdrfv
Newbie
*
Offline Offline

Activity: 308
Merit: 0


View Profile WWW
June 25, 2018, 09:24:40 AM
 #1

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.

100% New Software
PC, Mac, Android, & HTML5 Clients
Krill Rakeback
Low Rake
Bitcoin Poker 3.0
Bad Beat Jackpot
SwC Poker Relaunch
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
NeuroticFish
Legendary
*
Offline Offline

Activity: 1694
Merit: 1117


The real one is http://bitcoin.ORG


View Profile
June 25, 2018, 03:01:11 PM
 #2

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

.BITSLER.                 ▄███
               ▄████▀
             ▄████▀
           ▄████▀  ▄██▄
         ▄████▀    ▀████▄
       ▄████▀        ▀████▄
     ▄████▀            ▀████▄
   ▄████▀                ▀████▄
 ▄████▀ ▄████▄      ▄████▄ ▀████▄
█████   ██████      ██████   █████
 ▀████▄ ▀████▀      ▀████▀ ▄████▀
   ▀████▄                ▄████▀
     ▀████▄            ▄████▀
       ▀████▄        ▄████▀
         ▀████▄    ▄████▀
           ▀████▄▄████▀
             ▀██████▀
               ▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄            
▄▄▄▄▀▀▀▀    ▄▄█▄▄ ▀▀▄         
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄      
█  ▀▄▄  ▀█▀▀ ▄      ▀████   ▀▀▄   
█ █▄  ▀▄   ▀████       ▀▀ ▄██▄ ▀▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█  ▀▀       ▀▄▄ ▀████      ▄▄▄▀▀▀  █
█            ▄ ▀▄    ▄▄▄▀▀▀   ▄▄  █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ ▄▄   ███   ▀██  █           ▀▀  █ 
█ ███  ▀██       █        ▄▄      █ 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  
▀▄            █        ▀▀      █  
▀▀▄   ███▄  █   ▄▄          █   
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    
▀▀▄   █   ▀▀▄▄▄▀▀▀         
▄▄▄▄▄▄▄▄▄▄▄█▄▄▀▀▀▀              
              ▄▄▄██████▄▄▄
          ▄▄████████████████▄▄
        ▄██████▀▀▀▀▀▀▀▀▀▀██████▄
▄     ▄█████▀             ▀█████▄
██▄▄ █████▀                ▀█████
 ████████            ▄██      █████
  ████████▄         ███▀       ████▄
  █████████▀▀     ▄███▀        █████
   █▀▀▀          █████         █████
     ▄▄▄         ████          █████
   █████          ▀▀           ████▀
    █████                     █████
     █████▄                 ▄█████
      ▀█████▄             ▄█████▀
        ▀██████▄▄▄▄▄▄▄▄▄▄██████▀
          ▀▀████████████████▀▀
              ▀▀▀██████▀▀▀
            ▄▄▄███████▄▄▄
         ▄█▀▀▀ ▄▄▄▄▄▄▄ ▀▀▀█▄
       █▀▀ ▄█████████████▄ ▀▀█
     █▀▀ ███████████████████ ▀▀█
    █▀ ███████████████████████ ▀█
   █▀ ███████████████▀▀ ███████ ▀█
 ▄█▀ ██████████████▀      ▀█████ ▀█▄
███ ███████████▀▀            ▀▀██ ███
███ ███████▀▀                     ███
███ ▀▀▀▀                          ███
▀██▄                             ▄██▀
  ▀█▄                            ▀▀
    █▄       █▄▄▄▄▄▄▄▄▄█
     █▄      ▀█████████▀
      ▀█▄      ▀▀▀▀▀▀▀
        ▀▀█▄▄  ▄▄▄
            ▀▀█████
[]
odolvlobo
Legendary
*
Offline Offline

Activity: 2338
Merit: 1198



View Profile
June 25, 2018, 05:40:55 PM
Merited by Foxpup (2)
 #3

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)

Buy bitcoins with cash from somebody near you: LocalBitcoins
Buy stuff on Amazon at a discount with bitcoins or convert Amazon points to bitcoins: Purse.io
Join an anti-signature campaign: DannyHamilton's ignore list
bob123
Hero Member
*****
Offline Offline

Activity: 770
Merit: 748



View Profile WWW
June 26, 2018, 11:43:20 AM
 #4

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


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

Coding Enthusiast
Sr. Member
****
Online Online

Activity: 539
Merit: 442


Novice C♯ Coder


View Profile WWW
June 26, 2018, 01:46:39 PM
 #5

♯♯♯ 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.

Projects List+Suggestion box
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!