reference implementation v4