implement BSig engine v2