mirror of
https://github.com/yi-sun/zk-attestor.git
synced 2026-01-09 13:37:56 -05:00
fa1c3bf9e0f2b5f743dbe666b50a4b66cbe428fc
zkAttestor
Scalable on-chain trustless attestations to data from any past Ethereum block or state.
Project overview
This repository provides implementations of account, storage, and transaction proofs for Ethereum. Together, these enable a user to generate validity proofs for data from any current or past Ethereum block or state using a trusted block hash alone.
Install dependencies
- Run
yarnat the top level to install npm dependencies (snarkjsandcircomlib). - You'll also need
circomversion >= 2.0.2 on your system. Installation instructions here. - Building these circuits requires a Powers of Tau file with
2^24constraints in thecircuitssubdirectory with the namepot24_final.ptau. One such file can be downloaded from the Hermez trusted setup here.
Building proving keys and witness generation files
We provide four circuits, which together enable attestations to all current or historical Ethereum data available from an archive node:
eth_block_hash: Prove state, transaction, and receipt roots corresponding to a block hash.address_proof: Prove an account state corresponding to a state root.storage_proof: Prove the contents of a storage slot with corresponding storage root.tx_proof: Prove the contents of a transaction with corresponding transaction root.
Run yarn build:eth_block_hash, yarn build:address, yarn build:storage, yarn build:tx at the
top level to compile proving keys and witness generators for each file.
Testing
Run yarn test at the top level to run tests. Note that these tests only test correctness of witness generation.
Description
Languages
Circom
54.9%
Python
34%
Shell
8.1%
TypeScript
3%