Stellar
Guide for using zkFetch with Stellar blockchain data and services
Pre-requisite
You can access the code on Github:
You will need a valid Stellar account seed phrase. Make sure you have enough funds to sign and send transactions. Freighter wallet is a convenient option.
Code Exploration
/src/requestProof.js
This is the core part of the process, this code snippet shows how to fetch the latest XML price from CoinGecko's API in the form of a Reclaim proof. Once a proof is fetched, it gets written to /src/proof.json
.
/src/utils.js
A couple of Reclaim-specific methods for parsing proofs.
/src/verifyProof.js
The main script, it builds, signs, and sends the verification transaction to the network.
Try it
Clone the repo
Download ZK files
These are crucial for proof requesting, a device should have them locally to request Reclaim proofs.
Add your seed phrase
Add the secret phrase of your signing account to .env
.
Request a proof
Change directory into /src
and run:
Verify the proof
Once you have the proof in proof.json
, run the following to verify on-chain: