code: def verify_bitcoin(message, signature, address):
          
          magic_sig = base64.b64decode(signature)
  
          magic = magic_sig[0]
          sig = Signature.from_bytes(magic_sig[1:])
          sig.recovery_id = (magic - 27) & 0x3
          compressed = ((magic - 27) & 0x4) != 0
  
          # Build the message that was signed
          msg = b"\x18Bitcoin Signed Message:\n" + bytes([len(message)]) + message
          msg_hash = hashlib.sha256(msg).digest()
  
          derived_public_key = PublicKey.from_signature(msg_hash, sig)
          if derived_public_key is None:
              raise ValueError("Could not recover public key from the provided signature.")
  
          ver, h160 = address_to_key_hash(address)
          hash160 = derived_public_key.hash160(compressed)
          if hash160 != h160:
              return False
  
          return derived_public_key.verify(msg_hash, sig)
docs: Verifies a message signed using PrivateKey.sign_bitcoin()
          or any of the bitcoin utils (e.g. bitcoin-cli, bx, etc.)
  
          Args:
              message(bytes): The message that the signature corresponds to.
              signature (bytes or str): A Base64 encoded signature
              address (str): Base58Check encoded address.
  
          Returns:
              bool: True if the signature verified properly, False otherwise.