# Basic Architecture of an ECC library

This post will be short, as I do not go into any fruitful detail. I use this to take a view of the forest, so that we do not get lost in the trees.

## Layer 1

The first layer of an elliptic curve library is the Finite Field. This layer is solely designed to perform arithmetic modulo some prime p. $F_p$

## Layer 2

This second layer is the Elliptic Curve Layer. This layer is instantiated with a Finite Field and is usually denoted $E(F_p)$. The resulting object is a Group.

## Layer 3

Layer 3 is another Finite Field. It is known as the Scalar Field and is instantiated with an Elliptic Curve Group $E(F_p)$.

## Layer 4

Layer 4 is a group of methods for Scalar Multiplication. This layer requires Layer 2 and Layer 3.

## Layer 5

This layer is the most changing because it is the protocol layer. Things I would put into this layer are ECDH, Schnorr and other high level protocols. Without loss of too much generality, it is advisable to design your ECC library so that Layer 5 only needs to directly communicate with Layer 3 and 4.

### What does this have to do with Zero knowledge Proofs?

Conventionally most protocols you see, do not explicitly require Elliptic Curve Cryptography. What you are more likely to see is a request for a Group with certain properties. Another way to think of this is that, protocols ask for generic requirements and whomever can satisfy those requirements can be used. We do not need to use ECC, we could in turn use Lattice based crypto as long as the abstract requirements set out by the protocol are met.

I find it is often helpful to draw these separations and abstractions between different cryptographic areas, as it helps with both implementing and understanding how the system behaves as a whole.