  This paper is devoted to the study of solutions with critical regularity for
the two-dimensional Muskat equation. We prove that the Cauchy problem is
well-posed on the endpoint Sobolev space of $L^2$ functions with three-half
derivative in $L^2$. This result is optimal with respect to the scaling of the
equation. One well-known difficulty is that one cannot define a flow map such
that the lifespan is bounded from below on bounded subsets of this critical
Sobolev space. To overcome this, we estimate the solutions for a norm which
depends on the initial data themselves, using the weighted fractional
Laplacians introduced in our previous works. Our proof is the first in which a
null-type structure is identified for the Muskat equation, allowing to
compensate for the degeneracy of the parabolic behavior for large slopes.
