Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Brevis Client

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

View Content

NameTypeDescription
proveRequestProveRequestBrevis prover service will use it to prove circuit computation validity. It contains receipts, list of storage information and transactions used in application circuit
proofProveResponseProving response given by Brevis prover service
srcChainIdnumberCircuit input data original chain
dstChainIdnumberWhich chain the final proof will be posted on
optionQueryOption
apiKeystringIdentification which is used for Brevis partner flow
callbackAddressstringDeveloper’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.

Note: On-chain tx is not required if there is a partnership between the developer’s project and Brevis.

View Content

NameTypeDescription
proveRequestProveRequestsee above
appCircuitInfoAppCircuitInfoBrevis prover service will generate it automatically
srcChainIdnumbersee above
dstChainIdnumbersee above
optionQueryOption
apiKeystringsee above
callbackAddressstringsee above

SubmitProof

After proof is generated by the Brevis Prover Service, it should be uploaded to the Brevis gateway for proof aggregation.

View Content

NameTypeDescription
queryKeyQueryKeyQuery identification returned by Brevis gateway
dstChainIdnumbersee above
proofStringProvided 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.

View Content