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

Ethereum account in genesis #333

Closed
aakoshh opened this issue Jun 19, 2023 · 0 comments · Fixed by consensus-shipyard/fendermint#126
Closed

Ethereum account in genesis #333

aakoshh opened this issue Jun 19, 2023 · 0 comments · Fixed by consensus-shipyard/fendermint#126

Comments

@aakoshh
Copy link
Contributor

aakoshh commented Jun 19, 2023

Implement the handling of Ethereum Accounts during the genesis process:

  • Add it as an option for the genesis model
  • Add such addresses via the CLI commands
  • Handle them in the genesis interpreter by creating EVM actors and inserting into the Init actor

Background

During consensus-shipyard/fendermint#124 it was revealed that it's impossible to do a simple transfer between two "native" FVM Accounts using the Ethereum API. It can only be used to interact with Ethereum Accounts, which are different.

By native accounts we mean the f1 accounts, which have an address like f1<20-byte-from-blake2b-hash-of-secp256k1> , while the Ethereum accounts are the f410<20-byte-from-keccak256-hash-of-secp256k1> variants, a.k.a. f410 accounts. To send messages from them, any address like this has to be known by the Init actor.

During genesis we set up f1 accounts, but we could also set up f410 ones; currently the only way to create one would be to send a transfer of tokens from an f1 account to an f410 account, however, this can only be done with the Fendermint CLI, not the Ethereum API.

The reason the Ethereum API cannot send from f1 accounts is that the from of the transaction is not part of the RLP encoding of the transaction. Instead, the receiver side recovers the public key used to sign the transaction based on a specific hashing algorithm that Ethereum clients use. Once we have the public, we could generate f1 or f410 from it, but we don't know which one it should be, and both can exist on the ledger, independently. Therefore the product decision was that the translation layer that turns Ethereum transactions into Filecoin messages will use f410 addresses, and thus the Ethereum API only works if the f410 account actually exists.

Implementing this story will allow us to set up test accounts for Ethereum as well in the smoke tests, rather than have to resort to the native RPC commands for this during the tests.

@jsoares jsoares transferred this issue from consensus-shipyard/fendermint Dec 19, 2023
@jsoares jsoares closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants