The Term Structure Evacuation Kit is a tool designed for managing term structure data and generating zero-knowledge proofs for data evacuation. Below are the instructions to build, install, and use the kit.
To build the project and install the tool:
cargo build --release
cargo install --path term-structure-evacuation-kitAfter installation, you can use the ts-evacu command with various subcommands to manage and process your data. First, copy the example configuration file and replace it with your own API key:
cp config.json.example config.jsonTo update the state based on the provided configuration file and end block ID, use the update_state command. If the end block ID (-e) is not specified, the state will be updated to the latest block:
ts-evacu update_state -c config.json -e 19968461To query the balance of a specific account for a specified asset, use the query command with the account ID and token ID:
ts-evacu query -c config.json -a 2 -t 2To export the input files required for the evacuation zk proof, use the export command with the account ID and token ID:
ts-evacu export -c config.json -a 2 -t 2 > ./input.jsonTo export the data required to consume L1 requests in the smart contract, use the consume command with the configuration file:
ts-evacu consume -c config.jsonDownload the zkTrue-up Evacuation Witness Calculator and the zkTrue-up Evacuation Zkey.
Generate the witness:
node zkTrueUp-Evacuation_js/generate_witness.js zkTrueUp-Evacuation_js/zkTrueUp-Evacuation.wasm ./input.json ./witness.wtnsProve the circuit using snarkjs:
npx snarkjs groth16 prove evacu_finalized.zkey ./witness.wtns ./proof.json ./public.jsonExport the Solidity calldata:
npx snarkjs zkey export soliditycalldata ./public.json ./proof.jsonFor more detailed usage and options, please refer to the help command ts-evacu --help.