aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md70
1 files changed, 70 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..445968a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,70 @@
1# secp256k1 from Scratch — Learning Plan
2
3Building ECDSA on secp256k1 in Go, from first principles.
4
5**Goal:** Understand the math deeply, not just copy formulas. End with a working (non-production) implementation.
6
7---
8
9## Progress
10
11### Part 1: Foundations
12- [x] **Modular arithmetic** — clock math, remainders, finite sets
13- [x] **Modular division/inverses** — finding multiplicative inverses
14- [x] **What is an elliptic curve** — y² = x³ + 7, points as (x, y) pairs
15
16### Part 2: Curve Operations
17- [ ] **Point addition** — adding two points geometrically and algebraically
18- [ ] **Point doubling** — special case when adding a point to itself
19- [ ] **The point at infinity** — identity element (like zero for addition)
20- [ ] **Scalar multiplication** — multiplying a point by an integer (repeated addition)
21
22### Part 3: Key Pairs
23- [ ] **Generator point G** — the "starting point" everyone uses
24- [ ] **Private key** — just a random big number
25- [ ] **Public key** — private key × G (scalar multiplication)
26- [ ] **Why it's hard to reverse** — the discrete log problem
27
28### Part 4: ECDSA Signing
29- [ ] **What a signature proves** — "I know the private key for this public key"
30- [ ] **The signing algorithm** — k, r, s explained
31- [ ] **Why random k matters** — reuse = leaked private key
32
33### Part 5: ECDSA Verification
34- [ ] **The verification equation** — checking without knowing the private key
35- [ ] **Putting it together** — sign and verify a message
36
37### Part 6: Implementation
38- [ ] **Field element type** — big.Int wrapper with mod p
39- [ ] **Point type** — x, y coordinates + infinity
40- [ ] **Point addition/doubling** — the core math
41- [ ] **Scalar multiplication** — double-and-add algorithm
42- [ ] **ECDSA sign/verify** — the full flow
43- [ ] **Test against known vectors** — verify correctness
44
45---
46
47## Code Location
48
49`/home/ai/vault/projects/secp256k1-learn/`
50
51We'll build incrementally:
52- `field.go` — modular arithmetic
53- `point.go` — curve points and operations
54- `ecdsa.go` — signing and verification
55- `main.go` — demo/test harness
56
57---
58
59## Resources
60
61- secp256k1 parameters: p, n, G coordinates
62- Test vectors from Bitcoin/Nostr for verification
63- No external crypto libraries (that's the point)
64
65---
66
67## Notes
68
69*Add observations, "aha" moments, or questions here as we go.*
70