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": "log_requestProof",
"params": [uint32, uint62, uint32, uint32]
}
Request Parameters in order
Name | Description |
---|---|
srcChainId [uint32] | The chain ID of the chain that emitted the log. |
srcBlockNumber [uint64] | Block number on the source chain where the log was emitted. |
txIndex [uint32] | Index of the transaction (receipt belongs to) in the array of all transactions in that block. |
localLogIndex [uint32] | Index of the event in the logs array of the receipt i.e local to your transaction. Note: This is not the global log index. |
Response Body (Success)
{
"jsonrpc": "2.0",
"id": 1,
"result": int64
}
The response contains a int64 (jobID
) that uniquely identifies your request.
2. Query Log Proof
Endpoint: proof.testnet.polymer.zone
Method: POST
Request Body
{
"jsonrpc": "2.0",
"id": 1,
"method": "log_queryProof",
"params": [int64]
}
Response Fields
Name | Description |
---|---|
jobID [int64] | The jobID returned by the proof request. |
Response Body (Success)
{
“jsonrpc”: “2.0”,
“id”: 1,
"result": {
“jobID”: [int64],
“proof”: []byte [base64],
“status”: “complete” | “error” | “pending”
}
}
Response Fields
Name | Description |
---|---|
jobID [uint64] | Unique identifier for the API request. |
proof [base64] | A byte payload containing the IAVL proof of the application's log stored in the Polymer Rollup, along with the Sequencer-attested state root and corresponding block height. |
status | Indicates 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.
Note
- All of the proofs described above can be built using public RPCs. The primary function of the Prove API is to provide convenience and manage the coordination across multiple chain RPCs.