Brevis Client
Brevis-sdk-typescript provides useful client for developers to focus on application circuit design with convinient interaction with Brevis gateway
Submit
By calling the submit
function, Brevis client will wrap circuit inputs and send them to Brevis Gateway to finish the rest of the proving process.
The submit is a wrapper of two fundamental calls to the Brevis gateway. The first one is used to initialize the proving process on the Brevis gateway. The second one will upload application circuit proof to the Brevis gateway for future proof aggregation.
We highly recommend developers use this to kick off Brevis SDK integration for simple testing. For best practice, we recommend using subsequent APIs to reduce proving latency. Generally, it takes some time to prove the application circuit, from seconds to minutes. At the same time, Brevis Gateway can operate the parallel proving. It will save lots of time
Name | Type | Description |
---|---|---|
proveRequest | Brevis prover service will use it to prove circuit computation validity. It contains receipts, list of storage information and transactions used in application circuit | |
proof | Proving response given by Brevis prover service | |
srcChainId | number | Circuit input data original chain |
dstChainId | number | Which chain the final proof will be posted on |
option | ||
apiKey | string | Identification which is used for Brevis partner flow |
callbackAddress | string | Developer's application contract address. Used for Brevis partner flow only |
PrepareQuery
PrepareQuery will trigger Brevis gateway proving initialization. After that, Brevis gateway will return QueryKey and fee for this proving. Then developers can guide users to submit on-transaction SendRequest tx. Please note that it is not required for application circuit proof. In this way, parallel proving can be achieved.
On-chain tx is not required if there is a partnership between the developer's project and Brevis.
Name | Type | Description |
---|---|---|
proveRequest | see above | |
appCircuitInfo | Brevis prover service will generate it automatically | |
srcChainId | number | see above |
dstChainId | number | see above |
option | ||
apiKey | string | see above |
callbackAddress | string | see above |
SubmitProof
After proof is generated by the Brevis Prover Service, it should be uploaded to the Brevis gateway for proof aggregation.
Name | Type | Description |
---|---|---|
queryKey | Query identification returned by Brevis gateway | |
dstChainId | number | see above |
proof | String | Provided by Brevis Prover Service |
Wait
Developers can use wait() to check query status. It will get query status from the Brevis gateway periodically. You can find all possible query status here.
Last updated