  Backward stochastic differential equations extend the martingale
representation theorem to the nonlinear setting. This can be seen as
path-dependent counterpart of the extension from the heat equation to fully
nonlinear parabolic equations in the Markov setting. This paper extends such a
nonlinear representation to the context where the random variable of interest
is measurable with respect to the information at a finite stopping time. We
provide a complete wellposedness theory which covers the semilinear case
(backward SDE), the semilinear case with obstacle (reflected backward SDE), and
the fully nonlinear case (second order backward SDE).
