Support sorted pubkeys in redemption script