ton-society / grants-and-bounties

TON Foundation invites talent to imagine and realize projects that have the potential to integrate with the daily lives of users.
https://ton.org/grants
314 stars 139 forks source link

EVM Rollup on TON Feasibility Study #227

Open smartprogrammer93 opened 1 year ago

smartprogrammer93 commented 1 year ago

Summary

This proposal aims to conduct a feasibility study exploring the potential of building an Ethereum Virtual Machine (EVM) Rollup on the The Open Network (TON). The study will investigate the TON infrastructure, smart contracts, and the necessary steps for implementing an EVM Rollup.

Context

The integration of an EVM Rollup on TON would bridge the gap between Ethereum and TON, allowing developers to deploy and run Ethereum-compatible smart contracts on the TON blockchain. This would enable TON to leverage the thriving Ethereum ecosystem, attract more developers, and encourage new decentralized applications (dApps) to be built on its platform. A feasibility study is essential to outline a clear roadmap for the EVM Rollup's development and ensure that the project is well-planned, properly prioritized, and resource-efficient.

Goals

  1. Gain an in-depth understanding of the TON infrastructure and smart contracts
  2. Explore existing Rollup solutions and their applicability to TON
  3. Develop a comprehensive plan for the EVM Rollup implementation, including tech stack selection, timeline, and resource estimation

Deliverables

  1. A P2 proposal outlining high-level plans for the EVM Rollup implementation, including a whitepaper, architecture, budget, and timetable
  2. Identification of components to be developed, such as the EVM Rollup client and smart contract execution environment
  3. A list of challenges to overcome, such as the ZKVerifier on TON (if a ZK architecture is chosen), on-chain EVM simulator on TON (if an optimistic architecture is chosen), addressing account address differences between Ethereum and TON, and bridging TON tokens into the rollup.

Definition of Done

The feasibility study is considered complete and successful when the P2 proposal is delivered, addressing all the aforementioned goals and deliverables, and providing a well-researched basis for deciding whether to proceed with the EVM Rollup implementation on TON. We will provide a progress report every 2 week, in addition to the final deliverable above by the end of the period.

Reward

Oriental Release Date

6 weeks from the start of the project.

Gusarich commented 1 year ago

Workchains are made for this purpose.

smartprogrammer93 commented 1 year ago

@Gusarich Core development usually takes a long time, and until we reach having a workchain that is Fully EVM equivalent on TON. I would rather have the rollup for now where people can start to be on-boarded into the ecosystem. It would actually be a great test to show the core devs if people actually like the idea of an EVM workchain or not.

Gusarich commented 1 year ago

@smartprogrammer93 @Naltox @Hiyorimi I don't quite understand what you expect to learn from this research. EVM chains have a completely different architecture compared to TVM chains (TON). If your goal is to allow people to deploy EVM smart contracts on TON, you won't come up with any good solution.

There is only one "possible" way to allow people to deploy EVM contracts to TON: Create a highly complex compiler that will deeply analyze the Solidity code and generate a system of smart contracts in TON that will communicate in the way the developer initially intended. It must translate the high-level communications between EVM smart contracts into low-level message-based communications between TVM smart contracts, while counting fees, handling possible errors, and managing bounced messages. Isn't that too much complexity just to allow some EVM devs to deploy their toy "hello world" smart contract on TON?

There are also a few problems:

I can partially understand the reason "to simplify the entry into TON for EVM developers", but don't you think that conducting month-long research and then developing an incredibly complex solution is too much? I believe it would be much more effective to invest this time and effort in improving documentation and tools for beginners, rather than trying to simplify the deployment of a "hello world" EVM smart contract on TON.

smartprogrammer93 commented 1 year ago

@Gusarich The goal is not to allow people to deploy solidity smart contract to TON. The goal is to run a rollup chain that will use TON as the Settlement layer for transactions. There is no need for a special compiler. The normal Ethereum compilers will just work. Also, I would not belittle Ethereum smart contract devs to just want to run their 'Hello World'. EVM Chains have the highest level of Total Value Locked.

So, since EVM devs will just easily deploy their contracts to the rollup without any modifications. there will be no need for them to Learn the basics of TON or the Architecture of TON. Additionally we will not need to build a special compiler.

Taking this further, this is only the start. If we can introduce Zero Knowledge tech to TON, there is a lot of other possibilities that could be developed on TON using the same Tech.

Gusarich commented 1 year ago

@smartprogrammer93

The goal is to run a rollup chain that will use TON as the Settlement layer for transactions.

I can't understand what do you want to achieve. You probably didn't describe the idea in enough detail in the footstep. How are you going to execute EVM contracts on TVM?

Also, I would not belittle Ethereum smart contract devs to just want to run their 'Hello World'.

I'm not belittling EVM devs. I mentioned hello-world contracts because they can REALLY be adapted to any blockchain essentially unchanged.

So, since EVM devs will just easily deploy their contracts to the rollup without any modifications.

What's the point in deploying Ethereum smart contracts on TON?

Probably I could have misunderstood the idea of this research. I ask you to explain it 😄

smartprogrammer93 commented 1 year ago

@Gusarich no worries. I am glad someone is curious about this. you can checkout more information about Rollups on this Article here: https://www.quicknode.com/guides/web3-fundamentals-security/cryptography/introduction-to-ethereum-rollups/

I believe there is a lot of value to bring the ability for Solidity devs who already deployed their apps on Ethereum to deploy them on TON rollup where this dapps have already been battle tested and used across multiple EVM chains. This allows these devs to tap into the TON economy without having to rebuild their dapps with FunC. Also, it would hopefully introduce them to TON.

An Additional benefit to TON EVM rollup would be that possibly we can Bridge Tokens from both TON and Ethereum and have AMM with pools for all of these tokens which could bring more liquidity into them. Also, users can now hold TON tokens with their metamask or even Ledger wallet easily.

Gusarich commented 1 year ago

@smartprogrammer93 well, thank you for the link. But the thing is that I've already read several similar articles and as I understood, rollups were made for scaling Ethereum.

How are you going to use it to allow EVM contracts to be executed on TON?

smartprogrammer93 commented 1 year ago

@Gusarich, a rollup does not execute the transaction on the main chain. It only saves it and verifies it there.

alfredonodo commented 1 year ago

Hello, there is a similar TON Footsteps which aims to make a workchain with the support of zk-snark rollups for private transactions (like Zcash). TON does not need such technology for scalability through layer 2 like Ethereum as it reaches 10+ million TPS thanks to dynamic sharding up to 2^60 shards. Ethereum has abandoned 64-chain sharding in favour of proto-danksharding which allows it to scale via layer 2 via zk-snark rollups up to 100k+ TPS. Furthermore, EVM is inherently synchronous and does not allow smart contracts to run in parallel like TVM. I do not understand what advantages this TON Footsteps has over the other.

Gusarich commented 1 year ago

@alfredonodo I also cannot understand how are they going to integrate EVM into TON. Either it's going to be some super-complex solution, or just nothing.

Gusarich commented 1 year ago

How's it going? @smartprogrammer93

smartprogrammer93 commented 1 year ago

@Gusarich, it is going well. Our team has made great progress about the technical difficulties. We are ironing out some other details before starting to work on the timeline and the actual proposal.

Gusarich commented 1 year ago

What's up with this footstep? @smartprogrammer93

smartprogrammer93 commented 1 year ago

@Gusarich it is going well. we just had some delays because of vacations during summer

Gusarich commented 1 year ago

It’s been a long time already. How is your progress? Any news? @smartprogrammer93

smartprogrammer93 commented 1 year ago

@Gusarich, we are at the end of the project. We have all deliverables ready just reviewing everything before publishing 🎉

Gusarich commented 1 year ago

@smartprogrammer93 what’s up?

smartprogrammer93 commented 1 year ago

@Gusarich the wait is over. I will start posting the deliverables here in the coming days

smartprogrammer93 commented 1 year ago

White Paper Document here: https://docs.google.com/document/d/1Iop_mAVO7Wxvd_CnvdMRlGilZ32xjmFx_aLk-2EerSk/ First Medium Article in the series: https://medium.com/@smartprogrammer.eth/ton-zkevm-rollup-series-ep1-tech-stack-choice-8d9bc12abd71

smartprogrammer93 commented 1 year ago

White Paper Document here: https://docs.google.com/document/d/1Iop_mAVO7Wxvd_CnvdMRlGilZ32xjmFx_aLk-2EerSk/ First Medium Article in the series: https://medium.com/@smartprogrammer.eth/ton-zkevm-rollup-series-ep1-tech-stack-choice-8d9bc12abd71

Would like to clarify that the choice was made to go with a Zero-Knowledge rollup since an Optimistic rollup would require the implementation of the EVM in FunC, which is way harder and time consuming (if possible at all) than building a ZK verifier. It was very obvious to us that we did not include it in the article of the tech stack choice.

smartprogrammer93 commented 1 year ago

Second Medium Article in the series: https://medium.com/@smartprogrammer.eth/ton-zkevm-rollup-series-ep2-zkverifier-challenges-solutions-and-progress-7b3cdcdc0af3 One more to go.