Let $X= \mathbb{P}^1 \setminus \{0,1,\infty \}$, and let $S$ denote a finite set of prime numbers. In an article of 2005, Minhyong Kim gave a new proof of Siegel's theorem for $X$: the set $X(\mathbb{Z}[S^{-1}])$ of $S$-integral points of $X$ is finite. The proof relies on a `nonabelian' version of the classical Chabauty method. At its heart is a modular interpretation of unipotent $p$-adic Hodge theory, given by a tower of morphisms $h_n$ between certain $\mathbb{Q}_p$-varieties. We set out to obtain a better understanding of $h_2$. Its mysterious piece is a polynomial in $2|S|$ variables. Our main theorem states that this polynomial is quadratic, and gives a procedure for writing its coefficients in terms of $p$-adic logarithms and dilogarithms.