code: def address_to_scripthash(address: str) -> UInt160:
      
      AddressVersion = 23  # fixed at this point
      data = b58decode(address)
      if len(data) != 25:
          raise ValueError('Not correct Address, wrong length.')
      if data[0] != AddressVersion:
          raise ValueError('Not correct Coin Version')
  
      checksum_data = data[:21]
      checksum = hashlib.sha256(hashlib.sha256(checksum_data).digest()).digest()[:4]
      if checksum != data[21:]:
          raise Exception('Address format error')
      return UInt160(data=data[1:21])
docs: Just a helper method