  We show that, if $b\in L^1(0,T;L^1_{\mathrm{loc}}(\mathbb{R}))$ has spatial
derivative in the John-Nirenberg space $\mathrm{BMO}(\mathbb{R})$, then it
generalizes a unique flow $\phi(t,\cdot)$ which has an $A_\infty(\mathbb R)$
density for each time $t\in [0,T]$. Our condition on the map $b$ is optimal and
we also get a sharp quantitative estimate for the density. As a natural
application we establish a well-posedness for the Cauchy problem of the
transport equation in $\mathrm{BMO}(\mathbb R)$.
