  We consider the gravity water waves system with a periodic one-dimensional
interface in infinite depth, and prove a rigorous reduction of these equations
to Birkhoff normal form up to degree four. This proves a conjecture of
Zakharov-Dyachenko [55] suggested by the formal Birkhoff integrability of the
water waves Hamiltonian truncated at order four. As a consequence, we also
obtain a long-time stability result: periodic perturbations of a flat interface
that are of size $\varepsilon$ in a sufficiently smooth Sobolev space lead to
solutions that remain regular and small up to times of order
$\varepsilon^{-3}$. This time scale is expected to be optimal. Main
difficulties in the proof are the presence of non-trivial resonant four-waves
interactions, the so-called Benjamin-Feir resonances, the small divisors
arising from near-resonances and the quasilinear nature of the equations. Some
of the main ingredients that we use are: (1) a reduction procedure to constant
coefficient operators up to smoothing remainders, that, together with the
verification of key algebraic cancellations of the system, implies the
integrability of the equations at non-negative orders; (2) a
Poincar\'e-Birkhoff normal form of the smoothing remainders that deals with
near-resonances; (3) an a priori algebraic identification argument of the above
Poincar\'e- Birkhoff normal form equations with the formal Hamiltonian
computations of [55, 19, 27, 17], that allows us to handle the Benjamin-Feir
resonances.
