Skip to content

AggLayer: Separate out EthAddress and EthAddressFormat (name TBD) #2357

@mmagician

Description

@mmagician

It used to be call EthAddress, but was renamed as per #2238 (comment)

However, this was in the light of bridging-in, where we were passing a 160 bit value that was represented as an address on Ethereum, but was in fact encoding a Miden AccountId - i.e. it was not a "valid" Ethereum address ("valid" in the sense that there was no account associated with it).

In the bridging out flow, the value carried by the B2AGG note will actually be a valid Ethereum destination address.


I wouldn't change the naming to EthAddress (because it is not strictly correct) across the board.
I think the best solution here is to:

  1. create a separate EthAddress dedicated for the bridging-out flow. It also wouldn't have methods such as from_account_id(account_id: AccountId) as they don't make sense there.
  2. keep EthAddress as the base struct, and create a EthAddressFormat trait to encompass Miden<>Ethereum conversion logic like from_account_id / from_account_id

WDYT?

Originally posted by @mmagician in #2334 (comment)

Metadata

Metadata

Labels

agglayerPRs or issues related to AggLayer bridging integration

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions