is_alive

Description: Checks that the SHARP gateway is alive.

Example:

$ curl --cert user.crt --key user.key --cacert server.crt \
https://sepolia-recursive.public-testnet.provingservice.io/v1/gateway/is_alive

gateway is alive!

add_job

Description: Adds a Cairo job to SHARP

Parameters:

  • customer_id: The customer id
  • cairo_job_key: The Cairo job key
  • offchain_proof (optional): Whether the proof should only be offhcain, defaults to false
  • layout_proof (optional): The layout proof, defaults to dynamic

Data: A base 64 encoding of a Cairo PIE

Example:

$ curl --cert user.crt --key user.key --cacert server.crt \
https://sepolia-recursive.public-testnet.provingservice.io/v1/gateway/add_job?customer_id=the_sharp_book&cairo_job_key=example&offchain_proof=true&proof_layout=small \
-d $(base64 -i pie.zip)

{"code": "JOB_RECEIVED_SUCCESSFULLY"}

add_applicative_job

Description: Adds an applicative Cairo job to SHARP

Parameters:

  • customer_id: The customer id
  • cairo_job_key: The Cairo job key
  • offchain_proof (optional): Whether the proof should only be offhcain, defaults to false
  • layout_proof (optional): The layout proof, defaults to dynamic

Data:

A JSON file with the following entries:

  • cairo_pie_encoded: A base 64 encoding of a Cairo PIE
  • children_cairo_job_keys: A list of Cairo job keys to be aggregated by the applicative Cairo job

Example: 🚧

get_status

Description: Gets that status of a Cairo job.

URL Parameters:

  • customer_id: The customer id
  • cairo_job_key: The Cairo job key

Example:

$ curl --cert user.crt --key user.key --cacert server.crt \
https://sepolia-recursive.public-testnet.provingservice.io/v1/gateway/get_status?customer_id=the_sharp_book&cairo_job_key=example

{"status": "PROCESSED"}

get_proof

Description: Gets the proof of a Cairo job added with offchain_proof=true.

URL Parameters:

  • customer_id: The customer id
  • cairo_job_key: The Cairo job key

Example:

$ curl --cert user.crt --key user.key --cacert server.crt \
https://sepolia-recursive.public-testnet.provingservice.io/v1/gateway/get_proof?customer_id=the_sharp_book&cairo_job_key=example

{"annotations": ... }

get_dynamic_params

Description: Gets the parameters needed to use the dynamic layout

Data: Execution resources in JSON format

Example: 🚧

aggregations/gas

Description: Gets proof onchain data gas usages for Cairo jobs added by customer_id and verified on Ethereum between day_start and day_end.

customer_id must be one of ["starknet, herodotus", "paradigm-otc"].

day_start and day_end are "day epoch time", i.e. the number of days since 1970/01/01. To convert a regular epoch time to day_start or day_end, simply divide by 86,400 (the number of seconds in a day) and round down the result.

Example: 🚧

aggregations/cost

Description: Gets proof and onchain data costs for Cairo jobs added by customer_id and verified on Ethereum between day_start and day_end.

customer_id must be one of ["starknet, herodotus", "paradigm-otc"].

day_start and day_end are "day epoch time", i.e. the number of days since 1970/01/01. To convert a regular epoch time to day_start or day_end, simply divide by 86,400 (the number of seconds in a day) and round down the result.

Example: 🚧

aggregations/steps

Description: Gets the number of Cairo steps for Cairo jobs added by customer_id between day_start and day_end.

customer_id must be one of ["starknet, herodotus", "paradigm-otc"].

day_start and day_end are "day epoch time", i.e. the number of days since 1970/01/01. To convert a regular epoch time to day_start or day_end, simply divide by 86,400 (the number of seconds in a day) and round down the result.

Example: 🚧

aggregations/jobs

Description: Gets job information for Cairo jobs added by customer_id between day_start and day_end.

customer_id must be one of ["starknet, herodotus", "paradigm-otc"].

day_start and day_end are "day epoch time", i.e. the number of days since 1970/01/01. To convert a regular epoch time to day_start or day_end, simply divide by 86,400 (the number of seconds in a day) and round down the result.

Example: 🚧

Using cairo-sharp

cairo-sharp is a command line utility included in the cairo-lang package that gives free but limited access to Sepolia SHARP via the following commands:

NOTE: cairo-sharp submit is rate-limited to prevent a DOS attack on SHARP.

submit

Description: Submits a Cairo PIE to be proven and verified on Sepolia.

Parameters:

  • cairo_pie: The Cairo PIE

Example:

$ cairo-sharp submit pie.zip

Compiling...
Running...
Submitting to SHARP...
Job sent.
Job key: 699bf741-7c91-4b93-a158-aaddac7534c1s
Fact: 0xca15503f02f8406b599cb220879e842394f5cf2cef753f3ee430647b5981b782

status

Description: Gets that status of a job submitted by cairo-sharp submit.

Parameters:

  • job_key: The key of a job submitted by cairo-sharp submit

Example:

$ cairo-sharp status 699bf741-7c91-4b93-a158-aaddac7534c1

PROCESSED

is_verified

Description: Checks if a job submitted by cairo-sharp submit has been verified on Sepolia.

Parameters:

  • fact: The fact of a job submitted by cairo-sharp submit
  • node_url: An Ethereum node url

Example:

$ cairo-sharp is_verified 0xca15503f02f8406b599cb220879e842394f5cf2cef753f3ee430647b5981b782 \
--node_url https://ethereum-sepolia-rpc.publicnode.com

True

Making Cairo PIEs

Making a Cairo PIE is much easier than making a real pie, as demonstrated by the following steps:

  1. Install Scarb:

     curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh
    
  2. Create a new Cairo project:

     scarb new cairo_pie_example
     cd cairo_pie_example
    
  3. Add the following to your project's Scarb.toml:

     [cairo]
     enable-gas = false
    
  4. Compile your project:

     scarb build
    
  5. Install cairo-vm/cairo1-run:

     git clone https://github.com/lambdaclass/cairo-vm.git
     cd cairo-vm/cairo1-run
     make deps
    
  6. Generate your project's Cairo PIE:

     cargo run ../../target/dev/cairo_pie_example.sierra.json \
             --append_return_values \
             --layout=small \
             --cairo_pie_output=pie.zip
    
  7. Bon appétit! 🥧