News.EOS.WiKi Bilingual News & Info Of EOS

Syed Jafri谈EOSIO区块链互操作性/Syed Jafri Talks About EOSIO Blockchain Interoperability

S
BuiltOnEOSIO - EOSIO Challenge Winner

译文/Translated:

Block.one赞助的EOSIO Challenge为生态内的开发者探索基于互操作性的区块链应用规模化解决方法。

我们认为,建立开发者解决方案一个没有边界的概念。本着这个精神,我们希望社区提交的EOSIO智能合约能够在和以太坊虚拟机(EVM)功能相同的环境内运行基于solidity的以太坊智能合约。此外,该智能合约必须能供促进EOSIO更大的优势,如增加交易产出和提高智能合约处理速度。

我们收到的很多项目都很接近比赛的标准,但是,其中一个参赛人,Syed Jafri,和他的智能合约EOSIO.EVM却超过了我们的要求。

Syed说,solidity开发者可以利用EOSIO.EVM快速在EOSIO上启动和运行其应用,且“根据他们部署的EOSIO网络不同,其运行速度最大可能快100倍、便宜1000倍。”

超越比赛标准

Syed有多年的EOSIO 生态开发经验,他是一个资深开发者。他刚刚从卡尔加里大学毕业,是EOS Cafe Block的CEO,还是受欢迎的EOSIO区块浏览器Bloks.io背后的工程师。

应对我们提出的挑战需要诸多思考。一开始,Syed花了一整周思考搭建一个世界国。但第一个突破则是在他通过反序列化的方式读取和验证序列化交易的签名的时候才出现的。

“那时候我才真的感觉的,‘哇我能行。我还要接受更大的挑战。’”

Syed履行了自己的誓言,不久,他开始了一天工作18个小时,周末也不休息,一直在攻克他的解决方案。

达到了挑战的基本要求之后,他还是没有停下。他开始关注功能,思考开发者会怎么和EOSIO.EVM交互。“我做的时候就希望它能实现最大的功用。这就是我不断改进、突破挑战要求的动力。”

考虑到开发者需求,Syed设置了一个方法,能够绕过设置节点就利用EOSIO.EVM启动基于solidity项目。他的解决方案是怎样的呢?他利用了一个模拟的远程过程调用(RPC),这个RPC的javascript库和solidity开发者熟悉的web3库很像。

Syed解释说,“这就是你运行的一个简单的服务器。它可以接收以太坊交易、签署交易、把交易提交到EOSIO节点。你甚至不需要自己运行节点,因为每个EOSIO网络都有这些公共端点。”

Syed说EOSIO.EVM显示了EOSIO的潜力。“你可以用常见的代码做的任何事,比如运行虚拟机,都几乎可以在EOSIO中实现。你可以在EOS虚拟机中运行另一台虚拟机,而且速度还很快。”

利用EOSIO.EVM完成再部署只需要几周,而不是几年

如果你想用EOSIO.EVM把自己的solidity代码部署到EOSIO上,你就把Syed搭建的模拟RPC作为一个端点。Syed说,remix这类的工具能让你编译solidity代码,并将其部署到一个提供模拟RPC的地址上。

“基本上,这和部署到以太坊测试网或以太坊主网没什么差异。”

接下来,根据你部署的EOSIO网络不同,你还需要创建账户、购买资源,这样才能有足够的押金承担应用的CPU、NET和RAM费用。该账户提供给模拟RPC并覆盖了所有通过应用的交易。

Syed解释说,“你只需要提供模拟RPC中的账户私钥,接着就可以用来完成你自己的服务了。”

接下来,交易的部署和提交也和以太坊环境中相似。用户可以把网络添加到MetaMask来交互、签署和提交交易。除此之外,从用户的角度来看,该应用的使用上没有任何差别。

剩下来的是包装在EOS VM的EVM一对一副本。

Syed强调说,“你无需修改就可以运行所有的solidity代码。你运行的时候没有任何新东西。你可以使用你习惯的所有软件。你可以在一个RPC节点上运行的任何其它以太坊软件都可以继续使用。”

利用互操作性减少成本、提高性能

对于开发者来说,EOSIO.EVM带来了新的可能性。

Syed说,“速度层面上,比方说,你的solidity合约利用EOSIO区块链的速度会比用以太坊区块链快得多。”

除了速度,Syed说,交易的成本也会下降1000倍。开发者一直以来都很关注高昂的交易成本问题,而这个解决方案给项目提供了希望,让它们能够用低廉的解决方案除了大量的交易。

EOSIO.EVM让开发者能够最大化地实现安全。每个智能合约都要经过审核、确保其中没有漏洞且运行良好。如果一个智能合约用一种语言编写,但是用另一种重写,接着再用另一种改写,那么这就会很难实现,因为必须用这几种语言审核。如果能再多个网络中部署一个代码库,那么,维护安全就容易多了。

发现EOSIO智能合约真正的力量

Syed花了好几周的时间、牺牲了好几个周末、全心浸泡再EOSIO.EVM中,但最后,他说,整个过程最好的是他学到了经验。

成功的道路上,Syed说,在DevPost的协助下Block.one工程师的反馈很有帮助。“他们对所有的问题都反馈得很快,我觉得这对比赛的运行方式也很有帮助。”

Syed说,Block.one团队对EOSIO做的更新,尤其是发布EOS VM就是EOSIO.EVM能够良好运行的一个重要原因。

“我觉得,他们对EOS VM做的优化就证明了Block.one工程的优秀之处。”

现在他已经完成了挑战,Syed对利用EOSIO智能合约可以实现的成就很有信心。

“现在我没觉得哪个EOSIO合约是真正挑战。某种意义上,它们都是可行的。”

想要展示你的EOSIO现目吗?

我们的 #建立在EOSIO 系列展示了利用EOSIO科技的一些卓越的项目,它们都能为我们更加安全和联系的世界添砖加瓦。如果您想给我们下一个阶段的项目提建议,请给我们的开发者关系小组发送邮件spotlight@block.one

重要通知:所有提供的材料都受此重要通知的约束,您必须自行熟悉此间条款。该通知包含与我们软件、出版物、商标、第三方资源以及前瞻性声明相关的信息、限制和约束内容。通过访问我们的材料,您接收并同意此通知的条款。

原文/Original:

Block.one sponsored the EOSIO Challenge to explore interoperability based scaling solutions for blockchain application developers across the ecosystem.

We understand that building developer solutions is a borderless concept. In that spirit, we asked the community to submit an EOSIO smart contract capable of running solidity based Ethereum smart contracts in an environment that duplicates the functionality of the Ethereum Virtual Machine (EVM). In addition, the smart contract must also continue to leverage the wider benefits of EOSIO, such as increased transaction throughput and faster smart contract processing.

While a number of submissions came close to meeting the challenge criteria, one entrant, Syed Jafri, surpassed our specifications with his smart contract, EOSIO.EVM.

With EOSIO.EVM, Syed says solidity developers can rapidly launch on EOSIO and run their applications up to “100 times faster and 1,000 times cheaper, depending on which EOSIO network they deploy to.”

Going Beyond the Contest Criteria

With years of development experience, Syed is a longtime developer in the EOSIO ecosystem. He is a recent graduate from the University of Calgary, the CEO of EOS Cafe Block, and the engineer behind the popular EOSIO block explorer, Bloks.io.

Tackling the challenge required an enormous mental effort. Initially, Syed spent an entire week contemplating the scope of building an entire world state. He made his first major breakthrough when he was able to read and verify signatures in serialized transactions by deserializing them. 

“That was really the moment I was like, wow I can definitely do this. I just need to push a little harder.”

Living up to his words, Syed soon found himself working up to 18 hours a day on his solution without taking weekends off.

Once he met the basic requirements of the challenge he continued to push on. He found himself focused on functionality, pondering how developers would interact with EOSIO.EVM. “I wanted it to be as usable as possible when I was creating it. I think that’s what led me to going above and beyond the challenge.”

Taking into account developer needs, Syed devised a means to launch solidity based projects with EOSIO.EVM while bypassing the step of setting up a node. His solution? A mock remote procedure call (RPC) with a javascript library similar to the web3 library that solidity developers are familiar with. 

Syed elaborates, “It’s just a simple server that you run. It takes in Ethereum transactions, signs transactions, and then submits them to the EOSIO nodes. You don’t even need to run the nodes yourself because every EOSIO network has these public endpoints.”

Syed says EOSIO.EVM shows what is possible with EOSIO. “Essentially anything that you can do with normal code, such as running a virtual machine, you can do inside EOSIO. You can run another virtual machine inside the EOS Virtual Machine, and do it quite fast.”

Retool in Weeks Instead of Years with EOSIO.EVM

If you want to deploy your solidity code to EOSIO with EOSIO.EVM you will use the mock RPC Syed built as an end point. Syed says tools like remix allow you to compile and deploy your solidity code to an address that is supplied to the mock RPC.

“It’s essentially no different than deploying to an Ethereum testnet, or deploying to an Ethereum main net.”

Next, based on the EOSIO network you deploy on, you’ll need to create an account and buy resources in order to cover your application’s CPU, NET, and RAM costs with a sufficient stake. This account is supplied to the mock RPC, and covers the resources for all the transactions that go through the application.

Syed explains, “You would just supply the private key of that account in your mock RPC and use that for your own service.”

After that, the deployment and submitting of transactions is similar to that of an Ethereum environment. Users can add the network to MetaMask to interact, sign, and submit transactions. Outside of this, from a user perspective everything would stay the same when interacting with the application.

What you’re left with is a one to one copy of an EVM wrapped in EOS VM.

Syed emphasizes, “It runs all of your solidity code without any modifications. There’s nothing new that you have to run. You can use all the software that you’re used to. Any other Ethereum software that runs off of an RPC node works.”

Lower Your Costs and Increase Performance with Interoperability 

For developers, EOSIO.EVM represents a new realm of possibilities. 

Syed says “Speedwise you’re seeing orders of magnitude faster speed using, let’s say, an EOSIO chain with your solidity contracts than you are with an Ethereum chain.” 

Beyond speed, Syed goes on to say the cost of those transactions is reduced a thousand fold. High transaction costs have long been a concern for developers and this solution offers hope to projects that need low cost solutions to handle a high number of transactions.

EOSIO.EVM also helps developers follow best practices for security. Every smart contract must be audited to ensure it is bug free and functions properly. This can be difficult if the smart contract is engineered in one language, and then rewritten in another, because audits must be performed on both languages. It’s much easier to maintain security when deploying a single codebase to multiple networks.

Discover the True Power of EOSIO Smart Contracts

After dedicating weeks of his time, sacrificing his weekends, and immersing himself in EOSIO.EVM, Syed says the best part for him was the learning experience. 

Along his path to success Syed says the continuous feedback from Block.one engineers, facilitated by DevPost, was helpful. “They were very responsive with all the questions. And I think that was definitely helpful with the way the contest was run itself.”

Syed says the improvements made by Block.one’s team to EOSIO, specifically the release of EOS VM, are a large part of why EOSIO.EVM works so well. 

“I think that it’s a great testament to the great engineering at Block.one, with how optimized they’ve made the EOS VM.”

Now that he’s seen the challenge through, Syed is confident about what he can accomplish with EOSIO smart contracts. 

“I think at this point I don’t see any EOSIO contract as a challenge necessarily. It’s all feasible in a sense.”

Do You Want Your EOSIO Project to be Featured?

Our #BuiltOnEOSIO series showcases some of the amazing projects leveraging EOSIO technology to build a more secure and connected world. If you would like to suggest a project for us to feature please send an email to spotlight@block.one for our Developer Relations team to review.

Important Note: All material is provided subject to this important notice and you must familiarize yourself with its terms. The notice contains important information, limitations and restrictions relating to our software, publications, trademarks, third-party resources and forward-looking statements. By accessing any of our material, you accept and agree to the terms of the notice.

原文链接/Original URL:

About the author

By user
News.EOS.WiKi Bilingual News & Info Of EOS

Recent Posts