Skip to main content

Prove API

API Endpoints

1. Request Log Proof

Endpoint: proof.testnet.polymer.zone

Method: POST

Request Header

Authorization: Bearer <token>

Request Body

{
"jsonrpc": "2.0",
"id": 1,
"method": "polymer_requestProof",
"params": [{
"srcChainId": 11155420,
"srcBlockNumber": 26421705,
"globalLogIndex": 15
}]
}

Request Parameters in order

The parameters are now enclosed in a single object (instead of an array of separate values):

ParameterTypeDescription
srcChainIdint64Source chain ID where the event occurred
srcBlockNumberint64Block number on the source chain containing the event
globalLogIndexint64Index of the log in the block (as per standard API response)

Response Body (Success)

{
"jsonrpc": "2.0",
"id": 1,
"result": jobID
}

The response contains a jobID that uniquely identifies your request.

Response Fields

ParameterTypeDescription
jobIDint64The 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:

{
"jsonrpc": "2.0",
"id": 1,
"method": "polymer_queryProof",
"params": ["jobID"]
}

Response Body (Success)

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "complete",
"proof": "base64EncodedProofData..."
}
}

Response Fields

ParameterDescription
proofBasee64 Encoded bytes payload containing the IAVL proof of the application's log stored in the Polymer Rollup.
statusIndicates the current status of the proof (complete, error, pending).

Note: Proof bytes are base64 encodes at the moment, application must decode and then convert to hex in order to pass it as call data to the application contract on-chain.

Usage Example

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}`);

Advanced Methods

Endpoint: proof.testnet.polymer.zone

Request Method: POST

Proof Request Body:

{
“jsonrpc”: “2.0”,
“id”: 1,
"method": "log_requestProof",
"params": [uint32, uint64, uint32, uint32]
}
ParameterTypeDescription
srcChainIdunit32The chain ID of the chain that emitted the log.
srcBlockNumberunit32Block number on the source chain where the log was emitted.
txIndexunit32Index of the transaction (receipt belongs to) in the array of all transactions in that block.
localLogIndexunit32Index of the event in the logs array of the receipt i.e local to your transaction. Note: This is not the global log index.

Query Proof Body

{
"jsonrpc": "2.0",
"id": 1,
"method": "log_queryProof",
"params": [jobID]
}
ParameterTypeDescription
jobIDint64The jobID returned by the proof request.