🔮
Roll your own crypto
  • 🗞️Roll your own crypto* 🔮
  • 👩‍🏫Introduction to ECC
  • 🕓Galois Fields
  • ➰Elliptic Curve in Python
  • 🎯Representing a point
  • ➰Group Theory
  • ➕Point Addition in Python
  • ✖️Scalar Multiplication in Python
  • 🖋️ECDSA
  • 🎮Quiz: The Playstation 3 Hack
  • ❤️Conclusion
Powered by GitBook
On this page

Was this helpful?

Group Theory

PreviousRepresenting a pointNextPoint Addition in Python

Last updated 1 year ago

Was this helpful?

A group is a set of elements Z={a,b,c,...}Z = \{a, b, c, ...\}Z={a,b,c,...} and one binary operator +++ that satisfies the following axioms:

  • Closure: for anya,b∈Za,b ∈ Za,b∈Z, the element a+ba + ba+b is in ZZZ .

  • Associativity: for any a,b,c∈Za,b,c ∈ Za,b,c∈Z, (a+b)+c=a+(b+c)(a + b) + c = a + (b + c)(a+b)+c=a+(b+c).

  • Identity: a+I=aa + I = aa+I=a , for all a∈Za ∈ Za∈Z.

  • Invertibility: a+(−a)=Ia + (-a) = Ia+(−a)=I, for all a∈Za ∈ Za∈Z.

In addition to the above properties, if a group exhibits the commutative property of a+b=b+aa + b = b + aa+b=b+a, it is called an abelian group.

The elliptic curve used in Bitcoin is actually a mathematical group, that is finite, cyclic, abelian, and has a single-generator point, defined over the binary addition operator. These properties form the bedrock for an efficient signature and verification mechanism in Bitcoin.

A single-generator group contains an element G∈ZG ∈ ZG∈Z, called the generator point, such that repeated additions of GGG with itself can generate every element in ZZZ.

In fact, in prime order elliptic curves, any point can be a generator point.

Z={G,2G,3G,4G,...}Z = \{G, 2G, 3G, 4G, ...\}Z={G,2G,3G,4G,...}

Additionally, our group is cyclic, which means it has an order nnn, such that nG=InG = InG=I.

Let us now represent the generator point GGGin Python, used in Bitcoin.

# Generator point of the abelian group used in Bitcoin
G = Point(
    x=0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,
    y=0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8,
    curve=secp256k1
)

# Order of the group generated by G, such that nG = I
N = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141

Resources

➰
https://web.stanford.edu/class/ee392d/Chap7.pdf