Prove API Methods
1. Request Log Proof
Endpoint: proof.testnet.polymer.zone
Method: POST
Request Header
Headers
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/json
Request Body
Request Proof payload
{
"jsonrpc": "2.0",
"id": 1,
"method": "polymer_requestProof",
"params": [{
"srcChainId": 11155420,
"srcBlockNumber": 26421705,
"globalLogIndex": 15
}]
}
Request Parameters
The parameters are now enclosed in a single object (instead of an array of separate values):
Parameter | Type | Description |
---|---|---|
srcChainId | int64 | Source chain ID where the event occurred |
srcBlockNumber | int64 | Block number on the source chain containing the event |
globalLogIndex | int64 | Index of the log in the block (as per standard API response) |
Response Body (Success)
Success Response
{
"jsonrpc": "2.0",
"id": 1,
"result": jobID
}
The response contains a jobID that uniquely identifies your request.
Response Fields
Parameter | Type | Description |
---|---|---|
jobID | int64 | The jobID returned by the proof request. |
2. Query Proof Status
Endpoint: proof.testnet.polymer.zone
Method: POST
Request Body
To query the status of a proof job, use the polymer_queryProof
method:
Query Proof Status
{
"jsonrpc": "2.0",
"id": 1,
"method": "polymer_queryProof",
"params": ["jobID"]
}
Response Body (Success)
Complete Proof Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "complete",
"proof": "base64EncodedProofData..."
}
}
Response Fields
Parameter | Description |
---|---|
proof | Base64 encoded bytes payload containing the IAVL proof of the application's log stored in the Polymer Rollup. |
status | Indicates the current status of the proof (complete , error , pending ). |
info
Proof Encoding: Proof bytes are base64
encoded. Your application must decode and convert to hex
to pass as call data to the contract on-chain.
Usage Example
Complete API Flow
const response = await axios.post(
"https://proof.testnet.polymer.zone/",
{
jsonrpc: "2.0",
id: 1,
method: "polymer_requestProof",
params: [{
srcChainId: 11155420,
srcBlockNumber: 26421705,
globalLogIndex: 15
}]
},
{
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}
);
const jobId = response.data.result;
console.log(`Job ID: ${jobId}`);
// Poll for proof completion
let proofResponse;
let attempts = 0;
const maxAttempts = 30;
while (!proofResponse?.data?.result?.proof && attempts < maxAttempts) {
await new Promise(resolve => setTimeout(resolve, 2000)); // Wait 2 seconds
proofResponse = await axios.post(
"https://proof.testnet.polymer.zone/",
{
jsonrpc: "2.0",
id: 1,
method: "polymer_queryProof",
params: [jobId]
},
{
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
}
);
attempts++;
}
if (proofResponse?.data?.result?.proof) {
console.log("Proof generated successfully!");
const proof = proofResponse.data.result.proof;
// Use proof in your contract call
} else {
console.error("Proof generation timeout or failed");
}