The Goldilocks Field

The field of prime order:

p=264232+1p = 2^{64} - 2^{32} + 1

has some nice properties for ZK proofs, notably STARKs.

The order of Fp\mathbb{F}_p^* is p1p - 1, which is equal to:

264232=2323517257655372^{64} - 2^{32} = 2^{32} \cdot 3 \cdot 5 \cdot 17 \cdot 257 \cdot 65537

This means that the field has a 2322^{32}th root of unity, which is very useful.

Fp\mathbb{F}_p^* is generated by:

g=7g = 7

And taking g(p1)/232g^{(p - 1) / 2^{32}} gives us our root of unity:

ω=0x185629dcda58878c\omega = \texttt{0x185629dcda58878c}

Extensions

x2+7x^2 + 7 is an irreducible polynomial of degree 2 in Fp[x]\mathbb{F}_p[x]

x3+3x^3 + 3 is an irreducible polynomial of degree 3 in Fp[x]\mathbb{F}_p[x]

We can use these to define GF(p2)\text{GF}(p^2) and GF(p3)\text{GF}(p^3), respectively, giving us fields of size 128\text{128} and 192\text{192} bits.

Addendum

Shotouts to @mjos_crypto for finding a smaller root of unity:

ω=20033703337\omega = 20033703337

(https://twitter.com/mjos_crypto/status/1565438293717786625)