<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_if_branch_exist(db, root_hash, key_prefix):
 """ Given a key prefix, return whether this prefix is the prefix of an existing key in the trie. """

    validate_is_bytes(key_prefix)

    return _check_if_branch_exist(db, root_hash, encode_to_bin(key_prefix))