{"id":335272,"date":"2022-07-03T21:00:09","date_gmt":"2022-07-03T21:00:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=335272"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=335272","title":{"rendered":"<span>\u041a\u0430\u043a \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 Bitcoin-PUBKEY HEX \u0432 Bitcoin-\u0430\u0434\u0440\u0435\u0441 Base58 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u043e\u043d\u0435\u0442 BTC<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2ee\/1bb\/d34\/2ee1bbd3488b5f4641341938c3598427.png\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ee\/1bb\/d34\/2ee1bbd3488b5f4641341938c3598427.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u043e\u043d\u0435\u0442 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/bitcoin-checker.py\" rel=\"noopener noreferrer nofollow\">bitcoin-checker.py<\/a><\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/115\/c50\/ab8\/115c50ab8b21651ae63d3cd8d3ecb98d.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 bitcoin-checker.py\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 bitcoin-checker.py\" width=\"349\" height=\"97\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/115\/c50\/ab8\/115c50ab8b21651ae63d3cd8d3ecb98d.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 bitcoin-checker.py<\/figcaption><\/figure>\n<p> \u0422\u0430\u043a \u0436\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 <code>PUBKEY (HEX)<\/code> \u0432 \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441 <code>(Base58)<\/code> \u0432\u0441\u044e \u044d\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u0435\u043b\u0430\u0435\u0442 <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/pubtoaddr.py\" rel=\"noopener noreferrer nofollow\">pubtoaddr.py<\/a><\/p>\n<blockquote>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0441 \u043e\u0441\u043e\u0431\u043e\u0439 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430, \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u044f \u0411\u043b\u043e\u043a\u0447\u0435\u0439\u043d \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 Google Colab <a href=\"https:\/\/github.com\/demining\/TerminalGoogleColab\" rel=\"noopener noreferrer nofollow\">[TerminalGoogleColab]<\/a><\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0432\u0438\u0434\u0435\u043e\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e: <a href=\"https:\/\/www.youtube.com\/watch?v=S2D7PI6dK08\" rel=\"noopener noreferrer nofollow\">\u00abTERMINAL \u0432 Google Colab \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0441\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442 \u0432 GITHUB\u00bb<\/a><\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/tree\/main\/03CheckBitcoinAddressBalance\" rel=\"noopener noreferrer nofollow\">\u00abCryptoDeepTools\u00bb<\/a> \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 <em>Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/getbalance.sh\" rel=\"noopener noreferrer nofollow\">getbalance.sh<\/a><\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f67\/caa\/a24\/f67caaa24e0be3727879d8c9f842f9c7.png\" alt=\"\u041a\u043e\u043c\u0430\u043d\u0434\u044b\" title=\"\u041a\u043e\u043c\u0430\u043d\u0434\u044b\" width=\"462\" height=\"260\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f67\/caa\/a24\/f67caaa24e0be3727879d8c9f842f9c7.png\"\/><figcaption>\u041a\u043e\u043c\u0430\u043d\u0434\u044b<\/figcaption><\/figure>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d45\/57e\/1ae\/d4557e1ae1a44f4c54e688da3a4882c7.png\" alt=\"\u0424\u0430\u0439\u043b\u044b\" title=\"\u0424\u0430\u0439\u043b\u044b\" width=\"223\" height=\"268\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d45\/57e\/1ae\/d4557e1ae1a44f4c54e688da3a4882c7.png\"\/><figcaption>\u0424\u0430\u0439\u043b\u044b<\/figcaption><\/figure>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4ff\/051\/a09\/4ff051a0999975eca9beb0b3f349896f.png\" alt=\"\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430: getbalance.sh\" title=\"\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430: getbalance.sh\" width=\"344\" height=\"159\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ff\/051\/a09\/4ff051a0999975eca9beb0b3f349896f.png\"\/><figcaption>\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430: getbalance.sh<\/figcaption><\/figure>\n<pre><code class=\"bash\">grep 'PUBKEY = ' signatures.json > pubkeyall.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>grep<\/code> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0432 \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 \u0444\u0430\u0439\u043b: <code>pubkeyall.json<\/code><\/p>\n<pre><code class=\"bash\">sort -u pubkeyall.json > pubkey.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>sort<\/code> \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0434\u0443\u0431\u043b\u0438 \u043e\u0442\u0431\u0438\u0440\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u0444\u0430\u0439\u043b: <code>pubkey.json<\/code><\/p>\n<pre><code class=\"bash\">rm pubkeyall.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>rm<\/code> \u0443\u0434\u0430\u043b\u044f\u0435\u0442 <code>pubkeyall.json<\/code><\/p>\n<pre><code class=\"bash\">sed -i 's\/PUBKEY = \/\/g' pubkey.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>sed<\/code> \u0441\u0442\u0438\u0440\u0430\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <code>PUBKEY =<\/code><\/p>\n<pre><code class=\"bash\">python3 pubtoaddr.py<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/pubtoaddr.py\" rel=\"noopener noreferrer nofollow\">pubtoaddr.py<\/a> \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <code>pubkey.json<\/code> \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430\u0448\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 <code>PUBKEY (HEX)<\/code> \u0432  \u0444\u0430\u0439\u043b <code>addresses.json<\/code> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441\u0430 <code>(Base58)<\/code><\/p>\n<pre><code class=\"python\">import hashlib import base58   def hash160(hex_str):     sha = hashlib.sha256()     rip = hashlib.new('ripemd160')     sha.update(hex_str)     rip.update(sha.digest())     return rip.hexdigest()  # .hexdigest() is hex ASCII     pub_keys = open('pubkey.json', 'r', encoding='utf-8') new_file = open('addresses.json', 'a', encoding='utf-8') compress_pubkey = False   for pub_key in pub_keys:     pub_key = pub_key.replace('\\n', '')     if compress_pubkey:         if (ord(bytearray.fromhex(pub_key[-2:])) % 2 == 0):             pubkey_compressed = '02'         else:             pubkey_compressed = '03'         pubkey_compressed += pub_key[2:66]         hex_str = bytearray.fromhex(pubkey_compressed)     else:         hex_str = bytearray.fromhex(pub_key)         key_hash = '00' + hash160(hex_str)         sha = hashlib.sha256()     sha.update(bytearray.fromhex(key_hash))     checksum = sha.digest()     sha = hashlib.sha256()     sha.update(checksum)     checksum = sha.hexdigest()[0:8]   #   new_file.write(\"\" + (base58.b58encode(bytes(bytearray.fromhex(key_hash + checksum)))).decode('utf-8'))     new_file.write((base58.b58encode(bytes(bytearray.fromhex(key_hash + checksum)))).decode('utf-8') + \"\\n\") pub_keys.close() new_file.close()<\/code><\/pre>\n<blockquote>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0444\u0430\u0439\u043b <code>addresses.json<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u043e\u043d\u0435\u0442 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/bitcoin-checker.py\" rel=\"noopener noreferrer nofollow\">bitcoin-checker.py<\/a><\/p>\n<\/blockquote>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em>:  <code>python2 bitcoin-checker.py<\/code>  <\/p>\n<pre><code class=\"python\">import sys import re from time import sleep  try:    # if is python3     from urllib.request import urlopen except: # if is python2     from urllib2 import urlopen   def check_balance(address):      #Modify the value of the variable below to False if you do not want Bell Sound when the Software finds balance.     SONG_BELL = True      #Add time different of 0 if you need more security on the checks     WARN_WAIT_TIME = 0      blockchain_tags_json = [          'total_received',         'final_balance',         ]      SATOSHIS_PER_BTC = 1e+8      check_address = address      parse_address_structure = re.match(r' *([a-zA-Z1-9]{1,34})', check_address)     if ( parse_address_structure is not None ):         check_address = parse_address_structure.group(1)     else:         print( \"\\nThis Bitcoin Address is invalid\" + check_address )         exit(1)      #Read info from Blockchain about the Address     reading_state=1     while (reading_state):         try:             htmlfile = urlopen(\"https:\/\/blockchain.info\/address\/%s?format=json\" % check_address, timeout = 10)             htmltext = htmlfile.read().decode('utf-8')             reading_state  = 0         except:             reading_state+=1             print( \"Checking... \" + str(reading_state) )             sleep(60*reading_state)      print( \"\\nBitcoin Address = \" + check_address )      blockchain_info_array = []     tag = ''     try:         for tag in blockchain_tags_json:             blockchain_info_array.append (                 float( re.search( r'%s\":(\\d+),' % tag, htmltext ).group(1) ) )     except:         print( \"Error '%s'.\" % tag );         exit(1)      for i, btc_tokens in enumerate(blockchain_info_array):          sys.stdout.write (\"%s \\t= \" % blockchain_tags_json[i])         if btc_tokens > 0.0:             print( \"%.8f Bitcoin\" % (btc_tokens\/SATOSHIS_PER_BTC) );         else:             print( \"0 Bitcoin\" );          if (SONG_BELL and blockchain_tags_json[i] == 'final_balance' and btc_tokens > 0.0):                           #If you have a balance greater than 0 you will hear the bell             sys.stdout.write ('\\a\\a\\a')             sys.stdout.flush()              arq1.write(\"Bitcoin Address: %s\" % check_address)             arq1.write(\"\\t Balance: %.8f Bitcoin\" % (btc_tokens\/SATOSHIS_PER_BTC))             arq1.write(\"\\n\")             arq1.close()             if (WARN_WAIT_TIME > 0):                 sleep(WARN_WAIT_TIME)  #Add the filename of your list of Bitcoin Addresses for check all. with open(\"addresses.json\") as file:     for line in file:      arq1 = open('balance.json', 'a')         address = str.strip(line)         print (\"__________________________________________________\\n\")                  check_balance(address) print \"__________________________________________________\\n\" arq1.close()<\/code><\/pre>\n<blockquote>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435: <code>balance.json<\/code><\/p>\n<\/blockquote>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/93a\/f82\/c34\/93af82c3468566ef9f495d0732c9731c.png\" alt=\"\u0424\u0430\u0439\u043b: balance.json\" title=\"\u0424\u0430\u0439\u043b: balance.json\" width=\"564\" height=\"64\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/93a\/f82\/c34\/93af82c3468566ef9f495d0732c9731c.png\"\/><figcaption>\u0424\u0430\u0439\u043b: balance.json<\/figcaption><\/figure>\n<h2>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c:<\/h2>\n<ul>\n<li>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 <code>PUBKEY (HEX)<\/code> \u0432 \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441 <code>(Base58)<\/code><\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441\u0430 (Base58) \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u043e\u043d\u0435\u0442 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u0434\u043b\u044f \u043a\u0440\u0438\u043f\u0442\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:\u00a0<\/strong><a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/tree\/main\/03CheckBitcoinAddressBalance\" rel=\"noopener noreferrer nofollow\"><strong>https:\/\/github.com\/demining\/CryptoDeepTools\/tree\/main\/03CheckBitcoinAddressBalance<\/strong><\/a><\/p>\n<p><strong>Telegram:\u00a0<\/strong><a href=\"https:\/\/t.me\/cryptodeeptech\" rel=\"noopener noreferrer nofollow\"><strong>https:\/\/t.me\/cryptodeeptech<\/strong><\/a><\/p>\n<p><strong>\u0412\u0438\u0434\u0435\u043e\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b: <\/strong><a href=\"https:\/\/youtu.be\/Hsk6QIzb7oY\" rel=\"noopener noreferrer nofollow\"><strong>https:\/\/youtu.be\/Hsk6QIzb7oY<\/strong><\/a>  <\/p>\n<hr\/>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/62c1f79d152da45a6ba2980c\" data-style=\"\" id=\"62c1f79d152da45a6ba2980c\" width=\"\"><\/div>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/674812\/\"> https:\/\/habr.com\/ru\/post\/674812\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u043e\u043d\u0435\u0442 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/bitcoin-checker.py\" rel=\"noopener noreferrer nofollow\">bitcoin-checker.py<\/a><\/p>\n<figure class=\"bordered\"><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 bitcoin-checker.py<\/figcaption><\/figure>\n<p> \u0422\u0430\u043a \u0436\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 <code>PUBKEY (HEX)<\/code> \u0432 \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441 <code>(Base58)<\/code> \u0432\u0441\u044e \u044d\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u0435\u043b\u0430\u0435\u0442 <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/pubtoaddr.py\" rel=\"noopener noreferrer nofollow\">pubtoaddr.py<\/a><\/p>\n<blockquote>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0441 \u043e\u0441\u043e\u0431\u043e\u0439 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430, \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u044f \u0411\u043b\u043e\u043a\u0447\u0435\u0439\u043d \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 Google Colab <a href=\"https:\/\/github.com\/demining\/TerminalGoogleColab\" rel=\"noopener noreferrer nofollow\">[TerminalGoogleColab]<\/a><\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0432\u0438\u0434\u0435\u043e\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e: <a href=\"https:\/\/www.youtube.com\/watch?v=S2D7PI6dK08\" rel=\"noopener noreferrer nofollow\">\u00abTERMINAL \u0432 Google Colab \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0441\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442 \u0432 GITHUB\u00bb<\/a><\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/tree\/main\/03CheckBitcoinAddressBalance\" rel=\"noopener noreferrer nofollow\">\u00abCryptoDeepTools\u00bb<\/a> \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 <em>Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/getbalance.sh\" rel=\"noopener noreferrer nofollow\">getbalance.sh<\/a><\/p>\n<figure class=\"bordered\"><figcaption>\u041a\u043e\u043c\u0430\u043d\u0434\u044b<\/figcaption><\/figure>\n<figure class=\"bordered\"><figcaption>\u0424\u0430\u0439\u043b\u044b<\/figcaption><\/figure>\n<figure class=\"bordered\"><figcaption>\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430: getbalance.sh<\/figcaption><\/figure>\n<pre><code class=\"bash\">grep 'PUBKEY = ' signatures.json > pubkeyall.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>grep<\/code> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0432 \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 \u0444\u0430\u0439\u043b: <code>pubkeyall.json<\/code><\/p>\n<pre><code class=\"bash\">sort -u pubkeyall.json > pubkey.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>sort<\/code> \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0434\u0443\u0431\u043b\u0438 \u043e\u0442\u0431\u0438\u0440\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u0444\u0430\u0439\u043b: <code>pubkey.json<\/code><\/p>\n<pre><code class=\"bash\">rm pubkeyall.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>rm<\/code> \u0443\u0434\u0430\u043b\u044f\u0435\u0442 <code>pubkeyall.json<\/code><\/p>\n<pre><code class=\"bash\">sed -i 's\/PUBKEY = \/\/g' pubkey.json<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>sed<\/code> \u0441\u0442\u0438\u0440\u0430\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <code>PUBKEY =<\/code><\/p>\n<pre><code class=\"bash\">python3 pubtoaddr.py<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/pubtoaddr.py\" rel=\"noopener noreferrer nofollow\">pubtoaddr.py<\/a> \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <code>pubkey.json<\/code> \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430\u0448\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 <code>PUBKEY (HEX)<\/code> \u0432  \u0444\u0430\u0439\u043b <code>addresses.json<\/code> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441\u0430 <code>(Base58)<\/code><\/p>\n<pre><code class=\"python\">import hashlib import base58   def hash160(hex_str):     sha = hashlib.sha256()     rip = hashlib.new('ripemd160')     sha.update(hex_str)     rip.update(sha.digest())     return rip.hexdigest()  # .hexdigest() is hex ASCII     pub_keys = open('pubkey.json', 'r', encoding='utf-8') new_file = open('addresses.json', 'a', encoding='utf-8') compress_pubkey = False   for pub_key in pub_keys:     pub_key = pub_key.replace('\\n', '')     if compress_pubkey:         if (ord(bytearray.fromhex(pub_key[-2:])) % 2 == 0):             pubkey_compressed = '02'         else:             pubkey_compressed = '03'         pubkey_compressed += pub_key[2:66]         hex_str = bytearray.fromhex(pubkey_compressed)     else:         hex_str = bytearray.fromhex(pub_key)         key_hash = '00' + hash160(hex_str)         sha = hashlib.sha256()     sha.update(bytearray.fromhex(key_hash))     checksum = sha.digest()     sha = hashlib.sha256()     sha.update(checksum)     checksum = sha.hexdigest()[0:8]   #   new_file.write(\"\" + (base58.b58encode(bytes(bytearray.fromhex(key_hash + checksum)))).decode('utf-8'))     new_file.write((base58.b58encode(bytes(bytearray.fromhex(key_hash + checksum)))).decode('utf-8') + \"\\n\") pub_keys.close() new_file.close()<\/code><\/pre>\n<blockquote>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0444\u0430\u0439\u043b <code>addresses.json<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u043e\u043d\u0435\u0442 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em> <a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/blob\/main\/03CheckBitcoinAddressBalance\/bitcoin-checker.py\" rel=\"noopener noreferrer nofollow\">bitcoin-checker.py<\/a><\/p>\n<\/blockquote>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <em>Python-\u0441\u043a\u0440\u0438\u043f\u0442<\/em>:  <code>python2 bitcoin-checker.py<\/code>  <\/p>\n<pre><code class=\"python\">import sys import re from time import sleep  try:    # if is python3     from urllib.request import urlopen except: # if is python2     from urllib2 import urlopen   def check_balance(address):      #Modify the value of the variable below to False if you do not want Bell Sound when the Software finds balance.     SONG_BELL = True      #Add time different of 0 if you need more security on the checks     WARN_WAIT_TIME = 0      blockchain_tags_json = [          'total_received',         'final_balance',         ]      SATOSHIS_PER_BTC = 1e+8      check_address = address      parse_address_structure = re.match(r' *([a-zA-Z1-9]{1,34})', check_address)     if ( parse_address_structure is not None ):         check_address = parse_address_structure.group(1)     else:         print( \"\\nThis Bitcoin Address is invalid\" + check_address )         exit(1)      #Read info from Blockchain about the Address     reading_state=1     while (reading_state):         try:             htmlfile = urlopen(\"https:\/\/blockchain.info\/address\/%s?format=json\" % check_address, timeout = 10)             htmltext = htmlfile.read().decode('utf-8')             reading_state  = 0         except:             reading_state+=1             print( \"Checking... \" + str(reading_state) )             sleep(60*reading_state)      print( \"\\nBitcoin Address = \" + check_address )      blockchain_info_array = []     tag = ''     try:         for tag in blockchain_tags_json:             blockchain_info_array.append (                 float( re.search( r'%s\":(\\d+),' % tag, htmltext ).group(1) ) )     except:         print( \"Error '%s'.\" % tag );         exit(1)      for i, btc_tokens in enumerate(blockchain_info_array):          sys.stdout.write (\"%s \\t= \" % blockchain_tags_json[i])         if btc_tokens > 0.0:             print( \"%.8f Bitcoin\" % (btc_tokens\/SATOSHIS_PER_BTC) );         else:             print( \"0 Bitcoin\" );          if (SONG_BELL and blockchain_tags_json[i] == 'final_balance' and btc_tokens > 0.0):                           #If you have a balance greater than 0 you will hear the bell             sys.stdout.write ('\\a\\a\\a')             sys.stdout.flush()              arq1.write(\"Bitcoin Address: %s\" % check_address)             arq1.write(\"\\t Balance: %.8f Bitcoin\" % (btc_tokens\/SATOSHIS_PER_BTC))             arq1.write(\"\\n\")             arq1.close()             if (WARN_WAIT_TIME > 0):                 sleep(WARN_WAIT_TIME)  #Add the filename of your list of Bitcoin Addresses for check all. with open(\"addresses.json\") as file:     for line in file:      arq1 = open('balance.json', 'a')         address = str.strip(line)         print (\"__________________________________________________\\n\")                  check_balance(address) print \"__________________________________________________\\n\" arq1.close()<\/code><\/pre>\n<blockquote>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435: <code>balance.json<\/code><\/p>\n<\/blockquote>\n<figure class=\"bordered full-width\"><figcaption>\u0424\u0430\u0439\u043b: balance.json<\/figcaption><\/figure>\n<h2>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c:<\/h2>\n<ul>\n<li>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430 <code>PUBKEY (HEX)<\/code> \u0432 \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441 <code>(Base58)<\/code><\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u0411\u0438\u0442\u043a\u043e\u0439\u043d \u0410\u0434\u0440\u0435\u0441\u0430 (Base58) \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u043e\u043d\u0435\u0442 \u0411\u0438\u0442\u043a\u043e\u0438\u043d\u0430<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u0434\u043b\u044f \u043a\u0440\u0438\u043f\u0442\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:\u00a0<\/strong><a href=\"https:\/\/github.com\/demining\/CryptoDeepTools\/tree\/main\/03CheckBitcoinAddressBalance\" rel=\"noopener noreferrer nofollow\"><strong>https:\/\/github.com\/demining\/CryptoDeepTools\/tree\/main\/03CheckBitcoinAddressBalance<\/strong><\/a><\/p>\n<p><strong>Telegram:\u00a0<\/strong><a href=\"https:\/\/t.me\/cryptodeeptech\" rel=\"noopener noreferrer nofollow\"><strong>https:\/\/t.me\/cryptodeeptech<\/strong><\/a><\/p>\n<p><strong>\u0412\u0438\u0434\u0435\u043e\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b: <\/strong><a href=\"https:\/\/youtu.be\/Hsk6QIzb7oY\" rel=\"noopener noreferrer nofollow\"><strong>https:\/\/youtu.be\/Hsk6QIzb7oY<\/strong><\/a>  <\/p>\n<hr\/>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/62c1f79d152da45a6ba2980c\" data-style=\"\" id=\"62c1f79d152da45a6ba2980c\" width=\"\"><\/div>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/674812\/\"> https:\/\/habr.com\/ru\/post\/674812\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-335272","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335272"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335272\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}