construct unique_id and root_id from specified key