Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: zk light client #12

Merged
merged 67 commits into from
Feb 19, 2024
Merged

feat: zk light client #12

merged 67 commits into from
Feb 19, 2024

Conversation

dndll
Copy link
Member

@dndll dndll commented Jan 30, 2024

This is the first implementation of a zk light client, covering:

  • full sync protocol
  • parallel merkle verification proofs
  • verifier contract, this is still very first pass, but is functional for the "one-shot" use case.
  • one-shot command style "operator"

The focus here has been to cover as much of the basic functionality as possible, whilst there are still some improvements to be made on the contract and operator side of the light client for it to be fully functional for NEARDA.

The current verification circuit can take 128 proofs in batches of 4, this proves quite quickly and can cover roughly 4/MB * 128 in ~14mins on succincts current hardware. This allows rollups to post 512mb of provable data to NEARDA every 12 minutes. With folding we can further reduce the cost to verify this and we have some ideas for optimisation of the requests.

Additional functionality:

  • rpc module specifically for light client operations
  • light client protocol exposed, should be fairly usable by arbitrary dependents
  • upgrades to nearcore deps, borsh and others
  • cleans up test fixtures to support mainnet/testnet
  • CI for tests, parallel testing

Also:

  • bugfix in stake accounting

TODO:

  • queued proof operator
  • recursion on stepwise proofs
  • lazy sync
  • shared functionality protocol-crate <> circuit logic
  • Improve solidity deployment scripts
  • (maybe) expose the operator through the standard light client binary
  • gas accounting works
  • determine optimal batching size for verification and how to limit calldata issues. Removing account padding and such.

@dndll dndll force-pushed the plonky2x branch 7 times, most recently from b17847d to def88a7 Compare January 31, 2024 16:00
@dndll dndll force-pushed the plonky2x branch 2 times, most recently from 24662b3 to b12128e Compare February 16, 2024 10:37
@dndll dndll force-pushed the plonky2x branch 2 times, most recently from 1acc31b to d1cc465 Compare February 19, 2024 09:19
@dndll dndll changed the title wip: ZK light client feat: zk light client Feb 19, 2024
@dndll dndll marked this pull request as ready for review February 19, 2024 11:27
@dndll dndll merged commit abcb01b into master Feb 19, 2024
6 checks passed
@dndll dndll deleted the plonky2x branch February 19, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant