Chia-Network / chips

Apache License 2.0
45 stars 22 forks source link

CHIP | Add EVM to Chia Network via a 2nd Chia EVM chain #74

Closed misher2 closed 1 year ago

misher2 commented 1 year ago

:------------|:---- Title | Add EVM to Chia Network via a 2nd Chia EVM chain. Description | Currently Chia Network uses CLVM. A switch to EVM would wipe the network. This seems impractical. I am proposing that a second EVM chain be run alongside CLVM. Hopefully, someone can figure out a better way to do it than I am proposing. Given the low hardware requirements of the current Chia node and the envision is a second node being run based on the open source code of Go-Ethereum that produces blocks alongside the original blocks (or in the gap in between). Perhaps this can be done as an L2 instead? Have a flat 0.1 reward per block and add make tx's burn the gas so there is relatively no inflationary increase over time. Fork Chia to add a network bridge between the two chains. Author | misher2 (https://github.com/misher2). Editor | < Creator must leave this blank. Editor will be assigned.> Comments-URI | < Creator must leave this blank. Editor will assign a URI.> Status | < Creator must leave this blank. Editor will assign a status.> Category | Process Created | 2023-06-06 Dependencies | None

Abstract Add EVM capability to Chia Network via a 2nd Chia EVM chain

Motivation Currently, dapps/wallets are slow to integrate Chia because Lisp is obscure and little-known compared to Solidity which is well-used and tried+tested. Crypto is filled with hacks and exploits, Solidity smart contracts are largely open source and have been tested/audited over the years. Most mainstays like Uniswap or Compound are seen as reliable. Few are willing to try to make their equivalent on Chialisp because this requires a large amount of work+expense and the chance of being hacked is high. Cross-network bridges and app migration haven't happened because Chia has created a Great Wall around itself that no existing crypto dapp company is willing to jump over. Zilliqa recently forked to add EVM in addition to its smart contract language, I am proposing that Chia do similar. Chia Network is currently doing 99% of the work when it should be 1%. We should be able to use Metamask and have Uniswap along with the 100+ other ERC-20 compatible tokens on chain. The decision to focus on Chialisp has made development difficult. We need to fix it by adding in a way to take advantage of the large EVM codebase.

Specification Currently, ETH runs as two nodes the consensus and execution layers. Before the merge, they ran as two different levels of the network that worked alongside each other. I would propose that a basic Chia EVM be run now with a future Chip to add in the bridges similar to how the Merge was delayed.

Perhaps have the Chia EVM chain only be able to produce a block after the CLVM chain but make the difficulty low so it is found fast? I'm sure there is a way to have two chains run in parallel similar to the way Sharding or Avalanche works. Chia Network is working on bridges to EVM networks currently so it makes sense to make that bridge to their own network (Chia EVM) and then EVM-capable bridges built by the community can cross over to Chia EVM.

Security The Chia EVM chain would be less secure than the Chia CLVM chain. The CLVM chain would continue to be the chain Chia proposes to use for corporate customers. The EVM chain would exist as the more-casual use chain for new users to Chia and for dapps. There would be a slight trade-off between the security CLVM offers and the audited time-tested code EVM uses.

hoffmang9 commented 1 year ago

EVM as an L2 or side chain may make sense but I think anyone advocating that needs to offer some detailed use cases to make sure that there is actual functional value to be gained.

A second chain or direct EVM support in L1 is antithetical to the point that Chialisp was designed to address the security and efficiency shortcomings of Solidity and the EVM.

We have spoken to at least one development team in the past about an EVM L2, especially as a ZkRollup - which the BLS Opcodes CHIP and softfork make available.

danieljperry commented 1 year ago

This reads like a feature request. In order for it to be a CHIP (even as a draft), it needs to have a basic functional reference implementation.

Feel free to open a feature request in a different repo, but for now I'm going to close this one.