Skip to content

term-structure/Term-Structure-Evacuation-Kit

Repository files navigation

Term Structure Evacuation Kit

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.

Building and Installing

To build the project and install the tool:

cargo build --release
cargo install --path term-structure-evacuation-kit

Usage

After 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.json

Update State

To 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 19968461

Query Balance

To 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 2

Export Input Files

To 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.json

Consume Data

To 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.json

Generating Zero-Knowledge Proofs

Download 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.wtns

Prove the circuit using snarkjs:

npx snarkjs groth16 prove evacu_finalized.zkey ./witness.wtns ./proof.json ./public.json

Export the Solidity calldata:

npx snarkjs zkey export soliditycalldata ./public.json ./proof.json

License

MIT


For more detailed usage and options, please refer to the help command ts-evacu --help.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages