API Reference
zkToolkit API
API reference for cryptographic primitives
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API reference for cryptographic primitives
POST /api/zk-toolkit/hash/poseidon
{
"input": "hello world"
}
{
"success": true,
"data": {
"hash": "0x1234567890abcdef..."
}
}
POST /api/zk-toolkit/hash/pedersen
POST /api/zk-toolkit/hash/mimc
{
"input": "data",
"key": "optional_key"
}
POST /api/zk-toolkit/field/add
{
"a": "5",
"b": "7"
}
{
"success": true,
"data": {
"result": "12"
}
}
POST /api/zk-toolkit/field/sub
POST /api/zk-toolkit/field/mul
POST /api/zk-toolkit/field/div
POST /api/zk-toolkit/field/inv
{
"a": "5"
}
POST /api/zk-toolkit/field/pow
{
"base": "2",
"exp": "256"
}
POST /api/zk-toolkit/field/sqrt
GET /api/zk-toolkit/field/random
GET /api/zk-toolkit/field/prime
GET /api/zk-toolkit/ec/base
{
"success": true,
"data": {
"x": "5299619240641551281634865583518297030282874472190772894086521144482721001553",
"y": "16950150798460657717958625567821834550301663161624707787222815936182638968203"
}
}
POST /api/zk-toolkit/ec/mulbase
{
"scalar": "12345"
}
{
"success": true,
"data": {
"x": "123...",
"y": "456..."
}
}
POST /api/zk-toolkit/ec/add
{
"p1": { "x": "...", "y": "..." },
"p2": { "x": "...", "y": "..." }
}
POST /api/zk-toolkit/ec/mul
{
"point": { "x": "...", "y": "..." },
"scalar": "12345"
}
POST /api/zk-toolkit/ec/isoncurve
{
"x": "...",
"y": "..."
}
GET /api/zk-toolkit/ec/params
POST /api/zk-toolkit/shamir/split
{
"secret": "42",
"threshold": 3,
"shares": 5
}
{
"success": true,
"data": {
"shares": [
"1:1234567890",
"2:2345678901",
"3:3456789012",
"4:4567890123",
"5:5678901234"
],
"threshold": 3,
"total": 5
}
}
POST /api/zk-toolkit/shamir/combine
{
"shares": [
"1:1234567890",
"2:2345678901",
"3:3456789012"
]
}
{
"success": true,
"data": {
"secret": "42"
}
}
POST /api/zk-toolkit/proof/generate
{
"inputs": {
"a": "5",
"b": "7"
}
}
{
"success": true,
"data": {
"proof": {
"pi_a": [...],
"pi_b": [...],
"pi_c": [...],
"protocol": "groth16"
},
"publicSignals": ["12"]
}
}
POST /api/zk-toolkit/proof/verify
{
"proof": { ... },
"publicSignals": ["12"]
}
GET /api/zk-toolkit/proof/circuits
| Code | Description |
|---|---|
INVALID_INPUT | Invalid input format |
FIELD_OVERFLOW | Value exceeds field prime |
NOT_ON_CURVE | Point not on Baby JubJub curve |
PROOF_FAILED | Proof generation/verification failed |
INVALID_SHARES | Invalid or insufficient shares |