  Robust Gray codes were introduced by (Lolck and Pagh, SODA 2024). Informally,
a robust Gray code is a (binary) Gray code $\mathcal{G}$ so that, given a noisy
version of the encoding $\mathcal{G}(j)$ of an integer $j$, one can recover
$\hat{j}$ that is close to $j$ (with high probability over the noise). Such
codes have found applications in differential privacy.
  In this work, we present near-optimal constructions of robust Gray codes. In
more detail, we construct a Gray code $\mathcal{G}$ of rate $1 - H_2(p) -
\varepsilon$ that is efficiently encodable, and that is robust in the following
sense. Supposed that $\mathcal{G}(j)$ is passed through the binary symmetric
channel $\text{BSC}_p$ with cross-over probability $p$, to obtain $x$. We
present an efficient decoding algorithm that, given $x$, returns an estimate
$\hat{j}$ so that $|j - \hat{j}|$ is small with high probability.
