Skip to content

Instantly share code, notes, and snippets.

View nlitsme's full-sized avatar

willem nlitsme

View GitHub Profile
@nlitsme
nlitsme / curve_example.py
Last active January 19, 2025 10:14
example of bitcoin curve calculations in python
from __future__ import print_function, division
"""
Example of how calculations on the secp256k1 curve work.
secp256k1 is the name of the elliptic curve used by bitcoin
see http://bitcoin.stackexchange.com/questions/25382
"""
## the prime modules used in the elliptic curve coordinate calculations
p = 2**256 - 2**32 - 977