filecoin-project / filecoin-project/ref-fvm
Prototype account abstraction for Ethereum native transaction support
- Dominant language
- Rust
- Stars
- 422
- Forks
- 154
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 12
Description
## Proposal
https://github.com/filecoin-project/FIPs/discussions/388 by @anorth
## Goal
The goal of this issue is to conduct a prototype to validate the ideas therein and their applicability to native EVM transaction support. Concretely, https://github.com/filecoin-project/ref-fvm/issues/721 talks about how such an abstraction would be applied to this particular problem. This prototype shall act as the base for an eventual mature feature.
## High-level tasks
> Level of technical detail/accuracy here is low, just enough to structure the work.
1. Implement the actor code update flow.
- Implement an `sself::update_code_cid(Cid) -> Result` syscall. Takes the target CodeCID to which to switch this calling actor to.
- Handle such syscalls by delegating to an `update_to(addr: Address, curr_code_cid: Cid)` (or similarly named) actor entrypoint to evaluate the intake on the target side, i.e. exported FFI Wasm function.
- Implement the FVM mechanics to manage this, including a `delegatecall` like facility (target actor update intake method should execute in the same context as the caller).
2. Create a built-in Ethereum account actor (e.g. `eaccount`).
- Offers an `update_to` entrypoint to allow standard actors to upgrade to it.
- Offers a `validate` entrypoint that validates the signature on native Ethereum messages, fulfilling the contract specified in https://github.com/filecoin-project/FIPs/discussions/388.
3. Extend the standard `account` actor to enable upgrading f1 addresses (backed by secp256k1 keys) to `eaccount` by invoking `sself::update_code_cid`.
4. Extend the FVM to validate messages using the `validate` entrypoint. (New protocol-level signature type needed to indicate "delegate to sender actor"?)
5. (Eventually) Implement JSON-RPC `eth_sendSignedTransaction` on Lotus utilizing this mechanism.
## Not covered by this prototype
> Will need separate issues.
- Security model of code updates.
- Security model of validation entrypoint (for now we assume that the container has all syscalls available to it -- this will need to be restricted for no side effects).
- Returning gas spec as per https://github.com/filecoin-project/FIPs/discussions/388.
- Gas charges.
Contributor guide
Assessment
This issue has not been assessed yet.