encode referenced event with hash