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

Lightclient wallet for ETH + ERC20 balances #3796

Closed
3 of 5 tasks
dapplion opened this issue Feb 27, 2022 · 4 comments
Closed
3 of 5 tasks

Lightclient wallet for ETH + ERC20 balances #3796

dapplion opened this issue Feb 27, 2022 · 4 comments
Labels
epic Issues used as milestones and tracking multiple issues.

Comments

@dapplion
Copy link
Contributor

dapplion commented Feb 27, 2022

Motivation

Lodestar has so far developed a consensus lightclient that tracks the head with minimal resources. This is an important piece towards fully functional lightclients but doesn't have practical use for users. With the upcoming Amsterdam devconnect lightclient event https://lightclients.xyz/ it's very important to show the community the technical capabilities of lightclients today to rally support in this direction.

Browser based lightclients that support the full JSON RPC API require EVM execution with special SLOAD opcode that fetches storage dynamically. This is not an easy task, and it's being actively research by Portal Network participants https://github.com/ethereum/portal-network-specs. That's the long term goal, but meanwhile there are some valid use-cases that don't require EVM execution.

A read-only wallet that shows an account's ETH balance and ERC20 balances of well-known contracts doesn't require EVM execution since it can directly fetch storage slots at deterministic locations. This is what the main goal of this issue, and deploy it in Kintsugi / Klint testnets and then add p2p support for head tracking (upcoming).

Todo

In a web-app, or stand-alone library initially for easier testing:

  • Import lodestar's lightclient and sync to the head. Existing implementation in https://github.com/ChainSafe/eth2-light-client-demo
  • Request a consensus state proof to latest_execution_payload_header.state_root, with Lodestar proof API
  • Pre-compute execution state address of an account balance
  • Pre-compute execution state address of an account ERC20 balance and pre-selected contracts by the users
  • Request a execution state proof with EIP-1186 eth_getProof. Supported by Geth and EthereumJS. Validate proof against latest_execution_payload_header.state_root
@philknows philknows added the epic Issues used as milestones and tracking multiple issues. label Mar 2, 2022
@g11tech
Copy link
Contributor

g11tech commented Mar 3, 2022

UPDATE: got something rudimentary working for external addresses! ChainSafe/eth2-light-client-demo#28
image

@dapplion
Copy link
Contributor Author

dapplion commented Mar 8, 2022

Let's go! I can jump in latter and think of some design to show the info

@philknows
Copy link
Member

Is there anything outstanding in here you want to continue tracking @dapplion ? Otherwise, we can create new issues and add to the #3469 light client tracker.

@philknows philknows added scope-light-clients All issues regarding light client development. and removed scope-light-clients All issues regarding light client development. labels May 10, 2022
@dapplion
Copy link
Contributor Author

@g11tech did a fantastic job here so we can close it. If we have more ideas to extend it further let's do new issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Issues used as milestones and tracking multiple issues.
Projects
None yet
Development

No branches or pull requests

3 participants