<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Starknet Astro</title>
        <link>https://paragraph.com/@starknet-astro</link>
        <description>Starknet Astro 是 Starknet 生态的硬核媒体🔊和社区🎮
Starknet Astro provide the most cutting-edge and insightful research on Starknet Eco🚀</description>
        <lastBuildDate>Sun, 05 Apr 2026 08:46:29 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Starknet Astro</title>
            <url>https://storage.googleapis.com/papyrus_images/29c9767715c717b3cef6eb15ff6d14ad97396b67c12056f1b8b895426149fc29.png</url>
            <link>https://paragraph.com/@starknet-astro</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Starknet Astro Quarterly Review #1]]></title>
            <link>https://paragraph.com/@starknet-astro/starknet-astro-quarterly-review-1</link>
            <guid>pNUtBWpL7JdGQbU9sd3D</guid>
            <pubDate>Fri, 04 Aug 2023 15:15:20 GMT</pubDate>
            <description><![CDATA[First Cairo BootcampAstro launched the first Chinese Cairo Bootcamp on May 21st. The event aims to help more Chinese developers quickly master the Cairo language and build products on Starknet. This Bootcamp consisted of five sessions. With an overwhelming response, the Bootcamp witnessed more than 200 registrations and an impressive 140+ cumulative participants, averaging over 28 attendees per session.The topics covered in this session include:Introduction to Starknet and CairoDevelopment en...]]></description>
            <content:encoded><![CDATA[<h3 id="h-first-cairo-bootcamp" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">First Cairo Bootcamp</h3><p>Astro launched the first Chinese Cairo Bootcamp on May 21st. The event aims to help more Chinese developers quickly master the Cairo language and build products on Starknet. This Bootcamp consisted of five sessions. With an overwhelming response, the Bootcamp witnessed more than 200 registrations and an impressive 140+ cumulative participants, averaging over 28 attendees per session.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b9fc27e83a9274d9fcecf682ec37e88a2a630ac2ebd4152d5f294e193e1f1ade.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The topics covered in this session include:</p><ul><li><p>Introduction to Starknet and Cairo</p></li><li><p>Development environment setup</p></li><li><p>Deployment of ERC20 and ERC721 tokens on testnet</p></li><li><p>Cairo 2.0 syntax</p></li></ul><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/cryptonerdcn">Cryptonerd</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/shalom_hu">Shalom</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Real_Maxlion">Max</a> participated in the explanations.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c49cee65d3ea0dd1c98f232afd5d23a5c318c79c829f1ae8bf473b42b28f3f47.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Each class is recorded, and we will upload all the course videos to YouTube soon. Here are the tutorials and related documents we have prepared:</p><p>Course documents: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknetastro.xlog.app/">https://starknetastro.xlog.app/</a></p><p>Course slides PDF and video replays: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknet-astro.super.site/">https://starknet-astro.super.site/</a></p><p>The first Cairo Bootcamp organized by Astro has come to an end.</p><p>On August 3rd, Starknet Astro invited @StarkWareLtd developer <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/gyanlakshmi">Gyanlakshmi</a> to answer questions encountered by Chinese developers in Cairo development 🚀</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/789cfef9f4bccfde29edae8a12efbdd716196995ccd41031fd9d75c83b235f21.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The Q&amp;A list doc</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.google.com/document/d/1ku_y4M9PUe_GcwiBlvq6Kz2LkagyXD2Za1XCZj-IHVo/mobilebasic">https://docs.google.com/document/d/1ku_y4M9PUe_GcwiBlvq6Kz2LkagyXD2Za1XCZj-IHVo/mobilebasic</a></p><h3 id="h-cairo-book-chinese-version" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Cairo-Book Chinese Version</strong></h3><p>On May 31st, Astro completed the Chinese translation of the Cairo Book and maintained it with regular updates, ensuring that the Chinese version of the Cairo Book can stays synchronized with official updates in time.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b2f49dc2574bd698d1366149fd14c8ed0b34f123efb7b97c85ea73b81a69f956.jpg" alt="https://book.cairo-lang.org/zh-cn/index.html" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://book.cairo-lang.org/zh-cn/index.html</figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/cairo-book/cairo-book.github.io/pulls?q=is%3Apr+is%3Aclosed+author%3Acryptonerdcn">Our work records(PR).</a></p><p>And Astro has integrated <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/cryptonerdcn/status/1681702635479638016">WASM-Cairo</a> into CairoBook, so we can run Cairo code in the browser. If you also want to build Cairo programs that can run in the browser, please contact us.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/cryptonerdcn/status/1681702635479638016">https://twitter.com/cryptonerdcn/status/1681702635479638016</a></p><p>At the same time, the WASM-Cairo project won awards at both the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://taikai.network/pragma-oracle/hackathons/Cairo1hackathon/projects/clj5axhze03yuu601gir28kbr/idea">Starknet Hackathon hosted by Pragma</a> and the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://app.buidlbox.io/projects/wasm-cairo">Eth Shanghai Hackathon</a>.</p><h3 id="h-chinas-first-starknet-workshop-in-shanghai" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>China&apos;s First Starknet Workshop in Shanghai</strong></h3><p>On June 23-24, we held China&apos;s first Starknet Workshop in Shanghai to help developers quickly understand the Starknet technology stack and learn advanced content such as Cairo syntax, STARK proof generation, zkEVM, and sequencers.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d020111ca249d993ccfe7dfa822f6bcda921f0b2325b6186924c65743d273038.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Surprisingly, besides developers, there were also many Starknet project teams(including four full-chain game teams interested in Starknet) and investors present at the scene. The attendees exceeded 50 people for two consecutive days, and even heavy rain on the second day could not extinguish everyone&apos;s enthusiasm for Starknet.🔥</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ca8c9868cdcae02ec3f7c42cd5080df67d5944678359b7dc590ffd0238a12b75.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>At the workshop, we introduced the online Cairo code editor: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://astro-editor.netlify.app/">Astro Editor</a>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d5649feaf3651e10e5109bea75057da0477f468b5a21ac4994383d018b7d893e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-advocate-works" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Advocate Works</h3><p>Astro insists on promoting the entrepreneurial opportunities of the Cairo language and full-chain games, on-chain AI, contract wallets, and account abstractions on Starknet to individual developers, teams, and startups. Astro already helped some wallet, game, and NFT startups joined the Starknet ecosystem, and in the future, more Chinese development teams will land on Starknet. 🚀</p><p>On June 3rd, Type V DAO hosted a Twitter Space with Astro to talk about Starknet and L2.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/TypeV_Official/status/1664549188858945538">https://twitter.com/TypeV_Official/status/1664549188858945538</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d4c8cc5008f9ab3f097a40d112fc99151bc6efb8a8afa5c81ede69a55d9fff80.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>On July 13th, Astro held a Twitter Space after the Starknet mainnet upgraded to version v0.12, where many Starknet developers and enthusiasts gathered to discuss the Starknet ecosystem.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ceee83abc9e88904d6c08b9328e68a178da5270379a0c29826871f2fdcf5fc98.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>On July 15th, Astro researcher <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/CynicSong">CynicSong</a> completed a research article titled &quot;The EVM-Compatible Journey of Starknet: Kakarot zkEVM 101&quot; to introduce Kakarot to Chinese readers.</p><p>Special thanks to Kakarot CEO <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/ETazou">Elias</a> and the team for their suggestions and support on this article.</p><p>Kakarot is a zkEVM implemented on Starknet using the Cairo language. It simulates the EVM&apos;s stack, memory, execution, and other aspects as Cairo smart contracts. Kakarot faces challenges related to compatibility with Starknet&apos;s account system, cost optimization, and stability due to the experimental nature of the Cairo language.</p><p>Warp is a translator that converts Solidity code into Cairo code, providing compatibility at the high-level language level. Kakarot, on the other hand, provides compatibility at the EVM level by implementing EVM opcodes and precompiles.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/StarkNetAstroCN/status/1680195400417054720?t=LlqCQ_6LaPVkzj-0TRPasw&amp;s=19">https://twitter.com/StarkNetAstroCN/status/1680195400417054720?t=LlqCQ_6LaPVkzj-0TRPasw&amp;s=19</a></p><p>On July 21st, Astro&apos;s Dev Rel &amp; Researcher Max preached about the Starknet technology stack and ecosystem progress to the developer community LXDAO, which focuses on public goods development. The explanation was mainly based on the Chinese knowledge base completed by Astro.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknet-astro.super.site/">https://starknet-astro.super.site/</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/92a25bc5d961e6f406a74180fae9a5003aa029cf1878243ec8eb7b1e0d52c43d.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-future-plans" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Future Plans</strong></h3><p>Astro will hold the Starknet Hacker House in Chengdu from August 21st to 27th. Students will engage in a one-week development and learning program in the learning environment provided by Astro, and are encouraged to build their own Cairo projects during this period. Astro will provide further updates on the specific details and other information in upcoming event articles.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/de85450935014d0ebff7d71bd82e20617e370c067cea85d5a674ec257585c9e0.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>This Starknet Hacker House is part of Global Hacker House, and multiple developer communities will be hosting Hacker House events in various cities in China in August.</p><p>Registration link: 🔗</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://antalphalabs.typeform.com/hackerhouse">https://antalphalabs.typeform.com/hackerhouse</a></p><p>Astro will also launch the second phase of BootCamp in the second half of the year, which will include advanced topics such as account abstraction, full-chain games, STARK prover, and sequencer in Cairo.</p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/139ca55f555a6864df678fc9b3ba55293f42a1eda0268cbfbd3205e80a4e9a59.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Starknet Astro 第一期工作总结]]></title>
            <link>https://paragraph.com/@starknet-astro/starknet-astro</link>
            <guid>K9z6xZvHq6TpbDWd4m5q</guid>
            <pubDate>Fri, 28 Jul 2023 07:47:40 GMT</pubDate>
            <description><![CDATA[Starknet Astro 在团队成员和社区的共同支持下，度过了繁忙而充实的一个季度，圆满举办了国内首届 Starknet Workshop、Cairo Bootcamp 等等活动。 本文将带大家回顾 Astro 在 2023 年 5-7 月期间取得的成绩，并展望下一步的计划。 欢迎大家为 Astro 的建设提出建议或意见 💡第一期 Cairo BootcampAstro 在 5/21-7/16 期间举办了首届中文 Cairo Bootcamp ，本次 Bootcamp 旨在帮助更多中文开发者快速掌握 Cairo 语言并在 Starknet 上构建产品。本次 Bootcamp 共开展了五节课，报名数超过 200 人，累计参与人次超过 140，平均每次课程参与人数超过 28。本期课程内容包括Starknet 和 Cairo 介绍开发环境设置在测试网部署 ERC20 和 ERC721 代币Cairo 2.0 语法Cryptonerd、Shalom、Max 参与了讲解。每次课程都有录制，我们将在不久后将全部课程视频上传到 YouTube，以下是我们编写的教程以及相关文档： 课程文档...]]></description>
            <content:encoded><![CDATA[<p>Starknet Astro 在团队成员和社区的共同支持下，度过了繁忙而充实的一个季度，圆满举办了国内首届 Starknet Workshop、Cairo Bootcamp 等等活动。</p><p>本文将带大家回顾 Astro 在 2023 年 5-7 月期间取得的成绩，并展望下一步的计划。</p><p>欢迎大家为 Astro 的建设提出建议或意见 💡</p><h3 id="h-cairo-bootcamp" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>第一期 Cairo Bootcamp</strong></h3><p>Astro 在 5/21-7/16 期间举办了首届中文 Cairo Bootcamp ，本次 Bootcamp 旨在帮助更多中文开发者快速掌握 Cairo 语言并在 Starknet 上构建产品。本次 Bootcamp 共开展了五节课，报名数超过 200 人，累计参与人次超过 140，平均每次课程参与人数超过 28。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b9fc27e83a9274d9fcecf682ec37e88a2a630ac2ebd4152d5f294e193e1f1ade.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>本期课程内容包括</p><ul><li><p>Starknet 和 Cairo 介绍</p></li><li><p>开发环境设置</p></li><li><p>在测试网部署 ERC20 和 ERC721 代币</p></li><li><p>Cairo 2.0 语法</p></li></ul><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/cryptonerdcn">Cryptonerd</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/shalom_hu">Shalom</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Real_Maxlion">Max</a> 参与了讲解。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c49cee65d3ea0dd1c98f232afd5d23a5c318c79c829f1ae8bf473b42b28f3f47.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>每次课程都有录制，我们将在不久后将全部课程视频上传到 YouTube，以下是我们编写的教程以及相关文档：</p><p>课程文档：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknetastro.xlog.app/">https://starknetastro.xlog.app/</a></p><p>课件 PDF 及课程视频回放 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknet-astro.super.site/">https://starknet-astro.super.site/</a></p><h3 id="h-cairo-book" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Cairo-Book 中文版</strong></h3><p>5 月 31 日 Astro 完成了 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://book.cairo-lang.org/zh-cn/index.html">Cairo Book</a> 的中文翻译，并保持了平均每周更新一次的水平，保证了中文版 Cairo Book 能即时跟进官方的更新：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b2f49dc2574bd698d1366149fd14c8ed0b34f123efb7b97c85ea73b81a69f956.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>工作记录：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/cairo-book/cairo-book.github.io/pulls?q=is%3Apr+is%3Aclosed+author%3Acryptonerdcn">https://github.com/cairo-book/cairo-book.github.io/pulls?q=is%3Apr+is%3Aclosed+author%3Acryptonerdcn</a></p><p>并且 Astro 在 CairoBook 中集成了 WASM-Cairo，可以直接在浏览器中运行 Cairo 代码，如果你也希望构建可以在浏览器运行的 Cairo 程序，可以通过 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/StarkNetAstroCN">Astro 推特</a>联系我们。</p><p>同时 WASM-Cairo 项目分别在 Pragma 举办的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://taikai.network/pragma-oracle/hackathons/Cairo1hackathon/projects/clj5axhze03yuu601gir28kbr/idea">Starknet 黑客松</a>和 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://app.buidlbox.io/projects/wasm-cairo">Eth Shanghai</a> 黑客松都获奖。</p><h3 id="h-starknet-workshop-in-shanghai" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>中国首届 Starknet Workshop in Shanghai</strong></h3><p>6 月 23-24 日我们在上海举办了中国首届 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/StarkNetAstroCN/status/1673569439944687616?s=20">Starknet Workshop</a>，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/cryptonerdcn">CryptoNerd</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="">Ben</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/xiangganzi">Xiang</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Real_Maxlion">Max</a> 四位讲师在现场帮助开发者快速了解 Starknet 技术堆栈，学习 Cairo 语法、STARK 证明生成、zkEVM 和排序器等 Cairo 开发高级内容。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5b7274fc61a5817c2da1205c748ec6d00aeda766dfa71ff0c599a5786800da80.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>这是第一天 Workshop 现场情况🔥</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d020111ca249d993ccfe7dfa822f6bcda921f0b2325b6186924c65743d273038.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>出人意料的是，除了开发者之外，也有很多 Starknet 项目团队和投资人来到现场，现场有 Starknet 四个全链游戏团队。连续两天的到场人数超过 50 人，第二天尽管有暴雨也不能浇灭大家对 Starknet 的热情🔥</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ca8c9868cdcae02ec3f7c42cd5080df67d5944678359b7dc590ffd0238a12b75.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>在会上我们介绍了我们开发的在线 Cairo 代码编辑器：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://astro-editor.netlify.app/">Astro Editor</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d5649feaf3651e10e5109bea75057da0477f468b5a21ac4994383d018b7d893e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">布道工作</h3><p>Astro 坚持向个人开发者以及开发团队布道 Cairo 语言以及 Starknet 上全链游戏、链上 AI、合约钱包&amp;账户抽象的创业机会。 Astro 也正在帮助三个钱包、游戏、NFT 团队进入 Starknet 生态，在未来将有更多中国开发团队登陆 Starknet 🚀</p><p>6 月 2 日，Type V dao 与 Astro 的共同举办了 Starknet 主题的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/TypeV_Official/status/1664549188858945538">Twitter Space</a>，我们在本次 Space 中介绍和分享了 Starknet 技术堆栈、生态进展以及和其他 L2 之间的差异。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d4c8cc5008f9ab3f097a40d112fc99151bc6efb8a8afa5c81ede69a55d9fff80.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>7 月 13 日 Astro 在 Starknet 主网升级到 v0.12 版本后举办了以 Starknet 主网升级为主题的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/StarkNetAstroCN/status/1679382264260751360?s=20">Twitter Space</a>，和众多 Starknet 开发者、爱好者以及 Astro 社区成员共同讨论 Starknet。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ceee83abc9e88904d6c08b9328e68a178da5270379a0c29826871f2fdcf5fc98.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>7 月 15 日，Astro 研究员 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/CynicSong">@CynicSong</a> 完成了对 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/kkrt-labs/kakarot">Kakarot</a> 的研究文章《<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/StarkNetAstroCN/status/1680195400417054720?t=LlqCQ_6LaPVkzj-0TRPasw&amp;s=19">Starknet的 EVM 兼容之路：Kakarot zkEVM 101》</a>，向中文读者介绍了 Kakarot。</p><p>特别感谢 Kakarot 创始人 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/ETazou">Elias</a> 及团队对本文的指导和支持。</p><p>Kakarot 是使用 Cairo 语言在 Starknet 上实现的zkEVM。它以 Cairo 智能合约的形式模拟了 EVM 的堆栈、内存、执行和其他方面。Kakarot 面临与 Starknet 帐户系统的兼容性、成本优化和稳定性等挑战，因为 Cairo 语言尚处于实验阶段。</p><p>Warp 是将 Solidity 代码转换为 Cairo 代码的转换器，在高级语言级别提供兼容性。另一方面，Kakarot 通过实现 EVM 的操作码和预编译，提供了在 EVM 级别的兼容性。</p><p>7 月 21 日，Astro 的 Dev Rel &amp; 研究员 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Real_Maxlion">Max</a>，向专注于公共物品的开发者社区 LXDAO 布道了 Starknet 技术堆栈与生态进展，主要基于 Astro 完成的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknet-astro.super.site/">Starknet 中文知识库</a>讲解。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/92a25bc5d961e6f406a74180fae9a5003aa029cf1878243ec8eb7b1e0d52c43d.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>未来计划</strong></h3><p>Astro 将于 8 月 21-27 日在成都举办 Starknet Hacker House，学员们将在 Astro 提供的学习环境里进行为期一周的开发学习，鼓励在此期间内构建自己的 Cairo 项目。具体内容和其他信息 Astro 将在接下来的活动文章中更新。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/de85450935014d0ebff7d71bd82e20617e370c067cea85d5a674ec257585c9e0.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>本次 Starknet Hacker House 是 Global Hacker House 的一部分，本次 Starknet Hacker House 是 Global Hacker House 的一部分，多个开发者社区将于八月份陆续在中国各城市开展 Hacker House。</p><p>报名链接 🔗</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://antalphalabs.typeform.com/hackerhouse">https://antalphalabs.typeform.com/hackerhouse</a></p><p>Astro 也将在未来开展第二期线上 Cairo BootCamp，它将包含账户抽象、全链游戏、STARK 证明器、排序器等 Cairo 高级开发课程。</p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/dffd709d5ec013249c4704ae3cc62878f686953a29aa57bdbd90e3802fb994c0.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Starknet的EVM兼容之路：Kakarot zkEVM 101]]></title>
            <link>https://paragraph.com/@starknet-astro/starknet-evm-kakarot-zkevm-101</link>
            <guid>yWuVr6IXBnGjYPdNkpbN</guid>
            <pubDate>Sat, 15 Jul 2023 11:51:44 GMT</pubDate>
            <description><![CDATA[TL;DR虚拟机是一个软件仿真的计算机系统，为程序提供执行环境。它可以模拟各种硬件设备，使程序在受控且兼容的环境中运行。以太坊虚拟机（EVM）是一种基于栈的虚拟机，用于执行以太坊智能合约。zkEVM是一种集成了零知识证明/有效性证明技术的EVM。它允许使用零知识证明验证EVM的执行过程，而无需所有验证者重新执行EVM。市场上有各种zkEVM产品，每个产品都有自己的方法和设计。需要zkEVM的原因在于对在Layer 2上支持智能合约执行的虚拟机的需求。此外，一些项目选择使用zkEVM来利用EVM的广泛用户生态系统，并设计更友好于零知识证明的指令集。Kakarot是使用Cairo语言在Starknet上实现的zkEVM。它以Cairo智能合约的形式模拟了EVM的堆栈、内存、执行和其他方面。Kakarot面临与Starknet帐户系统的兼容性、成本优化和稳定性等挑战，因为Cairo语言尚处于实验阶段。Warp是将Solidity代码转换为Cairo代码的转换器，在高级语言级别提供兼容性。另一方面，Kakarot通过实现EVM的操作码和预编译，提供了在EVM级别的兼容性。什么是虚拟机？要...]]></description>
            <content:encoded><![CDATA[<p>TL;DR</p><ul><li><p>虚拟机是一个软件仿真的计算机系统，为程序提供执行环境。它可以模拟各种硬件设备，使程序在受控且兼容的环境中运行。以太坊虚拟机（EVM）是一种基于栈的虚拟机，用于执行以太坊智能合约。</p></li><li><p>zkEVM是一种集成了零知识证明/有效性证明技术的EVM。它允许使用零知识证明验证EVM的执行过程，而无需所有验证者重新执行EVM。市场上有各种zkEVM产品，每个产品都有自己的方法和设计。</p></li><li><p>需要zkEVM的原因在于对在Layer 2上支持智能合约执行的虚拟机的需求。此外，一些项目选择使用zkEVM来利用EVM的广泛用户生态系统，并设计更友好于零知识证明的指令集。</p></li><li><p>Kakarot是使用Cairo语言在Starknet上实现的zkEVM。它以Cairo智能合约的形式模拟了EVM的堆栈、内存、执行和其他方面。Kakarot面临与Starknet帐户系统的兼容性、成本优化和稳定性等挑战，因为Cairo语言尚处于实验阶段。</p></li><li><p>Warp是将Solidity代码转换为Cairo代码的转换器，在高级语言级别提供兼容性。另一方面，Kakarot通过实现EVM的操作码和预编译，提供了在EVM级别的兼容性。</p></li></ul><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">什么是虚拟机？</h2><p>要讲清楚什么是虚拟机，必须先讲当今主流的冯诺依曼架构下的计算机执行流程。运行在计算机上的种种程序，通常是由高级语言经过层层转化，最终生成机器可理解的机器码完成执行的。根据转化为机器码的方式不同，高级语言可以大致分为编译型语言与解释型语言。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/77d8bad98b4518f647dcc328449f8891c9cccb7363cabbd2111f554ffacf930b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>编译型语言是指在代码的编写完成后，需要经过编译器的处理，将高级语言代码转换成机器码，生成可执行文件。一次编译就可以多次以较高效率执行。编译型语言的优点是因为在编译时已经将代码转换为机器码，因此执行速度快，并且可以在没有编译器的环境下运行程序，便于用户使用，不需要安装额外的软件。常见的编译型语言包括C，C++，Go等。</p><p>与编译型语言相对应的是解释型语言。解释型语言是指代码通过解释器逐行解释执行，直接运行在计算机上，每次运行都要重新进行翻译过程。解释型语言的优点是开发效率高，代码易于调试，但执行速度相对较慢。常见的解释型语言包括Python，JavaScript，Ruby等。</p><blockquote><p>需要强调，语言从本质上并不区分编译型和解释型，只是在最初设计时会有一些倾向。C/C++绝大多数情况下是编译执行，但是也可以解释执行（Cint、Cling）。很多传统意义上的解释型语言，现在是编译成中间代码在虚拟机上执行（Python、Lua）。</p></blockquote><p>知道了物理机的执行流程，现在来讲虚拟机。</p><p>虚拟机通常通过模拟不同的硬件设备来提供一个虚拟的计算机环境。不同的虚拟机可以模拟的硬件设备有所不同，但通常包括CPU、内存、硬盘、网络接口等。</p><p>以以太坊虚拟机EVM为例，EVM是一种基于堆栈的虚拟机，它被用于执行以太坊智能合约。EVM通过模拟CPU、内存、存储器和栈等硬件设备来提供一个虚拟的计算机环境。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f5aee0cf93deb18194eb11ae4ffa0f9c7c950cf383c2dc7aa6ccf11f75c8618a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>具体来说，EVM是一种基于堆栈的虚拟机，它使用堆栈来存储数据和执行指令。EVM的指令集包括各种操作码，例如算术操作、逻辑操作、存储操作、跳转操作等，这些指令可以在EVM的堆栈上执行，从而完成智能合约的执行。</p><p>EVM模拟的内存和存储器是用于存储智能合约的状态和数据的设备。EVM将内存和存储器视为两个不同的区域，它可以通过读取和写入内存和存储器来访问智能合约的状态和数据。</p><p>EVM模拟的栈用于存储指令的操作数和结果。EVM的指令集中的大多数指令都是基于堆栈的，它们从栈中读取操作数并将结果推回栈中。</p><p>总之，EVM通过模拟CPU、内存、存储器和栈等硬件设备来提供一个虚拟的计算机环境，它可以执行智能合约的指令并存储智能合约的状态和数据。在实际运行中，EVM会将智能合约的字节码加载到内存中，并通过执行指令集来执行智能合约的逻辑。EVM实际取代的是上图中操作系统+硬件的部分。</p><p>EVM的设计过程，显然是自下而上的，先敲定了模拟的硬件环境（堆栈、内存），再根据对应的环境设计了自己的一套汇编指令集（Opcode）与字节码（Bytecode）。尽管汇编指令集是给人看的，但是涉及到很多底层知识，对开发者的要求较高，开发起来也较繁琐，所以需要高级语言，屏蔽晦涩繁琐的底层调用，为开发者提供更好的体验。EVM由于其汇编指令集的的定制化设计，很难直接利用传统的高级语言，索性重新一个新的高级语言以适配该虚拟机。以太坊社区为了EVM执行效率设计了两种编译型的高级语言——Solidity和Vyper。Solidity自不必强调，Vyper是Vitalik针对Solidity中存在的部分缺陷进行改进后设计的EVM高级语言，但是在社区没有获得很高的采用度，于是渐渐淡出历史舞台。</p><h2 id="h-zkevm" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">什么是zkEVM</h2><p>简单来讲，zkEVM就是运用零知识证明/有效性证明技术的EVM，让EVM的执行过程，可以通过零知识证明/有效性证明来更高效、低成本地验证，而不需要所有验证者都重新进行EVM的执行过程。</p><p>市场上的zkEVM产品众多，赛道火热，主要玩家包括Starknet, zkSync, Scroll, Taiko, Linea, Polygon zkEVM（原Polygon Hermez） 等，被vitalik分为了5类（1、2、2.5、3、4）。具体的内容可以查看Vitalik的博客。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.ca/general/2022/08/04/zkevm.html">https://vitalik.ca/general/2022/08/04/zkevm.html</a></p><h2 id="h-zkevm" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">为什么需要zkEVM</h2><p>这个问题需要从两方面来看。</p><p>最初的zk Rollup尝试，都只能实现较为简单的转账、交易功能，例如zkSync Lite, Loopring等。但是曾经沧海难为水，用惯了以太坊上图灵完备的EVM，当无法通过编程创造多样的应用时，人们便开始呼唤L2上的虚拟机。撰写智能合约的需求，是为一。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3fb64cf87395625517c88892cb73fdf3d21f714b1665d3a77ee66cae4395adf3.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>由于EVM中部分设计对于生成零知识证明/有效性证明不友好，部分玩家选择了在底层使用对于零知识证明/有效性证明友好的指令集，例如Starknet的Cairo Assembly和zkSync的Zinc Instruction。但是大家同时也都不愿放弃EVM庞大的用户生态，于是选择在上层兼容EVM，是3、4类zkEVM。还有部分玩家仍然坚持EVM传统指令集Opcode，将精力放在为Opcode生成更高效的证明上，是1、2类zkEVM。EVM的庞大生态，是为二。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e0497539c76011e2e8e546972d34846c126d2a0d074a5f4a52140c6f82a54a08.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-kakarot" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Kakarot：虚拟机上的虚拟机？</h2><p>为什么能够在虚拟机上再做一个虚拟机？这个事情对于计算机从业者而言是司空见惯的，但是对于不了解计算机的用户可能没那么显然。其实很好理解，这就好像搭积木，只要下层足够牢固（有图灵完备的执行环境），就可以无上限地往上层叠加积木。但是不论搭了多少层，最后的执行还是要交给最底层的物理硬件去处理，所以层数增高会导致效率的降低。同时，由于不同积木的设计不同（虚拟机设计不同），随着积木越搭越高，积木倒塌的可能性就越大（运行出错），也就需要更高的技术水平支撑。</p><p>Kakarot是在Starknet上用Cairo语言实现的一个EVM，以Cairo智能合约形式去模拟EVM中堆栈、内存、执行等内容。相对而言，实现EVM并不是什么难事，除了使用率最高的Go-Ethereum中用Golang编写的EVM，现存的还有使用Python, Java, JavaScript, Rust编写的EVM。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6a81c7d593f3a1cd2eaeefe0d167764fe747dd6f498c416352c6401205db932c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Kakarot zkEVM的技术难点在于，协议是作为Starknet链上合约存在的，这就带来了两个关键的问题。</p><ol><li><p>兼容性 Starknet使用的是和以太坊完全不同的账户体系，以太坊中账户分为EOA（外部拥有账户）和CA（合约账户），然而Starknet中支持原生的账户抽象，所有账户都是合约账户。同时，由于使用的密码学算法不同，用户无法使用同一个熵在Starknet中生成与以太坊相同的地址。</p></li><li><p>成本 由于kakarot zkEVM是作为合约存在于链上的，所以对于代码实现有着较高的要求，需要尽可能地面向Gas进行优化，降低交互成本。</p></li><li><p>稳定性 与使用Golang, Rust, Python等传统高级语言不同，Cairo语言仍然处于试验阶段，从Cairo 0到Cairo 1再到Cairo 2（或者如果你喜欢的话，Cairo 1 version 2），官方团队仍然在不断修改语言特性。同时，Cairo VM还未得到足够的测试，不排除后续大规模重写的可能。</p></li></ol><p>kakarot协议由五个主要的组件组成（GitHub文档中写的是四个，未包含EOA，本文为了便于读者理解做了调整）：</p><ul><li><p>Kakarot (Core)：负责执行以太坊形式的交易，同时为以太坊用户提供对应的Starknet账户</p></li><li><p>Contract Accounts：以太坊意义上的CA，负责存储合约的字节码、合约中变量状态</p></li><li><p>Externally Owned Accounts：以太坊意义上的EOA，负责将以太坊交易转发给Kakarot Core</p></li><li><p>Account Registry: 存储以太坊账户和Starknet账户的对应关系。</p></li><li><p>Blockhash Registry：Blockhash作为一个特殊的Opcode，需要过去的区块数据，而Kakarot无法在链上直接获取到数据。该组件存储<code>block_number -&gt; block_hash</code>的映射关系，由管理员写入，提供给Kakarot Core。</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/527b7cb65cb237f7f1b07480e5ec476b52bfcd1faddcf9652aa68b9f3fd68f26.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>据kakarot CEO <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Eikix">Elias Tazartes</a>反馈，在团队的最新版本中，放弃了Account Resister的设计，改为直接使用一个31bytes的Starknet地址到20位EVM地址的mapping来保存对应关系。在未来，为了提高互操作性以及允许Starknet合约注册自己的EVM地址，可能会重新使用Account Register的设计。</p><h2 id="h-starknetevmwarpkakarot" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Starknet上兼容EVM：Warp与kakarot有什么差异</h2><p>按照Vitalik定义的zkEVM类型而言，Warp属于Type-4，而kakarot当前属于Type-2.5。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ede0c95401052700789d753652888fb9d26178431c59953b8900d8f25461ccbd.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Warp是一个将Solidity代码转化为Cairo代码的转译器，之所以不叫编译器，大概是因为输出的Cairo仍是高级语言。通过Warp，Solidity开发者可以维持原先的开发状态，而不需要学习新的Cairo语言。对于很多项目方而言，Warp降低了进入Starknet生态的门槛，不需要使用Cairo重写大量的工程代码。</p><p>转译的思想虽然简单，但是兼容性也是最差的，有部分Solidity代码无法很好地翻译为Cairo，涉及到账户体系、密码算法等代码逻辑需要修改源代码才能完成迁移，具体的不支持特征可见<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nethermindeth.github.io/warp/docs/get_around_unsupported_features/">Warp文档</a>。例如，许多项目会对EOA账户与合约账户的执行逻辑进行区分，但是Starknet中所有账户都是合约账户，这部分的代码就需要修改后才能进行转译。</p><p>Warp是在高级语言层面的兼容，kakarot是在EVM层面的兼容。</p><p>EVM的全部重写，Opcode与Pre-compile的逐条实现，让kakarot拥有了更高原生的兼容性。毕竟，在相同的虚拟机（EVM）中执行，总是要比在不同的虚拟机（Cairo VM）中执行来得更兼容一些。Account Registry、Blockhash Registry更是巧妙地屏蔽了不同体系下的差异，把对用户的迁移摩擦降到最小。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/23d9e28d709597bd783804375cf9a681d500b2314f049015baca7e92f9b1e0ab.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h1 id="h-kakarot" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Kakarot 团队</h1><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d1e3dfd4480e2b7bef6b57cb384370f623b6d7dd7f1e6a31b40b39d7ec07b192.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>感谢kakarot团队对本文提出的宝贵意见，特别是<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Eikix">Elias Tazartes</a>。Thank you, sir!</p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/d57c207d52272a90a6a2d57b0eeb23d562d60a5e11b005d6f04636a94d41278d.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[首届中文 Cairo Bootcamp 开启报名！]]></title>
            <link>https://paragraph.com/@starknet-astro/cairo-bootcamp</link>
            <guid>bTIeh8DbmzRGpHG0lHbM</guid>
            <pubDate>Fri, 19 May 2023 11:43:52 GMT</pubDate>
            <description><![CDATA[由 Starknet 官方支持的首届中文 Cairo BootCamp 将于本周末开始🚀 本次 Cairo Bootcamp 是一个短期、知识密集的培训项目，旨在帮助有编程经验的个人掌握 Cairo 编程语言，Cairo 是一种用于编写可证明程序的编程语言，目前 Starknet 将 Cairo 语言用于其基础设施和编写 Starknet 合约。 在本次培训中我们将专注于代码实践，旨在使学员迅速沉浸在编码环境中，以培养更多具有独立开发能力的 Cairo 开发者。我们将邀请研究员与开发者以网络直播的形式讲解 Cairo 语言的基础理论和代码实践。完成课时还可获得专属 NFT 结课证明 😎一、课程规划课程时长：六周 课程安排：共计六个课时，每周末一课，持续 90 分钟。每周中安排直播答疑。 实践开发：在 Starknet 独立部署 ERC-20 或 ERC-721 直播形式：腾讯会议 学员要求：具备编程基础二、课程大纲第一课：介绍 Starknet&Cairo 并部署开发环境 第二课：Cairo 语言介绍 第三课：在 Starknet 上发布 ERC20 代币（上） 第四课：在 ...]]></description>
            <content:encoded><![CDATA[<p>由 Starknet 官方支持的首届中文 Cairo BootCamp 将于本周末开始🚀</p><p>本次 Cairo Bootcamp 是一个短期、知识密集的培训项目，旨在帮助有编程经验的个人掌握 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cairo-lang.org/">Cairo</a> 编程语言，Cairo 是一种用于编写可证明程序的编程语言，目前 Starknet 将 Cairo 语言用于其基础设施和编写 Starknet 合约。</p><p>在本次培训中我们将专注于代码实践，旨在使学员迅速沉浸在编码环境中，以培养更多具有独立开发能力的 Cairo 开发者。我们将邀请研究员与开发者以<strong>网络直播</strong>的形式讲解 Cairo 语言的基础理论和代码实践。完成课时还可获得专属 <strong>NFT 结课证明</strong> 😎</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">一、课程规划</h3><p><strong>课程时长</strong>：六周</p><p><strong>课程安排</strong>：共计六个课时，每周末一课，持续 90 分钟。每周中安排直播答疑。</p><p><strong>实践开发</strong>：在 Starknet 独立部署 ERC-20 或 ERC-721</p><p><strong>直播形式</strong>：腾讯会议</p><p><strong>学员要求</strong>：具备编程基础</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">二、课程大纲</h3><p>第一课：介绍 Starknet&amp;Cairo 并部署开发环境</p><p>第二课：Cairo 语言介绍</p><p>第三课：在 Starknet 上发布 ERC20 代币（上）</p><p>第四课：在 Starknet 上发布 ERC20 代币（下）</p><p>第五课：在 Starknet 上发布 ERC721 代币（上）</p><p>第六课：在 Starknet 上发布 ERC721 代币（下）</p><p><strong>第一课将于北京时间 2023 年 5 月 21 日（周日） 20：00-21：30 开始</strong>，直播课将会持续 90 分钟，讲30分钟，提问 10 分钟，休息 10 分钟，讲 30 分钟，提问 10 分钟。我们将在课前和课后向学员提供相关教程文档。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">三、报名方式</h3><p>点击<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.google.com/forms/d/e/1FAIpQLSdfWJai37nnhbw5YIK7eXL2QFjSbiosswA8E_MeNc_ECMRMYg/viewform">报名表链接</a>进行报名。</p><p>并添加小助手微信进入 Cairo 学习群</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7a7043b4518221dfb0f74f9fef5c4f65f12e81f23c6433372db28331f07c48c9.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">四、官方支持</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e78d99b5a37a651db0842b39c4dea000946988f55fa966088006a6bd0e593c8d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>本届中文 Cairo Bootcamp 受到 Starknet 支持</strong>。Starknet 是去中心化的 Validity-Rollup（通常称为 ZK-Rollup）。它作为以太坊上的 L2 网络运行，使任何应用程序都能实现大规模扩展，而不会影响以太坊的可组合性和安全性。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">五、合作社区</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ff9a2607ae90c887c01f2f5985545bbafb79fd62d85faaebc031057b2b34783b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Antalpha_Labs"><strong>Antalpha Labs</strong></a> 是一个非盈利的 Web3 开发者社区，致力于通过发起和支持开源软件推动 Web3 技术的创新和应用。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9682537550e81b08fe6ebff694888a51dc0de12e4511e8520266d80b42f42a80.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.bewater.ai/"><strong>BeWater</strong></a> 是一个服务于 buidler / builder 的开放创新平台。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b0fa676e9854f4a6023724260b1773d9f7fb91fc8c1ce3d49551b020aa1f111f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://builderdao.notion.site/"><strong>BuidlerDAO</strong></a> 是一个 web3 项目和人才网络。聚集投研、技术、运营等领域的 Web3 实干家，以 DAO 的方式组织内容输出和产品实践，建立 Web3 人才网络和项目加速器。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6d6327ae3c1e83f8efecc955d2892513d1a0a00c3defb11211de2f5567983bbc.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Dapp_Learning?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor"><strong>Dapp Learning</strong></a> 是一个专注于以太坊开发的线上开源开发者社区。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0e4987948b8c6ca104341a8df0a2db343526ddc3563015df6d206eb4a54b6970.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/UpchainDAO">登链</a>是一个由一群区块链技术爱好者维护、秉承去中心化理念的区块链技术社区。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c651fc61c151cb06692ecda9806f21b3adaf7ef5afacf9953292cf69d4da9377.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/EthereumCN">以太坊中文社区</a>(ECN)是以太坊区块链的中文社区，致力于提供优质的以太坊前沿技术资讯、促进以太坊爱好者的分享交流、用心连接中国社区和国际社区。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1db163c060a678eb8dd9db3f1ea218ba81998bba6f4bf0d90c811c6b4e8c5f35.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.reddio.com/"><strong>Reddio</strong></a> 是一家专注 StarkWare 生态的基础设施公司，基于 StarkEx 提供简单易用、面向 Web2 开发者的 0 gas, 10k TPS 以太坊 App/Game Chain，同时为 Starknet 提供自动化开发工具，并将提供 0 gas 的 L3 部署方案</p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/390ae4b939f7c153ac58a994809b907730951331a376b2327b9bda0009a931fc.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Ninth 教程]]></title>
            <link>https://paragraph.com/@starknet-astro/ninth</link>
            <guid>RCot5Ki5xkM1tkt9xnHD</guid>
            <pubDate>Wed, 10 May 2023 07:41:14 GMT</pubDate>
            <description><![CDATA[介绍： "Ninth: Seance"是一个神秘的项目，结合了仪式和游戏元素。参与者可以通过祈祷和仪式来与未知存在互动。本教程将为您介绍如何参与并获得奖励。 活动时间：从4月25日下午2点（UTC）到5月25日下午2点（UTC）步骤：注册和准备：访问官方网站或点击链接：https://seance.ninth.gg/。进行注册并创建账户。游戏规则：在"Seance"游戏中，您需要选择使用的代币，这里提供了$USDT和$NOAH两个选项。进入一个房间并选择两个数字（0-9），以消耗20个$NOAH或$USDT完成祈祷。每个房间最多可容纳5名玩家。在所有玩家完成祈祷后，将产生获胜者。游戏将通过随机数预言机获得链下的随机数，并根据随机数的最后一位选择失败者。前4名获胜者将每人获得25个$NOAH或$USDT。失败者将失去所有投入的代币，但可获得积分（$NOAH区域为3分，$USDT区域为1分）。如果玩家在$USDT区域，还将额外获得30个$NOAH。请注意，活动结束后，游戏仍将继续开放，但只有在活动期间，失败者才能获得$NOAH作为奖励。$NOAH代币和奖励的获取：$NOAH是"The...]]></description>
            <content:encoded><![CDATA[<p>介绍： &quot;Ninth: Seance&quot;是一个神秘的项目，结合了仪式和游戏元素。参与者可以通过祈祷和仪式来与未知存在互动。本教程将为您介绍如何参与并获得奖励。</p><p>活动时间：从4月25日下午2点（UTC）到5月25日下午2点（UTC）</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/29301bdd734525bd7a7195b49bd48319b393a627a349bd93fc214986a044f6cc.webp" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>步骤：</p><ol><li><p>注册和准备：</p><ul><li><p>访问官方网站或点击链接：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://seance.ninth.gg/%E3%80%82"><strong>https://seance.ninth.gg/。</strong></a></p></li><li><p>进行注册并创建账户。</p></li></ul></li><li><p>游戏规则：</p><ul><li><p>在&quot;Seance&quot;游戏中，您需要选择使用的代币，这里提供了$USDT和$NOAH两个选项。</p></li><li><p>进入一个房间并选择两个数字（0-9），以消耗20个$NOAH或$USDT完成祈祷。每个房间最多可容纳5名玩家。</p></li><li><p>在所有玩家完成祈祷后，将产生获胜者。游戏将通过随机数预言机获得链下的随机数，并根据随机数的最后一位选择失败者。</p></li><li><p>前4名获胜者将每人获得25个$NOAH或$USDT。</p></li><li><p>失败者将失去所有投入的代币，但可获得积分（$NOAH区域为3分，$USDT区域为1分）。如果玩家在$USDT区域，还将额外获得30个$NOAH。</p></li><li><p>请注意，活动结束后，游戏仍将继续开放，但只有在活动期间，失败者才能获得$NOAH作为奖励。</p></li></ul></li></ol><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6ae1a8af144973a6f7dfebd34a9885cbefdccea232288b1fa36ac817a746b0af.webp" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><ol><li><p>$NOAH代币和奖励的获取：</p><ul><li><p>$NOAH是&quot;The Ninth&quot;的游戏内资产，可在&quot;The Ninth&quot;的所有游戏中获取和使用。</p></li><li><p>在当前阶段，您只能通过参与&quot;Seance&quot;游戏来收集$NOAH。</p></li></ul></li><li><p>奖励：</p><ul><li><p>活动期间，将开设积分排行榜：前20名的参与者将获得各种&quot;The Ninth: Acsendance&quot;奖励，以及$USDT和$NOAH奖励。</p></li><li><p>第1名：城市通行证NFT<em>1，NFT神秘盒</em>5，500美元USDT，5,000个$NOAH。</p></li><li><p>第2名：NFT神秘盒*3，200美元USDT，3,000个$NOAH。</p></li><li><p>第3名：NFT神秘盒*2，100美元USDT，2,000个$NOAH。</p></li><li><p>第4-10名：NFT神秘盒*1，1,000</p></li></ul></li></ol>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/a98ae3e5ee1f90c22bd8cc815e8aa51e278cede9030c33a7c942b165aab251fb.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Cairo 1.0 的内部机制：探索 Sierra]]></title>
            <link>https://paragraph.com/@starknet-astro/cairo-1-0-sierra</link>
            <guid>JhHiKgnOGfY4sChLl4rm</guid>
            <pubDate>Fri, 24 Mar 2023 08:29:34 GMT</pubDate>
            <description><![CDATA[译者导读Cairo 是一个图灵完备的 ZK 友好高级语言，也是以太坊 L2-Starknet 的合约开发语言，它正在进行改版升级。本篇文章是分析 Cairo 1.0 系列文章的第一篇，作者 Mathieu 分析了 Sierra 作为 Cairo 高级语言到 Cairo 汇编的中间层的设计动机与实现原理。文中提到了大量 Cairo 0 存在问题、Cairo 1 改进之处，并附有丰富的代码细节，推荐 Cairo 开发者阅读全文以深入了解 Cairo 1.0。 原文链接TL;DRSierra 在高级 Cairo 编程语言与更原始的编译目标（如 CASM）之间担任了重要的中间人角色，确保生成的 CASM 可在 Starknet 上安全运行。它的设计以安全为中心，使用一组函数来生成安全的 CASM 代码，结合强大的编译器和线性类型系统来防止运行时错误，以及内置 Gas 系统来防止无限循环。 在接下来的部分，我们将专注于理解 Sierra 程序的结构，提供了阅读和理解 Sierra 程序所需的基本要求。简介我（Mathieu）最近参加了 Starkware Sessions 的两场会议，分别...]]></description>
            <content:encoded><![CDATA[<h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">译者导读</h3><p>Cairo 是一个图灵完备的 ZK 友好高级语言，也是以太坊 L2-Starknet 的合约开发语言，它正在进行改版升级。本篇文章是分析 Cairo 1.0 系列文章的第一篇，作者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/@enitrat?source=post_page-----7f32808421f5--------------------------------">Mathieu</a> 分析了 Sierra 作为 Cairo 高级语言到 Cairo 汇编的中间层的设计动机与实现原理。文中提到了大量 Cairo 0 存在问题、Cairo 1 改进之处，并附有丰富的代码细节，推荐 Cairo 开发者阅读全文以深入了解 Cairo 1.0。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/nethermind-eth/under-the-hood-of-cairo-1-0-exploring-sierra-7f32808421f5">原文链接</a></p><h2 id="h-tldr" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">TL;DR</h2><p>Sierra 在高级 Cairo 编程语言与更原始的编译目标（如 CASM）之间担任了重要的中间人角色，确保生成的 CASM 可在 Starknet 上安全运行。它的设计以安全为中心，使用一组函数来生成安全的 CASM 代码，结合强大的编译器和线性类型系统来防止运行时错误，以及内置 Gas 系统来防止无限循环。 在接下来的部分，我们将专注于理解 Sierra 程序的结构，提供了阅读和理解 Sierra 程序所需的基本要求。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">简介</h2><p>我（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/@enitrat?source=post_page-----7f32808421f5--------------------------------">Mathieu</a>）最近参加了 Starkware Sessions 的两场会议，分别是 Shahar Papini 的“<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=-EHwaQuPuAASierra">Enforcing Safety Using Typesystems</a>”和 Ori Ziv 的“<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=wYxUedcdVZ4">Not Stopping at the Halting Problem</a>”。如果你想了解更多有关 Cairo 堆栈的信息，我强烈建议你观看这些视频。以下文章是一个系列的第一篇，我将深入了解 Sierra 以更好地理解 Cairo、其机制以及整个Starknet。</p><p>Sierra（Safe Intermediate Representation 安全中间表示）是高级语言 Cairo 和诸如 Cairo Assembly（CASM）之类的编译目标之间的中间层。该语言旨在确保安全并防止运行时错误。它使用编译器检测可能在编译时失败的操作，以确保每个函数都返回并且没有无限循环。Sierra 使用简单但强大的类型系统来表达中间层代码，同时确保安全性。这使得可以有效地编译成 CASM。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">动机</h2><p>在 Cairo 0 中，开发人员会使用 Cairo 编写 Starknet 合约，将其编译为 CASM，并直接部署编译输出到 Starknet 上。用户可以通过调用智能合约函数、签署交易并将其发送给排序器来与 Starknet 合约交互。排序器将运行交易以获取用户的交易费用，证明者（SHARP）将为包括此交易的批次生成 ZK 证明，排序器将收取包括交易在内的交易费用。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b01370adf37017104d8d69d9611394fdcf1e1eb0d5d7a12fa606457fd486adc7.png" alt="Cairo 0 交易流程" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Cairo 0 交易流程</figcaption></figure><p>然而，该 Cairo 0流程会产生一些问题：</p><ul><li><p>在 Cairo 中只有有效的语句才能被证明，所以无法证明失败的交易。无法证明无效的语句，例如 <code>assert 0 = 1</code>，因为它转换为无法满足的多项式约束。</p></li><li><p>交易执行可能会失败，导致交易未被包括在块中。在这种情况下，排序器会做无偿的工作。由于失败的交易没有有效的证明，它们不能被包括在内，也没有办法强制排序器收费。</p></li><li><p>排序器可能被 DDoS攻击，攻击者使用无效交易使其白干一场，而排序器无法收取运行这些交易的任何费用。</p></li><li><p>无法区分审查制度 censorship（当排序器故意决定不包括某些交易）和无效交易，因为这两种类型的交易都不会被包括在块中。</p></li></ul><p>在以太坊上，所有失败的交易都被标记为 <strong>reverted</strong>，但仍包括在块中，允许验证者在失败时收取交易费用。为了防止恶意用户用无效交易轰击网络并使排序器不堪重负，从而使合法交易无法处理，Starknet 需要一个类似的系统，允许排序器收取失败交易的费用。为了解决上述问题，Starknet 网络需要实现两个目标：完整性和有效性。完整性确保交易执行始终可以被证明，即使它预计会失败。有效性确保不会拒绝有效交易，从而防止审查制度。</p><p>Sierra 是构造正确的（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.zhihu.com/question/371062734">Correct-by-constrction</a>），让排序器为所有交易收费。我们可以部署分支代码（例如if/else），而不是可能失败的代码（例如asserts）。Cairo 1 的 asserts 被翻译成分支 Sierra 代码，允许错误传播回返回布尔值的原始入口点，表示交易成功或失败。如果入口点返回值为 true/false，则 Starknet 操作系统可以确定交易是否有效，并决定是否应用状态更新，如果交易成功。</p><p>Cairo 1 提供类似于 Rust 的语法，并通过抽象 Sierra 的安全构造来创建可证明的、开发人员友好的编程语言。它编译为 Sierra，这是 Cairo 代码的构造正确的中间表示，不包含任何失败语义。这确保了没有 Sierra 代码会失败，并且它最终编译为 CASM 的安全子集。开发人员可以专注于编写高效的智能合约，而不必担心编写非失败的代码，所有这些都具有改进的安全原语。</p><p>开发人员将会将他们的 Cairo 1 代码编译为 Sierra，并将 Sierra 程序部署到 Starknet 上，而不是将 CASM 代码部署到 Starknet 上。在声明交易时，排序器将负责将 Sierra 代码编译为 CASM，以确保不能在 Starknet 上部署失败的代码。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">构造正确</h2><p>为了设计一个不会失败的语言，我们必须首先确定 Cairo 0 中的不安全操作。包括：</p><ul><li><p>非法的内存地址引用；尝试访问未分配的内存单元</p></li><li><p>断言（assertions），因为它们可能会失败而无法恢复</p></li><li><p>由于 Cairo 的一次性写入内存模型，导致对同一内存地址的多次写入</p></li><li><p>无限循环，这使得无法确定程序是否会退出</p></li></ul><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">确保解引用不会失败</h2><p>在 Cairo 0 中，开发人员可以编写以下代码，试图访问未分配的内存单元的内容。</p><p><code>let (ptr:felt*) = alloc();</code></p><p><code>tempvar x = [ptr];</code></p><p>Sierra 的类型系统通过强制执行严格的所有权规则并利用 <code>Box</code> 等智能指针来防止常见的指针相关错误，从而使得在编译时能够检测和防止无效指针解引用。<code>Box&lt;T&gt;</code> 类型用作指向有效和已初始化指针实例的指针，并提供两个函数进行实例化和解引用：<code>box_new()</code> 和 <code>box_deref()</code>。通过使用类型系统在编译时捕获解引用错误，从而使得从 Sierra 编译的 CASM 避免了无效指针解引用。</p><h2 id="h-yuan" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">确保不会重复写入任何内存单元</h2><p>在 Cairo 0 中，用户将使用如下数组：</p><p><code>let (array:felt*) = alloc();</code></p><p><code>assert array[0] = 1;</code></p><p><code>assert array[1] = 2;</code></p><p><code>assert array[1] = 3; // fails</code></p><p>然而，尝试两次写入同一数组索引会导致运行时错误，因为内存单元只能被写入一次。为避免这个问题，Sierra 引入了一个 <code>Array&lt;T&gt;</code> 类型以及一个 <code>array_append&lt;T&gt;(Array&lt;T&gt;, value:T) -&gt; Array&lt;T&gt;</code> 函数。该函数接受一个数组实例和一个要附加的值，并返回指向新的下一个空闲内存单元的更新的数组实例。因此，值会按顺序附加到数组的末尾，而不必担心由于已经写入的内存单元可能导致的冲突问题。</p><p>为确保已经附加的先前使用的数组实例不会被重复使用，Sierra 使用<strong>线性类型系统</strong>确保对象仅使用一次。因此，任何已经被附加的 Array 实例不能在另一个 <code>array_append</code> 调用中重复使用。</p><p>下面的代码显示了一个 Sierra 程序的片段，该程序创建了一个 felt 数组，并使用 <code>array_append</code> 库函数两次追加值 <code>1</code>。在代码中，第一个 <code>array_append</code> 调用使用 id <code>[0]</code> 的数组变量作为输入，并返回一个表示更新的数组的 id <code>[2]</code> 变量。然后将此变量用作下一个 <code>array_append</code> 调用的输入参数。重要的是要注意，一旦被库函数使用，id <code>[0]</code> 的变量就不能被重复使用，尝试使用 id <code>[0]</code> 作为输入参数调用 <code>array_append</code> 将导致编译错误。</p><p><code>array_new&lt;felt&gt;() -&gt; ([0]);</code></p><p><code>felt_const&lt;1&gt;() -&gt; ([1]);</code></p><p><code>store_temp&lt;felt&gt;([1]) -&gt; ([1]);</code></p><p><code>array_append&lt;felt&gt;([0], [1]) -&gt; ([2]);</code></p><p><code>felt_const&lt;1&gt;() -&gt; ([4]);</code></p><p><code>store_temp&lt;felt&gt;([4]) -&gt; ([4]);</code></p><p><code>array_append&lt;felt&gt;([2], [4]) -&gt; ([5]);</code></p><p>对于可以多次重新使用的对象，比如 <code>felts</code>，Sierra 提供了 <code>dup&lt;T&gt;(T) -&gt; (T,T)</code> 函数，返回两个相同对象的实例，可以用于不同的操作。 这个函数仅适用于安全可复制的类型，通常是不包含数组或字典的类型。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">非故障断言</h2><p>通常使用断言来评估代码中特定点布尔表达式的结果。如果评估结果不符，就会引发错误。与 Cairo 0 中不同，Cairo 1 断言指令的编译将生成分支 Sierra 代码。如果不满足断言，则该代码将提前终止当前函数执行，并继续执行下一条指令。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">确保使用字典的程序的健全性</h2><p>字典和数组一样存在多次添加值的问题，可以通过引入特殊的 <code>Dict&lt;K,V&gt;</code> 类型和一组工具函数来实例化、检索和设置字典中的值来解决这个问题。然而，字典存在一个健全性问题。每个 Dict 都必须在程序结束时调用 <code>dict_squash(Dict&lt;K,V&gt;) -&gt; ()</code> 函数来压缩，以验证键更新序列的一致性。未压缩的字典是危险的，因为恶意证明者可以证明不一致更新的正确性。</p><p>正如我们之前所见，线性类型系统强制对象只能使用一次。唯一使用“使用”Dict 的方法是调用 <code>dict_squash</code> 函数，该函数使用字典实例并不返回任何内容。这意味着在将 Sierra 代码编译为 CASM 时将检测到未压缩的字典，并在编译时引发错误。对于其他不需要一次性使用的类型，通常是不包含 Dict 的类型， Sierra 引入 <code>drop&lt;T&gt;(T)-&gt;()</code> 函数，该函数使用对象的实例并不返回任何内容。</p><p>值得注意的是，<code>drop</code> 和 <code>dup</code> 都不会产生任何 CASM 代码。它们仅在 Sierra 层提供类型安全，确保变量仅使用一次。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">防止死循环</h2><p>确定程序最终会停止或永远运行是计算机科学中的一个基本问题，被称为停机问题，在一般情况下是无法解决的。在像 Starknet 这样的分布式环境中，用户可以部署和运行任意代码，因此防止用户运行无限循环代码是很重要的，例如以下 Cairo 代码。</p><p><code>fn foo() { foo() }</code></p><p>由于递归函数如果停止条件永远不满足就可能导致无限循环，因此 Cairo-to-Sierra 编译器将在递归函数开头注入 <code>withdraw_gas</code>方法。由于该功能尚未实现，因此开发人员仍需要在递归函数中调用 <code>withdraw_gas</code>并自行处理结果，尽管在未来版本中应该会包含在编译器中。</p><p>该 <code>withdraw_gas</code> 函数将通过计算函数中每条指令的运行成本来从交易总可用 Gas 中扣除运行函数所需的 Gas 数量。成本是通过确定每个操作需要多少步来分析的，大多数操作的步在编译时是已知的。在 Cairo 程序执行期间，如果 <code>withdraw_gas</code> 调用返回 null 或负值，则当前函数执行会停止，所有待处理的变量都将通过对未压缩字典调用 <code>dict_squash</code> 和对其他变量调用 <code>drop</code> 来消耗，并将被认为是执行失败。由于 Starknet 上的所有交易都有一个有限的可用 Gas 量来执行交易，因此避免了无限循环，并通过确保仍有足够的 Gas 可用来删除变量并停止执行，排序器将能够从事务失败中收取费用。</p><h2 id="h-casm" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">通过一组有限的指令实现安全的CASM</h2><p>Sierra 的主要目标是确保生成的 CASM 代码不会失败。为实现这一目标，Sierra 程序由调用 <code>libfuncs</code> 的语句组成。这些是一组内置库函数，为这些函数生成的 CASM 代码是保证安全的。例如，<code>array_append</code> 库函数生成的安全 CASM 代码可用于将值附加到数组中。</p><p>通过仅允许一组安全和可信赖的库函数来实现代码安全的这种方法类似于 Rust 编程语言的哲学。通过提供一组安全和可信赖的抽象，这两种语言都有助于避免常见的编程错误，并增加代码的安全性和可靠性。Cairo 1 使用了与 Rust 类似的所有权和借用系统，为开发人员提供了一种在编译时推理代码安全性的方式，这有助于防止错误并提高整体代码质量。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">免责声明</h2><p>本文旨在为读者提供通用信息和理解，不表示 Nethermind 支持任何特定资产、项目或团队，也不保证其安全性。Nethermind 没有明示或暗示地向本文中包含的信息或观点的准确性或完整性作出任何陈述或保证。任何第三方不得以任何方式依赖本文，包括但不限于金融、投资、税收、监管、法律或其他建议，或将本文解释为任何形式的建议。 请注意，虽然 Nethermind 为 Starkware 提供服务，但本文不是这些服务的一部分。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">关于我们</h2><p>Nethermind 是一个由世界级建设者和研究者组成的团队。我们为全球企业和开发人员提供访问和构建去中心化 Web 的能力。我们的工作触及 Web3 生态系统的每个部分，从 Nethermind 节点到基础密码学研究和 Starknet 生态系统的基础设施。发现我们的 Starknet 工具套件：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nethermind.io/warp/">Solidity 转 Cairo 编译器 Warp</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nethermind.io/voyager/">StarkNet 区块浏览器 Voyager</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nethermind.io/horus/">针对 StarkNet 智能合约的开源形式验证工具 Horus</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NethermindEth/juno">StarkNet 客户端实现 Juno</a>，以及 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nethermind.io/smart-contracts-audits/">Cairo 智能合约安全审计服务</a>。 如果您有兴趣解决一些区块链中最困难的问题，请访问我们的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nethermind.page.link/careers">求职信息</a>！</p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/885ad55ee3d659c9499a7e027197d5328ce784fb9cb78c0ff5c2b4f332b41268.webp" length="0" type="image/webp"/>
        </item>
        <item>
            <title><![CDATA[What’s Starknet: a diffirent zkVM tech stack]]></title>
            <link>https://paragraph.com/@starknet-astro/what-s-starknet-a-diffirent-zkvm-tech-stack</link>
            <guid>kyLY75zrXZtDbff62h7I</guid>
            <pubDate>Tue, 14 Mar 2023 11:40:58 GMT</pubDate>
            <description><![CDATA[SummaryHow Starknet Works: Compares to Ethereum, Starknet only needs a sequencer to executes calculations off-chain. Then, in order to reduce the amount of data, the prover generates a ZK-STARK proof for the transaction. Finally, verifier verifies the correctness of the proof on-chain, and finally bundles multiple L2 transactions into a single transaction on Ethereum (known as Rollup). Therefore, Starknet reduces the execution and storage cost on the chain, resulting in lower gas fees and hig...]]></description>
            <content:encoded><![CDATA[<h3 id="h-summary" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Summary</h3><ol><li><p><strong>How Starknet Works</strong>: Compares to Ethereum, Starknet only needs a sequencer to executes calculations off-chain. Then, in order to reduce the amount of data, the prover generates a ZK-STARK proof for the transaction. Finally, verifier verifies the correctness of the proof on-chain, and finally bundles multiple L2 transactions into a single transaction on Ethereum (known as Rollup). Therefore, Starknet reduces the execution and storage cost on the chain, resulting in lower gas fees and higher TPS.</p></li><li><p><strong>EVM-equivalent:</strong> Starknet has a ZK-friendly Cairo VM which is different from EVM, which means Starknet does not support EVM and Solidity. But with the introduction of the Solidity compiler <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NethermindEth/warp">Warp</a> and the Cairo zkEVM <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/sayajin-labs/kakarot">Kakarot</a>, Starknet can achieve type 3 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.ca/general/2022/08/04/zkevm.html">EVM-equivalent</a>.</p></li><li><p><strong>STARK Proof System:</strong> Compared with other ZK proof systems, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eprint.iacr.org/2018/046.pdf">STARK</a> is safer and more scalable. Its proof generation speed linearly scalable, and verification time and proof size are <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://en.wikipedia.org/wiki/Logarithmic_scale">logarithmically scalable</a>($O(polylog(N))$). The larger the proof, the lower the total cost and verification time. Additionally, STARK relies purely on hashing and information theory, so it has simpler cryptography assumptions, making it resistant to quantum attacks. But it’s disadvantage is that the size of the initial proof generation is large.</p></li><li><p><strong>Cairo VM and Language:</strong> The <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.cairo-lang.org/">Cairo</a> VM is a STARK-friendly, Turing-complete von-Neumann CPU architecture. It can perform infinitely close to ASIC through software programming. And it has a programming language called Cairo, which is based on Cairo assembly AIR and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/starkware/cairo-1-0-aa96eefb19a0">Sierra</a>. This makes it highly efficient and safe to compile. It is similar to Rust, have a certain learning difficulty. Cairo supports verifiers to verify programs through bytecode hashes, improves on-chain scalability and privacy. But Cairo is still updating.</p></li></ol><p>In another article, we’d show the progress of decentralization of prover, sequencer, full node, client, Cairo, protocol and other Starknet network components.</p><h2 id="h-how-starknet-works" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">🛒 How Starknet Works</h2><p>First of all, let&apos;s see how Ethereum works. In Ethereum, verifying the correctness of transactions requires all nodes to check, validate, and execute each transaction. This process ensures the accuracy of the computation and broadcasts the resulting state changes across the network.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/62717b368ac402a2711b1f2541ea2b34bd8148175d1474be818352b9e41608da.png" alt="https://ethereum.org/en/developers/docs/evm/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethereum.org/en/developers/docs/evm/</figcaption></figure><p>But Starknet only executes calculations off-chain and generates a proof, then verifies the correctness of the proof on-chain, and finally bundles multiple L2 transactions into a single transaction on Ethereum. Accurately ZKR will write transactions to Ethereum as <code>calldata</code>, where data that is included in external calls to smart contract functions gets stored(similar to memory).</p><p>So Starknet can greatly improve network operation speed, reduce on-chain communication, increase network throughput, and therefore has higher TPS and lower gas compared to Ethereum.</p><p>In short, verifying the correctness of a calculation can be compared to a teacher needing to check whether the class has mastered a certain topic.</p><p><strong>The Ethereum method is to check that each student (node) if has memorized the entire textbook (state history), while the Starknet method is to administering a paper test. The latter being more efficient and less costly, but still guaranteed to be safe.</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f02ae906632d4ee774a304ee482402c1776d416087c09068f32c66ad389ae573.png" alt="it&apos;s not more boring than text exam" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">it&apos;s not more boring than text exam</figcaption></figure><p>As with most ZKRs such as Validity Rollup, Scroll, Polygon zkEVM and zkSync, Starknet has a class of roles called provers to generate proofs. And the verifiers verify the proofs as a contract on L1 (Ethereum).</p><p>Specifically, Starknet consists of five components: Prover, Sequencer, and Full Node on Starknet, as well as Verifier and Starknet Core (they are all deployed on Ethereum).</p><p>The following figure shows the architecture of Starknet, thanks to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/barretodavid">David</a> for his great work!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2aa7fa16508d714af4126739740346d2535ea905dbd2c426575dadb9c319cafc.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The workflow of Starknet is as follows:</p><ol><li><p>When we initiate a transaction on Starknet, an off-chain server—the sequencer—receives, sequences, validates, and bundles them into blocks. Execute the transaction, and then send the state transition to the Starknet Core contract.</p></li><li><p>The prover generates a proof for every transaction and send it to the verifier contract deployed on Ethereum.</p></li><li><p>The verifier sends the result of the validation to the StarkNet Core contract on Ethereum, and triggers a new set of Ethereum transactions from StarkNet Core contract to update the global state on-chain for record keeping. State transition is sent as &quot;calldata&quot; (Blob after EIP-4844) to save L1 transaction gas. These &quot;metadata&quot; can be decrypted by Starknet full nodes.</p></li></ol><p>A <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/eqlabs/pathfinder">full node</a> stores state changes, metadata, proofs, and records all transactions performed in Rollup. It tracks the current global state of the system. Decrypting the &quot;metadata&quot; allows for the reconstruction of Starknet&apos;s history when necessary.</p><h2 id="h-evm-equivalent" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">🚄EVM-equivalent</h2><p>The Starknet network itself is not EVM-equivalent and has designed a ZK-friendly Cairo VM.</p><p>Instead of making circuits for the Ethernet opcode, Starknet has made its own set of assembly language, AIR (Algebraic Intermediate Representation), and high-level language Cairo that are more ZK-friendly.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b7c2fd9c36ef551108ff08f8be08ecd5a9b934a05119e1eb17da535a5d80cfd4.png" alt="https://drive.google.com/file/d/1dhZ5GtSK4sHCNcklGzNHfR-lSzplpD8J/view " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://drive.google.com/file/d/1dhZ5GtSK4sHCNcklGzNHfR-lSzplpD8J/view</figcaption></figure><p>The disadvantage of not being equivalent with EVM is that it cannot inherit the Ethereum’s Solidity code and toolchain, so there is no basis for large-scale migration of the Ethereum application ecosystem to Starknet. The Cairo language has a certain learning threshold for developers, and the Cairo toolchain and libraries are in their infancy.</p><p>However, designing independent VM has its benefits. For instance, Starknet&apos;s Cairo VM is more ZK-friendly and executes circuits more efficiently, resulting in higher TPS and lower gas usage in the future (more details to follow). Additionally, abandoning EVM design opens up many possibilities for application innovations that are not possible on Ethereum.</p><p>Starknet belongs to the type 4 level <strong>EVM-equivalent</strong> defined by Vitalik (strictly speaking, Starknet is a zkVM).</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0b44c2905b5758955acc0b687dccd38e786affd2b6613c41367c8d8ad5e1937b.png" alt="https://vitalik.eth.limo/general/2022/08/04/zkevm.html" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://vitalik.eth.limo/general/2022/08/04/zkevm.html</figcaption></figure><p>Although Starknet “itself” is not EVM-equivalence, Starknet is still equivalent with Ethereum in other ways.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NethermindEth/warp">Warp</a> is a Solidity-Cairo translator, now complete, developed by Nethermind. It possible for Warp to transpile Ethereum smart contracts to Starknet Cairo Contracts.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/63f94365e2fb7bba408998c2816a446511298dd1afee2ce3c20fa20d67c3270a.png" alt="https://github.com/NethermindEth/warp" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://github.com/NethermindEth/warp</figcaption></figure><p>However, there are several features of Solidity that are not yet supported or do not have analogs in Starknet. While <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NethermindEth/warp">some of these features</a> may be introduced in the future, others may not be possible due to fundamental differences between the platforms.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/KakarotZkEvm">Kakarot</a> is a zkEVM written in Cairo(so it’s a contract), bytecode-equivalent EVM and allow developers run any EVM bytecode program. Ethereum applications can be deployed on Starknet by deploying to Kakarot.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/547290134398a918c5ffc1ba4005a1adc43aa71035feb6516272899c8a46c0a1.png" alt="https://github.com/sayajin-labs/kakarot" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://github.com/sayajin-labs/kakarot</figcaption></figure><p>Kakarot is a work in progress and is not yet ready for production.</p><p>Starknet&apos;s ZK-friendly Cairo VM does not support EVM and Solidity. However, by introducing the Solidity compiler Warp and the Cairo zkEVM Kakarot, it will be possible for Starknet to achieve a type 3 EVM-equivalent.</p><h2 id="h-stark-proof-system" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">🧬 STARK Proof System</h2><p>Currently, there are many different proof systems available for generating and verifying proofs, such as Halo, PLONK, Groth16, Groth09, Marlin, and Plonky2, etc., which all belong to the SNARK proof system. Every proof system has a prover who generates proofs and a verifier who verifies the proofs. Different ZK projects almost use different proof systems. The main proof systems are SNARK and STARK. And Starknet uses STARK.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b5d8f6bce9cdd6c50a062da919589f59ddf04f5f3162845cefcc801c2eb634d6.png" alt="https://medium.com/alliancedao/zkps-in-web-3-now-and-the-future-21b459348f29" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/alliancedao/zkps-in-web-3-now-and-the-future-21b459348f29</figcaption></figure><p>SNARK stands for Succinct Non-interactive Argument of Knowledge, while STARK stands for Scalable Transparent Argument of Knowledge. STARK is a special and innovative type of SNARK, with &quot;S&quot; changing from Succinct to Scalable and &quot;T&quot; standing for transparent, replacing the non-interactive feature.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e634277ea50213687b89d9d59a32cbc824d6285287779f0d2fb2cf8cff8eca3d.png" alt="https://www.altoros.com/blog/zero-knowledge-proof-improving-privacy-for-a-blockchain/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.altoros.com/blog/zero-knowledge-proof-improving-privacy-for-a-blockchain/</figcaption></figure><p>STARK has more innovations than SNARK. It does not need to rely on &quot;trusted settings&quot; like SNARKs. It also comes with simpler cryptography assumptions, avoids the need for elliptic curve, pairing, and exponential knowledge assumptions, relies purely on hashing and information theory, and is therefore resistant to quantum attacks. Generally speaking, STARK is more secure than SNARK.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0d9e014a60d6eb1f70cb5257b635629d40bee2bb2209048b8aa1282861e0e0cf.png" alt="https://research.thetie.io/zero-knowledge-starks-snarks/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://research.thetie.io/zero-knowledge-starks-snarks/</figcaption></figure><p>And STARK is more scalable. Proof generation speed is linearly scalable, and verification time and proof size are logarithmically scalable. However, the disadvantage is that the generated proof size is larger. As the size of the proof increases, the cost of verification decreases marginally, meaning that the larger the proof, the lower the average cost.</p><h3 id="h-proof-time-scales-linearly" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Proof time scales linearly</h3><p>Let&apos;s take a look at the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eprint.iacr.org/2021/582.pdf">doc</a> for STARKs. The amount of time spent by the prover scales nearly linearly with the number of hash invocations.</p><p>At 80-bit security, STARK takes 1 second to execute for every 12,288 hash invocations, yielding 12,288 invocations per second; while it takes 10 seconds for every 98,304 hash invocations, yielding 9,830 invocations per second. Therefore, we can know the amount of time spent by the prover scales nearly-linearly in the number of hash invocations, as shown in the following figure:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/786b4bb0a93994e9495fe38611ad6e01bcdca4febf4786674539cc61c0833b05.png" alt="https://eprint.iacr.org/2021/582.pdf" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://eprint.iacr.org/2021/582.pdf</figcaption></figure><h3 id="h-verifier-time-and-proof-size-scales-logarithmically" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Verifier time and proof size scales logarithmically</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1c1961a1053289116f8e5473dfbf6652d3fad8ab71326a3e3dc2585df9f8b3f8.png" alt="https://eprint.iacr.org/2021/582.pdf" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://eprint.iacr.org/2021/582.pdf</figcaption></figure><p>As you can see on the left, when the hash invocations is increased from 3,072 to 49,152, the verification time increases from 40 ms to 60 ms. And when the hash invocations increases from 49,152 to 786,432, the verification time only increases from 60 ms to 80 ms. The proof size is the same. Therefore, we can conclude that the more hash invocations, the shorter the average verification time and the smaller the average proof size.</p><p>As an example: Verification of the proofs of two programs of 1 million steps</p><p>● Total verification cost of each verified separately: $2 log2(T) \approx 794$</p><p>● Total verification cost of both verified together: $log2(2T) \approx 438$</p><p>Cost reduction of factor 1.8 (or almost 2)</p><p>All the experiments, for both the prover and the verifier, were run on the same machine with the following specifications:</p><ol><li><p>Operating-System: Linux 5.3.0-51-generic x86 64.</p></li><li><p>CPU: Intel(R) Core(TM) i7-7700K @ 4.20GHz (4 cores, 2 threads per core).</p></li><li><p>RAM: 16GB DDR4 (8GB × 2, Speed: 2667 MHz) While the prover uses multi-threading, in all of the experiments the verifier was restricted to utilize only a single thread.</p></li></ol><h3 id="h-recursive-proving" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Recursive Proving</h3><p>A universal and succinct proof/argument of knowledge system, such as STARKs, can be used to incrementally verify computation. This means that a computation can generate a proof that attests to the correctness of a previous instance of that computation. This concept is known informally as &quot;recursive proof composition&quot; or &quot;recursive STARKs.”</p><p>In other words, a recursive STARK prover would generate a proof for a statement saying the state of a system can be moved from a to <code>a+1</code> because the prover has verified a (recursive) proof attesting to the computational integrity of <code>a</code> and has faithfully executed the computation on the state <code>a</code>, reaching the new state <code>a+1</code>.</p><p><strong>In short, you can understand that the recursive proving combines two proofs,</strong> <code>a</code> and <code>a+1</code>, into a single proof. As the following figure shows:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/12863b8d4e5ef88701e3024cbd8d2ba3ae53ae3ccd3d3a4f737e67219aa40263.png" alt="https://medium.com/starkware/recursive-starks-78f8dd401025" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/starkware/recursive-starks-78f8dd401025</figcaption></figure><p>In this example, four statements are sent to SHARP (a Verifier) and each statement is proven in parallel. Then, each pair of proofs is validated by a Recursive Verifier statement, which is a Cairo program that verifies a STARK proof, and a proof is generated for each validation. This Recursive Verifier statement confirms that two proofs have been verified to be correct. Next, the two proofs are merged again by another Recursive Verifier statement. This results in one proof that attests to all four original statements. Finally, this proof can be submitted on-chain and verified by a Solidity verifier smart contract.</p><p>According to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cointelegraph.com/news/60-million-nfts-could-be-minted-in-a-single-transaction-starkware-founder">Eli Ben-Sasson</a>, co-founder of StarkWare, the new recursive validity proofs have the potential to rollup to 60 million transactions into a single one on the Ethereum blockchain.</p><h3 id="h-cairo-vm-and-cairo-language" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">⭐Cairo VM and Cairo Language</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7b09fdb72dcfea0900130490216f16b3ae35dde8ce79a60ab35349acce74f3bf.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.cairo-lang.org/">Cairo</a> VM is a STARK-friendly, Turing-complete von-Neumann CPU architecture. It includes a programming language called Cairo, which is based on Cairo assembly and AIR (Algebraic Intermediate Representations), making it highly efficient to compile.</p><p>Let&apos;s first take a look at Cairo VM. Cairo VM is a parallel state machine that allows transactions to be executed concurrently, significantly increasing TPS. In contrast, EVM is a serial state machine.</p><p>Cairo is a smart contract language that can be deployed on or off Starknet. Any Cairo program can generate STARK proofs. Its syntax is similar to Rust.</p><p>This a Cairo <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.cairo-lang.org/docs/hello_cairo/voting.html">voting system</a> example:</p><pre data-type="codeBlock" text="import json

from starkware.crypto.signature.signature import (
    pedersen_hash, private_to_stark_key, sign)

# Set an identifier that will represent what we&apos;re voting for.
# This will appear in the user&apos;s signature to distinguish
# between different polls.
POLL_ID = 10018

# Generate key pairs.
priv_keys = []
pub_keys = []

for i in range(10):
    priv_key = 123456 * i + 654321  # See &quot;Safety note&quot; below.
    priv_keys.append(priv_key)

    pub_key = private_to_stark_key(priv_key)
    pub_keys.append(pub_key)

# Generate 3 votes of voters 3, 5, and 8.
votes = []
for (voter_id, vote) in [(3, 0), (5, 1), (8, 0)]:
    r, s = sign(
        msg_hash=pedersen_hash(POLL_ID, vote),
        priv_key=priv_keys[voter_id])
    votes.append({
        &apos;voter_id&apos;: voter_id,
        &apos;vote&apos;: vote,
        &apos;r&apos;: hex(r),
        &apos;s&apos;: hex(s),
    })

# Write the data (public keys and votes) to a JSON file.
input_data = {
    &apos;public_keys&apos;: list(map(hex, pub_keys)),
    &apos;votes&apos;: votes,
}

with open(&apos;voting_input.json&apos;, &apos;w&apos;) as f:
    json.dump(input_data, f, indent=4)
    f.write(&apos;\n&apos;)
"><code>import json

from starkware.crypto.signature.signature import (
    pedersen_hash, private_to_stark_key, sign)

<span class="hljs-comment"># Set an identifier that will represent what we're voting for.</span>
<span class="hljs-comment"># This will appear in the user's signature to distinguish</span>
<span class="hljs-comment"># between different polls.</span>
<span class="hljs-attr">POLL_ID</span> = <span class="hljs-number">10018</span>

<span class="hljs-comment"># Generate key pairs.</span>
<span class="hljs-attr">priv_keys</span> = []
<span class="hljs-attr">pub_keys</span> = []

for i in range(10):
    <span class="hljs-attr">priv_key</span> = <span class="hljs-number">123456</span> * i + <span class="hljs-number">654321</span>  <span class="hljs-comment"># See "Safety note" below.</span>
    priv_keys.append(priv_key)

    <span class="hljs-attr">pub_key</span> = private_to_stark_key(priv_key)
    pub_keys.append(pub_key)

<span class="hljs-comment"># Generate 3 votes of voters 3, 5, and 8.</span>
<span class="hljs-attr">votes</span> = []
for (voter_id, vote) in <span class="hljs-section">[(3, 0), (5, 1), (8, 0)]</span>:
    r, <span class="hljs-attr">s</span> = sign(
        <span class="hljs-attr">msg_hash</span>=pedersen_hash(POLL_ID, vote),
        <span class="hljs-attr">priv_key</span>=priv_keys[voter_id])
    votes.append({
        'voter_id': voter_id,
        'vote': vote,
        'r': hex(r),
        's': hex(s),
    })

<span class="hljs-comment"># Write the data (public keys and votes) to a JSON file.</span>
<span class="hljs-attr">input_data</span> = {
    'public_keys': list(map(hex, pub_keys)),
    'votes': votes,
}

with open('voting_input.json', 'w') as f:
    json.dump(input_data, f, <span class="hljs-attr">indent</span>=<span class="hljs-number">4</span>)
    f.write('\n')
</code></pre><p>Cairo programs are collections of assembly code, and Cairo developers will write smart contracts in the high-level language Cairo rather than Cairo assembly. When we write a Cairo program, the Cairo compiler will compile the Cairo code into Cairo assembly, and the Cairo assembler will take the assembly code and generate Cairo bytecode (which runs on the Cairo CPU) to be executed in the Cairo VM.</p><p>Here are some Cairo&apos;s features.</p><h3 id="h-bootloading-loading-programs-from-their-hash" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Bootloading: Loading programs from their hash</h3><p>A program may write the bytecode of another program to memory and then set the Program Counter to point to that memory segment, thus starting the execution of the other program.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/027ecf51d412d478e912268b01e5b3a7e6c25d70907c5766f215caa22faffefe.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>One specific use of this idea is “Bootloading from hash”: A program, called “the bootloader” computes and outputs the hash of the bytecode of another program and then starts executing it as above. This way, the verifier only needs to know the hash of the program being executed and not its full bytecode.</p><p>This improves both privacy and scalability:</p><ol><li><p><strong>Privacy</strong>: the verifier can verify the execution of a program without knowing what the computation does.</p></li><li><p><strong>Scalability</strong>: assuming the program hash is known to the verifier, the verification time does not depend linearly on the program size, as would be the case if the program – rather than its hash – were given as input to the verifier. Verification time and program size have a logarithmic relationship, as mentioned in the STARK section.</p></li></ol><p><strong>CPU Architecture</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/200bcc4916f5d14c45c13614468500f2766ef02a30ee2d91f2666b7c8ef37866.webp" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Cairo VM is flexible. It can be infinitely close to the performance of AISC through software programming.</p><h3 id="h-builtins" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Builtins</h3><p>Developers can debug and use the internal setting function directly to reduce the amount of calculation development needed without converting any code.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ccf52a3e3f0b0a652761472644c9830e8f2242177496b4bd62c75f74dbc81824.png" alt="https://medium.com/@pban/demystifying-cairo-white-paper-part-i-b71976ad0108" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/@pban/demystifying-cairo-white-paper-part-i-b71976ad0108</figcaption></figure><p>The circuit represented by the ASIC chip or the experiment described in the developer&apos;s mathematics is equivalent to Cairo&apos;s circuit. However, Cairo is still being updated, and the latest version is called <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/starkware/cairo-1-0-aa96eefb19a0">Cairo 1.0.</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/03bc27076052fecbc0e127b03d27fbae4c530c36565aa16349ab28dd3757dea3.png" alt="https://medium.com/starkware/cairo-1-0-aa96eefb19a0" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/starkware/cairo-1-0-aa96eefb19a0</figcaption></figure><p>The main addition in Cairo 1.0 is Sierra (Safe Intermediate Representation). It serves as a new intermediate representation layer between Cairo 1.0 and Cairo bytecode. Sierra’s goal is to ensure that every Cairo run — i.e. a Cairo program and its input — can be proven.</p><h2 id="h-acknowledgement" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Acknowledgement</h2><p>Special thanks to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cyberight.capital/">Cyberight Capital</a> for supporting this article.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/60f415d0eef872644d4bcab2cec0d684395659f5c802ed1f9c100dc9be38875a.jpg" alt="https://cyberight.capital/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://cyberight.capital/</figcaption></figure><p>Cyberight Capital is an alternative investment institution. We discover the valid potential points of the industry by changing roles and respect for people and technology. Focusing on Humanist, Technology Driven, Independent Thinking.</p><h2 id="h-reference" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Reference</h2><p>[1]Starknet architecture review</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://david-barreto.com/starknets-architecture-review/#more-4602">https://david-barreto.com/starknets-architecture-review/#more-4602</a></p><p>[2]l2beat_final</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://drive.google.com/file/d/1dhZ5GtSK4sHCNcklGzNHfR-lSzplpD8J/view">https://drive.google.com/file/d/1dhZ5GtSK4sHCNcklGzNHfR-lSzplpD8J/view</a></p><p>[3]ZKPs in Web 3: Now and the Future</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/alliancedao/zkps-in-web-3-now-and-the-future-21b459348f29">https://medium.com/alliancedao/zkps-in-web-3-now-and-the-future-21b459348f29</a></p><p>[4]A Zero-Knowledge Proof: Improving Privacy on a Blockchain</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.altoros.com/blog/zero-knowledge-proof-improving-privacy-for-a-blockchain/">https://www.altoros.com/blog/zero-knowledge-proof-improving-privacy-for-a-blockchain/</a></p><p>[5]The Zero Knowledge Frontier: On SNARKs, STARKs, and Future Applications</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://research.thetie.io/zero-knowledge-starks-snarks/">https://research.thetie.io/zero-knowledge-starks-snarks/</a></p><p>[6]Cairo White Paper</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.cairo-lang.org/cairo-whitepaper/">https://www.cairo-lang.org/cairo-whitepaper/</a></p><p>[7]Demystifying Cairo White Paper — Part I <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/@pban/demystifying-cairo-white-paper-part-i-b71976ad0108">https://medium.com/@pban/demystifying-cairo-white-paper-part-i-b71976ad0108</a></p><p>[8]Demystifying Cairo White Paper — Part II</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/@pban/demystifying-cairo-white-paper-part-ii-9f9dc51886e9">https://medium.com/@pban/demystifying-cairo-white-paper-part-ii-9f9dc51886e9</a></p><p>[9]Scalable, transparent, and post-quantum secure computational integrity</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eprint.iacr.org/2018/046.pdf">https://eprint.iacr.org/2018/046.pdf</a></p><p>[10]ethSTARK docs</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eprint.iacr.org/2021/582.pdf">https://eprint.iacr.org/2021/582.pdf</a></p><p>[11]Recursive STARKs</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/starkware/recursive-starks-78f8dd401025">https://medium.com/starkware/recursive-starks-78f8dd401025</a></p><p>[12]AIR docs</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/pdf/2109.14534.pdf">https://arxiv.org/pdf/2109.14534.pdf</a></p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/4d74ec12fe2466bfaab45e5c695b31fc9babcb35b35b89a0005f765e4fb3c72e.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[解析链上游戏：链上复杂应用的未来]]></title>
            <link>https://paragraph.com/@starknet-astro/YfrCqkzk0OBY9fFjpnBw</link>
            <guid>YfrCqkzk0OBY9fFjpnBw</guid>
            <pubDate>Mon, 20 Feb 2023 12:21:31 GMT</pubDate>
            <description><![CDATA[TL;DR为什么需要关注链上游戏？（1）在区块链基建创新的背景下，链上游戏可能是下一代杀手级应用的雏形。（2）链上用户增长面临瓶颈，期望链上游戏可以为区块链可持续地带来更多活跃用户。（3）随着区块链扩容提速，区块链的 4G 时代将推动链上复杂应用的创新。新公链、zkEVM/VM、模块化所具备的账户抽象、资产管理、并行处理和 ZK 特性，为低单位收益、高 TPS 的链上复杂应用奠定了基础。链上游戏的现状如何？（1）目前链上游戏处于探索产品形态和验证市场的早期阶段。至今还没有一个可称成熟的链上游戏诞生，大多数链上游戏的可玩性、完成度不尽人意。（2）链上游戏相比传统游戏和 GameFi 仍有创新，如 Dark Forest、Isaac、Treaty 等链上游戏具有去中心、可组合、链上协作、合约化互动的特点。链上游戏可分为移植和原生两个类别。（1）移植类的链上游戏将解锁传统游戏的可能性，模拟经营类游戏由于可组合、异步回合时间以及金融博弈属性相比其他类型的游戏更适合移植成为链上游戏。（2）原生类的链上游戏更有可能带来链上复杂应用的创新。与链上游戏相关的概念还有超结构，自主世界等，它们扩展了...]]></description>
            <content:encoded><![CDATA[<h2 id="h-tldr" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">TL;DR</h2><ul><li><p>为什么需要关注链上游戏？（1）在区块链基建创新的背景下，链上游戏可能是下一代杀手级应用的雏形。（2）链上用户增长面临瓶颈，期望链上游戏可以为区块链可持续地带来更多活跃用户。（3）随着区块链扩容提速，区块链的 4G 时代将推动链上复杂应用的创新。新公链、zkEVM/VM、模块化所具备的账户抽象、资产管理、并行处理和 ZK 特性，为低单位收益、高 TPS 的链上复杂应用奠定了基础。</p></li><li><p>链上游戏的现状如何？（1）目前链上游戏处于探索产品形态和验证市场的早期阶段。至今还没有一个可称成熟的链上游戏诞生，大多数链上游戏的可玩性、完成度不尽人意。（2）链上游戏相比传统游戏和 GameFi 仍有创新，如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zkga.me/">Dark Forest</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://isaac-book.netlify.app/">Isaac</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://treaty.earth/">Treaty</a> 等链上游戏具有去中心、可组合、链上协作、合约化互动的特点。</p></li><li><p>链上游戏可分为移植和原生两个类别。（1）移植类的链上游戏将解锁传统游戏的可能性，模拟经营类游戏由于可组合、异步回合时间以及金融博弈属性相比其他类型的游戏更适合移植成为链上游戏。（2）原生类的链上游戏更有可能带来链上复杂应用的创新。与链上游戏相关的概念还有<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jacob.energy/hyperstructures.html">超结构</a>，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://0xparc.org/blog/autonomous-worlds">自主世界</a>等，它们扩展了链上游戏的想象空间。</p></li><li><p>链上游戏引擎的现状如何？（1）在链上游戏的早期阶段，链上游戏引擎团队往往肩负开创游戏产品的责任，且引擎团队远远少于游戏团队，分别有以太坊上的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mud.dev/">MUD</a> 和 Starknet 上的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/dojoengine/dojo">Dojo</a>。（2）在链上游戏引擎之外，还存在着其他链上游戏基础设施，如游戏公会 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/guildlyxyz">Guildly</a> 和游戏商店 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cartridge.gg/">Cartridge.gg</a>。</p></li><li><p>为什么 Starknet 是链上游戏军火库？（1）在性能方面，Starknet 理论上能达到 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.immutable.com/blog/immutablex-scaling-web3-games-with-starkware">9000 TPS</a>，其 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eprint.iacr.org/2021/582.pdf">STARK</a> 证明系统能够将 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cointelegraph.com/news/60-million-nfts-could-be-minted-in-a-single-transaction-starkware-founder">6000 万笔</a> L2 交易合并为以太坊上的一笔交易，Gas 有望低至 0.001 U。且 STARK 存在网络效应，交易成本会随着交易量的增加而减少，因此 Starknet 适合庞大用量的链上游戏。（2）Starknet 原生账户抽象，合约钱包相比传统钱包更能适应链上游戏交互场景。（3）Starknet 重视原生应用孵化。其开发团队 StarkWare 与 MatchBox、Only Dust、Volt Capital、Mask Network 等合作伙伴举办了多轮黑客松，孵化了大量链上游戏生态。</p></li><li><p>我们认为 Starknet 是链上游戏最重要的生态，我们将在下一篇研究中深入分析 Starknet 技术特性、链上游戏生态以及链上游戏设计与构建。</p></li></ul><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">什么是链上游戏</h2><p>链上游戏（Fully On-chain Game，也叫完全链上游戏、全链游戏）是指以合约的方式存在于区块链之中的游戏，区别于仅仅将游戏内资产铸造为代币的 GameFi 这类不完全链上游戏，链上游戏的状态存储、逻辑执行也在链上，因此它也具有去中心化、无需许可、可组合的特性。它更倾向于开创全新的游戏机制，而不是仅仅对现有游戏进行渐进式改进或者把道具上链。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/31b334cb3dcc126706354af65b34fae39710eac3d818ae6e7a322c12292f3211.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>那些不完全的链上游戏大多仅仅将游戏中的关键道具铸造为代币并流通于链上，游戏数据的存储与计算则在链下的中心化服务器上，比如 Axie Infinity、StepN，尽管它们已经取得了非常好的成绩，但这些游戏存在着一些显而易见的问题：</p><ol><li><p>玩法和内容有限。</p></li><li><p>中心化运营，项目方可以更改游戏规则。</p></li><li><p>以旁氏模型著称，往往被认为是 DeFi 的延续而非新的“游戏类别”。</p></li><li><p>仅仅是链下游戏的移植，并非链上原生应用。</p></li></ol><p>那么链上游戏能够解决这些问题，并承诺一个更加美好的未来吗？答案是：不。</p><p>区块链是一种全新的技术，与其用它来仿制、改造、嫁接旧产品，不如用它做一个原生的、全新的产品。马车时代的马粪问题从未被解决，而是随着汽车时代的到来被消灭了。链上游戏并非为解决 Web2 游戏和不完全链上游戏的旧问题而生，它致力于完全的创新。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7b72ee6587d0e19be47d3d89c87a44c1c9412f4456a117d453815841c7c6982d.png" alt="https://www.greensburgdailynews.com/news/messy-issue-of-horse-manure-divides-amish-neighbors/article_bfc694bd-7107-55ab-8f1c-132d194c1f2e.html" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.greensburgdailynews.com/news/messy-issue-of-horse-manure-divides-amish-neighbors/article_bfc694bd-7107-55ab-8f1c-132d194c1f2e.html</figcaption></figure><p>19 世纪的马拉火车在今天看来可能有些荒谬，但它是对当时的大众心理、政策法律、道路状况和产品形态的妥协。如今的联盟链和 GameFi 也是新技术对旧生态的妥协，是新时代的马拉火车，但我们都能感觉到它们不可能成为未来。新技术最终会逐渐重塑整个生态，链上游戏可能就是一个不太成熟的开端。</p><p>因此，更加重要的问题是：我们为什么需要关注和探索链上游戏？链上游戏处于哪个发展阶段？</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">为什么需要链上游戏？</h2><p><strong>【I don&apos;t know what this thing will be worth in the future, but it&apos;s new, so let&apos;s do it first.】</strong></p><p>——Max, founder of Astro Aerospace Industries, said</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c5227d72d1c82c105ff45d908f55d02b8a1b128009e1f51fa6209b557c27790f.png" alt="https://www.britannica.com/science/galaxy" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.britannica.com/science/galaxy</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">技术演化的必然</h3><p>链上游戏是技术演化的必然路径。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3b77b535760e80dcf76d49eaaea4be0a802835383f7d05b8d5cc55e4cbeb6013.png" alt="https://www.gartner.com/en/newsroom/press-releases/2021-08-23-gartner-identifies-key-emerging-technologies-spurring-innovation-through-trust-growth-and-change" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.gartner.com/en/newsroom/press-releases/2021-08-23-gartner-identifies-key-emerging-technologies-spurring-innovation-through-trust-growth-and-change</figcaption></figure><p>历史上的每次技术革命往往在若干年后才爆发出一些超级产品。那些推动技术大规模普及的二次创新和发明往往被人们所忽视，但正是这些创新和发明相互推动，才在因缘际合中碰撞出了真正的创新产品。历史上每个号称“从 0 到 1”的创新产品的背后往往都有若干个铺垫的技术。</p><p>坦克的背后是石油开采与冶炼、钢材加工、发动机、炸药学，智能手机的背后是操作系统、触摸屏、处理器、传感器，AI 的背后是计算机科学、神经科学、统计学、心理学、哲学。但弄清楚哪些具体的 N 次创新和发明是最终实现大规模采用并改变世界的创新产品是几乎不可能的，因为它们更有可能是一个技术发展路径上的一个分支而非“最终果实”。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d786bdbcad9e0e6b68079d20ff2d84928094752fe4349257211e13a4936ffbe8.png" alt="https://www.deviantart.com/lightingbolt666/art/Minecraft-production-tree-353859041" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.deviantart.com/lightingbolt666/art/Minecraft-production-tree-353859041</figcaption></figure><p>因此，目前不成熟的链上游戏可能会随着技术完善而成熟，也有可能变成另一个产品发展路上的中转站。但无论如何它是值得去关注与探索的，它作为链上应用最前沿的探索方向，即使它不是那个最终的杀手应用，也可能是杀手应用强相关的领域——正如历史中的每个创新产品所告诉我们的那样。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">区块链需要活跃用户</h3><p>区块链需要应用创新，以带来更多的活跃用户或者将用户活跃起来。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/443ecef822ec18eb888cad127002cebc94f50235ea68e8223f8ed2d1f9b23c26.png" alt="https://etherscan.io/chart/active-address" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://etherscan.io/chart/active-address</figcaption></figure><p>根据上图，我们可以知道以太坊每日活跃用户数存在瓶颈。我们已经见证了泛 DeFi 生态的爆发，但从旁观者的角度来看，NFT、GameFi 都是 DeFi 的延续。区块链目前缺少能够保证用户持续在链上活跃的、大规模采用的应用，因此游戏成为了区块链行业进一步扩展的目标领域。Axie Infinity 和 StepN 的经验表明，GameFi 不可持续，因此更持久、健康的链上游戏将取代 GameFi，成为下一代链上应用创新的代表。除了行业需求，一些技术极客也想要证明区块链能够实现更有趣、更复杂、更沉浸的应用程序，而不仅仅是数字货币和 DeFi。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">链上复杂应用</h3><p>一方面，对区块链而言，链上游戏是区块链科技树发展的必然路径，并且区块链也需要更大量级的活跃用户。</p><p>另一方面，新公链、zkEVM/VM、模块化的最新发展为区块链应用提供了一个更高 TPS 和更低 Gas 的网络环境，并且它们所具备的更加优越的账户抽象、资产管理、并行处理和 ZK 特性也为应用创新奠定了基础。</p><p>回顾低 TPS，高 Gas 的以太坊发展历史，那些低 TPS 要求、高单位收益（每笔交易都有高收入，因此对高 Gas 不敏感）的应用率先发展出来，如 DeFi、NFT。在早期，它们往往仅通过发行代币，设计旁氏模型，然后加上“简单”的运营，就能收获大量的财富。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e714f5336d1dc559354f3ddf832f52b07e511c707b9057e4100df293e38e8d75.png" alt="https://defillama.com/chains" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://defillama.com/chains</figcaption></figure><p>但在一个 TPS 更高，Gas 更低的网络上，允许有更低单位收益（每次交易的收益很低，因此容忍高Gas）和更高 TPS 要求的应用——或称之为链上复杂应用涌现出来。我们可以建立一个坐标系，横轴是 TPS，纵轴是单位收益，将许多应用排上去，我们将会知道在不同的 TPS/单位收益等级都有哪些应用，进而可以大致推理出有哪些应用将在更高性能表现的网络上诞生。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e5eb25244f56f29e2acc433c42540b75c125c29bca8dabdbe9377d00bee969df.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/bas1s_ventures?t=HrIU8j6iuGVJgzCK3Bf1xg&amp;s=09">Bas1s Ventures</a> 的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/WonderXu?t=zCxBJ0qKJ0l7nrHyF-OsTg&amp;s=09"> Wonder </a>认为：一个低单位收益高 TPS 的链上复杂应用类似于在 Web2 游戏里低 ARPPU（每个付费用户的平均收入） 的游戏/应用，需要足够多的用户交易才能不断突破应用的商业模式/代币经济的天花板——就像中国的美团和美国的 EPIC 依赖高频交易量的业务不断地切入其他低频的业务，最终都打造出了自己的商业生态。而足够多的用户交易又需要一个高 TPS 和低 Gas 的网络环境，因此这样的商业生态【较难直接在gas费高且处理速度有限的以太坊】上涌现，而在全新的区块链基础设施中诞生。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1d86b0a8cb6627822b42bb846aa622ab5824f3074e6af9bd16ca868bd9c851b8.png" alt="https://www.matthewball.vc/all/epicgamesprimermaster" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.matthewball.vc/all/epicgamesprimermaster</figcaption></figure><p>回顾历史，3G 转 4G 的网络扩容驱动了移动互联网的应用爆发。当年在进行 4G 部署的过程中，许多人质疑 4G 技术的作用，更快的邮件和更多的博客有什么用？更多的网速有什么用？但随后的智能手机应用爆发消除了这些疑问。</p><p>因此，在区块链扩容提速的背景下，链上游戏可能是下一代链上复杂应用的开端，链上游戏的早期探索可能为复杂链上应用的涌现奠定基础。正如 Jacob 所描述的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jacob.energy/hyperstructures.html">超结构（Hyperstructures）</a>那样，我们有机会通过区块链构建可以比我们自己的生命更长久的文明基础设施，为全世界人类及其后代打造永久可用的、可组合的、公共复用的网络应用。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">链上游戏现状</h2><p>一个为人们所熟悉的链上游戏是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zkga.me/">Dark Forest（黑暗森林）</a>，它是一款太空征服题材的多人在线链上游戏，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/dfdao/lightforest">dfdao</a> 的成员也在构建自定义的基础设施 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/dfdao/lightforest">Light Forest</a> 以允许任何人使用自定义规则集修改和运行自己的黑暗森林回合，从而创造出像 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/dfdao/dark-forest-arena-grand-prix-f761896a752e">Dark Forest 竞技场：大奖赛</a> 等的内容。</p><p>“黑暗森林的游戏背景是一个加密生成的无限宇宙，在宇宙中包含各种不同类型的行星和空间实体。最受欢迎的黑暗森林游戏模式是长达一周的大混战，数千名玩家、Bot、AI、甚至智能合约，为银河霸权展开面对面的竞争。玩家出生在宇宙中的一个微小母星上，他们必须收获资源，征服附近的星球，并通过联盟、贸易、谈判甚至战争与邻居互动，以扩大他们的帝国。”<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/dfarchon.eth/XCJor0YF0lUMzB7B4xZSjkXhIWmEN8HOMqvLz8K_hqY">——《黑暗森林 : 三年全链上游戏的启示录（上）》</a></p><p>黑暗森林不仅完全在链上运行，还利用了 ZK-SNARK 来帮助玩家在参与博弈的同时隐藏个人信息，因此游戏中的许多决策都是在隐藏信息或信息不对称的前提下完成的。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f654eb1f093bf325446169023d584300f932a44bb9af8ea85d64a09246f06c75.png" alt="https://mirror.xyz/dfarchon.eth/XCJor0YF0lUMzB7B4xZSjkXhIWmEN8HOMqvLz8K_hqY" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://mirror.xyz/dfarchon.eth/XCJor0YF0lUMzB7B4xZSjkXhIWmEN8HOMqvLz8K_hqY</figcaption></figure><p>Dark Forest 在日新月异的链上游戏是一个经典的案例，更前沿的案例是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://isaac-book.netlify.app/#/">Isaac</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://treaty.earth/">Treaty</a> 和 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://atlas.bibliothecadao.xyz/">LootRealms</a>。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://isaac-book.netlify.app/#/">Isaac</a> 由 Starknet 上的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.topology.gg/">Topology</a> 团队开发，它是一个基于《三体》和《流浪地球》背景的多人在线物理模拟游戏，部署在 Starknet 。所有玩家需要合作建造工厂管道和电网，将自然资源转化为各种设备以驱动行星逃离太阳系。它的特色在于需要玩家在链上进行协作以共同完成一个链上目标。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/046784e93d384f52d79f7aeb7e263e344b42d37c29ed995c5d5e402352d8d398.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Treaty 由 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.curio.gg/">Curio</a> 团队开发，它是一个大型多人在线的沙盘战略游戏。玩家可以在世界中扮演自己国家的州长，以分配资源、扩张领土、选择信任和合作的玩家做出战略决策，类似 Web2 中的《三国志-战略版》和《率土之滨》的简化版。它的特色在于玩家可以与其他玩家共同起草由代码执行的合约，比如禁运合约、和平合约，玩家在加入合约和支付会员费后，将被禁止攻击其他成员。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/482a686e9f4ef42e2b0ea7840834cacc688e4713ec0f2545857141c849619ba0.png" alt="https://blog.curio.gg/introducing-treaty/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://blog.curio.gg/introducing-treaty/</figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/LootRealms?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor">LootRealms</a> 由 Starknet 上的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/BibliothecaDAO">Bibliotheca DAO</a> 开发，其灵感来自于 Loot，是一个沙盘战争策略类游戏，在第一个版本，玩家需要持有<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://opensea.io/collection/lootrealms"> Realms NFT</a> 才能开始游戏，在第二个版本可以通过铸造冒险家 NFT 参与游戏，值得补充的是冒险家的装备就是之前大火的 Loot。在 2023 年 2 月 1 日，LootrRealms 总共筹集了近 4 百万 USDC（超额认购 6.35 倍）的社区筹款，它的特色在于相比其他链上游戏，它的可玩性和完成度非常高，并且率先进行了代币分配和链上治理，游戏内所有交易都通过一个叫做 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://scroll.bibliothecadao.xyz/docs/economics/nexus">Nexus</a> 的网络机器流动，玩家提供 $LORDS 作为 Nexus 运转的 Gas。目前 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/realMaskNetwork?t=DrjXQLIbMTl4xtH5cmLPkg&amp;s=09">Mask Network</a> 的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Kaspar_Chen?t=JJIUgjPSMfYpJ1K6wJOUhA&amp;s=09">Kaspar</a> 正在为 LootRealms 撰写一份深度研报，我们可以期待他的独特见解。其他沙盘模拟类型的完全链上游戏还有 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mithraeum.gitbook.io/mithraeum-new/game/overview">Mithraeum</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://conquest.eth.limo/">Conquest</a>。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1e6beef9348e1b7b912b2f1881d2ae24ac3b1016d91cda1bfca83d3ecf575958.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">链上游戏有哪些类别</h2><p>在这个部分，将展示链上游戏的细微差别。从区块链计算能力和成本的现状来看，链上游戏应该具备低并发量的特点以适应区块链的低效率，但从完全创新的角度来看则不然。在这里存在两个可能被忽略的潜在语境，它们分别是移植，即将以前的游戏移植到链上，以及原生，即开发一种只能在链上发展的游戏，如果我们还称之为游戏的话。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">移植</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ac271ff5c8651d96ddcfb10a8fa0a6f77637f923eee59894091b771e11f68eae.jpg" alt="https://www.teamlab.art/w/flowersbloom/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.teamlab.art/w/flowersbloom/</figcaption></figure><p>移植，指的是这个游戏本身可以在链下发展，但我们开发一个具有链上特色的版本。正如前面提到的，一个链上的游戏会比链下更加可组合、可复用、去中心，在某些地方更大化其游戏特色。移植类的链上游戏直观来看仅仅将游戏的存储和计算转移到链上。</p><p>受到 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/@wbarobinson">Will Robinson</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/alliancedao/unblocking-on-chain-games-part-two-the-18xx-genre-61b2f4e8837d">《Unblocking On-Chain Games: Part Two — The 18xx Genre》</a> 的启发，我将以 18xx 游戏为例以描述移植型的链上游戏。18xx 是一种回合制模拟经营游戏，游戏背景是在 1846 年，3-5 位铁路大亨在 1846-1935 年间通过在中西部投资和经营铁路公司来竞争赚钱并建立最佳股票投资组合，可以理解为更加复杂的大富翁。每个公司都有自己的金库，用来铺设铁轨或者升级铁轨和购买火车，而这个金库是完全独立于玩家的个人股票组合和银行的。游戏的关键在于平衡何时向您的公司注资以采取行动，或者全额支付您自己和其他股东的费用，这两种行动都会影响公司的股价。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f15471f085d4acb25d54c4e23ef7ddc3faeafcc4822648a0994e259ff81c006b.png" alt="https://www.boardgamemeeplelady.com/2019/02/25/1846-race-for-midwest-good-introduction-into-18xx/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.boardgamemeeplelady.com/2019/02/25/1846-race-for-midwest-good-introduction-into-18xx/</figcaption></figure><p>18xx 游戏这类游戏非常适合移植成为链上游戏，因为：</p><ol><li><p>具有足够的回合时间。在每个回合时间内，每个玩家需要确定一系列决策，然后在一个统一的时间点提交，因此它对区块链的 TPS 要求不会太高，并且可以通过聚合或打包交易以降低 Gas。</p></li><li><p>具有金融博弈属性。在 18xx 中玩家需要与其他玩家在一个金融市场中进行博弈，比如资产拍卖，因此它可以与 DeFi 很好地结合在一起。</p></li></ol><p>18xx 游戏移植到链上后，游戏中的股票可能是 Uni 和 Sushi、DAI 等“真实世界”中的代币，游戏中的交易市场由 Uni V3 驱动；我们还可以将过去的游戏状态写成合约——就像 Treaty 所做的那样。理论上我们可以将 18xx 置换为任何模拟经营游戏——如前面提到的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://treaty.earth/">Treaty</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mithraeum.gitbook.io/mithraeum-new/game/overview">Mithraeum</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://conquest.eth.limo/">Conquest</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/LootRealms?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor">Lootrealms</a>。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">原生</h3><p>原生，指的是那些在链上“第一次”被创造出来的游戏——如果我们还称它为“游戏”的话。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3d51eef703643e25007dbd5f153e9dc3e2f2e8e4d4957ecc21b890bc4b7314da.jpg" alt="https://www.teamlab.art/w/ever-blossoming-life-waterfall/#modal-1" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.teamlab.art/w/ever-blossoming-life-waterfall/#modal-1</figcaption></figure><p>Dark Forest 的创始人 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://substack.com/profile/1016942-gubsheep">gubsheep</a> 在 《<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gubsheep.substack.com/p/the-strongest-crypto-gaming-thesis?utm_source=profile&amp;utm_medium=reader2">The Strongest Crypto Gaming Thesis</a>》 中提到：</p><p>加密原生游戏是一种最大限度地拥抱区块链应用程序开发的架构模式和精神的游戏：</p><ul><li><p><strong>游戏数据的真实来源是区块链</strong>。区块链不仅仅用作数据的辅助存储，或者存储在专有服务器中的数据“镜像”。所有有意义的数据都存储在区块链上——而不仅仅是资产所有权。这使游戏能够充分利用可编程区块链的优势：一种无需许可即可互操作的透明数据存储。</p></li><li><p>游戏逻辑和规则通过智能合约实现。例如，游戏中的战斗，而不仅仅是所有权，都在链上。</p></li><li><p><strong>该游戏是根据开放生态系统原则开发的</strong>。游戏合约和可访问的游戏客户端是开源的。第三方开发者有权通过插件、第三方客户端、可互操作的智能合约，甚至完全重新部署来定制甚至分叉他们自己的游戏体验。这反过来又让游戏开发者可以利用整个（激励一致的）社区的创意输出。</p></li><li><p><strong>该游戏与客户端无关</strong>。这与以上三点密切相关，一个游戏是否加密原生的试金石是：“如果核心开发者提供的客户端明天就消失了，这个游戏还能玩吗？” 当且仅当游戏数据存储是无需许可的，如果游戏逻辑可以无需许可地执行，并且社区可以在不依赖核心团队提供的接口的情况下与核心智能合约进行交互，答案才是肯定的。</p></li><li><p><strong>该游戏包含真实世界价值的数字资产</strong>。区块链为价值本身的概念提供了一个原生 API，数字资产在默认情况下可以与加密货币互操作。这允许游戏开发者为其玩家和开发者社区构建新的正和激励结构。</p></li></ul><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.topology.gg/">Topology</a> 的创始人 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.guiltygyoza.xyz/">GuiltyGyoza</a> 在 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.guiltygyoza.xyz/2023/01/medium-rollup-digital-physics">《On Medium, Validity Rollup, and Digital Physics》</a> 中借用艾伦凯和麦克卢汉之口所说：区块链作为一种全新的媒介，最前沿的创新者需要在它上面创造独属于区块链的原生应用，如“自主世界”（Autonomous Worlds）。关于自主世界的更多资料，可以参考 0xparc 所撰写的《<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://0xparc.org/blog/autonomous-worlds">Autonomous Worlds</a>》 。</p><p>一个原生链上游戏的简单案例是 Starknet 上的生命游戏（Game of Life） <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.gol2.io/menu">GOL2</a>。关于生命游戏，也被叫做<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.m.wikipedia.org/wiki/%E5%BA%B7%E5%A8%81%E7%94%9F%E5%91%BD%E6%B8%B8%E6%88%8F">康威生命游戏</a>（Conway&apos;s Game of Life），或者康威生命棋，是英国数学家约翰·何顿·康威在 1970 年发明的细胞自动机。<strong>生命游戏规则可以概括为：以正方形网格排列的细胞要么活著要么死亡。 具有 2 个或 3 个活邻居的活细胞可以生存； 一个有 3 个活邻居的死细胞可以复活； 否则细胞死亡。</strong></p><p><strong>游戏原型大概是下面这个样子：</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c296e16901bebbac7d22b51e74b8305e554d8625622c7f57cdd3c214ee0fa98b.gif" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>GoL2 仍然参考传统生命游戏的基本规则，玩家在网格上创建一个初始配置，然后细胞将根据游戏规则进化（生或死），形成多种组合。玩家可以通过 GOL2 的代币来恢复选定的细胞或创建新的游戏。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3e31c865d7af5bef51d98fe9e67dbe168e80c093466730d4265f7ce809ec704a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>GOL2 利用了区块链特性在链上生成游戏内容，但它存在游戏机制过于简单，可玩性不足的问题——游戏中的任何“成就”不会给玩家带来任何成就感，也许我们可以期待链上原生游戏的迭代。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">链上游戏引擎现状</h2><p>如果链上游戏市场成立，那么制造链上游戏的游戏引擎就也是一个需求成立的基建赛道。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f25c0c0b7f59eea593b3b2b5131aab3a0f45df95ef9eeb8b8503deb6bca6bd25.png" alt="https://techblogcorner.com/2020/02/06/most-popular-game-engines-for-game-development/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://techblogcorner.com/2020/02/06/most-popular-game-engines-for-game-development/</figcaption></figure><p>但游戏引擎和游戏生产过程以及用户体验直接相关，特别是在用户生成内容（UGC）在游戏中扮演着重要角色的情况下。因此在链上游戏尚未验证的早期阶段，链上游戏引擎往往也肩负着开创一个游戏产品的责任。关于链上游戏引擎会有看上去两种实际上是一种的创投思路——无论是直接做链上游戏还是做链上游戏引擎都需要先做一个游戏。</p><p>关于链上游戏引擎的事实是目前在构建它的团队远远少于链上游戏的团队。</p><p>一个关于链上游戏引擎的案例是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mud.dev/">MUD</a>，它是以太坊复杂应用的开发框架，但更多用于开发链上游戏。</p><p>它添加了一些用于组织数据和逻辑的约定，并抽象掉了低级复杂性，因此允许开发者专注于应用程序的功能。它标准化了数据在链上的存储方式以提供所有网络代码来同步合约和客户端状态。这包括直接从 RPC 节点或通用 MUD 索引器同步状态。MUD 是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://simple.wikipedia.org/wiki/MIT_License">MIT 许可</a>的，因此它完全开源并且可以免费使用。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e65520628676242fd8d3e4999035b61ee476cdb03cbf096a40e402fd36a198db.png" alt="https://mud.dev/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://mud.dev/</figcaption></figure><p>在 22 年 11 月 22 日，MUD 背后的开发团队 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://lattice.xyz/">Lattice</a> 使用 MUD 完成了一个链上 MineCraft（我的世界）——<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://opcraft.mud.dev/?view=game">OPCraft</a>。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2a5c2cf671f31816e8ef98185b29da581bd5559e2ac4414bd90bba2af35f3a79.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>还记得前面提到过的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://0xparc.org/blog/autonomous-worlds">自主世界</a>吗？Lattice 认为 OPCraft 是一个自主世界：“这是一个链上 3D 体素世界，世界的每一个方面——每条河流、草叶和山顶上的一片雪——都存在于链上。每个动作都作为以太坊交易执行的世界。”Lattice 的思路是先开发引擎，再通过引擎开发游戏。</p><p>而 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknet-astro.super.site/">Starknet</a> 链上游戏开发团队 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.topology.gg/">Topology</a> 的创始人 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.guiltygyoza.xyz/">GuiltyGyoza</a> 认为不应该先设计游戏引擎再开发游戏，而应该根据游戏开发需求设计引擎。Topology 是一个知行合一的团队，它们已经开发出了 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://isaac-book.netlify.app/#/">Isaac</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mu-mu.netlify.app/">MuMu</a> 等链上游戏，新的链上 AI 格斗游戏将在二月份进行内测。顺便提一下，Starknet 生态的开发人员正在开发一个叫做 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/dojoengine/dojo">Dojo</a> 的链上游戏工具链，Starknet 的开发语言是 Cairo，因此它类似 MUD 的 Cairo 版本。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.folius.ventures/">Folius Ventures</a> 的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://substack.com/profile/86584886-aiko">Aiko</a> 也在<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://aiko.substack.com/p/84b">《沙盒，模拟游戏，和完全链上游戏引擎》</a>中提出了一种物理+化学+时间的游戏引擎，她认为基于物理规则的完全链上游戏没有意义，因为它是让玩家被动地“发现”逻辑。与这类链上游戏对应的是游戏物理（玩家在交互过程中发现的、在游戏中的物理规则，如打击土壤掉落装备），它相比剧情式的“被动游戏”更能让玩家有交互感，是一种“主动游戏”。</p><p>另一方面，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/bas1s_ventures?t=HrIU8j6iuGVJgzCK3Bf1xg&amp;s=09">Bas1s Ventures</a> 的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/WonderXu?t=zCxBJ0qKJ0l7nrHyF-OsTg&amp;s=09"> Wonder</a> 表示：现在有的链上游戏引擎主要是将部分关键事件触发的条件（如地理坐标信息）以数据结构的形式传送上链，但有相当一部分完整的逻辑是在中心化的服务器中执行的。而对于高并发游戏如 MMORPG 及 MOBA 来说。如果全部逻辑都在去中心化的环境下进行，则对网络传输的效率和成本有较高要求，才能在进行状态转换(state transition)时对游戏体验不造成重大负面影响。</p><p>在链上游戏引擎之外，还存在着其他链上游戏基础设施，比如游戏公会和游戏商店。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/guildlyxyz">Guildly</a> 是一个链上游戏公会，允许玩家共享账户和 NFT，目前还处于开发阶段。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/345b003f55eb1f4076cb50bce00b578b43cce2b8a2f19d1162be7a76834bf67a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/cartridge_gg">Cartridge.gg</a> 是一个 Starknet 上的游戏商店，玩家可以在其中了解和访问多个链上游戏，用户可以通过手机扫描二维码创建和登陆账户而不需要加密钱包。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7d847ef15e5aea8ac9d40308992b1c20885b596c34080bb0a647bd9a73724d64.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-starknet" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">链上游戏军火库：Starknet</h2><p>见多识广的读者会发现本篇文章中提到的许多案例都与 Starknet 相关，Starknet 是以太坊的 ZKR（基于 ZK 技术构建的 L2），它的链上游戏生态在整个区块链生态系统中独树一帜。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e94a1077c20f84c57dd2a2b89a0eeff18bf1077804f6e0b8d02160075e87eba8.png" alt="https://medium.com/starkware/part-1-starknet-sovereignty-a-decentralization-proposal-bca3e98a01ef" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/starkware/part-1-starknet-sovereignty-a-decentralization-proposal-bca3e98a01ef</figcaption></figure><p>Starknet 在性能方面非常适合链上游戏部署。一方面，Starknet 理论上能够达到 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.immutable.com/blog/immutablex-scaling-web3-games-with-starkware">9000 TPS</a>，其独特的 STARK 证明系统能够将 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cointelegraph.com/news/60-million-nfts-could-be-minted-in-a-single-transaction-starkware-founder">6000 万笔</a> L2 交易合并为以太坊上的一笔交易。且其 ZK 友好的 Cairo 语言有非常高的编译效率，开发人员也能为其 Cairo 代码生成零知识证明， Gas 有望低至 0.001 U。另一方面，其使用的 STARK 证明系统存在网络效应——平均证明大小和验证时间会随着证明规模的扩大而边际递减，简单来讲就是交易成本会随着交易量的增加而减少，因此 Starknet 尤其适合那些需要庞大采用量的链上游戏。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f804d2d5cdc109f14dc7244bab9173d97f1d8822e32bb9a5c476bcc55c243983.png" alt="https://eprint.iacr.org/2021/582.pdf" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://eprint.iacr.org/2021/582.pdf</figcaption></figure><p>Starknet 基于原生账户抽象设计的合约钱包相比传统钱包也更能适应链上游戏的交互场景。以太坊以及 EVM 兼容的公链/L2 大多都采用双账户设计，而 Starknet 是单账户设计，所有的账户都是合约，简单来讲这将赋予用户账户高度可编程性。比如我们在以太坊上常用的 Metamask（传统 EOA 钱包）不能够自定义某个授权的具体使用场景、功能甚至交易限额，且不支持多签，免密支付（会话密钥）等功能，因此在传统账户设计的区块链中的传统钱包不能适应需要高频授权和复杂交互的链上游戏交互场景，而这恰巧是合约钱包的长处。</p><p>并且 Starknet 重视原生应用孵化。其开发团队 StarkWare 与 MatchBox、Only Dust、Nethermind、Mask Network 等合作伙伴举办了多轮黑客松，促进了大量链上游戏团队的发展。</p><p>但 Starknet 存在一些问题。一方面，目前 Starknet 的排序器和证明器都是中心化运作的，需要在未来等待去中心协议的设计完成和证明器开源才能保证网络去中心。另一方面，由于网络限速，Starknet 性能尚未解锁，高 Gas 和网络拥堵的情况时而发生，用户体验较差，可能会在 Q1 进行主网更新，短期并不推荐大型项目直接部署在 Starknet 主网。</p><p>但总的来看，我们仍然认为 Starknet 是整个链上游戏生态中最有潜力的系统，我们将在下一篇研究中深入分析 Starknet 技术特性、链上游戏生态以及链上游戏设计与构建。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">鸣谢</h2><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starknet-astro.super.site/">Starknet Astro</a> 是 Starknet 生态最具创意的媒体，提供最前沿、深度的研究。本篇研究同样受到 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/bas1s_ventures?t=HrIU8j6iuGVJgzCK3Bf1xg&amp;s=09">Bas1s Ventures</a> 对部分思路与内容的支持推出，他们亦是 Web3 最前沿、专业的投资机构。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d187f9707d1ee8e98196124d4bdccf963ba70faaca227eb9a67145a46163a8a8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/bas1s_ventures?t=HrIU8j6iuGVJgzCK3Bf1xg&amp;s=09">Bas1s Ventures</a> 成立于 2021 年，是一家新晋 Web3 国际风投机构，围绕区块链的大规模应用及技术生态展开投资布局，并获得亚洲及世界一线传统游戏公司等支持。团队成员曾早期工作于币安等知名企业，投资组合包括：Delysium，Mirror World，Highstreet，Xterio，Taker Protocol 等。</p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/3b6e42e840610a8e92fadf9b22aa5b4e69cfbdf34bf5a8646a094c114f684c3a.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[StarkNet 技术架构和特色生态]]></title>
            <link>https://paragraph.com/@starknet-astro/starknet</link>
            <guid>MbfI3k2ePNLrtpRpR3jn</guid>
            <pubDate>Fri, 13 Jan 2023 13:45:15 GMT</pubDate>
            <description><![CDATA[关注 StarkNet Astro ✨ 中文频道；英文频道分享会内容过长，本次 AMA 总结文字做大量删减，如果你想了解 StarkNet 更多知识可前往 StarkNet Astro 知识库页面。StarkWareStarkWare 是 StarkEx 和 StarkNet 背后的开发团队，团队成员以密码学工程师为主，STARKs 和 SNARKs 发明者均是其创始人，技术实力一流；融资方面累计融资 2.7 亿美元，估值达到 80 亿美元，为 L2 最高。StarkEx简介StarkEx 是 StarkWare 创立的，为项目方定制 ZKR 的企业服务，它可以帮助项目定制应用专有的 ZKR，目前使用 StarkEx 的客户包括 dYdX 、Sorare、ImmutableX、DeversiFi 等。 与通用 ZKR 不同，在通过 StarkEx 定制的 ZKR 中，项目方往往具有超级管理员的权限，可以决定交易是否通过与排序，外部开发者不能免许可地部署应用，网络较为中心化，但优点是性能极高。工作原理StarkEx工作流如下：打包交易：链下服务器（往往由项目方中心化运行）处理客户请...]]></description>
            <content:encoded><![CDATA[<blockquote><p><strong>关注 StarkNet Astro</strong> ✨ <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/StarkNetAstroCN">中文频道</a>；<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/StarkNetAstro">英文频道</a></p></blockquote><p>分享会内容过长，本次 AMA 总结文字做大量删减，如果你想了解 StarkNet 更多知识可前往 StarkNet Astro 知识库页面。</p><h2 id="h-starkware" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">StarkWare</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9806f84d7fa5fe3a029a6712de3722b04d6f8a8c58b12d03cb8cd1e199d0de46.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>StarkWare 是 StarkEx 和 StarkNet 背后的开发团队，团队成员以密码学工程师为主，STARKs 和 SNARKs 发明者均是其创始人，技术实力一流；融资方面累计融资 2.7 亿美元，估值达到 80 亿美元，为 L2 最高。</p><h2 id="h-starkex" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">StarkEx</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7eba7e1e42214895cfa57bb4a0b44ed31bd0e7bd45309123321d1fdb9bd5acbb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">简介</h3><p>StarkEx 是 StarkWare 创立的，为项目方定制 ZKR 的企业服务，它可以帮助项目定制应用专有的 ZKR，目前使用 StarkEx 的客户包括 dYdX 、Sorare、ImmutableX、DeversiFi 等。</p><p>与通用 ZKR 不同，在通过 StarkEx 定制的 ZKR 中，项目方往往具有超级管理员的权限，可以决定交易是否通过与排序，外部开发者不能免许可地部署应用，网络较为中心化，但优点是性能极高。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">工作原理</h3><p>StarkEx工作流如下：</p><ol><li><p>打包交易：链下服务器（往往由项目方中心化运行）处理客户请求，将多个交易组合成一个“批次”，供 StarkEx 处理。</p></li><li><p>确认交易和更新状态：链下服务器确认交易合法，并以被压缩后的哈希形式更新系统状态。</p></li><li><p>为交易生成证明：SHARP 会为交易生成 STARK 证明以确认交易有效性，然后将证明和更新发送到链上 Verifier 智能合约，以确保交易的完整性。</p></li><li><p>链上验证证明：一旦 STARK 证明被验证，状态更新被提交并结算回以太坊主网。所有交易都是在链外处理和验证的，而其完整性的证明是在链上验证的。</p></li></ol><p>SHARP 是一个共享证明者，它同时为多个 StarkEx 客户/应用提供证明生成服务——生成计算完整性声明的证明。Verifier 是部署在以太坊上的智能合约，用于验证由 StarkEx 的交易生成的 STARK 证明的正确性。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5750cc89e4c8c0dc59c66364e4498678cb287d6fad7a8c4e6dda8264639f8b57.png" alt="https://docs.starkware.co/starkex/architecture/solution-architecture.html" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://docs.starkware.co/starkex/architecture/solution-architecture.html</figcaption></figure><h2 id="h-starknet" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">StarkNet</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d7bceb9c528bd65ed2a8cb330b9a0b22ef92d9ec8ca8f1f89f8edf7d1eb802bd.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">简介</h3><p>StarkNet 是一个通用的 ZK Rollup，理论上能够将 TPS 提高到 2000+，Gas 降低到 0.002 以下。</p><p>为什么 StarkNet 具有相比以太坊更高的性能？首先回顾一下以太坊的工作原理。在以太坊上，每提交一笔交易都需要所有节点检查、验证并执行交易来保证计算正确性，并将计算后的状态变化在网络中广播。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d2e74a36fabfb2f6577f6eff4e70a843dcf23a0a8bcf5ad80300250db97e0e2c.png" alt="https://ethereum.org/zh/developers/docs/evm/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethereum.org/zh/developers/docs/evm/</figcaption></figure><p>相比之下，StarkNet 仅在链下执行计算并生成一个 ZK 证明，然后在链上验证该证明的正确性，最后<strong>把多个 L2 交易打包为以太坊上的一笔交易</strong>。因此，StarkNet 上发生的交易成本可以被同一打包批次的其他交易所均摊，就像拼车（🚌拼多多）一样，交易越多，成本越低。StarkNet 为交易生成 ZK 证明的方法可以大大提高网络运行速度、减少链上通信量、增加网络吞吐，因此 StarkNet 相比以太坊具有更高 TPS 和更低 Gas。</p><p>简而言之，将验证计算正确性比喻为老师需要检查同学们是不是掌握了知识。<strong>以太坊的方法是检查每个同学是否能背诵整本教科书，而 StarkNet 的方法是让同学们做卷子。后者的效率更高，成本更低，但仍然保证安全。</strong></p><h3 id="h-evm" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">EVM 兼容</h3><p>StarkNet 网络本身不兼容 EVM（以太坊虚拟机），而设计了另外一套 ZK 友好的 Cairo VM，是 Vitalik 所说的第四类 zkEVM,，但属于严格意义上的 zkVM。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/066882a740a4d4d48c2623b179f22b7237db9ff9693ddf1aeafafad318e49af9.png" alt="https://vitalik.eth.limo/general/2022/08/04/zkevm.html" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://vitalik.eth.limo/general/2022/08/04/zkevm.html</figcaption></figure><p>在 zkVM 架构方面，StarkNet 实现了一套更加 ZK 友好的指令集、汇编语言、字节码、AIR（代数中间表示） 以及高级语言 Cairo。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/023c1dc60bc5c2277fda63bbe3ea5de9056f902f08c07335a0ad7393a1cf37c8.png" alt="https://www.youtube.com/watch?v=SEp5SFaYQHY&amp;t=6s" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.youtube.com/watch?v=SEp5SFaYQHY&amp;t=6s</figcaption></figure><p><strong>尽管 StarkNet 本身不兼容 EVM，但 StarkNet 仍然可以通过其他方式兼容以太坊。</strong></p><p>1、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NethermindEth/warp">Warp</a>：将 Solidity 转译为 Cairo 语言的转译器</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/db67173387aaf1e0645089bed152113f31be394bc3e63575787ec97123c7a48c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Warp 是一个 Solidity-Cairo 转译器，目前已经由以太坊著名基础设施团队 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/nethermindeth">Nethermind</a> 开发完成。Warp 可以把 Solidity 代码转译为 Cairo，但转译后的 Cairo 程序往往需要修改并增添 Cairo 特性（如调用内置函数，优化内存等）才能最大化执行效率。</p><p>2、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/KakarotZkEvm">Kakarot</a>：一个用 Cairo 语言编写的 zkEVM</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3e687429df12d762c45bc44d86243b0dda737714d5ab2c39c62ff5b36c117143.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Kakarot 是一个用 Cairo 写的智能合约，目前部署在 StarkNet（goerli测试网）上，100% 字节码等效 EVM。目前处于测试阶段。以太坊应用可以通过部署到 Kakarot 的方式移植到 StarkNet。</p><ul><li><p>✅ Kakarot 可以：(a) 执行任意 EVM 字节码，(b) 按原样部署 EVM 智能合约，(c) 调用 Kakarot 部署的 EVM 智能合约的功能（视图和写入方法）。</p></li><li><p>✅ Kakarot 是一个 EVM 字节码解释器。</p></li></ul><p>目前已经支持 EVM 全部操作码。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8a46e1f9c9f547eadc04467168d3ea8fb68141cdb43537a7d856c06a0e2341eb.png" alt="https://github.com/sayajin-labs/kakarot" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://github.com/sayajin-labs/kakarot</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">工作原理</h3><p>StarkNet 有五个组成部分。分别是在 StarkNet 上的 Prover（证明者），Sequencer（排序器）和全节点；以及部署在以太坊上的验证者（Verifier）和核心状态合约（StarkNet Core）。</p><p>工作流程如下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/623e6b4b3c843e4fc9121f079fd94757c025ac3ed225e153b3b40f6344a8aed3.png" alt="https://david-barreto.com/starknets-architecture-review/#more-4602" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://david-barreto.com/starknets-architecture-review/#more-4602</figcaption></figure><p>1、当我们在 StarkNet 上发起一个交易，一个链下服务器——排序器将会接收、排序、验证，并将它们打包到区块。执行交易，然后状态转换发送给 StarkNet Core 合约；</p><p>2、证明者将为交易生成证明，并发送给以太坊的验证者合约；</p><p>3、验证者将验证结果发送到以太坊上的 StarkNet Core 合约，并从 StarkNet Core 合约触发一组新的以太坊交易，以更新链上的全局状态以进行记录保存。状态事务作为“calldata” （EIP-4844后为Blob）来发送，以节省 L1 事务 gas。这些“metadata”可被 StarkNet 全节点解密。</p><p>全节点基本发挥存储功能。全节点存储状态改变、元数据、证明以及记录在 StarkNet 中的已被执行的所有事务，并跟踪系统的当前全局状态。在有必要的时候，全节点将解密“metadata”来重构 StarkNet 的历史。</p><p>参考 StarkNet 开发倡导者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/barretodavid">@barretodavid</a> 写的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://david-barreto.com/starknets-architecture-review/#more-4602">《StarkNet&apos;s Architecture Review》</a>。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">账户抽象</h3><p>不同于以太坊 EOA+CA 的双账户设计，StarkNet 实现了原生账户抽象，只有一种账户设计，借鉴了 EIP 4337 的精神，下图为交易模型：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/27762843b013d533017a572a83998c62f2d3eff95ecaa37d3c818891794813f0.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-stark" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">STARK 证明系统</h2><p>目前有许多不同的证明系统（生成和验证证明） ，如 Halo、PLONK、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eprint.iacr.org/2016/260.pdf">Groth16</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/huyuguang/zkpblog/blob/master/groth09.md">Groth09 </a>、Marlin、Plonky2 等，它们都属于 SNARK 证明系统。证明系统存在一个证明者生成证明，一个验证者验证证明。而不同的 ZK 项目几乎都会使用不同的证明系统，StarkNet 使用的 STARK 某种意义上属于一种特别的 SNARK 。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0435c84e3fbbf2012e055fbfcd65844e6a7081db55d16725ff7eef9abd49a7c7.png" alt="https://medium.com/alliancedao/zkps-in-web-3-now-and-the-future-21b459348f29" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/alliancedao/zkps-in-web-3-now-and-the-future-21b459348f29</figcaption></figure><p>STARK 相比 SNARK 有更多创新。它不需要和 SNARK 一样依赖“可信设置”。<strong>它还带有更简单的密码学假设，避免了对椭圆曲线、配对和指数知识假设的需要，纯粹依赖哈希和信息论，因此抗量子攻击。总体来讲 STARK 比 SNARK 更安全。</strong></p><p>在扩展性方面，STARK 的扩展性更强。证明生成速度具备线性扩展性，验证时间和证明大小具备对数扩展性。<strong>但缺点在于生成的证明尺寸更大。但随着证明规模增加，验证成本将会边际递减——这意味证明越大，总成本越低。</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2bac7069f230ca47278115d446ef2fde254343f4f8e8b0186f7c67f5e973f615.png" alt="https://consensys.net/blog/blockchain-explained/zero-knowledge-proofs-starks-vs-snarks/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://consensys.net/blog/blockchain-explained/zero-knowledge-proofs-starks-vs-snarks/</figcaption></figure><p><strong>总结一下，相比 SNARK，STARK 更安全，平均验证时间和证明大小将随着验证规模扩大而降低，缺点在于初始证明尺寸更大，因此更适合大规模应用。</strong></p><p>这里介绍一下 STARK 的重要特性：递归证明</p><p>任何通用的、简洁的知识系统的证明/论证（特别是STARKs） 都可以用来递增地验证计算。这意味着一个计算可以产生一个证明，以证明该计算的前一个实例的正确性，这个概念被非正式地称为 &quot;递归证明组合&quot;或者&quot;递归STARKs&quot;。</p><p>换句话说，一个递归 STARK 证明者可为一个陈述生成一个证明，即系统的状态可以从 a 移到 a+1。因为证明者已经验证了一个证实 a 的计算完整性的(递归)证明，并且忠实地执行了状态 a 的计算，达到了新的状态 a+1。<strong>简而言之，你可以理解该过程将 a 和 a+1 两个证明合并为了一个证明，在理论上可以将近乎无限的证明合并为一个证明，这将大幅减少证明大小和验证时间。如下图所示：</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/aa5289e690351da1f2594d343b19895379f270fa33d3ca43569fc30d70a6530e.png" alt="https://medium.com/starkware/recursive-starks-78f8dd401025" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/starkware/recursive-starks-78f8dd401025</figcaption></figure><h2 id="h-cairo-vm-cairo" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Cairo VM 和 Cairo 语言</h2><h3 id="h-cairo-vm" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Cairo VM 概述</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/023c1dc60bc5c2277fda63bbe3ea5de9056f902f08c07335a0ad7393a1cf37c8.png" alt="https://www.youtube.com/watch?v=SEp5SFaYQHY&amp;t=6s" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.youtube.com/watch?v=SEp5SFaYQHY&amp;t=6s</figcaption></figure><p>Cairo VM 是一个是一个采用冯诺依曼架构的 CPU VM，其编程语言也叫 Cairo，Cairo 语言基于 Cairo 汇编，因此编译效率非常高。 Cairo 是 <strong>C</strong>PU <strong>A</strong>lgebraic <strong>I</strong>ntermediate <strong>R</strong>epresentation （代数中间表达）的首字母缩写。Cairo VM 包含单个 AIR 来验证这个 「CPU」 的指令集。</p><p>它有时候也被叫做 StarkNet OS/Cairo OS 。它不同于 EVM，Cairo VM 不执行计算，仅为计算生成证明并验证正确性。</p><p>关于工作方式，它根据收到的输入的交易来更新系统的 L2 状态。促进 Cairo 合约的执行。Cairo VM 是基于 Cairo 的，合约可用的具体系统操作和功能可作为对操作系统的调用。</p><h3 id="h-cairo-vm" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Cairo VM 特性</h3><p>灵活的 CPU 架构</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d4b26e047554ff3cdda73ca36682ddc11176c90d410115da8461ab9418e0e6b6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Cairo VM 采用图灵完备的冯诺依曼 CPU 架构，可通过软件编程的方式无限接近 AISC 的性能，有对应的指令集，所以 Cairo 理论上可以复刻其他虚拟机。</p><p>只读非确定性内存模型</p><p>Cairo VM 采用只读的非确定性内存，这意味着每个内存单元的值由证明者选择，它不能随时间改变（在 Cairo 程序执行期间），是不可变的。该指令只能从中读取。我们可以将之视为一次写入的存储器：可以向一个单元写一次值，但事后不能改变它。而且它是连续的，如果有空会被任意值填充。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7e2a9767a19bb7ff42f6c8b1a4d4e02e8c1b6d1454d71df234d8450b8cf48338.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>ROM 优点包括：低成本，电路比 ROM 更简单；永存储，内存值将保证永久存储；不可篡改，数据不能修改和删除。</p><h3 id="h-cairo" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Cairo 语言概述</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/508d13b9f6e0196508c13ed11e3d31b2f04b231bfd8c2de5662999bb0e7b7f47.png" alt="https://www.cairo-lang.org/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.cairo-lang.org/</figcaption></figure><p>Cairo 是 StarkNet 的智能合约语言，基于 STARK 设计，Cairo 程序可生成 STARK 证明。</p><p>Cairo 程序是汇编代码的集合，Cairo 开发人员将以高级语言 Cairo 来编写智能合约而非 Cairo 汇编。当我们写了一个 Cairo 程序，Cairo 编译器会将 Cairo 代码编译成 Cairo 汇编，Cairo 汇编器将采用汇编代码生成 Cairo 字节码（它运行在 Cairo CPU）以在 Cairo VM 执行，当他最终运行到真实机器上还需要编译为操作码和机器代码（还有指令）。</p><h3 id="h-cairo" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Cairo 语言特性</h3><p><strong>启动加载：从哈希加载程序</strong></p><p>程序可以将另一个程序字节码写入内存，然后运行该程序。 这有两个好处：</p><ol><li><p>可扩展性，验证时间和程序大小呈现对数关系，正如 STARK 部分提到的。</p></li><li><p>隐私性，验证者可以验证程序是否正确执行而无需知道计算。</p></li></ol><p><strong>内置函数：减少代码编译</strong></p><p>开发者直接调用内置函数可以减少计算开销，优化开发体验，而不需要代码转换。添加内置函数不会影响 CPU 约束。这只是意味着相同的内存在 CPU 和内置函数之间共享，如图所示。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/42a113221e75c126e94f754f7d7ddf88ce3706401a5c12c7ab090411a8118d6e.png" alt="https://medium.com/@pban/demystifying-cairo-white-paper-part-i-b71976ad0108" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://medium.com/@pban/demystifying-cairo-white-paper-part-i-b71976ad0108</figcaption></figure><p>Cairo 体系结构没有指定一组特定的内置函数。可以根据需要在 AIR （代数中间表示）中添加或删除内置函数。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">特色生态</h2><p>与其他生态不同，StarkNet 有一些原生的创新应用，分别是全链游戏、合约钱包和链上 AI。</p><p>关于全链游戏（On-chain game），它不同于 GameFi。<strong>全链游戏与 GameFi 的根本差别在于前者是去中心、免许可、可组合、互操作的，而后者仅仅将游戏中的关键道具铸造为代币。</strong></p><p>GameFi 只是将游戏资产上链，计算与存储的部分则在链下的中心化服务器上，比如知名的 StepN，Axie Infinity，尽管它们已经取得了非常好的成绩，但这些游戏的玩法和内容是有限的，且受到项目方中心化运营的影响，项目方可以更改游戏规则。GameFi 也不支持 UCG ——玩家和开发者不能免许可地创造游戏内的内容与资产，并且其他链上应用也难以与之互操作。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2d503d2f19fe6e91543630e17b2b049e19b12e11b36664fedc85ab41fee0d5fb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>全链游戏则不仅仅是将游戏资产上链，整个游戏也以合约的方式存在于网络之中，游戏的状态存储、逻辑执行也完全在链上，符合区块链的去中心、免许可、可组合的基本属性。这意味着没有实体可以单方面更改游戏规则，游戏的主动权在玩家手中，游戏“官方”的概念将会逐渐消失。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/15c634e20c3eda49475dbae3d88e8e217b0c4772e672ded83ef69459c3a3ed55.png" alt="https://www.gamedeveloper.com/business/let-s-build-a-decentralized-game-economy-using-blockchains-part-1-" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.gamedeveloper.com/business/let-s-build-a-decentralized-game-economy-using-blockchains-part-1-</figcaption></figure><p>更有价值的是，玩家与开发者可以基于开源代码自定义前端，在基本规则约束下对游戏内的设施和资产进行再创造，解锁 UCG——用户创作内容的可能性。而且任何符合全链游戏合约规则的 DApp 都可以免许可地与之互操作，这将把全链游戏的可组合性扩展到更大的生态范围之中，不仅各个链游可以相互操作，链游与 DeFi 、NFT 以及在未来可能涌现的任何 DApp 都能够与全链游戏相互操作，这将打破 Web2 以垄断为商业模式的业务格局，给开发者和用户更完美的应用体验以及更有想象力的创造机会。</p><p>推荐项目 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.topology.gg/"><strong>Topology</strong></a><strong>、</strong><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://Cartridge.gg"><strong>Cartridge.gg</strong></a><strong>、</strong><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://briq.construction/"><strong>Briq</strong></a><strong>、</strong><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://realmseternum.com/"><strong>Lootrealms</strong></a></p><p>关于合约钱包，它具有强大的可编程、可组合的特性，从而能够适应 DeFi 之外的新场景如全链游戏、社交等。推荐 StarkNet 合约钱包 Braavos 和 Argent，前者可以将手机变成硬钱包，后者支持社交恢复，并且还将不断更新功能。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0ab9b55be5282ea6157d4d8fc80ed76b710d861d2949137981914666737a1e77.png" alt="https://coincodecap.com/best-smart-contract-wallet" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://coincodecap.com/best-smart-contract-wallet</figcaption></figure><p>关于链上 AI，StarkNet 允许 AI 模型在链下执行计算，将生成证明交由他人验证即可保证计算完整性，并且 STARK 证明系统存在网络效应，因此可降低需要大规模证明生成的 AI 模型的成本。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5608e50851df8a845f527cc838adeabbd0b5fdc01f5f8734847bd380b40744aa.png" alt="https://elearningindustry.com/how-machine-learning-helps-transform-supply-chain-management" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://elearningindustry.com/how-machine-learning-helps-transform-supply-chain-management</figcaption></figure><p>链上 AI 应用范围包括：游戏、预言机、交易（自动收益）、反女巫、KYC、数据隐私以及 AI 模型算力挖矿等。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">问答</h2><p><strong>Q：StarkNet 交易排序的逻辑是什么？是否也会有以太坊上的 MEV？官方排序器有 MEV 需求吗？能做吗？</strong></p><p>A：1）StarkNet 排序器排序，仍然是 gas 优先，去中心排序器后会做并行执行，目前去中心排序器的更多细节还没有确定，排序设计也还没有确定；L2 交易有顺序，在 L1 上作为批处理就不体现 L2 交易顺序；2）会有 MEV，但是还没确定排序器去中心的共识，可能会借鉴 Flashbots，PBS 之类的机制；3）目前 StarkNet 中心化运营排序器，官方没有做 MEV，Rollup 理论上都可以做。</p><p><strong>Q：L2 gas fee，速度在哪里可以看？哪里能看到它们最终的性能指标？</strong></p><p>A：Gas 在 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://l2fees.info/">https://l2beat.com/scaling/tvl</a> 看，TPS 在这里看 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethtps.info/">https://ethtps.info/</a>。目前 ZKR 的工程进度较慢，可能在年中才能迎来规模采用，现在比较性能意义不大，且 L3 的实现可能会给 TPS 计算造成阻碍。</p><p><strong>Q：为什么很多以太坊都部署在 Arbitrum？</strong></p><p>A：因为是 OPR，开发得更快；在前年就部署了，发展期更长。</p><p><strong>Q：ZKR 什么时候会迎来应用爆发？</strong></p><p>A：应用爆发分为两类，应用迁移和应用创新，迁移进度取决于不同 ZKR 的工程周期，可能会在 Q3-Q4；应用创新方面，哪些高 TPS、低单位收益的应用更能在 ZKR 上实现，可能会在年末爆发，取决于。</p><p><strong>Q：OPR 和 ZKR 的差别是什么？</strong></p><p>A：OPR 使用欺诈性证明，ZKR 使用有效性证明，后者更快更便宜，Vitalik 有过文章阐述</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.eth.limo/general/2021/01/05/rollup.html">https://vitalik.eth.limo/general/2021/01/05/rollup.html</a></p><p><strong>Q：StarkNet 有什么马上能用的合约钱包？</strong></p><p>A：Braavos、Argent。</p><p><strong>Q：账户抽象的未来是什么？</strong></p><p>A：基于账户抽象的合约钱包可编程，比如它允许用户自定义设置在某个时间内，低于一定价格的 Gas 都将被自动支付；而且相比 EOA 钱包更能适用 DeFi 之外的新场景如全链游戏、社交。它就是把钱包当成合约来设计，让钱包能实现合约能实现的功能。</p><p><strong>Q：StarkNet 上有哪些值得交互的项目？</strong></p><p>A：可以关注 Topology 团队开发的全链游戏 MuMu，它们近期还会推出一个新的链上 AI 格斗游戏；NFT 项目推荐 Briq，之前项目方给购买 NFT 的用户空投了圣诞树 NFT；推荐 Loot 系的游戏 Lootrealms，这个游戏发币了。</p><p><strong>Q：StarkNet 是不是更适合做链上 AI 和全链游戏？</strong></p><p>A：是的，因为 StarkNet 使用 STARK 证明系统，它的平均验证时间和证明尺寸会随着证明规模扩大而降低，因此具备网络效应，这是 SNARK 所不具备的特性，这对链上 AI 和游戏而言有助于降低成本和提高性能；另一方面 StarkNet 生态有很多全链游戏融资、开发的基础设施，如 MatchBoxDAO、Volt Capital、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://Cartridge.gg">Cartridge.gg</a> 等，官方也在大力支持全链游戏的发展，因此 StarkNet 在技术和资源支持方面适合做链上 AI 和全链游戏。</p><p><strong>Q：StarkNet 可不可以和其他公链对接？</strong></p><p>A：官方宣称不会，只会以太坊作为结算层；技术上可以。</p><p><strong>Q：账户抽象的缺点是什么？</strong></p><p>A：现在比较早期，相关的工具、代码不够成熟，但随着时间的推进账户抽象会越来越成熟，账户抽象的优点是让交易更加可编程。</p><p><strong>Q：ZKR 的电路是什么？为什么要有电路？</strong></p><p>A：可以理解为 ZK 的代码；ZKR 需要为代码的计算生成证明，高级语言的代码需要编译为字节码再变成 ZK 电路才能够被用来生成 ZK 证明。</p>]]></content:encoded>
            <author>starknet-astro@newsletter.paragraph.com (Starknet Astro)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/fe8d6308a509fc92aa87e51f7b2aeb9167892ef7234da621487f4ae9f9b4490d.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>