Public Keys, Private Keys, Signature, Verification.
Python Implementation of basic crypto.
Testing cryptographic primitives.
Functional test framework.
Note: Drop your PR and review related questions below
Summary
This PR redefines the cryptographic primitives used in the Bitcoin core's functional testing framework. And adds a new module in the python framework as secp256k1.py. This module includes all the cryptographic primitives. So the way to review this PR is to understand some fun basic crypto maths.
To start with, Cover the first 3 chapters of the Programming Bitcoin Book.
If you haven't done programming Bitcoin already, skim through the concepts and skip the exercises.
Bitcoin uses secp256k1 elliptic curve for all its cryptographic operations like key/address generation, digital signatures etc. See curve specifications for the full curve details.
class GE represents infinity explicitly. what is point at infinity in an elliptic curve? Why do we need this point? Where are regions in the code where we need to handle infinity scenarios properly?
What's a generator point in an elliptic curve?
Are there any downsides to rewriting the elliptic curve logic using fields/groups?
Session Details
[Crypto]
[python]
Learning
Functional test framework.
Summary
This PR redefines the cryptographic primitives used in the Bitcoin core's functional testing framework. And adds a new module in the python framework as
secp256k1.py
. This module includes all the cryptographic primitives. So the way to review this PR is to understand some fun basic crypto maths.To start with, Cover the first 3 chapters of the Programming Bitcoin Book. If you haven't done programming Bitcoin already, skim through the concepts and skip the exercises.
A free PDF is available here
Cover the below concepts from the book
Public Key and Private Key
Theory
Bitcoin uses
secp256k1
elliptic curve for all its cryptographic operations like key/address generation, digital signatures etc. See curve specifications for the full curve details.Mathematically:
group elements
.field elements
.field element
from which a curve point on the elliptic curve is generated.Generator Point
is a predefined point (group element
) on the elliptic curve, which is used to "generate" the public key, from the private key.Questions
In the questions below, GE = group element and FE = field element
class FE
for basic field element operations - addition, multiplication.class FE
.class GE
represents infinity explicitly. what is point at infinity in an elliptic curve? Why do we need this point? Where are regions in the code where we need to handle infinity scenarios properly?