The confidence interval for a difference between two proportions for a large sample is constructed from the [[standard normal distribution]]. An approximate $100(1-\alpha)\%$ confidence interval is given by
$\hat p_1 - \hat p_2 \pm z_{\alpha/2} \sqrt{\frac{\hat p_1(1- \hat p_1)}{n_1} + \frac{\hat p_2(1- \hat p_2)}{n_2}}$
# construction
An estimator of the difference between proportions is $\hat p_1 - \hat p_2$. By the CLT, we know that
$\displaylines{
\hat p_1 \sim N(p_1, \ p_1(1-p_1)/n_1) \\
\hat p_2 \sim N(p_2, \ p_2(1-p_2)/n_2)
}$
For simplicity and due to the fact that we have large sample sizes, we replace each true variance
$\sigma_{\hat p_i} =\frac{p_i(1-p_i)}{n_i}$
with estimators
$\hat \sigma_{\hat p_i} = \frac{\hat p_i(1- \hat p_i)}{n_i}$
$\hat p_1 - \hat p_2$ is a [[linear combination of normal random variables]] and therefore has the distribution (assuming the two samples are independent)
$\hat p_1 - \hat p_2 \sim N \Big (p_1 - p_2, \frac{\hat p_1(1- \hat p_1)}{n_1} + \frac{\hat p_2(1- \hat p_2)}{n_2} \Big )$
To find the confidence interval at the relevant confidence level, let's say $90\%$, standardize to a [[standard normal distribution]] by subtracting the mean and dividing by the square root of the variance and then define the critical values that capture the true value with the desired probability.
$P(z_{\alpha/2} \le \frac{\hat p_1 - \hat p_2 - (p_1 - p_2)}{\sqrt{\frac{\hat p_1(1- \hat p_1)}{n_1} + \frac{\hat p_2(1- \hat p_2)}{n_2}}} \le z_{\alpha/2}) = 95\%$
Solving for $p_1 - p_2$ in the middle, we have our confidence interval.
$\hat p_1 - \hat p_2 \pm z_{\alpha/2} \sqrt{\frac{\hat p_1(1- \hat p_1)}{n_1} + \frac{\hat p_2(1- \hat p_2)}{n_2}}$