Taiko Prover
This guide will walk you through the steps necessary to run the Taiko prover on Gevulot. You can watch the demo video for a visual demonstration.
The Witness
We will first need a witness for the proof. The steps here:
download a random witness
rename it to a unique name
upload to http server
1.1 Download a random witness
There are 58 Taiko witnesses of various sizes located here, numbered 46800-46857:
Choose one at random and download it.
If you'd like a genuinely random number, this link will generate a number in the given range. Just plug the value into the url above and download the file.
1.2 Rename the file
Next, rename the file to something unique. It is important that the entire proof request be a unique string. This may be done via unique input files, or accomplished with a nonce (not used here).
For this example, we have downloaded witness-46807.json
and renamed it here:
1.3 Calculate the hash
For this step, you will need to have built gevulot-cli
and have it in your path. Call it with the calculate-hash
action, and pass in the witness file.
1.4 Upload to a public http server
Lastly, you will need a public url for for the file. An S3 bucket would be one option. Just make sure the file has public read permissions.
Execute the proof
2.1 The parameters structure for the proof
Use the json structure below as a template for creating the parameter inputs. You will observe:
three arguments are passed in as key/value pairs
two folders are used
the
/gevulot
path is used for static files embedded in the prover image. In this case, there is one, a 512MB proof parameters file, with degree k = 22.the
/workspace
path is used for dynamic file instances
one input file is passed in, namely our witness. Edit the url and hash values, the latter associated with the
local_path
property.the output proof from the prover is referenced as an input into the verifier.
In sum, you will have to edit witness file data in four places:
the argument list, for the
-w
parameterthe
vm-path
propertythe
file_url
propertythe
local_path
property, which holds the file hash string
Note: the program hashes are static, corresponding to the currently deployed instances of the Taiko prover and verifier.
3.2 Execute the proof
We then embed the json struct (with whitespace removed) in a command line call to gevulot-cli
, using the exec
action.
You will get back a transaction hash, e.g:
Verify the results
Use the transaction hash to get the verifier output.
3.1 View the transaction
First, you can query the transaction itself, by calling gevulot-cli
with the get-tx
action and the hash. It will return the parameters passed into the exec
call, along with some additional metadata.
3.2 View the transaction tree
Now, print out the transaction tree using the print-tx-tree
action and the txhash you got back from the exec
call. The tree will eventually contain leaves, from which you can read the verifier results.
In the case of The Taiko prover, it can take 6-7 minutes for a proof to complete. Until then, no tree will be found.
When the proof completes, you will see a tree like this
3.3 Examine a leaf
You may see several Leaf
entries. Choose the first, and do a get-tx
on it to print out the verifier results.
3.4 Parse the verification result
Under payload.Verification.verification
, we see a string encoded as base64. Use jq
plus base64
to decode that at the command line. Now we can read the json text generated by the verifier.
And you're done!
Last updated