Skip to main content

Set ProofApi

Some of the functions in matic.js are suffixed with the term faster. As the name suggests, they generate results faster compared to their non-faster counterparts. They do so by utilizing the Proof Generation API as the backend which can be hosted by anyone.

https://apis/ is a publicly available Proof Generation API, hosted by Polygon.

The setProofApi method can help in setting the Proof Generation API’s URL to the matic.js instance.

import { setProofApi } from '@maticnetwork/maticjs'


Utilizing a self-hosted Proof Generation API service will offer better performance compared to a publicly hosted one.

Please follow the installation instructions provided in the file of to self-host the service.

e.g - if you have deployed the proof API and the base URL is -, then you need to set base URL in setProofApi

import { setProofApi } from '@maticnetwork/maticjs'


We recommend using faster API's, because some API's, particularly where proof is being generated, make a lot of RPC calls and it might be very slow with public RPC's.