This Tornado-based HTTP API verifies matrix multiplication proofs using Freivalds' algorithm and spot-checking rows. Float vectors and matrices are transmitted in Base64 form (raw bytes of the underlying float array).
Requests must be signed with a private key that corresponds to the ALLOWED_ADDRESS
environment variable.
Creates a new session, generates a pair of deterministic matrices
- A UUID-based
session_id
- The square matrix dimension
n
- A 16-byte
master_seed
(hex-encoded) for deterministic row generation.
{
"n": 16384 // optional; default is 16384
}
{
"session_id": "some-uuid",
"n": 16384,
"master_seed": "abcd1234..." // hex-encoded
}
After instructing the prover to set
{
"session_id": "some-uuid",
"commitment_root": "abcdef..." // hex-encoded
}
{
"challenge_vector": "base64-of-float-array"
}
The challenge_vector
is a Base64-encoded float array, serialized in the same format used internally (e.g. 32-bit floats).
Sends the vector
{
"session_id": "some-uuid",
"Cr": "base64-of-float-array"
}
Cr
is the Base64-encoded result of
{
"freivalds_ok": true,
"spot_rows": [12, 999, ...]
}
If freivalds_ok
is false, the spot rows list is empty.
Performs a final spot-check on multiple rows. Each row’s content is Merkle-verified and numerically compared.
{
"session_id": "some-uuid",
"rows": [
{
"row_idx": 5,
"row_data": "base64-of-float-array",
"merkle_path": ["abcd...", "1234...", ...] // list of hex-encoded siblings
},
...
]
}
-
row_data
is the Base64-encoded row of$(C)$ atrow_idx
.
{
"all_passed": true,
"results": [
{
"row_idx": 5,
"pass": true
},
...
]
}
If all_passed
is false, at least one row failed verification. The session is freed after this call.
Manually deletes a session prior to its completion or timeout, if the completion is no longer needed.
{
"session_id": "some-uuid",
}
{
"status": "ok"
}
If the session does not exist, this call will return a 500
error.
This Tornado-based HTTP API manages a prover’s side of matrix multiplication verification. It deterministically constructs matrices
Generates matrices
{
"n": 16384,
"seed": "abcd1234..." // hex-encoded 16-byte seed
}
{
"status": "ok"
}
On success, the product
Returns the Merkle root of
{
"commitment_root": "abcdef..." // hex-encoded
}
Computes r
is provided in Base64 form (raw bytes of the underlying float array).
{
"r": "base64-of-float-array"
}
{
"Cr": "base64-of-float-array"
}
The result is a Base64-encoded float array of length
Given a list of row indices, returns the corresponding rows of
{
"row_idxs": [12, 999, ...]
}
{
"rows": [
{
"row_idx": 12,
"row_data": "base64-of-float-array", // The entire row's bytes
"merkle_path": ["abcd...", "1234...", ...] // hex-encoded list of siblings
},
...
]
}
The row_data
field is Base64-encoded raw bytes of the float array for row row_idx
. The merkle_path
is a list of hexadecimal-encoded sibling hashes proving that row’s membership under the commitment_root
.