INVERSE BOUNDARY VALUE PROBLEMS WITH UNKNOWN BOUNDARIES: OPTIMAL STABILITY