Class Groups: A Comprehensive Primer
In 2018, Benedikt Bunz and Ben Fisch, both PhD students at Stanford University, released a paper along with Dan Boneh titled “Batching Techniques for Accumulators with Applications to IOPs and Stateless Blockchains”. In it they use some basic group theory to build a dynamic accumulator, which allows for storing and deleting elements in addition to the use of both membership and non-membership proofs. It can be used to create a vector commitment data structure analogous to Merkle trees, with the main difference being that it allows for constant-sized inclusion proofs, where a Merkle tree has
One of the main security assumptions their construction uses is that it relies on a group of unknown order. In particular the strong RSA assumption must hold, meaning it is hard to compute a chosen root of a random group element. There are two good candidates for such a group. The simpler of the two is known as an RSA group, or a multiplicative group of order
Class groups come from a long line of mathematical research, and were originally discovered by Gauss in his Disquisitiones Arithmeticae in 1801. The math that’s been developed on top of his work in the past two centuries involves some decently complex algebra. I’ll explain most of the concepts used but will expect that you know what groups, rings, fields, homomorphisms, and isomorphisms are in an algebraic context. Feel free to look them up if not.
This post is meant to be an introduction to what a class group is and to summarize the most important results to consider when implementing them as a group of unknown order; detailed proofs can be found in the list of further readings below.
What is a class group?
There are two equivalent ways to understand the class group which are isomorphic to one another. One coming from a subfield of mathematics known as algebraic number theory is known as the ideal class group, which is the quotient of fractional ideals by fractional principal ideals
by working with an equivalence relation over forms which all have the same discriminant
These two views are actually pretty different; it’s not at all obvious that they represent the same object! Either is paramaterized by its integer discriminant
- What discriminant should be chosen
- How to represent the group in a numerical setting
- What algorithms should be used when performing the group operation
The ideal class group makes it easier to understand how and why a particular form of discriminant should be chosen. As we will see, we want the discriminant to be the negation of a prime congruent to 3 mod 4, or
Ideal Class Group
In basic field theory there is the concept of a field extension, or a field containing another field as a subfield. The degree of an extension is the size of the larger field’s basis over the smaller base field. An example of this is the complex numbers
Similarly, we can construct generalizations of the rational numbers by adding in
Once we have our quadratic extension
where
Something that would help us to understand
Because every ring is an abelian group under addition, every ring is a
where
What are the possible
for some
To define the discriminant of a finite extension
where the notation above means we take the square of the determinant of the given matrix.
For our case where
Given these embeddings and the
We’re almost ready to construct the class group itself! To do so we’ll need the concept of an ideal, which is an additive subgroup of a ring with an additional multiplicative “absorption” property. Specifically if we have an ideal
For any
We can generalize the concept of an ideal of a ring to get the idea of a fractional ideal. Intuitively a fractional ideal
As an example
For any two ideals or fractional ideals
Since ideals are closed under addition, this gives the smallest ideal containing every element of both
A fractional ideal
Finally we need one more concept from group theory known as a quotient group. While I won’t define it formally here, a basic example is given by
Let
There are two extreme cases we can consider here. If
The order or number of elements of
Form Class Group
Next we will discuss the form class group, and see how it is related to the ideal class group. The form class group was originally discovered in the study of binary quadratic forms, or functions of the form
where
All binary quadratic forms in a given form class group have the same discriminant, given by
A form represents an integer
The form class group is made up of equivalence classes of forms, or sets of forms considered to be equivalent. This is similar to how, when doing arithmetic mod 3, the symbol 1 represents the set of all integers congruent to 1 (mod 3). We say that two forms
In order to be a valid group, we need a group operation
We mentioned above the the ideal class group with discriminant
As the form class group is composed of equivalence classes of forms, it would also be good if we could reduce any form of an equivalence class down to one unique element. Since we also want to represent elements
We can break down the reduction operation into two pieces; a “normalization” operation and a “reduction” operation, with the requirement that a form must be normalized before it is reduced.
A form
where
When we normalize a form
Two forms
This is actually only partially true, as we can relax the second requirement to be
The “correct” form of equivalence mentioned above gives us an action of
with det
With this is mind, we can show that
Once we’ve normalized a form, we can then reduce it to obtain its unique reduced equivalent form. A form
We can define a reduction operation as
where
Similar to normalized forms, we can see that a reduced form
How do we know reduced elements are relatively small? If
Because in a reduced form
There is also a reasonable upper bound on the number of reduction steps required, given by
The group operation itself, known as “form composition”, is a bit complicated. The basic idea is that, given two forms
Let LinCong
- Set
, , $w ← (a, α, g)$ - Set
, , , - Set $(μ, ν) ←
(tu, hu + sc, st)$ - Set $(λ, ρ) ←
(tv, h - tμ, s)$ - Set
, , . - Return
.
In practice it’s best to always reduce the result
In order to be a group operation forms under composition must have an identity element. If
For any form
We’re now done constructing the form class group! We have a group operation, a way to get a unique representative element from each equivalence class of forms, an identity, and inverses.
There is one very important optimization we can do. Above we mentioned that we want to choose the negation of a prime
This, in addition to the fact that
- Set
LinCong - Return
.
This is a big deal for efficiency, since we can compute exponentiation using repeated squaring.
Isomorphism
Going back to the ideal class group, there is another construction equivalent to the quotient group
Ideal and form class groups are isomorphic when the discriminant
We need just a few more tools before defining the isomorphism itself. If
In our case where
Next, if
As their names and notation suggests, the field and absolute norms are related. If an ideal
The isomorphism between ideal and form class groups is as follows. If
with inverse
where
where for some element of a ring of integers
If
Solved and Open Conjectures
We’ll conclude with a handful of conjectures made in some form by Gauss in 1801 which show further why we want to use a negative discriminant:
- The class number of the ideal class group of
converges to infinity as . - There are exactly 13 negative discriminants having a class number of 1, in particular -3, -4, -7, -8, -11, -12, -16, -19, -27, -28, -43, -67, -163.
- There are infinitely many positive discriminants associated with class groups having a class number of 1.
The first was proven in 1934 by Hans Heilbronn, the second in 1967 by Heegner, Stark and Baker. The third remains open.
Further Reading
- The Chia VDF Competition exposition of class groups is an excellent overview on how to implement the group numerically. The form class group algorithms above on normalization, reduction, and composition in particular were taken from here.
- A Survey on IQ Cryptography by Johannes Buchmann and Safuat Hamdy is a great survey from 2001 of cryptography using class groups of imaginary quadratic order.
- A Course in Computational Algebraic Number Theory by Henry Cohen is a well-written and comprehensive textbook on algorithms fundamental to algebraic number theory.
- The Structure of the Class Group of Imaginary Quadratic Fields by Nicole Miller and The Correspondence Between Binary Quadratic Forms and Quadratic Fields by Corentin Perret-Gentil are both good proof-focused introductions to the ideal and form class groups and their correspondence.