Skip to content

Instantly share code, notes, and snippets.

@paulmillr
paulmillr / active.md
Last active May 13, 2026 17:15
Most active GitHub users (by contributions). https://paulmillr.com

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@paulmillr
paulmillr / microgpt.py
Created February 14, 2026 23:02 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@paulmillr
paulmillr / guide.md
Last active January 18, 2026 18:57
Sign git commits with ssh key

Sign git commits with ssh key

  • git version must be >= 2.34. Earlier versions don't support gpg.format ssh (signing commits with ssh keys).

    If you're printing signature keys in git log by using %GK %GF %GP %GT in git.format.pretty, earlier versions will crash when doing git log with following error:

    BUG: gpg-interface.c:284: bad signature

  • OpenSSH version must be >= 8.8. Earlier versions don't support valid-after,valid-before options.

Paul Miller's explanation of endomorphism:


secp256k1 is Koblitz curve (e.g. Short Weierstrass curve with a=0).

Koblitz curves allow using efficiently-computable GLV endomorphism ψ:

  1. GLV endomorphism ψ transforms a point: P = (x, y) ↦ ψ(P) = (β·x mod p, y)
  2. GLV scalar decomposition transforms a scalar: k ≡ k₁ + k₂·λ (mod n)
@paulmillr
paulmillr / BLS_Signature.md
Last active August 26, 2025 00:42
BLS Signature for Busy People

BLS Signature for Busy People

bls12-381 is pairing-friendly Barreto-Lynn-Scott elliptic curve construction allowing to:

  • Construct zk-SNARKs at the ~120-bit security, as per Barbulescu-Duquesne 2017
  • Efficiently verify N aggregate signatures with 1 pairing and N ec additions: the Boneh-Lynn-Shacham signature scheme is orders of magnitude more efficient than Schnorr

BLS can mean 2 different things:

@paulmillr
paulmillr / github-languages-stats.json
Last active July 19, 2025 12:33
Most active GitHub users raw data
{
"Total": 910,
"my dms": 1,
"harbor is safe": 1,
"the Galaxy ": 1,
"Practice author": 1,
"Graph Representation Learning - rusty1s": 1,
"the PHP ecosystem": 1,
"software and to ensure that Python code is properly ported to Python 3": 1,
"Vienna - alanhamlett": 1,
@paulmillr
paulmillr / noble.py
Created April 25, 2025 18:04
noble.py
### noble-secp256k1.py - MIT License (c) Paul Miller (paulmillr.com) ###
# initial: 0.177 / 36ms
# jacobian: 0.111 / 3.7ms
# + constant-time: 4ms
# + constant-time + precomputes: 2.6ms
class Curve:
# Params: a, b
a = 0
@paulmillr
paulmillr / bookmarklet.js
Created March 23, 2025 17:35
download vscode extensions as .vsix
javascript:(function()%7Bconst%20URL_VSIX_PATTERN%20%3D%20'https%3A%2F%2Fmarketplace.visualstudio.com%2F_apis%2Fpublic%2Fgallery%2Fpublishers%2F%24%7Bpublisher%7D%2Fvsextensions%2F%24%7Bextension%7D%2F%24%7Bversion%7D%2Fvspackage'%3B%0A%0Alet%20itemName%20%3D%20new%20URL(window.location.href).searchParams.get('itemName')%3B%0Alet%20%5Bpublisher%2C%20extension%5D%20%3D%20itemName.split('.')%3B%0Alet%20version%20%3D%20document.querySelector('%23versionHistoryTab%20tbody%20tr%20.version-history-container-column').textContent%3B%0A%0Alet%20url%20%3D%20URL_VSIX_PATTERN.replace('%24%7Bpublisher%7D'%2C%20publisher)%0A%09%09%09%09%09%09%20%20.replace('%24%7Bextension%7D'%2C%20extension)%0A%09%09%09%09%09%09%20%20.replace('%24%7Bversion%7D'%2C%20version)%3B%0A%0Awindow.open(url%2C%20'_blank')%3B%7D)()%3B
// PART 1
// secp256k1 curve parameters. Verify using https://www.secg.org/sec2-v2.pdf
const P = 2n ** 256n - 0x1000003d1n; // curve's field prime
const N = 2n ** 256n - 0x14551231950b75fc4402da1732fc9bebfn; // curve (group) order
const CURVE = { P: P, n: N, a: 0n, b: 7n };
const err = (m = ''): never => {
throw new Error(m);
}; // error helper
const M = (a: bigint, b: bigint = P) => {
// mod division
@paulmillr
paulmillr / dart.md
Last active January 7, 2025 21:10
Leaked internal google dart email

---------- Forwarded message ----------

From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com