🧞♂️ Genie is a zk-TLS based on-ramp system that bridges Web2 payments (e.g. Binance) to on-chain assets.
legacy-web-prover: ZK-TLS proof generation via HTTPS traffic interception.noir-web-prover-circuits: Core ZK circuits implemented in Noir (ChaCha20, HTTP, JSON, etc).zk-vault: Smart contract logic ofenrollandclaimfor on-chain USDT distribution.
The main logic of the legacy-web-prover is to run zk-tls logic using SuperNova. However, the circuit used in the legacy code is made with a circom base.
We implemented a noir-based zk-tls circuit at https://github.com/elysia-dev/noir-web-prover-circuits.
To run this code in the current codebase (legacy-web-prover), we needed to implement a new interface. So we implemented a SuperNova interface that takes a noir file as input.
We also implemented zk-tls attestation for the Binance payment API, for which we created a manifest.
Run notary server:
cargo run -p notary -- --config ./fixture/notary-config.tomlProve & verify a test API response {"hello":"world"}:
cargo run -p client -- --config ./fixture/client.origo_noir_tcp_local.jsonWe haven't implemented generating proofs in the browser yet. The command line approach requires private data in environment variables. Follow these steps to reproduce the process shown in the demo:
-
In genie vault:
- Deploy the vault. Make sure to put the private_key that will be used as the contract owner in the env.
-
In legacy-web-prover (this repo):
- Put the generated vault address into
MINATO_VAULT_ADDRESSin.env. - Put the same private_key as used above into
PRIVATE_KEYandNOTARY_PRIVATE_KEY.
- Put the generated vault address into
-
In Binance:
- Get a Binance API key.
- Write the api_key to
target_headers.x-mbx-apikeyinfixture/client.origo_tcp_local_binance.json. - Write the secret to
BINANCE_SECRETin your environment variables.
-
In legacy-web-prover: Run the client script, replacing the receiver-binance-id with the ID of the Binance account that issued the API:
cargo run -p demo --bin demo -- --config ./fixture/client.origo_tcp_local_binance.json \ --log-level=INFO --from-binance-id 93260646 --receiver-binance-id 71035696 --amount 1 --currency USDT
