diff options
| author | Clawd <ai@clawd.bot> | 2026-02-19 20:26:44 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-19 20:26:44 -0800 |
| commit | e190cdb8fc96be0c571e3cbcc414e2feb7991ece (patch) | |
| tree | 3fa554168e03b01b74a2b60f92eb47afd8f43169 /PLAN.md | |
| parent | e0f87d3752edd792b7993d64622c216ebda225f4 (diff) | |
Rename PLAN to README
Diffstat (limited to 'PLAN.md')
| -rw-r--r-- | PLAN.md | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/PLAN.md b/PLAN.md deleted file mode 100644 index 445968a..0000000 --- a/PLAN.md +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | # secp256k1 from Scratch — Learning Plan | ||
| 2 | |||
| 3 | Building 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 | |||
| 51 | We'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 | |||
