Rusting of an Iron nail at oil water boundary surface
According to your description, this looks like localized corrosion. Due to differences in the availability of oxygen in the solution, the two half-reactions of the redox process take place on different areas of the surface of the corroding metal. The oxygen reduction reaction preferably takes place on the nail surface in the medium with higher concentration of dissolved $\ce{O2}$ (water).

$$\ce{O2 + 4e- + 2H2O -&gt; 4 OH-}$$

The metal dissolution (oxidation) is then limited to the more oxygen-starved surface area, which is presumably right at the the phase border, where consequently the deposit of corrosion products is formed.

\begin{aligned}
\ce{Fe &amp;-&gt;~ Fe^2+ + 2e-}\\
\ce{Fe^2+ + 2OH- &amp;-&gt;~ Fe(OH)2 \rightleftharpoons FeO + H2O}\\
\end{aligned}

Since these two half-reactions are coupled, the amount of corrosion products formed depends on the oxygen concentration. When there is sufficiently dissolved oxygen available, $\ce{Fe^2+}$ is easily oxidized by to $\ce{Fe^3+}$, and thus the final product, which is commonly called rust, is a mixture of more or less hydrated iron(III) oxides and hydroxides.

$$\ce{Fe^3+ + 3OH- -&gt; Fe(OH)3 \rightleftharpoons FeO(OH) + H2O}$$
$$\ce{2FeO(OH) \rightleftharpoons Fe2O3 + H2O}$$