  This thesis extends a previously found relation between the integrable KdV
hierarchy and the boundary dynamics of pure gravity on AdS$_3$ described in the
highest weight gauge, to a more general class of integrable systems associated
to three-dimensional gravity on AdS$_3$ and higher spin gravity with gauge
group $SL(N,\mathbb{R})\times SL(N,\mathbb{R})$ in the diagonal gauge. We
present new sets of boundary conditions for the (higher spin) gravitational
theories on AdS$_3$, where the dynamics of the boundary degrees of freedom is
described by two independent left and right members of a hierarchy of
integrable equations. For the pure gravity case, the associated hierarchy
corresponds to the Gardner hierarchy, also known as the "mixed KdV-mKdV" one,
while for the case of higher spin gravity, they are identified with the
"modified Gelfand-Dickey" hierarchies. The complete integrable structure of the
hierarchies, i.e., the phase space, the Poisson brackets and the infinite
number of commuting conserved charges, are directly obtained from the
asymptotic structure and the conserved surface integrals in the gravitational
theories. Consequently, the corresponding Miura transformation is recovered
from a purely geometric construction in the bulk. Black hole solutions that fit
within our boundary conditions, the Hamiltonian reduction at the boundary and
more general thermodynamic ensembles called "Generalized Gibbs Ensemble" are
also discussed.
