Bitcoin Forum
August 20, 2018, 03:36:17 AM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How to make wallet address sanity check algorithm?  (Read 64 times)
wsxdrfv
Jr. Member
*
Offline Offline

Activity: 210
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.


my BitcoinEssence (BTE) address : EbpxqVRFy2253rXobedjrHGTi2f1KHkxd4
1534736177
Hero Member
*
Offline Offline

Posts: 1534736177

View Profile Personal Message (Offline)

Ignore
1534736177
Reply with quote  #2

1534736177
Report to moderator
1534736177
Hero Member
*
Offline Offline

Posts: 1534736177

View Profile Personal Message (Offline)

Ignore
1534736177
Reply with quote  #2

1534736177
Report to moderator
1534736177
Hero Member
*
Offline Offline

Posts: 1534736177

View Profile Personal Message (Offline)

Ignore
1534736177
Reply with quote  #2

1534736177
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1534736177
Hero Member
*
Offline Offline

Posts: 1534736177

View Profile Personal Message (Offline)

Ignore
1534736177
Reply with quote  #2

1534736177
Report to moderator
NeuroticFish
Legendary
*
Offline Offline

Activity: 1582
Merit: 1048


The real one is http://bitcoin.ORG


View Profile WWW
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
*
Online Online

Activity: 2226
Merit: 1122



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: Purse.io
Join an anti-signature campaign: DannyHamilton's ignore list
bob123
Hero Member
*****
Offline Offline

Activity: 658
Merit: 530



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
****
Offline Offline

Activity: 478
Merit: 286


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
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!