5. Let $\left\{a_{n}\right\}$ be a positive geometric sequence with the sum of the first $n$ terms denoted as $S_{n}$, and
$$
2^{10} S_{30}+S_{10}=\left(2^{10}+1\right) S_{20} .
$$

Then the common ratio of the sequence $\left\{a_{n}\right\}$ is ( ).
(A) $\frac{1}{8}$
(B) $\frac{1}{4}$
(C) $\frac{1}{2}$
(D) 1
5. C.

From the given information,
$$
\begin{array}{l}
S_{20}-S_{10}=2^{10}\left(S_{30}-S_{20}\right) \\
\Rightarrow \frac{S_{30}-S_{20}}{S_{20}-S_{10}}=2^{-10}=q^{10} .
\end{array}
$$

Since $a_{n}>0$, we have $q=\frac{1}{2}$.