The understanding of transition in shear flows has recently progressed along new paradigms based on the central role of coherent flow structures and their nonlinear interactions. We follow such paradigms to identify, by means of a nonlinear optimization of the energy growth at short time, the initial perturbation which most easily induces transition in a boundary layer. Moreover, a bisection procedure has been used to identify localized flow structures living on the edge of chaos, found to be populated by hairpin vortices and streaks. Such an edge structure appears to act as a relative attractor for the trajectory of the laminar base state perturbed by the initial finite-amplitude disturbances, mediating the route to turbulence of the flow, via the triggering of a regeneration cycle of and hairpin structures at different space and time scales. These findings introduce a new, purely nonlinear scenario of transition in a boundary-layer flow.