def forge_block_header_data(protocol_data):
    """
    Returns a binary encoding for a dict of the form
    `{'block_header_data: string}`, as expected by the protocol.

    This corresponds to the encoding given by
    `data_encoding.(obj1 (req "block_header_data" string))`. See
    `lib_data_encoding/data_encoding.mli` for the spec.
    """
    assert len(protocol_data) == 1 and 'block_header_data' in protocol_data
    string = protocol_data['block_header_data']
    tag = '0000'
    padded_hex_len = f'{len(string):#06x}'[2:]
    return tag + padded_hex_len + bytes(string, 'utf-8').hex()