filecoin-project / FIPs

The Filecoin Improvement Proposal repository
312 stars 166 forks source link

FIP-0091: Add support for legacy Ethereum transactions #995

Closed aarshkshah1992 closed 4 months ago

aarshkshah1992 commented 4 months ago

This FIP adds support for legacy Homestead Ethereum transactions to Filecoin.

Note that only legacy Ethereum transactions with the following parameters will be supported.

type LegacyEthTx struct {
    Nonce int  
    To *EthAddress
    Value big.Int
    GasPrice big.Int
    GasLimit int  
    Input []byte  
    V big.Int 
    R big.Int 
    S big.Int
}

As legacy transactions do not have a ChainID, the same signed contract creation transaction can be used to create the contract on multiple chains and ensure that the address of the contract remains the same on all chains. There are some legacy contracts whose users need support for such chain agnostic transactions and contract creation.

Support for EIP-155 and EIP-2930 transactions is deferred to future FIPs.

Discussion at #962.

Schwartz10 commented 4 months ago

Hey thanks for putting this together @aarshkshah1992 - one additional thing to note wrt "Change Motivation" - we also just generically get a lot of user's complaining about wallets not working to do simple sends of FIL (even outside of the GLIF UI). For instance, see this email from last night:

image

Sending FIL natively from Coinbase wallet (and several others like Trust, Phantom) should "just work". This doesn't seem related to being able to deploy smart contracts, but it's still quite important to fix because many user's are stuck with their FIL in wallets that throw this same error. Their only choice right now is to import their same private keys / seed phrases into a new wallet, which is not a safe practice. In an ideal world no wallet provider would send legacy txns, but that's just not the case.

aarshkshah1992 commented 4 months ago

@Schwartz10 Thanks for pointing that out. I have added the point about wallet support for legacy transactions to the Change Motivation section