I'm trying to understand which assumption are necessary to prove the invariance of the spacetime interval $$\Delta s^2=c^2\Delta t^2-\Delta \mathbf{x}^2$$ in special relativity. The postulates of special relativity are:
Principle of relativity
speed of light is constant in every frame of reference
From the second postulate is evident that $$ds'^2=0 \iff ds^2=0.$$ Then from the answer Invariance of spacetime interval directly from postulate we may see how this, and the fact that the two infinitesimal are of the same order, leads to $$ds'^2=ads^2.$$ In some other answers (e.g.Proving invariance of $ds^2$ from the invariance of the speed of light) it is pointed out that $ds'^2=ads^2$ arises from the fact that my coordinate transformation is linear.
My question is: what is the assumption I use to prove $ds'^2=ads^2$? Do I need linearity and if so where do I use it? And what about the principle of relativity?