ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

Universal addressing spec and foreign runtime support

Open raulk opened this issue 3 years ago • 1 comments

Motivation

Foreign runtimes (e.g. EVM) make assumptions about the addressing scheme. Furthermore, existing workloads deployed on those runtimes (e.g. smart contracts on Ethereum) make further assumptions, as is the case of Solidity smart contracts.

All of this is aggravated by the fact that Filecoin lacks a stable, universal address (universal = can refer to any actor). ID addresses are universal but not stable (they are sensitive to reorgs). f1 and f3 addresses are stable but not universal. f2 is semi-stable because the current address generation algorithm is stateful (unlike something like CREATE2).

We need to introduce a stable, universal address and a scheme for using that address type in foreign runtimes, notably the EVM first.

Constraints

As postulated by the author (@raulk).

  • Zero ambiguity and full compatibility with existing tools. In the immediate horizon, our goal is to interoperate seamlessly with Ethereum wallets like MetaMask. These wallets keep custody of keys and compute receiving addresses using Ethereum's scheme. Users will expect that the address presented there is usable as-is in Filecoin. It would be inadmissible for users to send to the address only to have funds locked because of a mismatch in the protocol's address validation scheme.
  • Ideally, registry-less. We have the opportunity here to provide a multi-chain addressing scheme, potentially even under the multiformats umbrella. This could be a specialised version of multihash, or something entirely new. The basic outline would be: given some cryptographic input (e.g. public key or contract creation parameters) and some chain-specific function (e.g. Ethereum = keccak-256 with 160 right truncation), produce an address.
  • Compatible with the upcoming Undifferentiated Actor type.
  • Compatible with actor/contract address generation schemes.

raulk avatar Aug 08 '22 11:08 raulk

https://github.com/filecoin-project/ref-fvm/issues/694

karim-agha avatar Aug 23 '22 17:08 karim-agha