cosmos/ethermint-archive

Integration: x/bank and the EVM

alexanderbez opened this issue · 3 comments

Current behavior

Ethermint as it stands allows for clients to submit Ethereum and SDK routed txs.
Ethereum routed txs include both contract execution and external account balance
transfers. SDK routed txs include most prominently governance, staking.

Because there is functional overlap between the EVM, in the sense of performing
balance transfers, and the Cosmos SDK (e.g. banking module and by proxy other
modules that need banking functionality) there then stems some ambiguity on how
these pieces fit together.

Desired behavior

Our goal is to allow for seamless integration of tools, frameworks, and Dapps
that exist in the Ethereum ecosystem while integrating the existing Cosmos SDK
modules and functionality in a way that makes sense while maintaining flexibility
and performance.

Proposal (high level)

The Cosmos SDK modules that rely on the banking module should essentially exist
and function as they do today. These modules have the ability, albeit limited in
scope depending on the module, to check, send, and receive balances. We regard
these functions to operate on a single coin in the Ethermint world. However, this
coin is directly fungible with Ether in Ethereum. In other words, we introduce
the notion of a staking coin in Ethermint that is baked by Ether (but not 1:1 due to inflation).

Clients can still use contracts and Dapps as they exist in Ethermint using their
Ether and ERC-20 tokens, however, whenever they want to execute some functionality
in the Cosmos SDK such as delegating to validator or voting on a governance proposal,
they will need to exchange their Ether for the fungible token in Ethermint.

This can be achieved with provided custom precompiles utilized in the Ethermint
smart contract and Ethermint's banking module implementation.

Fees & Gas

Ethereum routed transaction fees are to be paid directly by the sender in ETH,
whereas Ethermint routed transaction fees are to be paid directly by the designated
"fee payer" in the staking coin, which refers to the first signer of the transaction
in the Cosmos SDK.

Inflation

Inflation (provisions and fees collected) will occur with the Ethermint staking
coin.

Would love further thoughts!

/cc @jaekwon @ebuchman @sunnya97 @AdityaSripal @zmanian

Closing this as I gather more thoughts from consensus on today's discussion. Will re-open after shortly.

Closing/rejecting proposal. As @jaekwon and I discussed, we believe it'll be a more seamless and better experience if we can figure out how to unify the two ecosystems via a single coin (Photon?).

This will require me to dig into geth's stateDB implementation more, figure out the dependency graph and see what needs to be reimplemented in order to get seamless bank module integration.