def update_user(self, username, profile, owner_privkey):
        """
            Update profile_hash on blockchain
        """

        url = self.base_url + "/users/" + username + "/update"

        owner_pubkey = get_pubkey_from_privkey(owner_privkey)

        payload = {
            'profile': profile,
            'owner_pubkey': owner_pubkey
            }

        resp = self._post_request(url, payload)

        try:
            unsigned_tx = resp['unsigned_tx']
        except:
            return resp

        dht_resp = write_dht_profile(profile)
        dht_resp = dht_resp[0]

        if not dht_resp['status'] == 'success':
            return {"error": "DHT write failed"}

        # sign all unsigned inputs
        signed_tx = sign_all_unsigned_inputs(owner_privkey, unsigned_tx)

        return self.broadcast_transaction(signed_tx)
Update profile_hash on blockchain