  This paper solves the $L^2$ version of Maz'ya's open problem (Integral
Equations Operator Theory 2018) on the sharp uncertainty principle inequality
\[\int_{\mathbb{R}^N}|\nabla {\bf\it u}|^2dx\int_{\mathbb{R}^N}|{\bf\it
u}|^2|{\bf\it x}|^2dx\ge C_N\left(\int_{\mathbb{R}^N}|{\bf\it
u}|^2dx\right)^2\] for solenoidal (namely divergence-free) vector fields
${\bf\it u}={\bf\it u}({\bf\it x})$ on $\mathbb{R}^N$. The best value of the
constant turns out to be $C_N=\frac{1}{4}\left(\sqrt{N^2-4(N-3)}+2\right)^2$
which exceeds the original value $N^2/4$ for unconstrained fields. Moreover, we
show the attainability of $C_N$ and specify the profiles of the extremal
solenoidal fields: for $N\ge4$, the extremals are proportional to a poloidal
field that is axisymmetric and unique up to the axis of symmetry; for $N=3$,
there additionally exist extremal toroidal fields.
