Guide
CLI
The curves command runs both tools from a terminal and prints the same JSON a model gets
Two commands and a server
npx @agntn/curves compute log --a 2 --b 2 --p 17 --point 5,1 --other 16,4
{
"operation": "log",
"order": "19",
"scalar": "13"
}
From here on it's plain curves. In a project that means pnpm exec curves. Or pnpm add -g @agntn/curves once.
| Command | Does |
|---|---|
curves compute <operation> | add, double, negate, multiply, check, order, count, points, log on a curve you give |
curves secp256k1 <operation> | add, subtract, negate, multiply, lift, check on secp256k1 |
curves mcp | the MCP server over stdio |
Points and numbers
compute takes points as x,y. Integers are decimal or 0x hex. Negative a? --a -3 works, and so does --a=-3. It's reduced mod p anyway.
curves compute multiply --a 2 --b 2 --p 17 --point 5,1 --scalar -2
{
"operation": "multiply",
"point": {
"x": "6",
"y": "14"
}
}
secp256k1 takes SEC1 hex, compressed or not. --uncompressed writes 65 bytes instead of 33.
curves secp256k1 lift --x 79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
When it says no
A refusal is one line on stderr and exit code 1. No stack trace.
curves secp256k1 subtract --point 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 --other 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
The result is the point at infinity, which is no public key, as with P minus P
An option the operation doesn't take is refused too. count with a --scalar? It says so instead of quietly ignoring it. curves <command> --help lists every flag.