def get_subdomain_ops_at_txid(txid, proxy=None, hostport=None):
    """
    Get the list of subdomain operations added by a txid
    Returns the list of operations ([{...}]) on success
    Returns {'error': ...} on failure
    """
    assert proxy or hostport, 'Need proxy or hostport'
    if proxy is None:
        proxy = connect_hostport(hostport)

    subdomain_ops_schema = {
        'type': 'object',
        'properties': {
            'subdomain_ops': {
                'type': 'array',
                'items': {
                    'type': 'object',
                    'properties': OP_HISTORY_SCHEMA['properties'],
                    'required': SUBDOMAIN_HISTORY_REQUIRED,
                },
            },
        },
        'required': ['subdomain_ops'],
    }

    schema = json_response_schema(subdomain_ops_schema)

    resp = {}
    try:
        resp = proxy.get_subdomain_ops_at_txid(txid)
        resp = json_validate(schema, resp)
        if json_is_error(resp):
            return resp

        # names must be valid
        for op in resp['subdomain_ops']:
            assert is_subdomain(str(op['fully_qualified_subdomain'])), ('Invalid subdomain "{}"'.format(op['fully_qualified_subdomain']))

    except ValidationError as ve:
        if BLOCKSTACK_DEBUG:
            log.exception(ve)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except AssertionError as e:
        if BLOCKSTACK_DEBUG:
            log.exception(e)

        resp = {'error': 'Server response included an invalid subdomain', 'http_status': 500}
        return resp

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    return resp['subdomain_ops']
Get the list of subdomain operations added by a txid
    Returns the list of operations ([{...}]) on success
    Returns {'error': ...} on failure