What is the algorithm used for phong shading normal interpolation? Let's suppose we have an object consisting of only 3d points, and triangle faces that each take a subset of these 3d points. How can I interpolate the normal vectors to get that Phong smooth shading? The actual algorithm seems impossible to find yet everybody is doing it.

There is one post on here, but I still have no idea how to implement it: Normal Interpolation for Phong shading

Also, it seems wrong to me that this supposed formula only takes in account two normals. What if you have a triangle surrounded by 3 other triangles? Then how do you blend the normals?
EDIT: I misunderstood your question, so please disregard this answer.

The Phong shading model assumes a surface normal $\mathbf{n}$ at the shading point $\mathbf{x}$ but it is independent of its type, so either the shading normal or the geometric normal will work. Moreover, this reflectance model requires an incoming and outgoing directions. In that sense, you can't just "interpolate the normals" to get the desired effect since you need to take into account the positions of the camera and the light, as well as the roughness parameters.

The (normalized) Phong BRDF is a sum of a diffuse and specular term:

$$
f_r(\mathbf{x},\omega_i,\omega_o) = \frac{\rho_d}{\pi} + \rho_s \frac{n+2}{2\pi}\max(0,\cos^n\alpha),
$$
where


$\rho_d$ is the diffuse albedo, i.e. the fraction of the incoming energy that is reflected diffusely,
$\rho_s$ is the specular albedo, i.e. the fraction of the incoming energy that is reflected specularly,
$n$ is the Phong exponent; higher values yield more mirror-like specular reflection, and
$\alpha$ is the angle between the perfect specular reflection direction $\omega_r$ and the outgoing direction $\omega_o$.


You can compute $\omega_r$ from the surface normal $\mathbf{n}$ and the lighting direction $\omega_i$, which is just

$$
\omega_r = 2\mathbf{n}(\mathbf{n}\cdot\omega_i) - \omega_i.
$$

Typically you pick the albedos such that $\rho_d + \rho_s \leqslant 1$ to conserve energy.