<?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>郭宇</title>
        <link>https://paragraph.com/@guoyu</link>
        <description>Retired. live in Tokyo &amp; Azumino at this moment. ex-senior principal engineer at Bytedance for 6 yrs. Founder of ChecksFinance &amp; CodefoDAO</description>
        <lastBuildDate>Wed, 02 Dec 2026 00:37:57 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>郭宇</title>
            <url>https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/6d1513bcc0312e4214bc8cb9cc1866339e30c61a29d509bc7524235ecb0d4bb7.jpg</url>
            <link>https://paragraph.com/@guoyu</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[日本移居指南]]></title>
            <link>https://paragraph.com/@guoyu/QEW9hZWgfe38qPVKtvhI</link>
            <guid>QEW9hZWgfe38qPVKtvhI</guid>
            <pubDate>Sat, 10 Sep 2022 14:46:31 GMT</pubDate>
            <description><![CDATA[本文基于 Checks Finance（チェックス株式会社）内部文档修改而来，原文是为新员工入职、移居日本时编写的生活指南，因此略有删改。チェックス株式会社正在招募兼职高级 App 研发工程师，如果你感兴趣这个职位，请投递简历到此邮箱 contact#checks.finance当你看到这篇文章时，请允许我作为チェックス株式会社的 CEO 向你道一声恭喜！我相信，前往一个陌生的国家工作对我们来说都并不是容易的事，面对工作上的挑战与截然不同的生活节奏，人们很容易在缺少好友的环境中感到迷茫，甚至迷失自我。不过，并不需要太过于担心，在此，我希望能为你提供一些生活上的建议，帮助你尽快适应将要面对的一切变化。 作为探访过 300 多个温泉乡，游历日本全岛的资深温泉达人，我目前在日本有着 3 处不同的家，它们在长野安曇野、東京南青山与沖縄宮古島。チェックス株式会社采用结果导向的，宽松的异步工作制，我们并不要求雇员居住在某个固定的城市，因此，这篇文章将会全事无巨细地向你介绍日本生活中的方方面面，便于你在探索日本生活的过程中，找到最适合自己的家。 collect://致谢kitayoshi.et...]]></description>
            <content:encoded><![CDATA[<blockquote><p>本文基于 Checks Finance（チェックス株式会社）内部文档修改而来，原文是为新员工入职、移居日本时编写的生活指南，因此略有删改。チェックス株式会社正在招募兼职高级 App 研发工程师，如果你感兴趣这个职位，请投递简历到此邮箱 contact#checks.finance</p></blockquote><p>当你看到这篇文章时，请允许我作为チェックス株式会社的 CEO 向你道一声恭喜！我相信，前往一个陌生的国家工作对我们来说都并不是容易的事，面对工作上的挑战与截然不同的生活节奏，人们很容易在缺少好友的环境中感到迷茫，甚至迷失自我。不过，并不需要太过于担心，在此，我希望能为你提供一些生活上的建议，帮助你尽快适应将要面对的一切变化。</p><p>作为探访过 300 多个温泉乡，游历日本全岛的资深温泉达人，我目前在日本有着 3 处不同的家，它们在长野安曇野、東京南青山与沖縄宮古島。チェックス株式会社采用结果导向的，宽松的异步工作制，我们并不要求雇员居住在某个固定的城市，因此，这篇文章将会全事无巨细地向你介绍日本生活中的方方面面，便于你在探索日本生活的过程中，找到最适合自己的家。</p><p>collect://</p><hr><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">致谢</h3><ul><li><p><strong>kitayoshi.eth</strong> 为这篇文章做了非常有意义的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/kitayoshi.eth/O8FxN4Zj5R4FYsZTWl5x29FuNLyYDCziJineCnnvI2I">补充</a>，推荐阅读全文后补充阅读。</p></li><li><p><strong>Socranotes</strong> 补充了非常详细的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0xC64699356692B79BC3d19F1524Dbc4C3E06AC725/4E8aczIQlMR6lgBn4JmU8cvSJClJ7AZix6nxtTMGdS0">宠物入境的指南</a>，推荐携带宠物移居日本的朋友阅读。</p></li></ul><hr><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">目录</h3><ul><li><p>入境前的准备</p></li><li><p>入境手续</p></li><li><p>居民登记手续、在留卡与 My Number Card</p></li><li><p>理解住址、印章与住民票</p></li><li><p>移动通信服务</p></li><li><p>公共交通系统</p></li><li><p>公共礼仪与常识</p></li><li><p>租房问题</p></li><li><p>垃圾分类制度</p></li><li><p>语言与求助</p></li><li><p>医疗保险制度与疫苗接种</p></li><li><p>年金制度</p></li><li><p>税收制度</p></li><li><p>银行账户与信用卡</p></li><li><p>消费、无现金支付与积分系统</p></li><li><p>购房与贷款</p></li><li><p>驾照、租车与驾驶体验</p></li><li><p>邮政与快递系统</p></li><li><p>气候与天气</p></li><li><p>灾难与灾备</p></li><li><p>专业教育与国家资格</p></li><li><p>亲属签证</p></li><li><p>宠物抚养与保险</p></li></ul><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">入境前的准备</h2><p>欢迎入职！怀着激动的心情收拾行李时，请别忘记入境时所需要的最重要的材料。</p><p><strong>必要的文件：</strong></p><p><strong>护照</strong>：请带上有效护照与旧护照。如果你的最新护照有效期较短，我们建议你在申请签证前更新护照，因为在国内更新护照的时间远比在日本要短，手续也更加简单。携带旧护照的原因是，旧护照上可能存在有效签证。</p><p><strong>签证</strong>：确保你的最新护照上存在有效的工作签证。</p><p><strong>PCR 阴性检测报告</strong>：按照日本当前的防疫政策（截至2022年9月6日），如果你尚未完成国际认可的几种 mRNA 疫苗的全部 3 针接种。首次入境日本时，除了需要准备必要的文件（护照与签证）之外，还需要在出发前 72 小时之内进行 PCR 检测并提交阴性核酸报告。</p><p><strong>机票</strong>：确认你已购买了有效的单程机票，出发前请核对机票时间，提前抵达机场办理手续。东京有羽田机场与成田机场两处不同的国际机场，出发前，请核对目的地机场信息。</p><p><strong>暂时停留的住址</strong>：确定前往日本后的居住地址，日本法律规定，外国居民在入境 14 天内，需要登录住址。如果你并未在前往日本前租到满意的房子，也可以填写亲属或好友的居住地。</p><p><strong>证件照</strong>：准备若干 40x30 mm 的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://s3.us-west-2.amazonaws.com/secure.notion-static.com/bab563da-27dd-4c59-bb2c-d360ca7a99d7/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20220910%2Fus-west-2%2Fs3%2Faws4_request&amp;X-Amz-Date=20220910T131714Z&amp;X-Amz-Expires=86400&amp;X-Amz-Signature=05b5e2a76e0702f2891471fc15a93a95f87ca121260e852f614ae15acf266963&amp;X-Amz-SignedHeaders=host&amp;response-content-disposition=filename%20%3D%22Untitled.png%22&amp;x-id=GetObject">免冠证件照片</a>，用于申请和更新在留卡。</p><p><strong>有用的小东西</strong>：</p><p>**印章：**建议在国内提前刻好印章，虽然日本正在经历整个社会的数字化转型，但在许多地方仍然需要印章（例如不支持重复签名认证的银行）在出发前提前刻好全名的印章（日语中称之为 <strong>実印</strong>）是必不可少的准备之一。刻印章时，可以选择自己喜欢的字体，文字的左右上下顺序不受限制，但一般来说，日本的印章使用小篆等古文字体，阅读顺序是从上到下，或从右至左。关于刻印的服务，你可以在淘宝上很轻松地找到，价格约百元。</p><p><strong>口罩</strong>：准备适量的医用口罩即可，入境日本后，在便利店或者药妆店很容易即可买到新的口罩。一般来说，不需要准备 N95 口罩。</p><p><strong>签字笔</strong>：入境日本时，你可能需要一支好用的签字笔来填写表格。</p><p><strong>移动网络</strong>：日本的机场和公共设施一般提供免费的无线网络，如果你希望无缝切换联网状态，我们建议你开启移动漫游，入境日本前，请联系你的移动运营商确保国际漫游有效。</p><p><strong>驾照与证明文件</strong>：如果你在中国持有有效驾照，强烈建议在出发前，于居住地申请更换日本驾照所需要的文件，你可以在<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.keishicho.metro.tokyo.lg.jp/menkyo/menkyo/kokugai/kokugai05.html">这里</a>找到所需要的文件种类，请别忘记出发时携带你的有效驾照。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">入境手续</h2><p>欢迎来到日本！这里是樱花与海浪的国度。</p><p>由于这是你的首次入境，入境手续需要花费一些时间。</p><p><strong>检疫</strong>：</p><p>由于目前的疫情防控政策变化较快，你<strong>可能</strong>需要进行到达检疫，进行快速 PCR 测试，具体政策请遵循落地时的详细指南。</p><p><strong>入境</strong>：</p><p><strong>领取在留卡</strong>：向入境检查官出示你的工作签证后，你会需要等待领取在留卡，在留卡是外国人在日本居住必要的身份证件，会标记你的姓名，出生年月，国籍与在留资格。它与驾照，My Number Card 一样都是有效的身份证件。</p><p><strong>选定汉字名</strong>：领取在留卡时，我们强烈建议你标注汉字名，汉字名是指你驾照上的汉字名称，不同于西方国家，日本同时使用罗马字与汉字来代表法定名称，因此，你需要专门于在留卡上指定你的汉字名称。注意，日语汉字名可能与你的简体中文名有所不同，在入境前，请确认你的汉字名在日语汉字表中是否有同样的汉字可以代表，如果没有，你需要在填写汉字名时使用类似汉字进行替换。注意，汉字名称没有法定的读音，因此，在留卡或者其他身份卡片上不会标准读音，你可以随意解释汉字的读音。<strong>注意</strong>：如果你的入境机场不支持为在留卡选定汉字名，你则需要在入境后前往所在城市的入境管理处再次办理添加汉字名服务。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.isa.go.jp/zh-cn/about/guidance/index.html">https://www.isa.go.jp/zh-cn/about/guidance/index.html</a></p><hr><h2 id="h-my-number-card" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">居民登记手续、在留卡与 My Number Card</h2><p>领取在留卡后，你便可以和居民一样自由在这个国家活动。也许你会仔细端详这个卡片，思考它与身份证有何不同，在这一小节，我会向你解释他们的异同。</p><p><strong>作为身份证的在留卡</strong>：</p><p>如前所述，在留卡是标记着<strong>外国人</strong>在日本居住资格的卡片。因此，只有外国居民才拥有在留卡，就算取得了<strong>永住资格</strong>（PR）在没有变更国籍的情况下，你仍然需要持有在留卡才能在日本居住。在某种意义上，在留卡是外国居民真正的身份证。不过，一般来说，因为日本民众没有在留卡，在日本国内办理各种手续，不一定要出示在留卡作为身份证，驾照，My Number Card，健康保险证，都可以作为有效的身份证件。法律规定，外国居民出门时，需要<strong>时刻携带</strong>在留卡。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.isa.go.jp/zh-cn/publications/materials/newimmiact_4_point.html">https://www.isa.go.jp/zh-cn/publications/materials/newimmiact_4_point.html</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">在留卡范例（正面）</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">在留卡范例（反面）</figcaption></figure><p><strong>元数据</strong>：</p><p>在留卡标记了姓名（汉字和罗马字拼音），照片，性别，国籍，出生日期，签发日期与有效期，在留资格（签证种类），工作范围（是否允许兼职打工或者开设公司），还有住址。</p><p><strong>登记居民住所</strong>：</p><p>入境后首次领取在留卡时，由于你在日本没有确定的住所，住址栏填写为「未定」，日本法律规定，在入境后的 14 天，外国居民必须前往固定住所所在的区政府登录地址，登记时，需要携带相应的证明材料和在留卡，区政府部门的工作人员会将更新后的地址打印于在留卡的反面，当住所更换时，需要同步前往住址所在区政府更新你的在留卡地址。</p><p><strong>作为加密 IC 身份证的 My Number Card：</strong></p><p>My Number Card（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.kojinbango-card.go.jp/zh-cn/"><strong>个人编号卡</strong></a>）是近年日本数字厅推出的全民身份证，它不仅覆盖外国居民，也包括日本国民，它本质上是一张带有唯一用户编号的加密 IC 芯片卡，申请时，需要填写三种不同的密码。使用这些密码进行解锁，便可以使用个人编号卡进行 App 授权，关联印章，医疗保险，年金，税务或疫苗接种等全方位的信息。</p><p>我们建议你在登记居民住所时于区政府申请 My Number Card，由于日本数字厅的工作效率并不高，申请过程需要一段时间，申请大约一个月之后，你会受到领取 My Number Card 的通知书，届时，可以携带通知书前往所在区政府领取。</p><p>如果你遗忘了密码，请携带在留卡和 My Number Card 前往区政府修改密码。不输入密码时，My Number Card 无法使用。</p><div data-type="embedly" src="https://www.kojinbango-card.go.jp/zh-cn/" data="{&quot;provider_url&quot;:&quot;https://www.kojinbango-card.go.jp&quot;,&quot;description&quot;:&quot;敬告用户，至此，实施了聊天栏的多语言化，除了日语以外增加了以下多种语言的支持功能。 对应语言（自动翻译） 使用聊天栏时，请点击页面左下角的Maina-chan图标。如果要切换语言，请点击聊天栏右上角的按钮并选择一种语言。 关于个人编号卡・电子证明书的有效期限通知书中的记载错误 我们向个人编号卡或电子证明书将于2023年4月到期的居民邮寄了有效期限通知书，通知书中存在错误内容，特此订正。 ...&quot;,&quot;title&quot;:&quot;首页 - マイナンバーカード総合サイト&quot;,&quot;url&quot;:&quot;https://www.kojinbango-card.go.jp/zh-cn/&quot;,&quot;thumbnail_width&quot;:1078,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2dff27c0966aca70c23a526b40e785c4063319248c04389ba52829df4aa459e0.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Kojinbango-card&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:561,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1078,&quot;height&quot;:561,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2dff27c0966aca70c23a526b40e785c4063319248c04389ba52829df4aa459e0.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2dff27c0966aca70c23a526b40e785c4063319248c04389ba52829df4aa459e0.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.kojinbango-card.go.jp/zh-cn/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>首页 - マイナンバーカード総合サイト</h2><p>敬告用户，至此，实施了聊天栏的多语言化，除了日语以外增加了以下多种语言的支持功能。 对应语言（自动翻译） 使用聊天栏时，请点击页面左下角的Maina-chan图标。如果要切换语言，请点击聊天栏右上角的按钮并选择一种语言。 关于个人编号卡・电子证明书的有效期限通知书中的记载错误 我们向个人编号卡或电子证明书将于2023年4月到期的居民邮寄了有效期限通知书，通知书中存在错误内容，特此订正。 ...</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.kojinbango-card.go.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2dff27c0966aca70c23a526b40e785c4063319248c04389ba52829df4aa459e0.png"/></div></a></div></div><p><strong>登记印章</strong>：</p><p>在未来的日本生活中，进行某些经济登记时，你会需要使用到印章证明，因此，我们强烈建议你在首次登录居民住所时，携带个人印章，同时申请印章登记。登记印章后，你会得到一张区政府发行的<strong>印鑑登録証</strong>，在 My Number Card 申请并领取完成后，My Number Card 也可以直接代替印鉴登录证使用。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/ac74d1e6683ccc4217db303a580febef8191fddfaf20b610d50c2772836f4bb5.jpg" alt="印鑑登録証范本" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">印鑑登録証范本</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c1f4f8d2896180e3633bfbf0c3307573990eac7de23d089f24591e1f9ebf9d77.jpg" alt="印章证明范本" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">印章证明范本</figcaption></figure><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">理解住址、印章与住民票</h2><p>与许多国家不同，居民住所和个人印章是日本文化和行政服务中非常重要的概念，理解这些概念，有助于你开展在日本的各项经济活动。</p><p><strong>作为哈系的住址</strong>：</p><p>如前所述，日本虽然在积极推进社会的数字化，于近年推出了 My Number Card，但绝大多数经济活动，并不关联个人编号，即使需要<strong>住民票</strong>时，也会考虑到隐私问题和匿名化，隐去个人编号。法律意义上，绝大多数登录的信息，是居民的法定名字与住址的组合哈系（hash），在某些契约的签订时，也会要求对比印章证明，用来证明签约双方对应的自然人资格。简而言之，一对姓名与地址的组合，即表明自然人的唯一性。</p><p>住址的写法是：</p><blockquote><p>[邮编] [都道府县] [市区町村] [建筑名（可省略）] [房间号]，例如：</p><p>107-0062 東京都港区南青山 7-7-7-1207</p></blockquote><p>对应的英文写法是：</p><blockquote><p>107-0062 7-7-7-1207, Minami Aoyama, Minato-ku, Tokyo-to.</p></blockquote><p>其中，港区在行政区划上属于 City。</p><p><strong>印章文化</strong>：</p><p>在日本，印章文化深入人心，它代表着签名。专业的印章鉴定师有能力对比不同的印章细节，来判定合同的真实性。</p><p>你会在许多情况下使用到印章，例如签订租房合同，办理银行账户，或购买属于自己的第一台日系手动挡跑车时。因此，印章对几乎所有民事合同来说都十分重要。如果你丢失了印章，必须及时前往区政府更换所登录的法定印章。</p><p>一般来说，签订民事合同使用印章时，需要配合法定的印鉴证明，如果你拥有 My Number Card，可以持卡前往便利店的打印机上使用行政服务快速打印印鉴证明，如果你并不持有 My Number Card 或仍在申请中，便需要持<strong>印鑑登録証</strong>和在留卡或其他有效身份证前往所在区政府申请印鉴证明。</p><p>也有某些不需要印鉴证明就能使用印章的场合，例如申请银行账户时。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7e4558591d38df11b68b38e693c3b4001bc99348ee57aa6c56af697b69787089.png" alt="日本印章范例" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">日本印章范例</figcaption></figure><p><strong>住民票</strong>：</p><p>住民票是一张 A4 纸大小的证书，用于表记姓名、对应住址、世代信息（户籍信息）。你可以认为住民票是你的住址证明。如前所述，当需要确认住址的情况下，我们会需要打印住民票。</p><p>你可能存在一个疑问，日本有相当多的法定证件上登记了住址，为何不使用现成的证件，而需要单独打印住民票来进行特定的手续呢？</p><p>我认为，一种解释是，行政手续必须遵守非强制的原则，由于部分民众并不拥有驾照，甚至不拥有健康保险卡，住民票作为法定意义上表记住址的文件，有其向后兼容的存在意义。</p><p>与印鉴证明相同，如果你拥有 My Number Card，可以持卡前往便利店的打印机上使用行政服务快速打印住民票，如果没有，只能携带法定身份证件前往区政府办理。</p><div data-type="embedly" src="https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8" data="{&quot;provider_url&quot;:&quot;http://wikipedia.org&quot;,&quot;description&quot;:&quot;この記事は特に記述がない限り、日本国内の法令について解説しています。また最新の法令改正を反映していない場合があります。 ご自身が現実に遭遇した事件については法律関連の専門家にご相談ください。 免責事項 もお読みください。 住民票（じゅうみんひょう）とは、 日本において 市町村と 特別区（以下「市区町村」という。）が 住民基本台帳法に基づき作成し ...&quot;,&quot;title&quot;:&quot;住民票 - Wikipedia&quot;,&quot;url&quot;:&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8&quot;,&quot;html&quot;:&quot;&lt;p&gt;&lt;b&gt;&amp;#20303;&amp;#27665;&amp;#31080;&lt;/b&gt;&amp;#65288;&amp;#12376;&amp;#12421;&amp;#12358;&amp;#12415;&amp;#12435;&amp;#12402;&amp;#12423;&amp;#12358;&amp;#65289;&amp;#12392;&amp;#12399;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC\&quot; title=\&quot;&amp;#26085;&amp;#26412;\&quot;&gt;&amp;#26085;&amp;#26412;&lt;/a&gt;&amp;#12395;&amp;#12362;&amp;#12356;&amp;#12390;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%B8%82%E7%94%BA%E6%9D%91\&quot; title=\&quot;&amp;#24066;&amp;#30010;&amp;#26449;\&quot;&gt;&amp;#24066;&amp;#30010;&amp;#26449;&lt;/a&gt;&amp;#12392;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E7%89%B9%E5%88%A5%E5%8C%BA\&quot; title=\&quot;&amp;#29305;&amp;#21029;&amp;#21306;\&quot;&gt;&amp;#29305;&amp;#21029;&amp;#21306;&lt;/a&gt;&amp;#65288;&amp;#20197;&amp;#19979;&amp;#12300;&amp;#24066;&amp;#21306;&amp;#30010;&amp;#26449;&amp;#12301;&amp;#12392;&amp;#12356;&amp;#12358;&amp;#12290;&amp;#65289;&amp;#12364;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E5%9F%BA%E6%9C%AC%E5%8F%B0%E5%B8%B3%E6%B3%95\&quot; title=\&quot;&amp;#20303;&amp;#27665;&amp;#22522;&amp;#26412;&amp;#21488;&amp;#24115;&amp;#27861;\&quot;&gt;&amp;#20303;&amp;#27665;&amp;#22522;&amp;#26412;&amp;#21488;&amp;#24115;&amp;#27861;&lt;/a&gt;&amp;#12395;&amp;#22522;&amp;#12389;&amp;#12365;&amp;#20316;&amp;#25104;&amp;#12375;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91\&quot; title=\&quot;&amp;#20303;&amp;#27665;\&quot;&gt;&amp;#20303;&amp;#27665;&lt;/a&gt;&amp;#12395;&amp;#38306;&amp;#12377;&amp;#12427;&amp;#35352;&amp;#37682;&amp;#12434;&amp;#34892;&amp;#12358;&amp;#20844;&amp;#31807;&lt;sup id=\&quot;cite_ref-1\&quot; class=\&quot;reference\&quot;&gt;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8#cite_note-1\&quot;&gt;&lt;span class=\&quot;cite-bracket\&quot;&gt;[&lt;/span&gt;1&lt;span class=\&quot;cite-bracket\&quot;&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;#12398;&amp;#21517;&amp;#31216;&amp;#12391;&amp;#12354;&amp;#12427;&amp;#12290;&amp;#21516;&amp;#27861;&amp;#12395;&amp;#35215;&amp;#23450;&amp;#12373;&amp;#12428;&amp;#12427;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E5%9F%BA%E6%9C%AC%E5%8F%B0%E5%B8%B3\&quot; title=\&quot;&amp;#20303;&amp;#27665;&amp;#22522;&amp;#26412;&amp;#21488;&amp;#24115;\&quot;&gt;&amp;#20303;&amp;#27665;&amp;#22522;&amp;#26412;&amp;#21488;&amp;#24115;&lt;/a&gt;&amp;#12434;&amp;#27083;&amp;#25104;&amp;#12377;&amp;#12427;&amp;#12418;&amp;#12398;&amp;#12391;&amp;#12354;&amp;#12426;&amp;#12289;&amp;#24066;&amp;#21306;&amp;#30010;&amp;#26449;&amp;#12395;&amp;#12424;&amp;#12387;&amp;#12390;&amp;#20491;&amp;#20154;&amp;#21336;&amp;#20301;&amp;#12418;&amp;#12375;&amp;#12367;&amp;#12399;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%B8%96%E5%B8%AF\&quot; title=\&quot;&amp;#19990;&amp;#24111;\&quot;&gt;&amp;#19990;&amp;#24111;&lt;/a&gt;&amp;#21336;&amp;#20301;&amp;#12391;&amp;#20316;&amp;#25104;&amp;#12373;&amp;#12428;&amp;#12289;&amp;#20491;&amp;#20154;&amp;#21336;&amp;#20301;&amp;#12391;&amp;#20316;&amp;#25104;&amp;#12373;&amp;#12428;&amp;#12383;&amp;#12418;&amp;#12398;&amp;#12399;&amp;#19990;&amp;#24111;&amp;#12372;&amp;#12392;&amp;#12395;&amp;#12414;&amp;#12392;&amp;#12417;&amp;#12425;&amp;#12428;&amp;#12427;&lt;sup id=\&quot;cite_ref-2\&quot; class=\&quot;reference\&quot;&gt;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8#cite_note-2\&quot;&gt;&lt;span class=\&quot;cite-bracket\&quot;&gt;[&lt;/span&gt;2&lt;span class=\&quot;cite-bracket\&quot;&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;#12290;\n&lt;/p&gt;&lt;p&gt;&amp;#24066;&amp;#21306;&amp;#30010;&amp;#26449;&amp;#38263;&amp;#12399;&amp;#12289;&amp;#24120;&amp;#12395;&amp;#20303;&amp;#27665;&amp;#22522;&amp;#26412;&amp;#21488;&amp;#24115;&amp;#65288;&amp;#20303;&amp;#27665;&amp;#31080;&amp;#65289;&amp;#12398;&amp;#27491;&amp;#30906;&amp;#12394;&amp;#35352;&amp;#37682;&amp;#12364;&amp;#34892;&amp;#12431;&amp;#12428;&amp;#12427;&amp;#12424;&amp;#12358;&amp;#21162;&amp;#12417;&amp;#12427;&amp;#12371;&amp;#12392;&amp;#12289;&amp;#12381;&amp;#12375;&amp;#12390;&amp;#12289;&amp;#12381;&amp;#12398;&amp;#20107;&amp;#21209;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E8%A1%8C%E6%94%BF%E8%A1%8C%E7%82%BA\&quot; title=\&quot;&amp;#34892;&amp;#25919;&amp;#34892;&amp;#28858;\&quot;&gt;&amp;#22519;&amp;#34892;&lt;/a&gt;&amp;#12398;&amp;#31649;&amp;#29702;&amp;#12364;&amp;#36969;&amp;#27491;&amp;#12395;&amp;#34892;&amp;#12431;&amp;#12428;&amp;#12427;&amp;#12424;&amp;#12358;&amp;#24517;&amp;#35201;&amp;#12394;&amp;#25514;&amp;#32622;&amp;#12434;&amp;#35611;&amp;#12376;&amp;#12427;&amp;#12371;&amp;#12392;&amp;#31561;&amp;#12364;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E7%BE%A9%E5%8B%99\&quot; title=\&quot;&amp;#32681;&amp;#21209;\&quot;&gt;&amp;#36012;&amp;#21209;&lt;/a&gt;&amp;#12392;&amp;#12373;&amp;#12428;&amp;#12390;&amp;#12356;&amp;#12427;&lt;sup id=\&quot;cite_ref-3\&quot; class=\&quot;reference\&quot;&gt;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8#cite_note-3\&quot;&gt;&lt;span class=\&quot;cite-bracket\&quot;&gt;[&lt;/span&gt;3&lt;span class=\&quot;cite-bracket\&quot;&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;#12290;&amp;#12414;&amp;#12383;&amp;#12289;&amp;#20303;&amp;#27665;&amp;#12399;&amp;#12289;&amp;#24120;&amp;#12395;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%89%80\&quot; title=\&quot;&amp;#20303;&amp;#25152;\&quot;&gt;&amp;#20303;&amp;#25152;&lt;/a&gt;&amp;#12420;&amp;#19990;&amp;#24111;&amp;#12398;&amp;#22793;&amp;#26356;&amp;#31561;&amp;#12398;&amp;#23626;&amp;#20986;&amp;#12434;&amp;#27491;&amp;#30906;&amp;#12395;&amp;#34892;&amp;#12358;&amp;#12371;&amp;#12392;&amp;#12364;&amp;#36012;&amp;#21209;&amp;#12392;&amp;#12373;&amp;#12428;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%98%98\&quot; title=\&quot;&amp;#22040;\&quot;&gt;&amp;#34394;&amp;#20605;&lt;/a&gt;&amp;#12398;&amp;#23626;&amp;#20986;&amp;#31561;&amp;#12289;&amp;#20303;&amp;#27665;&amp;#31080;&amp;#12398;&amp;#27491;&amp;#30906;&amp;#12394;&amp;#35352;&amp;#37682;&amp;#12434;&amp;#38459;&amp;#23475;&amp;#12377;&amp;#12427;&amp;#12424;&amp;#12358;&amp;#12394;&amp;#34892;&amp;#28858;&amp;#12434;&amp;#12375;&amp;#12390;&amp;#12399;&amp;#12394;&amp;#12425;&amp;#12394;&amp;#12356;&amp;#12392;&amp;#12373;&amp;#12428;&amp;#12390;&amp;#12356;&amp;#12427;&lt;sup id=\&quot;cite_ref-4\&quot; class=\&quot;reference\&quot;&gt;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8#cite_note-4\&quot;&gt;&lt;span class=\&quot;cite-bracket\&quot;&gt;[&lt;/span&gt;4&lt;span class=\&quot;cite-bracket\&quot;&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;#12290;&amp;#20303;&amp;#25152;&amp;#12420;&amp;#19990;&amp;#24111;&amp;#31561;&amp;#12398;&amp;#22793;&amp;#26356;&amp;#12398;&amp;#23626;&amp;#20986;&amp;#12399;&amp;#12289;&amp;#22793;&amp;#26356;&amp;#12364;&amp;#12354;&amp;#12387;&amp;#12383;&amp;#26085;&amp;#12363;&amp;#12425;14&amp;#26085;&amp;#20197;&amp;#20869;&amp;#65288;&amp;#36578;&amp;#20986;&amp;#23626;&amp;#12399;&amp;#30064;&amp;#21205;&amp;#12377;&amp;#12427;&amp;#21069;&amp;#12414;&amp;#12391;&amp;#65289;&amp;#12395;&amp;#34892;&amp;#12358;&amp;#12371;&amp;#12392;&amp;#12392;&amp;#12373;&amp;#12428;&amp;#12390;&amp;#12356;&amp;#12427;&lt;sup id=\&quot;cite_ref-5\&quot; class=\&quot;reference\&quot;&gt;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8#cite_note-5\&quot;&gt;&lt;span class=\&quot;cite-bracket\&quot;&gt;[&lt;/span&gt;5&lt;span class=\&quot;cite-bracket\&quot;&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;#12290;\n&lt;/p&gt;&lt;p&gt;&amp;#20303;&amp;#27665;&amp;#31080;&amp;#12399;&amp;#12289;&amp;#20303;&amp;#27665;&amp;#12398;&amp;#23621;&amp;#20303;&amp;#38306;&amp;#20418;&amp;#12398;&amp;#20844;&amp;#35388;&lt;sup id=\&quot;cite_ref-6\&quot; class=\&quot;reference\&quot;&gt;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8#cite_note-6\&quot;&gt;&lt;span class=\&quot;cite-bracket\&quot;&gt;[&lt;/span&gt;6&lt;span class=\&quot;cite-bracket\&quot;&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;#65288;&amp;#20303;&amp;#27665;&amp;#31080;&amp;#12398;&amp;#20889;&amp;#12375;&amp;#12420;&amp;#20303;&amp;#27665;&amp;#31080;&amp;#35352;&amp;#36617;&amp;#20107;&amp;#38917;&amp;#35388;&amp;#26126;&amp;#26360;&amp;#12398;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BA%A4%E4%BB%98\&quot; title=\&quot;&amp;#20132;&amp;#20184;\&quot;&gt;&amp;#20132;&amp;#20184;&lt;/a&gt;&amp;#31561;&amp;#65289;&amp;#12398;&amp;#12411;&amp;#12363;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E9%81%B8%E6%8C%99%E4%BA%BA%E5%90%8D%E7%B0%BF\&quot; title=\&quot;&amp;#36984;&amp;#25369;&amp;#20154;&amp;#21517;&amp;#31807;\&quot;&gt;&amp;#36984;&amp;#25369;&amp;#20154;&amp;#21517;&amp;#31807;&lt;/a&gt;&amp;#12408;&amp;#12398;&amp;#30331;&amp;#37682;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%9B%BD%E6%B0%91%E5%81%A5%E5%BA%B7%E4%BF%9D%E9%99%BA\&quot; title=\&quot;&amp;#22269;&amp;#27665;&amp;#20581;&amp;#24247;&amp;#20445;&amp;#38522;\&quot;&gt;&amp;#22269;&amp;#27665;&amp;#20581;&amp;#24247;&amp;#20445;&amp;#38522;&lt;/a&gt;&amp;#12539;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%BE%8C%E6%9C%9F%E9%AB%98%E9%BD%A2%E8%80%85%E5%8C%BB%E7%99%82\&quot; class=\&quot;mw-redirect\&quot; title=\&quot;&amp;#24460;&amp;#26399;&amp;#39640;&amp;#40802;&amp;#32773;&amp;#21307;&amp;#30274;\&quot;&gt;&amp;#24460;&amp;#26399;&amp;#39640;&amp;#40802;&amp;#32773;&amp;#21307;&amp;#30274;&lt;/a&gt;&amp;#12539;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BB%8B%E8%AD%B7%E4%BF%9D%E9%99%BA\&quot; title=\&quot;&amp;#20171;&amp;#35703;&amp;#20445;&amp;#38522;\&quot;&gt;&amp;#20171;&amp;#35703;&amp;#20445;&amp;#38522;&lt;/a&gt;&amp;#12539;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%9B%BD%E6%B0%91%E5%B9%B4%E9%87%91\&quot; title=\&quot;&amp;#22269;&amp;#27665;&amp;#24180;&amp;#37329;\&quot;&gt;&amp;#22269;&amp;#27665;&amp;#24180;&amp;#37329;&lt;/a&gt;&amp;#12398;&amp;#34987;&amp;#20445;&amp;#38522;&amp;#32773;&amp;#12398;&amp;#36039;&amp;#26684;&amp;#12398;&amp;#30906;&amp;#35469;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%85%90%E7%AB%A5%E6%89%8B%E5%BD%93\&quot; title=\&quot;&amp;#20816;&amp;#31461;&amp;#25163;&amp;#24403;\&quot;&gt;&amp;#20816;&amp;#31461;&amp;#25163;&amp;#24403;&lt;/a&gt;&amp;#12398;&amp;#21463;&amp;#32102;&amp;#36039;&amp;#26684;&amp;#12398;&amp;#30906;&amp;#35469;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%AD%A6%E9%BD%A2%E7%B0%BF\&quot; title=\&quot;&amp;#23398;&amp;#40802;&amp;#31807;\&quot;&gt;&amp;#23398;&amp;#40802;&amp;#31807;&lt;/a&gt;&amp;#12398;&amp;#20316;&amp;#25104;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E7%94%9F%E6%B4%BB%E4%BF%9D%E8%AD%B7\&quot; title=\&quot;&amp;#29983;&amp;#27963;&amp;#20445;&amp;#35703;\&quot;&gt;&amp;#29983;&amp;#27963;&amp;#20445;&amp;#35703;&lt;/a&gt;&amp;#21450;&amp;#12403;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BA%88%E9%98%B2%E6%8E%A5%E7%A8%AE\&quot; title=\&quot;&amp;#20104;&amp;#38450;&amp;#25509;&amp;#31278;\&quot;&gt;&amp;#20104;&amp;#38450;&amp;#25509;&amp;#31278;&lt;/a&gt;&amp;#12395;&amp;#38306;&amp;#12377;&amp;#12427;&amp;#20107;&amp;#21209;&amp;#12289;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%8D%B0%E9%91%91%E7%99%BB%E9%8C%B2\&quot; title=\&quot;&amp;#21360;&amp;#37969;&amp;#30331;&amp;#37682;\&quot;&gt;&amp;#21360;&amp;#37969;&amp;#30331;&amp;#37682;&lt;/a&gt;&amp;#12395;&amp;#38306;&amp;#12377;&amp;#12427;&amp;#20107;&amp;#21209;&amp;#12289;&amp;#20303;&amp;#27665;&amp;#22522;&amp;#26412;&amp;#21488;&amp;#24115;&amp;#12395;&amp;#22522;&amp;#12389;&amp;#12367;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BA%BA%E5%8F%A3\&quot; title=\&quot;&amp;#20154;&amp;#21475;\&quot;&gt;&amp;#20154;&amp;#21475;&lt;/a&gt;&amp;#12289;&amp;#20154;&amp;#21475;&amp;#21205;&amp;#24907;&amp;#21450;&amp;#12403;&amp;#19990;&amp;#24111;&amp;#25968;&amp;#35519;&amp;#26619;&amp;#12394;&amp;#12393;&amp;#12398;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E5%9B%BD%E6%94%BF%E5%BA%9C\&quot; title=\&quot;&amp;#26085;&amp;#26412;&amp;#22269;&amp;#25919;&amp;#24220;\&quot;&gt;&amp;#22269;&lt;/a&gt;&amp;#21450;&amp;#12403;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E5%9C%B0%E6%96%B9%E5%85%AC%E5%85%B1%E5%9B%A3%E4%BD%93\&quot; title=\&quot;&amp;#22320;&amp;#26041;&amp;#20844;&amp;#20849;&amp;#22243;&amp;#20307;\&quot;&gt;&amp;#22320;&amp;#26041;&amp;#20844;&amp;#20849;&amp;#22243;&amp;#20307;&lt;/a&gt;&amp;#12398;&amp;#34892;&amp;#25919;&amp;#20107;&amp;#21209;&amp;#12395;&amp;#21033;&amp;#29992;&amp;#12373;&amp;#12428;&amp;#12390;&amp;#12356;&amp;#12427;&lt;sup id=\&quot;cite_ref-7\&quot; class=\&quot;reference\&quot;&gt;&lt;a href=\&quot;https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8#cite_note-7\&quot;&gt;&lt;span class=\&quot;cite-bracket\&quot;&gt;[&lt;/span&gt;7&lt;span class=\&quot;cite-bracket\&quot;&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;#12290;\n&lt;/p&gt;&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Wikipedia&quot;,&quot;type&quot;:&quot;link&quot;}" format="iframe"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://ja.wikipedia.org/wiki/%E4%BD%8F%E6%B0%91%E7%A5%A8" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>住民票 - Wikipedia</h2><p>この記事は特に記述がない限り、日本国内の法令について解説しています。また最新の法令改正を反映していない場合があります。 ご自身が現実に遭遇した事件については法律関連の専門家にご相談ください。 免責事項 もお読みください。 住民票（じゅうみんひょう）とは、 日本において 市町村と 特別区（以下「市区町村」という。）が 住民基本台帳法に基づき作成し ...</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>http://wikipedia.org</span></div></div></a></div></div><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">移动通信服务</h2><p>如今，生活中最重要的东西是智能手机，办理完繁琐的登记手续后，你拥有了一张登记有效地址的在留卡， 此时，我们便可以开始申请手机卡。</p><p><strong>套餐与号码选择：</strong></p><p>日本的移动通信服务五花八门，资费参差不齐。按照运营商选择，有 Softbank，docomo，au，按照套餐资费来选择，分为正常运营商与格安运营商，后者包括 ahamo，乐天移动，povo 和 Line Mobile 等等。考虑到个人偏好差异，这里不做具体推荐。</p><p>部分移动运营商，例如乐天移动，支持在线选择手机号码，挑选满意的号码，是开启日本生活的重要一步。</p><div data-type="embedly" src="https://ahamo.com/" data="{&quot;provider_url&quot;:&quot;https://ahamo.com&quot;,&quot;description&quot;:&quot;ahamoのオフィシャルウェブサイトです。ahamoのご契約を検討される方はこちらへ。オンラインで受付可能な条件無しの30GB2,970円（税込）。&quot;,&quot;title&quot;:&quot;ahamo&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://ahamo.com/index.html&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aa1e39b79c812ac56c4ac255569df32b965c54d14f8b8cd9e825f67638d29d6.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;ahamo&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aa1e39b79c812ac56c4ac255569df32b965c54d14f8b8cd9e825f67638d29d6.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aa1e39b79c812ac56c4ac255569df32b965c54d14f8b8cd9e825f67638d29d6.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://ahamo.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>ahamo</h2><p>ahamoのオフィシャルウェブサイトです。ahamoのご契約を検討される方はこちらへ。オンラインで受付可能な条件無しの30GB2,970円（税込）。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://ahamo.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aa1e39b79c812ac56c4ac255569df32b965c54d14f8b8cd9e825f67638d29d6.png"/></div></a></div></div><div data-type="embedly" src="https://network.mobile.rakuten.co.jp/" data="{&quot;provider_url&quot;:&quot;https://network.mobile.rakuten.co.jp&quot;,&quot;description&quot;:&quot;楽天モバイル公式。料金プラン「Rakuten最強プラン」は、ギガもアプリ通話も無制限！ 家族割引適用で880円/月（税込968円）～ギガ無制限で2,880円/月（税込3,168円）。最新のiPhoneや人気のAndroidスマートフォンも続々登場！※2024年2月時点 ※混雑時など公平なサービス提供のため速度制御する場合あり&quot;,&quot;title&quot;:&quot;楽天モバイル&quot;,&quot;author_name&quot;:&quot;楽天モバイル&quot;,&quot;url&quot;:&quot;https://network.mobile.rakuten.co.jp/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f0732616e68fd6bfe7fe4f27bfbf6791cd1ee9678bb8e292c400227c5150b3a3.png&quot;,&quot;thumbnail_width&quot;:1200,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Rakuten&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f0732616e68fd6bfe7fe4f27bfbf6791cd1ee9678bb8e292c400227c5150b3a3.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f0732616e68fd6bfe7fe4f27bfbf6791cd1ee9678bb8e292c400227c5150b3a3.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://network.mobile.rakuten.co.jp/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>楽天モバイル</h2><p>楽天モバイル公式。料金プラン「Rakuten最強プラン」は、ギガもアプリ通話も無制限！ 家族割引適用で880円/月（税込968円）～ギガ無制限で2,880円/月（税込3,168円）。最新のiPhoneや人気のAndroidスマートフォンも続々登場！※2024年2月時点 ※混雑時など公平なサービス提供のため速度制御する場合あり</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://network.mobile.rakuten.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f0732616e68fd6bfe7fe4f27bfbf6791cd1ee9678bb8e292c400227c5150b3a3.png"/></div></a></div></div><div data-type="embedly" src="https://povo.jp/" data="{&quot;provider_url&quot;:&quot;https://povo.jp&quot;,&quot;description&quot;:&quot;povo2.0は基本料0円の格安スマホプラン。au回線だから速度もエリアも品質も安定！eSIM対応、期間縛りなし、事務手数料なし、データ使い放題もトッピングが選べて、5Gにも対応！乗り換えにおススメ！&quot;,&quot;title&quot;:&quot;【公式】povo2.0 | 基本料ゼロから始めるau回線のスマホプラン【公式】povo2.0&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://povo.jp/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d01f4f55833554cf6d7695e2a5346ba579b1f0121f21555ff96c78cf4ebf1661.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;povo2.0&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d01f4f55833554cf6d7695e2a5346ba579b1f0121f21555ff96c78cf4ebf1661.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d01f4f55833554cf6d7695e2a5346ba579b1f0121f21555ff96c78cf4ebf1661.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://povo.jp/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>【公式】povo2.0 | 基本料ゼロから始めるau回線のスマホプラン【公式】povo2.0</h2><p>povo2.0は基本料0円の格安スマホプラン。au回線だから速度もエリアも品質も安定！eSIM対応、期間縛りなし、事務手数料なし、データ使い放題もトッピングが選べて、5Gにも対応！乗り換えにおススメ！</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://povo.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d01f4f55833554cf6d7695e2a5346ba579b1f0121f21555ff96c78cf4ebf1661.jpg"/></div></a></div></div><p><strong>eSIM</strong>（<strong>虚拟 SIM 卡）：</strong></p><p>大部分日本运营商如今支持发行 eSIM（虚拟 SIM 卡），这意味着，你可以使用支持 eSIM 卡的手机即时发行 SIM 卡，而不需要等待 SIM 邮寄的过程。iPhone 普遍支持 eSIM 卡。</p><p><strong>携号转网</strong>：</p><p>大部分日本运营商支持快速的携号转网，这意味着，如果你想更换运营商和网络套餐，并不需要前往营业所，在 App 上取得 MNP 号码即可快速办理。携号转网通常会有几小时的网络断续，取决于具体情况。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ahamo.com/support/mnp/#rakutenmobile">https://ahamo.com/support/mnp/#rakutenmobile</a></p><p><strong>5G 覆盖</strong>：</p><p>作为世界上最大的城市之一，东京的大多数核心地区覆盖了 5G，一些运营商，例如软银，在扩大他们的 5G 覆盖规模，推出了所谓的 5G WIFI 路由，这样，即时不施工也能在家里使用 5G 作为无线网络。</p><div data-type="embedly" src="https://www.softbank.jp/internet/air/" data="{&quot;provider_url&quot;:&quot;https://www.softbank.jp&quot;,&quot;description&quot;:&quot;5G対応！Wi-Fi搭載で自宅のどこでもインターネットが使い放題のSoftBank Air（ソフトバンクエアー）をご案内します。工事不要、置くだけですぐに使える、通信制限なしでWi-Fiがサクサク快適。&quot;,&quot;title&quot;:&quot;自宅・家庭用Wi-FiならSoftBank Air（ソフトバンクエアー）工事不要、置くだけですぐに使える | インターネット・固定電話 | ソフトバンク&quot;,&quot;thumbnail_width&quot;:200,&quot;url&quot;:&quot;https://www.softbank.jp/internet/air/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/568721e49bb2e3618c9efc672ddea658b2e0c69d5398b8ba1c78f3dbadf3500e.gif&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;ソフトバンク&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:200,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:200,&quot;height&quot;:200,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/568721e49bb2e3618c9efc672ddea658b2e0c69d5398b8ba1c78f3dbadf3500e.gif&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/568721e49bb2e3618c9efc672ddea658b2e0c69d5398b8ba1c78f3dbadf3500e.gif"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.softbank.jp/internet/air/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>自宅・家庭用Wi-FiならSoftBank Air（ソフトバンクエアー）工事不要、置くだけですぐに使える | インターネット・固定電話 | ソフトバンク</h2><p>5G対応！Wi-Fi搭載で自宅のどこでもインターネットが使い放題のSoftBank Air（ソフトバンクエアー）をご案内します。工事不要、置くだけですぐに使える、通信制限なしでWi-Fiがサクサク快適。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.softbank.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/568721e49bb2e3618c9efc672ddea658b2e0c69d5398b8ba1c78f3dbadf3500e.gif"/></div></a></div></div><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">公共交通系统</h2><p>日本拥有世界上最准时和完善的公共交通系统，每日搭乘公共交通出行，是大部分人日本居民的生活方式，在这一小节，我会向你介绍它们具体的类型。</p><div data-type="embedly" src="https://www.jreast.co.jp/" data="{&quot;provider_url&quot;:&quot;https://www.jreast.co.jp&quot;,&quot;description&quot;:&quot;JR東日本の公式サイト。列車の運行・時刻表・駅の情報や、旅行・観光、きっぷ、Suica、大人の休日倶楽部、ビューカードなどをご案内。企業・IR・採用情報もご覧いただけます。新幹線・特急、びゅう国内ツアーのインターネット予約ができます。&quot;,&quot;title&quot;:&quot;JR東日本：東日本旅客鉄道株式会社&quot;,&quot;mean_alpha&quot;:255,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.jreast.co.jp/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;JR東日本：東日本旅客鉄道株式会社&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.jreast.co.jp/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>JR東日本：東日本旅客鉄道株式会社</h2><p>JR東日本の公式サイト。列車の運行・時刻表・駅の情報や、旅行・観光、きっぷ、Suica、大人の休日倶楽部、ビューカードなどをご案内。企業・IR・採用情報もご覧いただけます。新幹線・特急、びゅう国内ツアーのインターネット予約ができます。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.jreast.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png"/></div></a></div></div><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdf2ba5e45fd6fe4a0038674456094086166f12cd57fb087d0fa32c48e4f1dec.png" alt="复杂的东京地铁线路图" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">复杂的东京地铁线路图</figcaption></figure><p><strong>电车</strong>：</p><p>日本的电车系统泛指包括 JR（日本铁道），市营铁道，都营地铁，私营铁路为主的，以电气驱动的铁道系统。不同的铁道系统提供不同的纸质车票，但都支持使用 IC 交通卡相互换乘。日本的铁道系统非常复杂，很难在本小节详细介绍，在这里，我们会给你提供一些电车搭乘建议。</p><ul><li><p>购买 IC 交通卡： 推荐购买 Suica 或 Pasmo，这两种交通卡都支持在 iPhone 或其他支持 NFC 功能的智能手机中在线发行，如果你使用 iPhone，在发行交通卡前，可能需要下载对应的 App，并将手机地区设置为日本。</p></li></ul><div data-type="embedly" src="https://www.jreast.co.jp/suica/" data="{&quot;provider_url&quot;:&quot;https://www.jreast.co.jp&quot;,&quot;description&quot;:&quot;JR東日本の「Suica」公式ホームページ。Suica（カードタイプ）、モバイルSuica、Apple PayのSuicaについてご案内いたします。&quot;,&quot;title&quot;:&quot;Suicaトップ：JR東日本&quot;,&quot;mean_alpha&quot;:255,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.jreast.co.jp/suica/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;JR東日本：東日本旅客鉄道株式会社&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.jreast.co.jp/suica/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Suicaトップ：JR東日本</h2><p>JR東日本の「Suica」公式ホームページ。Suica（カードタイプ）、モバイルSuica、Apple PayのSuicaについてご案内いたします。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.jreast.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png"/></div></a></div></div><div data-type="embedly" src="https://www.pasmo.co.jp/use/" data="{&quot;provider_url&quot;:&quot;https://www.pasmo.co.jp&quot;,&quot;description&quot;:&quot;PASMOの様々な使い方をご紹介しています。&quot;,&quot;title&quot;:&quot;PASMOを使う｜PASMO（パスモ）&quot;,&quot;url&quot;:&quot;https://www.pasmo.co.jp/use/&quot;,&quot;thumbnail_width&quot;:1000,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4303453db19a8bef8868d0bb42821bd700895636ca011b881ca681bc92915d05.webp&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Pasmo&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:540,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1000,&quot;height&quot;:540,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4303453db19a8bef8868d0bb42821bd700895636ca011b881ca681bc92915d05.webp&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4303453db19a8bef8868d0bb42821bd700895636ca011b881ca681bc92915d05.webp"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.pasmo.co.jp/use/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>PASMOを使う｜PASMO（パスモ）</h2><p>PASMOの様々な使い方をご紹介しています。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.pasmo.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4303453db19a8bef8868d0bb42821bd700895636ca011b881ca681bc92915d05.webp"/></div></a></div></div><ul><li><p>通勤费用： 不同铁道公司计价的基础费用不同，一般来说，根据搭乘里程不同，票价在 150-300 日元不等。</p></li><li><p>交通卡充值： 以手机 App 发行的交通卡，一般能够通过手机中内置的卡片进行充值，例如 iOS 中支持以 Apple Pay 快捷充值交通卡。如果你选择购买实体卡片，可以在所有便利店进行充值，或者搭乘电车时在车站的购票窗口使用自助机器进行现金充值。</p></li><li><p>下载导航应用： 初来乍到，复杂的电车系统间的换乘很难不依赖导航应用。在日本，我们推荐你下载「乘换案内」或「Google Map」前者的换乘信息和时刻表更为准确，后者更适合大部分用户的使用习惯。</p></li></ul><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.jorudan.co.jp/">https://www.jorudan.co.jp/</a></p><ul><li><p>乘车： 日本的电车时间抵达和出发时间精确到秒。因此，大部分日本居民出行并不会提前很久抵达车站，换句话说，不同电车之间换乘时间也会相当紧凑，对于不熟悉日本生活的外国居民来说，很可能会在换乘中遇到困难，我们建议在搭乘不熟悉的线路前，保留充足的换乘时间。在日本，搭乘公共交通工具完全匿名，你不需要携带特定的身份证即可搭乘。</p></li><li><p>预约与提前购票： 电车根据停靠车站数量和抵达时间不同，分为**特急、快速、急行、準急、普通（各停）**等几大类，对于长距离电车而言，一般需要提前预约车票和座位，我们推荐使用 Eki Net（JR 东日本）进行预约。</p></li></ul><div data-type="embedly" src="https://www.eki-net.com/personal/top/index" data="{&quot;provider_url&quot;:&quot;https://www.eki-net.com&quot;,&quot;description&quot;:&quot;新幹線・JR特急の空席案内、申込のほか、国内旅行の予約も可能です。きっぷと合わせてレンタカー予約がおトクにご利用いただけます。&quot;,&quot;title&quot;:&quot;えきねっと（JR東日本）｜トップ：新幹線・JR特急列車の予約 東日本のツアー 駅レンタカー申込&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.eki-net.com/Personal/Top/Index&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b8a109533bb91e36c5e5693fa7f5d5bce80678c8e93bd2c71a1dc6707fc11250.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;えきねっと（JR東日本）｜トップ：新幹線・JR特急列車の予約 東日本のツアー 駅レンタカー申込&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b8a109533bb91e36c5e5693fa7f5d5bce80678c8e93bd2c71a1dc6707fc11250.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b8a109533bb91e36c5e5693fa7f5d5bce80678c8e93bd2c71a1dc6707fc11250.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.eki-net.com/personal/top/index" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>えきねっと（JR東日本）｜トップ：新幹線・JR特急列車の予約 東日本のツアー 駅レンタカー申込</h2><p>新幹線・JR特急の空席案内、申込のほか、国内旅行の予約も可能です。きっぷと合わせてレンタカー予約がおトクにご利用いただけます。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.eki-net.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b8a109533bb91e36c5e5693fa7f5d5bce80678c8e93bd2c71a1dc6707fc11250.png"/></div></a></div></div><ul><li><p>指定席位购票机的使用： 在车站自助购买机票时，使用指定席位购票机是许多外国居民不适应的生活细节，在以下网页，你可以在线学习 JR 购票机的使用方式，它提供了一个模拟器帮助我们学习：</p></li></ul><div data-type="embedly" src="https://www.jreast.co.jp/mv-guide/" data="{&quot;provider_url&quot;:&quot;https://www.jreast.co.jp&quot;,&quot;description&quot;:&quot;JR東日本の指定席券売機に関する総合案内ページです。指定席券売機では、乗車券・定期券の購入、払いもどし、えきねっとでご予約いただいたきっぷの受取など、さまざまな機能をご利用いただけます。&quot;,&quot;title&quot;:&quot;指定席券売機ご利用案内：JR東日本&quot;,&quot;mean_alpha&quot;:255,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.jreast.co.jp/mv-guide/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;JR東日本：東日本旅客鉄道株式会社&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.jreast.co.jp/mv-guide/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>指定席券売機ご利用案内：JR東日本</h2><p>JR東日本の指定席券売機に関する総合案内ページです。指定席券売機では、乗車券・定期券の購入、払いもどし、えきねっとでご予約いただいたきっぷの受取など、さまざまな機能をご利用いただけます。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.jreast.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/54f3ac69bc2b720183e642aed6b6310c2a25d087176e64700c92d04a1d67c116.png"/></div></a></div></div><ul><li><p>票价组成： 对于长距离电车而言，车票分为<strong>基础票价（乗車券）和</strong>座位票价（座席券）。在普通电车与特急电车进行换乘时，可以使用交通 IC 卡支付完整旅行的基础票价，但可能需要提前预定或在车站月台单独购买特急电车的座位票。</p></li><li><p>绿色车厢： 对于长距离电车而言，一般设有绿色车厢。绿色车厢在特急电车中通常是一等座车厢，在快速和急行混编电车中，通常是带有固定座位的车厢，以区别于自由席位车厢。绿色车厢的座位票需要单独购买，如果你使用移动交通 IC 卡，可以直接在 App 中购买，如果使用纸质车票，可以使用月台或车站的自助购票机购买。</p></li></ul><div data-type="embedly" src="https://zh.wikipedia.org/zh-cn/%E7%B6%A0%E8%89%B2%E8%BB%8A%E5%BB%82" data="{&quot;provider_url&quot;:&quot;https://zh.wikipedia.org&quot;,&quot;description&quot;:&quot;绿色车厢（日语： ／，英语：Green Car）是 日本国有铁道（国铁）和 JR各公司旅客列车内比普通车厢更舒适、设备更豪华的 一等车厢。1969年国铁车费设定更新时，把战前已有的1等座席车（一等车）、2等座席车（二等车）废除，并把特急乘车券和急行乘车券合并。自此就设定了\&quot;普通车厢\&quot;和较高级的\&quot;绿色车厢\&quot;。而寝台列车（ 卧铺列车 ...&quot;,&quot;title&quot;:&quot;绿色车厢 - 维基百科，自由的百科全书&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://zh.wikipedia.org/zh-cn/%E7%B6%A0%E8%89%B2%E8%BB%8A%E5%BB%82&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/17f96bc23e91fdd650bdf387d6849868128718913ebbf0c1b6685113f3645883.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Wikipedia&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:900,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:900,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/17f96bc23e91fdd650bdf387d6849868128718913ebbf0c1b6685113f3645883.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/17f96bc23e91fdd650bdf387d6849868128718913ebbf0c1b6685113f3645883.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://zh.wikipedia.org/zh-cn/%E7%B6%A0%E8%89%B2%E8%BB%8A%E5%BB%82" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>绿色车厢 - 维基百科，自由的百科全书</h2><p>绿色车厢（日语： ／，英语：Green Car）是 日本国有铁道（国铁）和 JR各公司旅客列车内比普通车厢更舒适、设备更豪华的 一等车厢。1969年国铁车费设定更新时，把战前已有的1等座席车（一等车）、2等座席车（二等车）废除，并把特急乘车券和急行乘车券合并。自此就设定了&quot;普通车厢&quot;和较高级的&quot;绿色车厢&quot;。而寝台列车（ 卧铺列车 ...</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://zh.wikipedia.org</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/17f96bc23e91fdd650bdf387d6849868128718913ebbf0c1b6685113f3645883.jpg"/></div></a></div></div><p><strong>高铁（新干线）</strong>：</p><p>日本的高速铁道网络始于 1964 年，是世界上第一个商用高铁网络，也称作新干线。它的搭乘方法与票价系统与普通电车略有不同。</p><ul><li><p>交通 IC 卡的使用： 使用 Eki Net 提供的无纸质票据方式预定新干线车票，可以在 web 服务中将车票与你的交通 IC 卡进行绑定，绑定时，需要提供移动交通卡或者实体卡片的对应编号信息。你可以在 Suica App 或 Pasmo App 中查询到这些编号。使用这类方式预定车票，可使用对应的交通 IC 卡直接进站。</p></li></ul><div data-type="embedly" src="https://www.jreast.co.jp/touchdego/" data="{&quot;provider_url&quot;:&quot;https://www.jreast.co.jp&quot;,&quot;description&quot;:&quot;予約不要で改札にお手持ちの交通系ICカードをタッチするだけで新幹線の自由席に乗車できるサービスです。※初回のみ登録が必要です。※事前にチャージが必要です。※他社モバイルサービス含みます。&quot;,&quot;title&quot;:&quot;自由席乗るならタッチでGo!新幹線│JR東日本&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.jreast.co.jp/touchdego/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c99fc16c11b60189c7e6f1c917b7e3aef57548c5e9d8a3b1a193084c0764bc75.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;自由席乗るならタッチでGo!新幹線│JR東日本&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c99fc16c11b60189c7e6f1c917b7e3aef57548c5e9d8a3b1a193084c0764bc75.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c99fc16c11b60189c7e6f1c917b7e3aef57548c5e9d8a3b1a193084c0764bc75.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.jreast.co.jp/touchdego/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>自由席乗るならタッチでGo!新幹線│JR東日本</h2><p>予約不要で改札にお手持ちの交通系ICカードをタッチするだけで新幹線の自由席に乗車できるサービスです。※初回のみ登録が必要です。※事前にチャージが必要です。※他社モバイルサービス含みます。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.jreast.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c99fc16c11b60189c7e6f1c917b7e3aef57548c5e9d8a3b1a193084c0764bc75.jpg"/></div></a></div></div><ul><li><p>纸质车票： 如果你无法使用 Eki Net 预定电子车票，则需要领取纸质车票。纸质车票可以在窗口或者自助购票机发行。注意，不同区间车票可能会发行多张不同的纸质车票。</p></li><li><p>通勤费用： 新干线的通勤费用较为昂贵，甚至高于民航票价。因此，对于路途较远的旅行，我们不推荐采用新干线出行。</p></li><li><p>通行券（JR Pass）： 由于新干线的费用较高，日本铁道公司会发行针对性的优惠折扣车票，统称为 JR Pass，你可以在这里查询到所有 JR Pass 的信息。疫情后，JR Pass 也有针对居住在日本的外国人的专门优惠。</p></li></ul><div data-type="embedly" src="https://japanrailpass.net/" data="{&quot;provider_url&quot;:&quot;https://japanrailpass.net&quot;,&quot;description&quot;:&quot;日本観光になくてはならないJAPAN RAIL PASSは、JRグループ6社が共同して提供するパスです。&quot;,&quot;title&quot;:&quot;ジャパン・レール・パス | JAPAN RAIL PASS&quot;,&quot;url&quot;:&quot;https://japanrailpass.net/&quot;,&quot;thumbnail_width&quot;:2400,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/557d3df267c773e1d5ed9e2a6612f6cea74939dc833100a2e31244f7ac722a47.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Japanrailpass&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/557d3df267c773e1d5ed9e2a6612f6cea74939dc833100a2e31244f7ac722a47.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/557d3df267c773e1d5ed9e2a6612f6cea74939dc833100a2e31244f7ac722a47.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://japanrailpass.net/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>ジャパン・レール・パス | JAPAN RAIL PASS</h2><p>日本観光になくてはならないJAPAN RAIL PASSは、JRグループ6社が共同して提供するパスです。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://japanrailpass.net</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/557d3df267c773e1d5ed9e2a6612f6cea74939dc833100a2e31244f7ac722a47.jpg"/></div></a></div></div><ul><li><p>席位与车厢： 大部分新干线班次拥有自由席位车厢与固定席位车厢。前者的车票价格更低，但当旅行旺季时，例如年末年始（元旦假期）时，自由席位车厢通常会很难找到空位。</p></li></ul><p><strong>民航：</strong></p><p>日本有着发达的民航网络，作为列岛的国度，拥有超过 100 座机场。</p><ul><li><p>航空公司与忠诚度计划： 日本的两大航空公司是<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.jal.co.jp/jp/en/?city=TYO">日本航空</a>（JAL）与<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.ana.co.jp/">全日空</a>（ANA）前者是寰宇一家的成员，后者是星空联盟的成员。除此之外，日本还有大量的廉价航空公司运营流行航线的航班，例如 JetStar，Peach，星悦航空 (Star Flyer) 等等。</p></li><li><p>通勤费用: 日本航空票价分布广泛，对于流行的航线，航空公司之间的竞争很激烈，因此，很容易购买到单程小于 1 万日元的机票。</p></li><li><p>乘机： 搭乘日本的公共交通系统均为匿名，因此，你并不需要携带有效的身份证进行核验。一般来说，民航机票可以通过提前值机发行登机二维码，使用二维码自助通过安检闸口，即可登机。如果你无法通过提前值机获得二维码，也可以前往机场的自助值机柜台打印纸质登记凭证。特殊地，如果你办理了航空公司联名的 IC 信用卡，也可以直接刷卡登机。</p><p>与其他国家不同，对于日本国内航线，登机和办理行李托运的抵达截至时间一般为<strong>航班起飞前的 30 分钟</strong>。而登机开始时间一般为航班起飞前的 10 分钟。</p><p>另外，日本国内航线登机的安全检查允许携带饮料，有专门的饮料检测机负责检测饮料安全。</p></li></ul><p><strong>巴士系统</strong>：</p><p>日本的巴士系统分为路线巴士与高速巴士，后者的巴士网络遍布日本各大城市，是经济实惠的出行方式。</p><ul><li><p>路线巴士的搭乘方式： 路线巴士指城市内或者城市间的短途巴士，有两种不同的计价方式，分别是<strong>一票制</strong>和<strong>里程计价制</strong>。一票制巴士的上车们通常是前门，在上车时刷交通 IC 卡或者现金付费。里程计价制的上车门通常是后门，上车时，需要领取「整理券」，整理券表记了上车站点的编号，下车时，于前门的自助投币机，根据所持编号的费用进行付款。</p><p>近年来，也有支持交通 IC 卡的电子整理券巴士出现，对于此类巴士，上下车都需要刷卡，费用会自动扣除。</p></li><li><p>高速巴士的预约与搭乘： 高速巴士分为日间巴士与过夜巴士两种，不同的巴士公司可能存在不同的预约渠道，但大多数巴士公司都能在此网站预定。所有高速巴士都在固定的巴士中心发车，对于东京来说，最大的巴士中心在新宿巴士中心。</p></li></ul><p><strong>出租车</strong>：</p><p>众所周知，日本的出租车费用很高，在都市内通勤，赶时间时，搭乘出租车也是不错的选择。</p><ul><li><p>出租车费用 以东京都为例，出租车的起步价约为 420 日元。大部分出租车都支持使用交通 IC 卡和信用卡付款，一些出租车也支持使用二维码支付。</p></li><li><p>打车软件 大都市内，出租车遍布城市，扬招十分方便。但打车软件近年也渗透到日本人的日常生活中，流行的打车软件有 GoTaxi，Uber，滴滴打车等，赶飞机时，提前预约出租车会比较便利。</p></li></ul><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">公共礼仪与常识</h2><p>礼仪是日本文化中的重要部分，它渗透进日常生活中的每一处细节。作为外国居民，我们时常会不习惯日本文化中的礼仪，无法解读周围的「空气」或对话中的语境，本小节我会向你介绍一些基本的公共礼仪，外国居民是否遵从文化上的礼仪是个人选择，但理解日本人的行事方式有助于我们更适应日本的生活。</p><p><strong>公共交通上的礼仪</strong>：</p><ul><li><p>静音车厢： 如无特殊说明，在搭乘公共交通时，均为静音车厢，请将移动电话调整为静音（震动）模式，播放视频或听音乐时，请戴上耳机。静音车厢不能接打电话，如需接打电话，可以在车厢的连接处，或下车后接打。</p></li><li><p>饮食问题： 除了搭乘新干线，飞机和特定的带有席位的特急电车时，除饮水之外的饮食均被禁止。</p></li><li><p>搭乘顺序： 搭乘巴士时，请尽量先坐靠后的座位。</p></li><li><p>礼让与优先座位： 电车与巴士上多设有特殊的优先座位，在有富余座位的时候，一般不使用特殊优先座位。当使用特殊座位时，遇到无法站稳的老人，孕妇，孩子和其他行动不便人士时，礼让座位并不是法律要求，但这是良好的习惯。</p></li><li><p>座椅调节： 新干线、特急电车与飞机的座椅通常可以调节，调节前，如果后座有乘客使用，请事先询问对方意见或以缓慢的速度调节。下车时，请将座椅状态复原。</p></li></ul><p><strong>其他礼仪与生活常识</strong>：</p><ul><li><p>左行： 除大阪市以外的地区，行人的行进方向一般为左行，在车站通道内，有时也会有特殊的行进方向标记，请遵循标记路线前行。</p></li><li><p>扶梯秩序： 搭乘电梯时，日本人一般站立在左道，右侧则是赶时间的急用通道。即使近年各大车站都在试图改变这一习惯，号召民众呈更为安全的两排站立，但搭乘扶梯时，靠左站立并让出一条通道仍然是目前主流的习惯。</p></li><li><p>自行车的使用： 日本的街道狭窄，一般没有专用的自行车道。因此，使用自行车出行时，在道路左侧行驶，人行道没有行人或避让机动车时，也可以在人行道行驶。过街时，请下车推行。</p><p>自行车在停车时，需要寻找专门的自行车停车场。如肆意停车于路边，可能会被视为违法停车，警告期间后会被专业人士剪去车锁并扣留在专门的自行车停车场。</p><p>如使用自行车与行人发生碰撞时，可能面临大额赔付，因此，在购买自行车后，同时购买自行车保险，是非常必要的生活常识。</p></li><li><p>机动车驾驶礼仪： 驾驶机动车时，需要遵循的礼仪包括： 在并线时交叉汇入； 并线时，后者礼让我们驾驶的车辆时，并线后，打双闪致意； 高速行驶时，遇到堵车打双闪告知后方司机； 转弯时，礼让所有直行车辆后再转弯； 遇到没有红绿灯的人行横道，有行人意欲通过时，主动停车礼让行人； 别的车辆礼让我们驾驶的车辆时，招手或轻按喇叭致意；</p></li><li><p>排队礼仪： 日本人非常喜欢排队，经常能在饮食店门口看到大排长龙的队伍。排队时，请尊重前后的个人空间，留有一定空档。队伍较长时，排队前，由于队伍可能是断裂的，请提前确认队尾的位置。</p></li><li><p>使用敬语： 与他人对话时，使用敬语是良好的习惯。</p></li><li><p>外出时的垃圾问题： 日本的街道一般没有垃圾桶，但你可以在便利店，大型购物中心，超市门口寻找到垃圾筒；外出时，并非所有垃圾都可以丢在公共垃圾筒。丢弃垃圾时，请确认该垃圾筒的垃圾分类指南。在找不到垃圾筒的情况下，请携带垃圾回到住处后再进行分类丢弃。</p></li><li><p>温泉与浴场礼仪： 浴场文化是日本文化中独特的一部分，在使用温泉大浴场时，也请你遵循礼仪： 洗干净身体后再进入汤池； 进入汤池只能携带小毛巾，不能穿衣服进入浴场或汤池； 入浴时，保持安静或较低的说话音量； 如有纹身时，请尽量不要使用大浴场，改为使用私人浴场。</p></li></ul><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">租房问题</h2><p>准备从临时住处搬到属于自己的小家？那么你需要了解在日本租房需要准备的材料和细节问题。</p><p><strong>租房成本</strong>：</p><p>在大都市内，不同地区的租房成本差异较大。一般来说，如果寻找独立住房，不与其他人合租的情况下，1K 或 1LDK 的成本在 8-30 万日元不等。我们建议你划出 1/5-1/4 的月收入作为预算租房。</p><p>即使在临近的社区，由于具体房型不同，装修情况不同，楼龄不同，租房价格也会千差万别。在租房前，你需要提前了解所居住的社区，是否满足自己的偏好。</p><p>租房时，前期费用包括：</p><ul><li><p>礼金：作为房东的谢礼，一般为一个月的房租。</p></li><li><p>押金：通常为一个月的房租，可以在退租后根据情况取回。</p></li><li><p>房租：通常租期开始后一个月的房租。</p></li><li><p>中介费：通常为一个月或半个月的房租；有时，根据房屋情况不同，中介费会得到减免，对于刚建成新房，由业主直接管理的房源（例如三井賃貸）可以免去中介费。</p></li><li><p>保证会社与租房保险：在日本，租客一般来说有义务购买租房保险，有时，业主会制定特定的保证公司，为租客提供租房保险，保证公司收到保险费用后，在租客无法履行合同，迟纳租金的情况下，作为租客的保证人，保证公司会按时给业主垫付房租。</p></li><li><p>火灾保险和其他保险：有时，租客会被要求购买火灾保险，作为居住者，我们也可以主动购买地震和火灾保险等家财保险。</p></li><li><p>杂费：包括房屋清洁费，钥匙更换费等杂费。</p></li></ul><p>租房后，每月的费用包括：</p><ul><li><p>租金：所租住房间的租金</p></li><li><p>管理费：公寓的物业管理费</p></li><li><p>修缮金：公寓的修缮基金费用</p></li><li><p>组合费，网络费用，露台使用费，仓库使用费等杂费（如有）</p></li></ul><p><strong>租房手续</strong>：</p><p>日本的租房手续是申请制，申请时，租房者需要提交自己的相关材料，填写表格，房主会根据实际情况判断是否接受申请。一般来说，在存在租房中介的情况下，中介会向租房者提供申请书，在某些情况下（例如三井賃貸）也可以由租房申请者自助提交申请书。</p><p>申请书一般需要填写的内容：</p><ul><li><p>姓名，性别，目前住址</p></li><li><p>工作岗位，公司名和收入</p></li><li><p>保证人，可以是亲属或者所在公司的担保者。</p></li><li><p>双亲地址和电话（租房申请者是外国居民的场合，可能需要填写在日本居住的好友的联络方式）</p></li></ul><p><strong>租房合同</strong>：</p><p>日本的租房合同分为<strong>一般租约</strong>（普通借家）与<strong>固定时间租约</strong>（定期借家），一般租约的时间是 2 年，但无论合同年限多长，在不经过租客的同意下，业主无法更换租客，即使在拖欠房租，保证公司不得不垫付业主房租的情况下，由于法律保护，业主也无法直接赶走租客。固定时间租约则正好相反，在租约时间结束后，业主有权告知租客离开。因此，在租房时签约前，需要仔细确认租约的类型。</p><p><strong>水电煤气签约</strong>：</p><p>在日本，租房者有义务签约水电煤气。租房入住后，公寓的管理组合会提供一本详细的房屋使用说明书，其中包括所在地区的电气契约公司，水道公司和煤气公司。一般来说，可以通过网络申请或电话申请的方式开通水电煤气，预约到开通的时间可能在 1-2 周，在搬家前，最好提前准备。</p><p>水电煤气的缴款手段多样，可以在收到每月的费用请求书后使用 PayPay 缴纳，也可以前往附近便利店缴纳，或者，主动向银行申请代扣代缴。近年来，也出现了许多大型公司的业主直租公寓（如 Daiwa house 的 D-Room），并不需要开通水电煤，而会在房租中一并扣除，并支持使用信用卡自动扣款。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">垃圾分类制度</h2><p>日本采用严格的垃圾分类制度，并保持着世界上最高的资源垃圾回收率。但严苛的垃圾分类制度，是外国居民在日本居住最先会遇到的难题之一。</p><p><strong>基本分类逻辑</strong>：</p><p>日本不同地区的垃圾分类规则有很大不同，但大致遵循基本的分类逻辑，它们是：</p><ul><li><p>可燃垃圾：包括厨余垃圾（生垃圾），污损的纸类或塑料，其他无法回收但可以燃烧的垃圾。</p></li><li><p>资源垃圾：包括塑料瓶与可回收塑料制品（塑料袋，膨化塑料，塑料瓶标签，瓶盖等），玻璃瓶，铝罐，干净纸张（报纸，杂志，书籍，宣传海报），纸盒纸箱，电池等。</p></li><li><p>不可燃垃圾：包括金属，碎玻璃，复杂结构的小型电器等。</p></li><li><p>大件垃圾：超过回收规定体积的任何垃圾。</p></li></ul><p>特殊的，在一些资源类垃圾回收困难的地区（例如离岛）资源垃圾会被视为可燃垃圾处理。不同的资源垃圾，回收时间，方法根据地区都有所不同。对于公寓的住户，一般可以将所有垃圾分类后丢弃在公寓管理的垃圾回收箱或垃圾房，对于居住在户建（单体别墅）的住户，需要在社区规定的指定回收日的上午 8 点前，将垃圾分类后置于街道旁边的指定垃圾回收点，若丢弃在其他地方，均视为违法丢弃垃圾。请注意，违法丢弃垃圾在日本是<strong>犯罪行为</strong>。</p><p><strong>特殊垃圾的处理</strong>：</p><p>对于大件垃圾，例如大型地毯或者家具之类的垃圾，需要购买相应的大件垃圾回收票才能被回收。大件垃圾回收票可以在便利店买到。不同地区的大件垃圾回收地点不用，一般来说会在街道旁有固定回收店，有些公寓的垃圾房也支持回收大件垃圾。在东京都，主动将大件垃圾运送到垃圾回收站则会提供免费的回收服务。</p><p>有一些特殊垃圾，例如复杂的电子产品，冰箱和其他大型家电，大件垃圾回收站并不会回收这类垃圾，对于这类垃圾，需要联络专门的垃圾处理人员或垃圾处理公司进行回收。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">语言与求助</h2><p>日本的官方语言是日语，对于居住在日本的外国居民，不会使用日语并不会影响你在日本的基本生活质量，但熟悉日语会极大的改善你的居住质量。我建议你在业余时间主动学习日语。</p><p><strong>官方语言</strong>：</p><p>在日本的大都市，英语普及率较高，因此，如果前往区政府或者是其他的公共服务部门，不会使用日语的情况下，通常能得到质量较高的外语服务。日本大量的行政服务网站为外国居民设立了不同语言版本的专门网页，因此，如果你无法阅读日语，也可以使用母语在线获取信息。特殊地，日语在官方语言和文件中大量使用日语汉字，对于出生在中国或其他使用汉语国家的居民来说，阅读官方发布的文件，例如法律和行政文档，即使不了解日语，也会非常轻松。</p><p><strong>求助</strong>：</p><p>如果你在日本遇到危险，比如人身伤害，交通事故或者其他需要求助的情况，报警是第一选择，日本的报警电话是 110，报警电话有专门的多语言接待中心，因此，不会日语也可以轻松报警，得到母语警员的支持。日本警察系统完善，待人亲切，警官必须使用敬语与报警人交谈，因此，请不用惧怕报警获得求助。此外，丢失物品的情况下也可以报警求助。</p><p><strong>语言学习支持</strong>：</p><p>日本针对外国居民提供语言学习支持服务，例如港区会在外国居民登录地址后，发放英语和其他语言的指南，指南中有报名日语学习班的方法，这些日语学习班或在线课程均为免费参加。对于外国居民来说，这不妨是学习语言，认识新朋友的好方法。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">医疗保险制度与疫苗接种</h2><p>日本施行全民医疗保险，基本报销比例是 70%~80%（视保险者条件而定）但遇到特殊情况，也能使用多重保险报销高达 100% 的医疗费用。理解日本的医疗保障体系和就医流程，是在日本生活必不可少的一部分。</p><p><strong>医疗保险种类</strong>：</p><ul><li><p>公共医疗保险：分为国民健康保险和职工健康保险。前者是所有人群可以主动购买的保险，针对受教育阶段的居民，例如学生和留学生，国民健康保险有优惠减免条件。后者是受雇佣的工作者购买的保险，一般由雇主购买。无论何种保险</p></li><li><p>共济组合保险：诸如都道府県民共済集团这样的协会组织提供的保险，由私人主动购买，所涵盖的保险覆盖广泛，涉及医疗保险，生命保险，火灾保险等复杂类型，对于已经购买公共医疗保险的人士来说，作为补充保险降低生病住院时的经济压力，是非常好的辅助保险手段。</p></li></ul><p>日本的保险种类广泛，涉及面很广，受保险的病症也覆盖相当大的范畴，甚至包括一部分牙科疾病，如果万一得病，不清楚是否在保险范围内，请务必咨询医师。</p><p><strong>分级诊疗制度</strong>：</p><p>日本采用分级诊疗制度，分为医院，一般诊所和牙科诊所。无论公立私立，所有诊所都可以使用健康保险卡进行问诊。</p><ul><li><p>医院：一般是大型医疗机构，如无转诊介绍信，不会接待个人病患，119 急诊除外。</p></li><li><p>一般诊所：多为私立诊所，诊所按照科室区分，不同的诊所可能处理不同的类型的疾病，有些诊所不能直接问诊，需要预约，在大都市，也有相当多的诊所可以直接持健康保险卡无需预约直接问诊。在问诊前，需要提前了解所前往的诊所是否有对应疾病的科室。如果你遇到急性疾病而无法独自前往诊所，请直接拨打 119 前往急诊设施。</p></li><li><p>牙科诊所：专门治疗牙科疾病的诊所，牙科诊所中，部分治疗手段，如药品或器械可能不在医疗保险的范围之类，问诊前，务必咨询医师。</p></li></ul><p><strong>问诊逻辑与身体检查</strong>：</p><p>许多外国居民不了解日本的分诊制度，容易在得病是乱求医，遇到不必要的烦恼，分诊制度的目的是，对于小病和长期疾病，患者能够找到稳定的医师咨询和治疗，对于大病和急病，患者能第一时间被分诊或急救服务转送到大医院进行治疗。在这样的前提下，我们需要熟悉所居住的社区内的小型诊所，并了解自己的身体问题。因此，我建议在日本居住的第一时间，前往体检中心，进行全面的体检，掌握自己的身体状况。</p><p>日本存在大量的私立体检中心，可以方便地预约，并进行全方位的身体检查。你可以在这里找到东京都的绝大多数体检中心并进行预约。</p><p><strong>疫苗接种</strong>：</p><p>日本对 Covid-19 采用免费的疫苗接种政策，无论你是否持有疫苗接种券，现在，都能够向所在区政府咨询，而随时前往疫苗接种中心进行接种时，接种前，你可以选择接种 Moderna 或者辉瑞疫苗。</p><hr><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://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/67529b2d63c0f27e7228c646252966158f390694f4fa974a480b0a467181a8e6.png" alt="年金制度图示" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">年金制度图示</figcaption></figure><p>一般来说，国民年金是非受雇人群缴纳的年金，保险费用需要自己缴纳，而厚生年金是受雇佣者缴纳的年金，保险费用由所在公司缴纳。</p><p>年金，即退休金的领取有复杂的计算逻辑，一般来说，年金需要持续缴纳 10 年以上，才有资格在退休后领取退休金。如果你对相关的计算逻辑感兴趣，可以查询日本年金机构的网站。</p><div data-type="embedly" src="https://www.nenkin.go.jp/service/riyoushabetsu/index.html" data="{&quot;provider_url&quot;:&quot;https://www.nenkin.go.jp&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;title&quot;:&quot;利用者別ガイド&quot;,&quot;author_name&quot;:&quot;Japan Pension Service&quot;,&quot;url&quot;:&quot;https://www.nenkin.go.jp/service/riyoushabetsu/index.html&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4ea4e59c3d9b9e54db4cc116a09b4615d77acf7f468a59682f90c5a1e1ad7f56.png&quot;,&quot;thumbnail_width&quot;:1200,&quot;provider_name&quot;:&quot;Nenkin&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4ea4e59c3d9b9e54db4cc116a09b4615d77acf7f468a59682f90c5a1e1ad7f56.png&quot;}}}" format="small"></div><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">税收制度</h2><p>日本是典型的高税收，高福利国家。税收是每个税务居民的义务，税收的组成极其复杂，在这一小节，我们主要介绍一些和生活、个人信用息息相关的税收种类。</p><p><strong>日本税务居民定义</strong>： 在日本国内拥有住所，或在日本拥有居所且常住 1 年以上的人统称为居住者。对于居住者，不论收入的来源地，要对其全球范围的收入征收所得税。</p><p>注意：全球征税的前提是你的海外收入进行了税务信息交换，如果你不了解税务信息交换或者你有税务筹划的需求，请咨询专门的税理士。</p><p><strong>消费税</strong>：</p><p>对于一般民众而言，消费税是一种商品流转环节的税收，并不针对具体的收入进行缴纳。在购买商品或服务的过程中，日本的消费税会叠加在商品价格之上收取，因此，商品价格+消费税是你购买商品时应付的总价，相应的，如果你为他人提供服务或商品而收取报酬，你也应当对对方收取消费税。</p><p>消费税的税率是 10%，对于特殊类型的商品，例如便利店的外带食物和优惠范畴内的生活日用品，消费税的税率是 8%。</p><p>购买商品时，小票上会表面这次购物的消费税税率，便于消费者理解非含税价格。</p><p>由于消费税是流转税的一种，无论你是否是日本税务居民，在消费过程中都会被征收消费税，特别的出境退税情况除外，如果你在日本居住不满半年，一般也可以要求进行退税。</p><p><strong>所得税</strong>：</p><p>所得税按照工资数额进行阶梯计算，计算方法是：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a29402ac7a2524e39d4b9efcad0bc4307eddec523316b29b57e024a4e22427c6.png" alt="所得税阶梯计算表" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">所得税阶梯计算表</figcaption></figure><p>其中，控除额度指的是，纳税时，需要减去的部分，比如，当税前工资是 700 万日元的情况下，应纳税金额是：</p><blockquote><p>7,000,000円×0.23 - 636,000円= 974,000円</p></blockquote><p>一般来说，所得税会在发放工资时被一并扣除。所得税的最高税率是 45%。</p><div data-type="embedly" src="https://www.nta.go.jp/taxes/shiraberu/taxanswer/shotoku/2260.htm" data="{&quot;provider_url&quot;:&quot;https://www.nta.go.jp&quot;,&quot;description&quot;:&quot;令和7年4月1日現在法令等] 所得税 所得税の税率は、分離課税に対するものなどを除くと、5パーセントから45パーセントの7段階に区分されています。 課税される所得金額（1,000円未満の端数金額を切り捨てた後の金額です。）に対する所得税の金額は、次の「所得税の速算表」を使用すると簡単に求められます。 ...&quot;,&quot;title&quot;:&quot;No.2260 所得税の税率｜国税庁&quot;,&quot;url&quot;:&quot;https://www.nta.go.jp/taxes/shiraberu/taxanswer/shotoku/2260.htm&quot;,&quot;thumbnail_width&quot;:700,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/01b6d91bcc27384abfdd527a7b6c3b2b929df1fca9a9ff9bed78493c0681707f.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Nta&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:178,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:700,&quot;height&quot;:178,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/01b6d91bcc27384abfdd527a7b6c3b2b929df1fca9a9ff9bed78493c0681707f.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/01b6d91bcc27384abfdd527a7b6c3b2b929df1fca9a9ff9bed78493c0681707f.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.nta.go.jp/taxes/shiraberu/taxanswer/shotoku/2260.htm" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>No.2260 所得税の税率｜国税庁</h2><p>令和7年4月1日現在法令等] 所得税 所得税の税率は、分離課税に対するものなどを除くと、5パーセントから45パーセントの7段階に区分されています。 課税される所得金額（1,000円未満の端数金額を切り捨てた後の金額です。）に対する所得税の金額は、次の「所得税の速算表」を使用すると簡単に求められます。 ...</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.nta.go.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/01b6d91bcc27384abfdd527a7b6c3b2b929df1fca9a9ff9bed78493c0681707f.png"/></div></a></div></div><p><strong>住民税</strong>：</p><p>住民税是一种特殊的地方税，是所居住地区的地方税总称，如果你居住在东京都，则为<strong>特別区民税・都民税</strong>，如果居住在其他地方，则可能为<strong>区市町村民税。</strong></p><p>住民税的纳税逻辑是，根据每自然年 1 月 1 日所在居住地区，计算前一自然年的收入并在当年缴纳税收。纳税由地方税务局通知雇主缴纳（特別徴収），个人不需要计算需缴纳的税收。但是，在有控除条件（退税条件）存在的情况下，个人需要向地方税务局进行申报，从而减去不应征税的部分。</p><p>住民税的<strong>税率是 10%</strong>，其中，市町村民税为 6％，道府県民税・都民税为 4％，税收会按照比率缴纳给不用级别的地方政府。</p><p>在一定情况下，住民税可以无需缴纳（非课税对象），住民税作为一种地方税收，有着极其复杂的控除条件（退税条件），比如自己承担的医疗费和孩子的抚养费等，如果你对住民税的减免感兴趣，可以<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.tax.metro.tokyo.lg.jp/kazei/kojin_ju.html">查看这里</a>了解具体的减免情况。</p><p><strong>注意</strong>：住民税是个人信用中非常重要的参考标准，一般来说，在每年中旬（5-6月）可以查询住民税缴纳情况，这意味着，在申请信用卡或其他贷款服务时，需要在此时间之后申请。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/050c3abb2b2474cbe4cedcc36407322e801ebeea3f9115945e17983a4839fc0d.png" alt="住民税计算流程" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">住民税计算流程</figcaption></figure><div data-type="embedly" src="https://www.tax.metro.tokyo.lg.jp/kazei/kojin_ju.html" data="{&quot;provider_url&quot;:&quot;https://www.tax.metro.tokyo.lg.jp&quot;,&quot;description&quot;:&quot;東京都主税局の個人住民税(暮らしと税金)のページです。&quot;,&quot;title&quot;:&quot;個人住民税|暮らしと税金|東京都主税局&quot;,&quot;mean_alpha&quot;:245.5,&quot;thumbnail_width&quot;:600,&quot;url&quot;:&quot;https://www.tax.metro.tokyo.lg.jp/kazei/life/kojin_ju&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;主税局&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:315,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:600,&quot;height&quot;:315,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.tax.metro.tokyo.lg.jp/kazei/kojin_ju.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>個人住民税|暮らしと税金|東京都主税局</h2><p>東京都主税局の個人住民税(暮らしと税金)のページです。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.tax.metro.tokyo.lg.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png"/></div></a></div></div><p><strong>固定资产税（房产税）</strong>：</p><p>固定资产税也称房产税，税种全民为<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.tax.metro.tokyo.lg.jp/shisan/kotei_tosi.html">固定資産税・都市計画税（土地・家屋）</a></p><p>固定资产税只会对日本持有房产和土地的税务居民征收。房产房屋所属分割土地的征税分开征收，税率均为 <strong>1.4％</strong>。税额按照房产和土地的评价额度收取，而非房产和土地的交易价格。详细计算方法可参考下方的指南：</p><div data-type="embedly" src="https://www.tax.metro.tokyo.lg.jp/shisan/kotei_tosi.html" data="{&quot;provider_url&quot;:&quot;https://www.tax.metro.tokyo.lg.jp&quot;,&quot;description&quot;:&quot;東京都主税局の固定資産税・都市計画税（土地・家屋）(不動産と税金)のページです。&quot;,&quot;title&quot;:&quot;固定資産税・都市計画税（土地・家屋）|不動産と税金|東京都主税局&quot;,&quot;mean_alpha&quot;:245.5,&quot;thumbnail_width&quot;:600,&quot;url&quot;:&quot;https://www.tax.metro.tokyo.lg.jp/kazei/real_estate/kotei_tosi&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;主税局&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:315,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:600,&quot;height&quot;:315,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.tax.metro.tokyo.lg.jp/shisan/kotei_tosi.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>固定資産税・都市計画税（土地・家屋）|不動産と税金|東京都主税局</h2><p>東京都主税局の固定資産税・都市計画税（土地・家屋）(不動産と税金)のページです。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.tax.metro.tokyo.lg.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8e49d6ca04f337cba6e5840a99d62871ffa46e12bbba7470224b6588506a2e05.png"/></div></a></div></div><p><strong>税务确定申报（</strong><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.nta.go.jp/taxes/shiraberu/shinkoku/kakutei.htm"><strong>確定申告</strong></a><strong>）</strong>：</p><p>在每年到次年的 1 月，税务居民可以主动进行税务确定申报。税务申报可以采用手机 App 或者网上申请的方式进行申报。对于受雇职工而言，如果没有工资以外的其他收入，或者应当减免税收的对象，一般不需要进行税务确定申报。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">银行账户与信用卡</h2><p>每位移居到日本的外国居民都有必要在第一时间办理银行账户。在收入累计到一定程度后，我建议你尝试申请日本信用卡，在消费的过程中累积良好的信用。</p><p><strong>银行账户的种类和申请</strong>：</p><p>在日本，银行账户分为<strong>邮政储蓄银行、一般银行</strong>和<strong>网络银行</strong>。对于受雇职工而言，可以在领取在留卡并登记住址后直接申请一般银行的账户（称为口座）例如 SMBC 银行，三菱 UFJ 银行等。</p><p>申请时，最好前往距离所登记地址最近的银行分行，在人工窗口填表申请，申请过程可能需要 10 - 30 分钟，申请时，需要携带个人印章和有效身份证件。</p><p><strong>信用卡</strong>：</p><p>对于外国居民，信用卡的申请是个复杂的问题，一般来说，只有当住民税记录开始生效之后，商业银行才会批准外国居民的信用卡，在此之前，会被视为无信用记录或者不缴纳税收的特殊人群。如果受雇于特大上市公司或知名企业，则可能会有例外。</p><p>不过，也有诸如乐天信用卡，Paidy 等金融机构会为外国居民开设信用卡或信用服务，但这些授信的额度都较低。我的建议是，对于外国居民，应当尽早尝试申请这类宽松的信用服务，以持续累计良好的信用，为一年后住民税生效时申请商业银行的信用卡打下基础。</p><p>不同信用卡的申请方式，所需材料，批准条件都有所不同。一般申请信用卡并不需要本人认证，只需填写姓名，基本个人信息，供职企业，驾照编号（如有），并在线填写信用卡四位密码，在线登记信用卡还款自动绑定的银行账户即可申请。部分信用卡服务会被实时批准或拒绝。有关信用卡的申请情况，可以参考这个表格：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a417307cc715a06a03c48d1a9c6bf5c7ecb541cef2cadab4825638a3164041fd.png" alt="按照品牌分类的信用申请情况预览" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">按照品牌分类的信用申请情况预览</figcaption></figure><p>如果信用卡的申请被拒绝，最好等待 3 个月以上再提交申请，或尝试没有被拒绝的其他金融机构发行的信用卡。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">消费、无现金支付与积分系统</h2><p>日本的日常消费依赖现金，许多外国居民对此感到不便，不过，疫情极大地加速了日本跨入无现金社会的发展步伐，目前，包括电子现金，信用卡，二维码支付在内的几十种支付方式已经深入日本社会的方方面面，遍布列岛。</p><p><strong>无现金支付种类</strong>：</p><ul><li><p>信用卡：最为普遍的无现金支付方式，带有 IC 芯片的信用卡可以使用无接触式支付或者刷卡支付几种不同的支付方式。</p></li><li><p>电子现金（例如交通 IC 卡，ID，QuicPay）：日本特有的支付方式，付款最为快速便利。电子现金可以理解为预付卡，交通 IC 卡是典型的预付卡，可以通过现金充值，或者使用 Apple Pay 等方式使用信用卡充值。同时，许多信用卡整合了电子现金的功能，允许用户使用信用卡时无需输入密码，自动记账预付的方式进行消费。通过此类方式，整合电子现金支付渠道的收款终端都能支持信用卡的付款，比如，你在支持 QuicPay 的收款机上即可使用 Apple Pay 付款。</p></li><li><p>二维码支付（PayPay等）：中国居民比较熟悉的支付方式，展示二维码给对应的收款终端，即可无需输入密码扣除费用。PayPay 是目前日本市场占有率最高的二维码支付 App。</p></li></ul><p><strong>积分系统</strong>：</p><p>不同于多数国家，日本的积分系统相当发达，无论大、中小企业均有意愿建立自己的积分计划。而且，大部分积分计划的积分都是 1:1 兑换日元的「円分」。</p><p>按照积分发行方的地位，日本的积分系统可以分为：</p><ul><li><p>自社发行积分：例如企业门店的积分 App，消费券，集点卡等等。许多门店的积分卡仍然是以纸质或 IC 芯片卡的形式发行，疫情后，也有许多企业开始考虑发行积分 App。</p></li><li><p>第三方发行积分：例如 TSUTAYA 发行的 T-Point，Docomo 的 D-Point，乐天 Point 等等。商户和企业可以在结帐系统中集成第三方积分对应的会员卡，而将积分发行委托给第三方企业，并进行异步结算。</p></li></ul><p>チェックス株式会社的产品 enbun 即是针对积分市场设计的 web3 SaaS 产品，理解日本的积分在日常生活中的使用场景和便利性，对改善产品功能，解决用户需求来说十分必要。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">购房与贷款</h2><p>泡沫经济时代之后，日本维持了长打数十年的低利率社会，对于普通人而言，低利率会凸显在住房贷款的利率这一重要议题之上。如果你非常满意日本的生活，准备在日本稳定居住，甚至购置真正意义上属于自己的房屋，那么你会需要理解这一小节的内容。</p><p><strong>贷款上限和影响因素</strong>：</p><p>职工的贷款上限一般是年收入的 6-7 倍。如果你的年收是 800 万日元，那么商业银行对你的一般住宅贷款上限是 5000 万元左右。如果你获得高度人才签证或供职于大型、知名企业，贷款会得到优先批准，但这不会影响贷款上限。特殊地，如果你持有永住资格，则可以享受 flat35 贷款，贷款额度会提升到 8000 万日元。一些其他因素也会影响贷款的审批和上限，例如婚姻情况，抚养情况等等，这取决于银行的具体政策。</p><p><strong>贷款利率与首付</strong>：</p><p>日本住房贷款利率极低，浮动利率基本在 1% 以内，长期固定利率的 flat35 基本在 1.5% 左右。具体利率的影响因素很多，包括申请时的在留资格，所申请房屋的基本情况等等。某些贷款政策要求具体的房租满足各项条件，例如是否为新耐震住宅，是否有长期优良住宅资格认证等等，具体请咨询你的房屋销售中介和贷款顾问。</p><p>在取得永住资格前，住房贷款一般只能承担房屋总金额的 80%，需要负担 20% 的首付，取得永住资格后，许多银行则能够提供 0 首付的购房政策。</p><p>日本最大的住房贷款中介 ARUHI 关于 flat35 的介绍：</p><div data-type="embedly" src="https://www.aruhi-corp.co.jp/product/flat35/" data="{&quot;provider_url&quot;:&quot;https://www.sbiaruhi.co.jp&quot;,&quot;description&quot;:&quot;フラット35は、全期間固定金利の住宅ローンです。金利引き下げ制度やお申し込み方法も充実。Webからのお申し込みで事務手数料の割引を実施中です。&quot;,&quot;title&quot;:&quot;フラット35 （最新金利とご融資条件のご案内） | ARUHI 住宅ローン | SBIアルヒ株式会社&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.sbiaruhi.co.jp/product/flat35/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7de0c649ac9a91fe644889063bce71cfa0d0047c25858446b2bcb07c8471c415.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;SBIアルヒ株式会社&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7de0c649ac9a91fe644889063bce71cfa0d0047c25858446b2bcb07c8471c415.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7de0c649ac9a91fe644889063bce71cfa0d0047c25858446b2bcb07c8471c415.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.aruhi-corp.co.jp/product/flat35/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>フラット35 （最新金利とご融資条件のご案内） | ARUHI 住宅ローン | SBIアルヒ株式会社</h2><p>フラット35は、全期間固定金利の住宅ローンです。金利引き下げ制度やお申し込み方法も充実。Webからのお申し込みで事務手数料の割引を実施中です。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.sbiaruhi.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7de0c649ac9a91fe644889063bce71cfa0d0047c25858446b2bcb07c8471c415.jpg"/></div></a></div></div><p><strong>优势与劣势</strong>：</p><p>许多年轻人梦想拥有一套自己的住房，但在日本，大部分人年轻人并不会在组建家庭前购置房屋，其中一个原因是，购置房屋需要承担固定资产税，相比房租成本与贷款+固定资产税的成本而言，不仅增加了成本，还带来了额外的顾虑和压力。当然，房租存在资产属性，在东京都，今年，固定资产的价格上涨很快，疫情之后，上涨接近 30%，但考虑到日本漫长的泡沫破裂期，许多人仍然不会将房屋等价于资产，因此，在购房问题上，需要谨慎考虑，择优挑选。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">驾照、租车与驾驶体验</h2><p>日本是四季分明的岛国和汽车大国，不同的季节，都很适宜公路旅行。如果你对在日本获得驾照和日本的驾驶体验感兴趣，不妨了解这一小节的内容。</p><p><strong>获得日本驾照</strong>：</p><p>有两种不同的方式获得日本驾照：</p><ul><li><p>更换驾照（免許に切り替え）：如果你持有他国驾照，可以申请更换驾照，不过，对于中国驾照来说，更换驾照不仅需要准备相当多的材料，还需要参加笔试和场地内考试，可能无法一次更换成功。关于更换日本驾照需要准备的详细材料，你可以在下方的链接找到：</p></li></ul><div data-type="embedly" src="https://www.keishicho.metro.tokyo.lg.jp/menkyo/menkyo/kokugai/kokugai05.html" data="{&quot;provider_url&quot;:&quot;https://www.keishicho.metro.tokyo.lg.jp&quot;,&quot;description&quot;:&quot;令和7年10月1日、道路交通法施行規則の一部改正により、外国免許の切替における手続内容等が変更となりました。 令和7年10月1日施行・改正道路交通法施行規則について 外務省の発行する身分証明書 権限のある機関が発行する身分を証明する書類で国家公安委員会が定めるもの 上記いずれか1通に加え、 公の機関が発行した住所を確かめるに足りる書類又はこれに準ずるもの 旅券（パスポート） が必要となります。&quot;,&quot;title&quot;:&quot;外国で取得した運転免許証を日本の運転免許証に切り替えるには&quot;,&quot;url&quot;:&quot;https://www.keishicho.metro.tokyo.lg.jp/menkyo/menkyo/kokugai/kokugai05.html&quot;,&quot;author_name&quot;:&quot;Metropolitan Police Department&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c640cdf1267bb39978d33ca34c5e31ef7f177a46643f848374e0252a017ff247.jpg&quot;,&quot;thumbnail_width&quot;:500,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Tokyo&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:299,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:500,&quot;height&quot;:299,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c640cdf1267bb39978d33ca34c5e31ef7f177a46643f848374e0252a017ff247.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c640cdf1267bb39978d33ca34c5e31ef7f177a46643f848374e0252a017ff247.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.keishicho.metro.tokyo.lg.jp/menkyo/menkyo/kokugai/kokugai05.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>外国で取得した運転免許証を日本の運転免許証に切り替えるには</h2><p>令和7年10月1日、道路交通法施行規則の一部改正により、外国免許の切替における手続内容等が変更となりました。 令和7年10月1日施行・改正道路交通法施行規則について 外務省の発行する身分証明書 権限のある機関が発行する身分を証明する書類で国家公安委員会が定めるもの 上記いずれか1通に加え、 公の機関が発行した住所を確かめるに足りる書類又はこれに準ずるもの 旅券（パスポート） が必要となります。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.keishicho.metro.tokyo.lg.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c640cdf1267bb39978d33ca34c5e31ef7f177a46643f848374e0252a017ff247.jpg"/></div></a></div></div><ul><li><p>考取驾照：合宿是考取日本驾照最快的方式，它需要你花费约 14 天时间和 20-30 万日元的成本，即可在驾校完成大部分驾照申请步骤。</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/86e4b11fad6a0bc764b5d4493aa3d644bce6dfe3c3ee5be9e0803f1c9dc7e40c.png" alt="日本驾照范本" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">日本驾照范本</figcaption></figure><p><strong>合宿考取驾照流程</strong>：</p><p>选择合宿考取驾照是大部分日本居民考取驾照的方式，我推荐采用这种方式取得驾照。众所周知，日本的驾驶训练非常认真琐碎，执照分门别类，门槛极高，我本人持有中日韩三国驾照，日本驾照的学习过程，对外国居民来说，是不可多得的珍贵体验。</p><ul><li><p>预约合宿入校时间：日本有相当多的合宿预约网站，我推荐使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.mentoro.jp/">合宿免許 Wow</a> 来寻找适合自己的驾校，其中，我学习的驾校是位于山形県的百年驾校マツキドライビングスクール山形中央校。此网站不仅能在线预约时间，还能将报名需要的大部分信息在线填写表格，后续也能持续使用邮件沟通，免去外国居民不愿意接打日语电话的烦恼。</p></li></ul><div data-type="embedly" src="https://www.mentoro.jp/" data="{&quot;provider_url&quot;:&quot;https://www.mentoro.jp&quot;,&quot;description&quot;:&quot;運転免許をとるならファミリーマート店内放送でおなじみの合宿免許WAO!!（ワオ）。全国105校をカバー、普通車・自動二輪（バイク）・大型・同時教習など多車種の合宿免許をご紹介。夏休みの合宿免許ご予約も絶賛受付中！&quot;,&quot;title&quot;:&quot;合宿で免許をとろう！合宿免許WAO!!（ワオ）-全国から人気の合宿免許自動車教習所をご案内&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.mentoro.jp/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3b1e75006f8c46594c5ba8e06ed6bac5142f68f8409303d113707d926ba84120.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;合宿免許WAO!!&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3b1e75006f8c46594c5ba8e06ed6bac5142f68f8409303d113707d926ba84120.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3b1e75006f8c46594c5ba8e06ed6bac5142f68f8409303d113707d926ba84120.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.mentoro.jp/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>合宿で免許をとろう！合宿免許WAO!!（ワオ）-全国から人気の合宿免許自動車教習所をご案内</h2><p>運転免許をとるならファミリーマート店内放送でおなじみの合宿免許WAO!!（ワオ）。全国105校をカバー、普通車・自動二輪（バイク）・大型・同時教習など多車種の合宿免許をご紹介。夏休みの合宿免許ご予約も絶賛受付中！</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.mentoro.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3b1e75006f8c46594c5ba8e06ed6bac5142f68f8409303d113707d926ba84120.jpg"/></div></a></div></div><ul><li><p>入校，驾驶技能部分的学习：日本的驾驶训练分为两部分，第一步部分是汽车驾驶训练，这意味着，入校第一天就会开始练习开车（真实场地驾驶）。每日，驾校会判断学员是否符合课程的通过要求，如果通过，课程老师则会在所负责的课程盖上个人印章，在驾驶技能的学习过程中，也穿插着理论课程，连续一周的学习全部通过后，会进行技能和理论两方面的考试，考试全部通过后，学员会得到「仮免許」进行道路练习。</p></li><li><p>道路练习：第二部分的学习，即道路练习，是在公开道路上的课程，持续一周的道路课程和第二部分的理论课程（包括心肺复苏和紧急救援课程）结束后，会进行道路练习的综合考试，但不会进行理论考试。第二部分的道路考试结束后，学员即可领到毕业证。</p></li><li><p>换取驾照：返回居住城市（如东京）后，我们需要自行前往免許試驗場进行驾照更换手续，手续包括检查视力和最后的笔试。笔试合格线为 90/100，难度相对驾校的试题也有所增加，因此，通过率较低。部分情况下可能需要重复申请，多次考试才能真正通过免許試驗場的笔试，通过笔试后，约等待 1-2 小时即可领取驾照。</p></li></ul><div data-type="embedly" src="https://www.keishicho.metro.tokyo.lg.jp/menkyo/shikenjo/shikenjo/samezu.html" data="{&quot;provider_url&quot;:&quot;https://www.keishicho.metro.tokyo.lg.jp&quot;,&quot;description&quot;:&quot;運転免許手続の来場に関する情報をお知らせしていますので、ご確認ください。 これから来場される方へのお願い 鮫洲運転免許試験場の運転免許の更新業務については、混雑により長時間お待ちいただく場合や一日に実施可能な講習の定員に達した場合は、受付をお断りする場合があります。 ...&quot;,&quot;title&quot;:&quot;鮫洲運転免許試験場&quot;,&quot;url&quot;:&quot;https://www.keishicho.metro.tokyo.lg.jp/menkyo/shikenjo/shikenjo/samezu.html&quot;,&quot;author_name&quot;:&quot;Metropolitan Police Department&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/aaad178ab1f378589391b66e2f44385e6ff827fde14a3a07adef8d61b577e053.gif&quot;,&quot;thumbnail_width&quot;:600,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Tokyo&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:690,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:600,&quot;height&quot;:690,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/aaad178ab1f378589391b66e2f44385e6ff827fde14a3a07adef8d61b577e053.gif&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/aaad178ab1f378589391b66e2f44385e6ff827fde14a3a07adef8d61b577e053.gif"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.keishicho.metro.tokyo.lg.jp/menkyo/shikenjo/shikenjo/samezu.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>鮫洲運転免許試験場</h2><p>運転免許手続の来場に関する情報をお知らせしていますので、ご確認ください。 これから来場される方へのお願い 鮫洲運転免許試験場の運転免許の更新業務については、混雑により長時間お待ちいただく場合や一日に実施可能な講習の定員に達した場合は、受付をお断りする場合があります。 ...</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.keishicho.metro.tokyo.lg.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/aaad178ab1f378589391b66e2f44385e6ff827fde14a3a07adef8d61b577e053.gif"/></div></a></div></div><p><strong>驾驶体验与租车：</strong></p><p>日本是多山地国家的岛屿国家，道路相对而言比较狭窄，但也颇具驾驶乐趣。</p><p><strong>城市中的驾驶：</strong></p><p>在大都市中进行驾驶是难度较高，挑战很大的驾驶体验，其中，东京的首都高速建设于 1960 年代，原本设计车速为 60km/h 的狭窄道路拥有大量的弯道，岔路和起伏，如今这些道路普遍行驶着车速超过 80km/h 的现代汽车。驾驶首都高，与其说是驾驶日常，不如说是竞技娱乐。但因为如此，是只有在日本才能获得的难得驾驶乐趣。</p><p>除了复杂的都市高速系统，日本的巷道狭窄，很容易看错导航，需要关注的行人，自行车等道路要素很多，因此，挑战城市中和城市高速的驾驶需要做好万全的心理准备。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e08849a0de10ccc354fbf4afdfee512c778c65d9ac11a2bb2ead0b10168064ea.png" alt="首都高图示" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">首都高图示</figcaption></figure><p><strong>乡间驾驶</strong>：</p><p>日本的乡间驾驶体验很棒，在道路和景色开阔的田野或山谷中驾驶，能观赏到类似欧洲山脉的天际线和富有东方色彩的乡村景观，这使得日本的公路旅行成为一件不得不体验的人生经历。</p><p>在乡间驾驶需要注意一些安全问题，尤其是，乡间许多交叉点没有红绿灯，需严格按照一时停止线进行停止和观察，以防冲突。</p><p>日本遍布全国的特色道路休息区（道の駅）是乡间驾驶中不得不拜访的根据地。在那里，你可以了解到当地村落与众不同的人文风情和地产果蔬。</p><div data-type="embedly" src="https://www.michi-no-eki.jp/" data="{&quot;provider_url&quot;:&quot;https://www.michi-no-eki.jp&quot;,&quot;description&quot;:&quot;全国「道の駅」連絡会 道の駅公式ホームページ 道の駅の最新の地域情報や、道の駅の魅力をお届けします。&quot;,&quot;title&quot;:&quot;道の駅 公式ホームページ 全国「道の駅」連絡会&quot;,&quot;url&quot;:&quot;https://www.michi-no-eki.jp/&quot;,&quot;thumbnail_width&quot;:1400,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/38a5fef0f6fa61991801fab6a0afacf8851bfde1ff1e8a2bd6b16a27644c5a31.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Michi-no-eki&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:718,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1400,&quot;height&quot;:718,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/38a5fef0f6fa61991801fab6a0afacf8851bfde1ff1e8a2bd6b16a27644c5a31.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/38a5fef0f6fa61991801fab6a0afacf8851bfde1ff1e8a2bd6b16a27644c5a31.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.michi-no-eki.jp/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>道の駅 公式ホームページ 全国「道の駅」連絡会</h2><p>全国「道の駅」連絡会 道の駅公式ホームページ 道の駅の最新の地域情報や、道の駅の魅力をお届けします。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.michi-no-eki.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/38a5fef0f6fa61991801fab6a0afacf8851bfde1ff1e8a2bd6b16a27644c5a31.jpg"/></div></a></div></div><p><strong>租车</strong>：</p><p>日本租车网络发达，预约简单，费用和手续也很便宜便利。租车公司包括丰田租车，日产租车，Times 租车等等，都能在租车预定网站上统一查询。租车网点遍布所有机场，新干线车站和特急电车主要站点，在使用公共交通工具旅行时，配合租车，可以达到非常灵活而轻松的旅行体验。</p><p>租车时，只需出示驾照，在租车前付款，不需缴纳额外的押金。近年，有些租车行也提供 Touch &amp; Go 服务，只需要预先登录驾照，即可直接付款后开走车。例如 Times 租车或 Times Car Share 之类的分时租车服务，也允许无接触式的手机解锁汽车，这使得日本租车的体验变的更加便捷了。</p><div data-type="embedly" src="https://share.timescar.jp/" data="{&quot;provider_url&quot;:&quot;https://share.timescar.jp&quot;,&quot;description&quot;:&quot;タイムズのカーシェアリングサービス「タイムズカー」！必要な時に自由にクルマを使えます。&quot;,&quot;title&quot;:&quot;カーシェアリングならタイムズカー&quot;,&quot;thumbnail_width&quot;:90,&quot;url&quot;:&quot;https://share.timescar.jp/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d428b8557bc120624f7b511059e2ac0a2a2fa91bebdef1b16a8903b584349cdc.gif&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;カーシェアリングならタイムズカー&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:90,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:90,&quot;height&quot;:90,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d428b8557bc120624f7b511059e2ac0a2a2fa91bebdef1b16a8903b584349cdc.gif&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d428b8557bc120624f7b511059e2ac0a2a2fa91bebdef1b16a8903b584349cdc.gif"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://share.timescar.jp/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>カーシェアリングならタイムズカー</h2><p>タイムズのカーシェアリングサービス「タイムズカー」！必要な時に自由にクルマを使えます。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://share.timescar.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d428b8557bc120624f7b511059e2ac0a2a2fa91bebdef1b16a8903b584349cdc.gif"/></div></a></div></div><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">邮政与快递系统</h2><p>一旦成为日本的居民，登录住址后，便会收到相当数量的邮件。由于社会的运转极大地依赖书面邮件，日本的邮政系统仍然保持着一如既往的工作效率，在许多国家由快递物流替代的功能，日本邮政也正在做着积极地改善。在这一小节，我会向你介绍日本邮政系统的基本概念和有用的小知识。</p><div data-type="embedly" src="https://www.post.japanpost.jp/kitte/index.html" data="{&quot;provider_url&quot;:&quot;https://www.post.japanpost.jp&quot;,&quot;description&quot;:&quot;日本郵便株式会社の公式Webサイトです。普通切手をはじめ、人気のキャラクターや美しい自然・風景、さまざまな題材を描いた特殊切手や、地域の特色に富んだオリジナル フレーム切手など、バラエティ豊かな切手をご用意しています。&quot;,&quot;title&quot;:&quot;郵便局 | 日本郵便株式会社&quot;,&quot;url&quot;:&quot;https://www.post.japanpost.jp/kitte/index.html&quot;,&quot;thumbnail_width&quot;:1200,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;郵便局 | 日本郵便株式会社&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1200,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:1200,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.post.japanpost.jp/kitte/index.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>郵便局 | 日本郵便株式会社</h2><p>日本郵便株式会社の公式Webサイトです。普通切手をはじめ、人気のキャラクターや美しい自然・風景、さまざまな題材を描いた特殊切手や、地域の特色に富んだオリジナル フレーム切手など、バラエティ豊かな切手をご用意しています。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.post.japanpost.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg"/></div></a></div></div><p><strong>邮票与平信（第一種郵便物）</strong></p><p>作为古老的快递方式，平信在日本的日常生活中仍然维持着重要的角色，物业服务公司的通知单，银行水电费账单，信用卡通知单或日常生活中的合同契约，大多都会使用平信进行邮寄。</p><p>日本的邮政网络遍布全岛，在任何信封包装物上贴上邮票，投递到邮筒，即可寄出平信。日本的邮票价格为 63-230 日元不等，一般来说，如果平信内装有会员卡，钥匙或其他带有重量的物品，需要称重后选择对应价位的邮票或邮票组合，在邮局，工作人员会帮忙称重并确定价格。</p><p>日本的邮票背面涂有沾着剂，用少许水淋湿，即可贴付于信封之上。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5d979d0bb462132a36d7257d3175fd98b6b94a2faeb5aa69c10b92783366df29.png" alt="84 日元的邮票" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">84 日元的邮票</figcaption></figure><p><strong>叶书（葉書、第二種郵便物）</strong></p><p>叶书（葉書）是日本特色的邮件，形如期名，类似小型明信片，诸如账户密码，续费通知之类承载有限信息的邮件通常以叶书形式寄送。</p><p>叶书的邮资也是 63 元，与最低价邮票价格相同。包含隐私信息的叶书，背面会以重复印刷的纹路遮挡内容，因此，即使透过阳光也无法看清内容本身。</p><p>也有能够两面撕开的叶书，此类叶书承载内容更多，保险合同会采用此类叶书寄送。</p><p><strong>信件包与邮包（レターパック　ゆうパック）</strong></p><p>信件包与邮包是今年日本邮政为了满足网上二手商品交易推出的准快递服务。两者均可在便利店或邮局购买对应的包装带/盒，填写发送人与收件人地址后，自助投递到邮箱寄送，也可以根据查询编码查询寄送进度。</p><p>信件包可以发送 A4 大小的，重量在 4kg 以下的物品，邮费为 370 或 520 日元（按厚度区分）</p><p>邮包则适合较大的物品，按不同尺寸提供了不同的小型快递盒，价格也有所不同。</p><div data-type="embedly" src="https://www.post.japanpost.jp/service/letterpack/" data="{&quot;provider_url&quot;:&quot;https://www.post.japanpost.jp&quot;,&quot;description&quot;:&quot;レターパックは、A4サイズ・4kgまで全国一律料金で、信書も送れるサービスです。専用封筒に荷物を詰めるだけで、全国どこでも430円もしくは600円で送付可能。ポストにも投函できます。&quot;,&quot;title&quot;:&quot;郵便局 | 日本郵便株式会社&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.post.japanpost.jp/service/letterpack/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;郵便局 | 日本郵便株式会社&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1200,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:1200,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.post.japanpost.jp/service/letterpack/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>郵便局 | 日本郵便株式会社</h2><p>レターパックは、A4サイズ・4kgまで全国一律料金で、信書も送れるサービスです。専用封筒に荷物を詰めるだけで、全国どこでも430円もしくは600円で送付可能。ポストにも投函できます。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.post.japanpost.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fdec958ca3f9a7a6bd17ee1fd816e220d0267c535e503c572e4738109ad2521e.jpg"/></div></a></div></div><p><strong>回信</strong></p><p>日本的日常沟通大量依赖信件，因此，常有寄件者在邮件内部添有返还信封的事情发生，我们在生活中如有希望对方回信，可以提前写好收件人地址，使用平信信封，或者信件包的形式，方便收件者回信。</p><p><strong>国际快件的寄送</strong></p><p>日本邮政与中国邮政合作，可以直接在任何邮局寄送前往国内的 EMS 快递，十分方便。其中，诸如渋谷邮局支持无休的 24 小时运作（疫情后营业时间略有不同），这提高了邮政国际快递的发送效率。</p><p><strong>其他快递系统</strong></p><p>如果你希望采用其他的快递公司发送包裹，在日本，可以选择的快递公司主要有<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.kuronekoyamato.co.jp/">ヤマト運輸</a>（黑猫快递），<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.sagawa-exp.co.jp/">佐川急便</a>等。普通快递公司相对于邮政局，价格会有所上浮。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">气候与天气</h2><p>日本的大部分地区是四季分明的温带海洋性气候。一年之中，并不会有极端炎热或极端严寒的季节。但是，日本的气候也存在一些令人不满的问题。</p><p><strong>花粉问题</strong></p><p>花粉问题是春季困扰日本居民的一大问题，外国居民在刚搬入日本居住时，前两年或许不会感知到花粉，但由于日本冬季空气清澄，能见度高，春季花粉飞散时，会随着空气四处传播到日本列岛。除了北海道的某些地区没有花粉问题之外，诸如遥远的离岛也不存在花粉问题。</p><p>在花粉季节，预防花粉带来的过敏是重要的日常防护，对此，可以购买隔离花粉的喷雾，口罩，或在室内使用空气清新器过滤花粉，改善空气循环。</p><div data-type="embedly" src="https://www.kyowakirin.co.jp/kahun/about/calendar.html" data="{&quot;provider_url&quot;:&quot;https://www.kyowakirin.co.jp&quot;,&quot;description&quot;:&quot;協和キリンによる花粉症の鼻や目などの症状への対策や治療、花粉の予報、病院検索など、情報満載の花粉症の情報サイトです。&quot;,&quot;title&quot;:&quot;花粉症ナビ&quot;,&quot;thumbnail_width&quot;:250,&quot;url&quot;:&quot;https://www.kyowakirin.co.jp/kahun/index.html&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/668ecbd55800ff215ee9450c861b4de08e8c94e27e6bd8f68c717ecaf9a9e9aa.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Kyowakirin&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:250,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:250,&quot;height&quot;:250,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/668ecbd55800ff215ee9450c861b4de08e8c94e27e6bd8f68c717ecaf9a9e9aa.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/668ecbd55800ff215ee9450c861b4de08e8c94e27e6bd8f68c717ecaf9a9e9aa.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.kyowakirin.co.jp/kahun/about/calendar.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>花粉症ナビ</h2><p>協和キリンによる花粉症の鼻や目などの症状への対策や治療、花粉の予報、病院検索など、情報満載の花粉症の情報サイトです。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.kyowakirin.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/668ecbd55800ff215ee9450c861b4de08e8c94e27e6bd8f68c717ecaf9a9e9aa.jpg"/></div></a></div></div><p><strong>梅雨季</strong></p><p>与中国的大陆性气候类似，日本也有梅雨季节，梅雨季节多出现在春末夏初，绣球花盛开的季节。对关东地区来说，梅雨季约有漫长的 20-30 天，在梅雨季节时，衣服很难自然晾干。对此，日本大多数新装修的房屋均备有浴室烘干系统，可以将湿衣物挂在浴室内，进行风干。</p><div data-type="embedly" src="https://tenki.jp/rainy-season/" data="{&quot;provider_url&quot;:&quot;https://tenki.jp&quot;,&quot;description&quot;:&quot;全国の梅雨入りと梅雨明けの情報（速報値）を、気象予報士による今後の予想など、その時その時の状況解説とともにお届けします。気象庁では、現在までの天候経過と１週間先までの見通しをもとに、梅雨の入り明けの速報を「梅雨の時期に関する気象情報」として発表しています。&quot;,&quot;title&quot;:&quot;梅雨入り梅雨明け予想・状況 2025 - tenki.jp&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://tenki.jp/rainy-season/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f070f10b3f2fcae1b891264c1ff0114f81fa5a52e05e36a2d57adf181cdd75c9.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;tenki.jp&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f070f10b3f2fcae1b891264c1ff0114f81fa5a52e05e36a2d57adf181cdd75c9.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f070f10b3f2fcae1b891264c1ff0114f81fa5a52e05e36a2d57adf181cdd75c9.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://tenki.jp/rainy-season/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>梅雨入り梅雨明け予想・状況 2025 - tenki.jp</h2><p>全国の梅雨入りと梅雨明けの情報（速報値）を、気象予報士による今後の予想など、その時その時の状況解説とともにお届けします。気象庁では、現在までの天候経過と１週間先までの見通しをもとに、梅雨の入り明けの速報を「梅雨の時期に関する気象情報」として発表しています。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://tenki.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f070f10b3f2fcae1b891264c1ff0114f81fa5a52e05e36a2d57adf181cdd75c9.jpg"/></div></a></div></div><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">灾难与灾备</h2><p>日本位于欧亚板块断裂带，火山和地质活动频繁，因此诞生了极其丰富的温泉等旅游资源，但这也时刻影响着我们的日常生活。防止灾害带来的次生问题，最好的办法是直面灾难。</p><p><strong>地震的自救</strong></p><p>日本地震多发，因此，也有完善的地震预测和通知系统。如果你居住在东京，一般来说，里氏 9 级以下的地震不会早晨大面积房屋垮塌和人身伤害，但对于地震的防灾，我们仍需要了解万全：</p><ul><li><p>关注地震信息：安装地震救灾 App，例如 NERV 防灾，或关注气象厅的地震主页。</p></li><li><p>选择新耐震的房屋居住：1981 年后，日本颁布了新的房屋耐震要求。选择 1981 年后建设的房屋居住，有助于保障我们的人身安全。</p></li><li><p>常备救灾物资：日本有成熟的救灾物品供应，日常生活中，我们也需要囤积一些保质期较长的防灾物品，例如矿泉水，自热应急食品，应急电源，小型发电机等。</p></li><li><p>了解社区避难点：所有居民区都有对应的灾害避难指南，常出现于街道路牌，多为学校，公园等开阔地带，了解所居住社区的避难点，特大灾害时，才能熟悉逃离路径。</p></li><li><p>大地震时的对策：在突发的巨大地震发生时候，基本的防灾逻辑是：</p><ul><li><p>确保人身安全：钻到桌椅下方，防止被落下物砸到</p></li><li><p>关闭火源，打开门窗，确认家人或同居者的安全</p></li><li><p>确认地震应急救灾物资的位置和库存，如饮用水，应急电源等。</p></li><li><p>关注余震和海啸信息，如果所在位置有海啸风险，请遵循应急电台指示迅速前往社区所在的海啸避难所。</p></li></ul></li></ul><p>特别地，日本的橱柜由于防灾原因，多设有地震感应器，在地震时，橱柜会被自动锁住。如果震后打开橱柜时发现被锁住，需要将柜门按到底后，用力快速拉开即可。我们也可以在房屋家具的选购时，考虑安装一些特有的地震锁定装置，这会保障诸如电视之类大家电的资产安全。</p><div data-type="embedly" src="https://www.data.jma.go.jp/multi/quake/index.html?lang=jp" data="{&quot;provider_url&quot;:&quot;https://www.data.jma.go.jp&quot;,&quot;description&quot;:&quot;気象庁&quot;,&quot;url&quot;:&quot;https://www.data.jma.go.jp/multi/quake/index.html?lang=jp&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Jma&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"></div><p><strong>洪水问题</strong></p><p>大都市内的水道设施完善，因此几乎不会出现洪水问题。但在乡间生活时，例如九州地区，每年都会由于广泛的降雨发生河道泄洪灾害。如果你的居住地位于河川附近，需要了解的事情有：</p><ul><li><p>居住房屋的海拔位置</p></li><li><p>河川泛滥时，社区的紧急避难点位置</p></li></ul><p><strong>台风与暴雪问题</strong></p><p>日本处在太平洋的第一道大陆架屏障，因此，每年夏季的台风会影响日本列岛的天气。如果你居住的位置在海岸附近，夏季，防止台风带来的次生灾害，可以做到的事情有：</p><ul><li><p>关闭门窗，使用胶带固定容易划破的玻璃窗。</p></li><li><p>远离海边与河边，不在台风登陆时进行户外活动。</p></li></ul><p>冬季，由于日本海带来的冷空气，导致日本本岛的降雪量非常大，最大的降雪量在青森地区的八甲田山。如果你居住在长野，富山，北海道或者靠近其他日本海的地带，冬季也会面临暴雪的烦恼。雪季，需要特别注意的是居住房屋的积雪问题，长期的积雪可能对屋顶，汽车带来损害。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">专业教育与国家资格</h2><p>日本有着极其专业的教育分野，在任何一个领域，几乎都有对应的国家和民间资格。如果你在工作之余想要培养一份兴趣，甚至将这份兴趣发展成专业执照，日本的专业教育和国家资格会是非常棒的学习路径。在日语中，这称为「生涯学习」。</p><div data-type="embedly" src="https://www.u-can.co.jp/special/theme/national/" data="{&quot;provider_url&quot;:&quot;https://www.u-can.co.jp&quot;,&quot;description&quot;:&quot;国家資格を難易度別に一覧表にしました。人気ランキングやおすすめの選び方も紹介します。「この難易度なら、取得を目指せるかも」「この資格、国家資格だったの？」など、新しい発見があるかもしれません。&quot;,&quot;title&quot;:&quot;国家資格・難易度別一覧表!人気ランキングやおすすめの選び方&quot;,&quot;mean_alpha&quot;:223.131746032,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.u-can.co.jp/special/theme/national/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b20b453981347fc93616f6ec5ab3ad6d842e5b0b8963598d6819c50b3d0dd16.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;生涯学習のユーキャン&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b20b453981347fc93616f6ec5ab3ad6d842e5b0b8963598d6819c50b3d0dd16.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b20b453981347fc93616f6ec5ab3ad6d842e5b0b8963598d6819c50b3d0dd16.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.u-can.co.jp/special/theme/national/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>国家資格・難易度別一覧表!人気ランキングやおすすめの選び方</h2><p>国家資格を難易度別に一覧表にしました。人気ランキングやおすすめの選び方も紹介します。「この難易度なら、取得を目指せるかも」「この資格、国家資格だったの？」など、新しい発見があるかもしれません。</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.u-can.co.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b20b453981347fc93616f6ec5ab3ad6d842e5b0b8963598d6819c50b3d0dd16.png"/></div></a></div></div><p><strong>国家资格考试申请</strong></p><p>任何居住在日本的居民均可自助申请国家资格的考试，这和居民的在留资格无关。由于日语考试中大量使用汉字，对中国和其他使用汉字的人士来说更为有利。不同的国家资格考试，每年进行的时间和次数都不一，需要准备的材料也不一样。在大部分书店，都可以买到热门考试的学习材料，部分考试也可能会需要进行现场授课，这则要求我们有一定的日语水平。</p><p><strong>兴趣资格</strong></p><p>虽然大部分国家资格可以用来申请工作，也存在一些为了培养日常兴趣的资格，例如船舶驾照，園芸装飾技能士、狩猟免許等国家资格。你可以在这里找到完整的日本国家资格的列表：</p><div data-type="embedly" src="https://www.shikakude.com/paje/kokkashikaku.html" data="{&quot;provider_url&quot;:&quot;https://www.shikakude.com&quot;,&quot;description&quot;:&quot;日本で取得できる資格の概要をほとんど網羅。国家資格、公的資格、民間資格の資格の種類のほか、独立できる資格、情報処理の資格、福祉系の資格、地球を守る資格などの資格の分野で取りたい資格をすぐに見つけることができます。資格をとってライバルたちに差をつけよう！！現在掲載資格726種類！&quot;,&quot;title&quot;:&quot;国家資格のページ - 資格の王道&quot;,&quot;url&quot;:&quot;https://www.shikakude.com/paje/kokkashikaku.html&quot;,&quot;thumbnail_width&quot;:97,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/516690920c38fd1ddce391f9c540cf7df02c1802e23c4eee7dc3caa6456e0937.gif&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Shikakude&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:38,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:97,&quot;height&quot;:38,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/516690920c38fd1ddce391f9c540cf7df02c1802e23c4eee7dc3caa6456e0937.gif&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/516690920c38fd1ddce391f9c540cf7df02c1802e23c4eee7dc3caa6456e0937.gif"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.shikakude.com/paje/kokkashikaku.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>国家資格のページ - 資格の王道</h2><p>日本で取得できる資格の概要をほとんど網羅。国家資格、公的資格、民間資格の資格の種類のほか、独立できる資格、情報処理の資格、福祉系の資格、地球を守る資格などの資格の分野で取りたい資格をすぐに見つけることができます。資格をとってライバルたちに差をつけよう！！現在掲載資格726種類！</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.shikakude.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/516690920c38fd1ddce391f9c540cf7df02c1802e23c4eee7dc3caa6456e0937.gif"/></div></a></div></div><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">亲属签证</h2><p>百善孝为先，如果你正在考虑将父母，孩子或者其他亲属接到日本生活，也许你需要关注这一小节的内容。</p><p><strong>短期签证（探亲签证）</strong></p><p>探亲签证也称探亲・访友签证，签写身元保证书后，即可为朋友和家人办理的短期旅游签证，最长居住时间为 90 天。</p><div data-type="embedly" src="https://www.cn.emb-japan.go.jp/itpr_zh/visa_shinzoku.html" data="{&quot;provider_url&quot;:&quot;https://www.cn.emb-japan.go.jp&quot;,&quot;description&quot;:&quot;首页 &gt; 赴日签证（签证咨询） &gt; 各类签证申请手续及所需材料 &gt; 申请方法 &gt; 短期停留 &gt; 探亲・访友签证&quot;,&quot;title&quot;:&quot;探亲・访友签证&quot;,&quot;url&quot;:&quot;https://www.cn.emb-japan.go.jp/itpr_zh/visa_shinzoku.html&quot;,&quot;thumbnail_width&quot;:360,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0cf81fc9687a190e6775536e21b1048722466604858b50aa982f536c6614e604.gif&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Emb-japan&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:240,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:360,&quot;height&quot;:240,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0cf81fc9687a190e6775536e21b1048722466604858b50aa982f536c6614e604.gif&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0cf81fc9687a190e6775536e21b1048722466604858b50aa982f536c6614e604.gif"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.cn.emb-japan.go.jp/itpr_zh/visa_shinzoku.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>探亲・访友签证</h2><p>首页 &gt; 赴日签证（签证咨询） &gt; 各类签证申请手续及所需材料 &gt; 申请方法 &gt; 短期停留 &gt; 探亲・访友签证</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.cn.emb-japan.go.jp</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0cf81fc9687a190e6775536e21b1048722466604858b50aa982f536c6614e604.gif"/></div></a></div></div><p><strong>长期签证（家族滞在签证）</strong></p><p>家族滞在签证是为了将所抚养的孩子，伴侣接到日本定局，长期生活在日本的签证。一般需要证明被抚养人没有经济来源，无法通过个人申请，需要通过专门的代理机构申请。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.moj.go.jp/isa/applications/status/dependent.html">https://www.moj.go.jp/isa/applications/status/dependent.html</a></p><p><strong>特殊签证（高度人才的亲属签证与特定活动签证）</strong></p><p>如果你持有高度人才签证，父母满一定年龄，并且家中有小孩，即可为父母或保姆申请特殊的亲属签证，这一签证和高度人才本人的签证绑定，没有时间限制，最多可为父母共两人申请签证。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.moj.go.jp/isa/publications/materials/newimmiact_3_system_index.html">https://www.moj.go.jp/isa/publications/materials/newimmiact_3_system_index.html</a></p><p>特别的，如果你不持有高度人才签证，但仍希望在日本赡养父母，可以为父母申请<strong>特定活动签证</strong>，这类签证的解释权完全取决于申请材料的可信度，因此没有特别固定的要求，如果你有需求，可以咨询专门的行政书士。</p><hr><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">宠物抚养与保险</h2><p>宠物是现代生活中必不可少的精神伴侣，宠物是我们家庭的一份子，抚养宠物，也意味着承担了一份家庭和社会责任。这一小节，我会向你介绍在日本抚养宠物需要注意的问题。</p><p><strong>宠物抚养手续</strong></p><p>宠物可以从宠物商店购买或从他人处领养，但无论是何种渠道获得宠物，都应该进行宠物登记，一般在领养后的 30 天内进行登记，根据所居住地址的不同，登记手续和地点也会有所不同。在宠物商店购买宠物时，一般店家会提供登记到保险一系列的指南。</p><p>抚养宠物必须戴有项圈，对于猫类动物，需要做绝育手续并在家中饲养。对于狗类宠物，在出门时，饲主有义务处理宠物的粪便和尿液，因此，遛狗前应该准备好塑料手袋与水瓶。</p><p><strong>出行指南</strong></p><p>携带宠物出行是需要提前了解的话题，因为，在日本，没有主动声明可以携带宠物出入的室内公共场所，为了他人的健康考虑，一律是禁止宠物出现的。但是，在日本的社区或高速公路服务区，都有针对宠物设计的场所，也存在专门的宠物出行指南和导航。</p><p>在和宠物一起出门进行长途旅行时，一定要注意的事情是：</p><ul><li><p>确认租车公司是否允许在车内携带宠物，如果允许，需要确认具体的携带的要求。否则可能会在租车后被请求赔偿。</p></li><li><p>确认出行的酒店是否允许携带宠物。如果露营，则需要确认露营场是否允许接待宠物。</p></li><li><p>确认途中的宠物散步区域，例如高速公路或国道是否有针对狗类宠物设计的 dog run 等等。</p></li></ul><p><strong>医疗保险</strong></p><p>如果照顾不周或者季节和饮食因素，宠物也会生病。如果不购买保险，生病时可能会需有相当大的经济负担，因此，为宠物购买健康保险是非常必要的准备。</p><p>不同的保险公司提供的保险内容，费用也有所不同，如果你感兴趣这个话题，可以点击这里的链接了解不同的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hoken.kakaku.com/pet/">宠物保险套餐</a>。</p><hr><p>如果你对日本移居指南有建议或意见，可以在下边的评论框中发表自己的看法：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://embed.0xecho.com.ipns.page/?color-theme=light&amp;desc=&amp;has-h-padding=true&amp;has-v-padding=true&amp;modules=tip%2Clike%2Ccomment%2Cdislike&amp;receiver=guoyu.eth&amp;target_uri=https%3A%2F%2Fguoyu.mirror.xyz%2FbPaDKAcrhJGUbaXu9BWDcdD-F46gBFATTvf_qwZ9Bso&amp;height=800&amp;display=iframe">https://embed.0xecho.com.ipns.page/?color-theme=light&amp;desc=&amp;has-h-padding=true&amp;has-v-padding=true&amp;modules=tip%2Clike%2Ccomment%2Cdislike&amp;receiver=guoyu.eth&amp;target_uri=https%3A%2F%2Fguoyu.mirror.xyz%2FbPaDKAcrhJGUbaXu9BWDcdD-F46gBFATTvf_qwZ9Bso&amp;height=800&amp;display=iframe</a></p><div data-type="embedly" src="https://0xecho.com/developer" data="{&quot;url&quot;:&quot;https://0xecho.com/developer&quot;,&quot;provider_url&quot;:&quot;https://0xecho.com&quot;,&quot;provider_name&quot;:&quot;0xecho&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"></div>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c4b9af0bc263717b2c75942038a967a4ccf97732c329de95cfbb3cc842e1e46d.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Layer2、多层资产中继网络与 Web3 大规模应用迷思]]></title>
            <link>https://paragraph.com/@guoyu/layer2-web3</link>
            <guid>rZcLk4wI8aUjRuWxIOOi</guid>
            <pubDate>Wed, 18 May 2022 16:17:31 GMT</pubDate>
            <description><![CDATA[最近两周的工作集中在关于 DApp 中合约部署的思考，大部分时间，我在学习 zkRollup Layer2 的合约开发，并研究它们的网络设计特点。其中，StarkNet 设计的 Cairo 编程语言可以帮助我们更好地开发富应用的 DApp，并减少一个数量级的 Gas 费用消耗。 在 StarkNet 中，所有地址均为合约地址，没有外部账户（EOA）的概念，它的钱包账户由用户签名部署的「账户合约」组成，该私钥的签名才能操作这个「账户合约」的转账。这是一个很有趣的想法，我们知道，在以太坊主网中，EOA 与合约账户是一直以来的历史遗留问题之一，从 EIP86 草案到 EIP-2938 草案，都致力于将账户逻辑从 EOA 中抽象出来，并将其逻辑应用到智能合约所管理的账户中，以实现「智能合约钱包」。 StarkNet 的主流钱包方案 Argent X 即是一种「智能合约钱包」的实现，社区也提供了对应的 JS SDK，帮助开发者在本地或自己所部署的 DApp 中实现智能合约钱包。 如果我们把目光转向多签名合约，就会发现智能合约钱包作为服务，比作为 Inject Provider 的角色更受关...]]></description>
            <content:encoded><![CDATA[<p>最近两周的工作集中在关于 DApp 中合约部署的思考，大部分时间，我在学习 zkRollup Layer2 的合约开发，并研究它们的网络设计特点。其中，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starkware.co/starknet/">StarkNet</a> 设计的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.cairo-lang.org/">Cairo</a> 编程语言可以帮助我们更好地开发富应用的 DApp，并减少一个数量级的 Gas 费用消耗。</p><p>在 StarkNet 中，所有地址均为合约地址，没有外部账户（EOA）的概念，它的钱包账户由用户签名部署的「账户合约」组成，该私钥的签名才能操作这个「账户合约」的转账。这是一个很有趣的想法，我们知道，在以太坊主网中，EOA 与合约账户是一直以来的历史遗留问题之一，从 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethlibrary.io/zh/eip-86.html">EIP86</a> 草案到 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethlibrary.io/zh/eip-2938.html">EIP-2938</a> 草案，都致力于将账户逻辑从 EOA 中抽象出来，并将其逻辑应用到智能合约所管理的账户中，以实现「智能合约钱包」。</p><p>StarkNet 的主流钱包方案 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.argent.xyz/argent-x/">Argent X</a> 即是一种「智能合约钱包」的实现，社区也提供了对应的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/0xs34n/starknet.js">JS SDK</a>，帮助开发者在本地或自己所部署的 DApp 中实现智能合约钱包。</p><p>如果我们把目光转向多签名合约，就会发现智能合约钱包作为服务，比作为 Inject Provider 的角色更受关注，被使用的次数也更多，其中，最流行的服务便是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gnosis-safe.io/">Gnosis Safe</a>*。但反过来，作为独立钱包角色的智能合约钱包，并没有受到广泛的应用，尤其在 L1/L1s 方案中，无法与传统 EOA 钱包（例如 MetaMask）相竞争。</p><blockquote><p>*注：在这里，Gnosis Safe 提供的钱包是一种多签名合约编程范式，并非 EIP86 与 EIP-2938 中提到的合约账户抽象。</p></blockquote><p>我认为，智能合约钱包虽然有明显的技术与体验优势，但在重资产安全的 L1/L1s 网络中引入了合约这一额外的复杂性与安全风险，并无法改变需要牢记助记词的烦恼（由于仍然需要为智能合约钱包设定权限）导致用户感知不到其技术优势。除了以 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://support.argent.xyz/hc/en-us/articles/360022631992-About-guardians">Argent Guardians</a> 为代表的创新产品允许用户使用三方确认找回智能合约钱包的权限之外，大部分用户只在多签名合约的场景下使用它，把此作为一种开放式资产或额外确认的管理模式。</p><p>在 StarkNet 类似的 Layer2 网络中，智能合约钱包不存在历史负担，因此，它也许能够为 DApp 走向大众带来一些技术架构上的优势。</p><p>实际上，随着以太坊的 Layer2 网络，尤其是 zkRollup 网络的上线，智能合约钱包很可能将允许我们设计出多层资产资产中继网络（Multi-layer Asset Relay Network）以帮助我们的用户使用 L1 的 EOA 账户控制所有应用层资产。</p><p>多层资产资产中继网络（以下简称 MARN）是我的一个产品设想，它并不存在于目前的现实中，在本文的剩余部分，我将解释 MARN 是什么，以及我们为什么需要它。</p><h3 id="h-1" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1. 大规模用户产品需求</h3><p>回到我开发 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://checks.finance/">Checks Finance</a> DApp 中最初需求，我需要它能够支持如下功能：</p><ol><li><p><strong>非外部钱包 SDK</strong>：用户不需要下载第三方钱包，能够直接在 DApp 中创建钱包。</p></li><li><p><strong>非托管钱包模型</strong>：用户不需要将他们的私钥托管在我提供的服务或第三方外部中，但我们需要提供可行的流程让用户找回钱包的控制权。</p></li><li><p><strong>无 Gas 费用</strong>：用户感知不到他们付出了 Gas 费用，由于新用户没有方便的渠道获得 gas token，这对于他们来说尤其必要。</p></li><li><p><strong>快速区块确认</strong>：用户不会在操作区块链交易时卡住或等待太长时间。</p></li><li><p><strong>安全与良好的资产流动性</strong>：用户能通过广泛，安全，快速与富有交易深度的桥合约来转移他们的资产。</p></li></ol><p>通过观察大部分市面上的 DApp，我发现，它们能够在第 4 与第 5 点做到很好，但在前 3 点当中，由于面向的主要是 Crypto Native 用户，一般，这些团队并不会花太多成本来考虑进行优化。</p><p>毫无疑问，这几个难题在很大程度上限制了进入 Web3 的用户规模。如果不从根本上解决问题，我很难说服自己 Web3 产品能在下个周期中得到一个数量级的用户增长。</p><p>为了解决问题 1-3，我开始寻找业界可能存在的方案。</p><p>首先，钱包方案是我们首先要迈过的重要门槛。目前，对于 DApp 开发者来说，流行的钱包方案大概有这几种：</p><ol><li><p>外部钱包连接：最流行，但对新用户来说门槛最高。我们不在此文中考虑这种方案。</p></li><li><p>本地钱包 SDK：整合简单，但用户一旦删除 App 数据，将无法找回私钥，面临很大的丢失风险。</p></li><li><p>托管钱包服务：通过将私钥绕开 DApp 应用逻辑直接上传到 Secrets Service 来进行管理的托管钱包服务，使用本地 SDK 进行交易签名，一些服务可以支持导出私钥。</p></li></ol><p>面向大规模用户产品的方案中，第三种托管钱包方案是目前最多产品所使用的方案，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://web3auth.io/">Web3Auth</a> 与 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://magic.link/">MagicLink</a> 是这种方案的代表产品。它非常明确，用户能使用邮箱、手机或其他社会化登录方式来管理并找回他们的私钥，通过这种方式，它能带来足够多的外部用户，但它的缺点也十分明显：它带来了潜在的安全隐患，这种隐患可能并不限于 AWS 的私钥储存服务，也可能涉及托管钱包平台在设计上的安全风险。</p><p>其次，零 Gas 费用的设计目前有几种主流的范式：</p><ol><li><p>通过 Gas Relayer 代理用户在创建交易时的 Gas：使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://opengsn.org/">GSN</a> 或 OpenZeppelin 提供的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://defender.openzeppelin.com/">Gas Relayer</a> 来创建元交易（Meta Transaction）</p></li><li><p>使用 L2 方案（例如 IMX 或 StarkNet）代理 Gas：通过智能合约钱包来创建元交易，接受消息的交易方合约能为用户代为支付 Gas 费用。</p></li><li><p>使用机器人 EOA 在服务端代理用户的请求：这种方案最简单，但会带来额外的安全风险，以及这无法表现出用户与合约双方真实的交易。</p></li></ol><p>考虑到 Gas Relayer 额外的手续费和基准 Gas 费用，使用后者（L2 方案）来部署我们的 DApp 合约显然是更有效与成本更低的方式。其中，一些 L2 方案甚至支持采用特定的 ERC-20 token 以支付 Gas 费用（例如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zksync.io/">zkSync2.0</a>）这样的费用模型会成为 DApp 经济模型中的一部分，提升我们所发行的治理 token 的价值，就像 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://defikingdoms.com/crystalvale/">DeFi Kingdoms Crystalvale</a> 所做的那样。</p><p>作为总结，在针对大规模用户产品的设计上来看，我们需要寻找到一种产品设计思路，能够同时支持以上的需求，目前，比较可行的方式看起来是使用 Layer2 的方案。</p><h3 id="h-2-eoa" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2. 外部账户（EOA）存在的问题</h3><p>使用 Layer2 的方案，我们可以基于智能合约钱包简单的实现元交易，以 StarkNet 为例，虽然它钱包的实现是智能合约钱包，但由于我们需要一个明确的控制权限，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.argent.xyz/argent-x/">Argent X</a> 的产品设计思路仍然沿袭着 EOA 钱包 MetaMask 的理念：在钱包初始化时（对于 StarkNet 来说即是部署账户合约时）我们需要记住钱包的助记词。</p><p>这带来的一个易于混淆的概念：是否我们的 DApp 支持多少个网络，用户就需要新建多少个 EOA 钱包？</p><p>遗憾的是，市场上大部分 DApp 都遵循这一愚蠢但无奈的思路进行设计。我把这种产品设计称为「多重钱包噩梦」在用户看来，这不仅无益于理解 Web3 与 Web2 产品有何不同，甚至在很大程度上提高了用户侧使用产品的安全隐患。</p><p>我理解，这种无奈的方式一方面由于符合目前 EOA 钱包的设计思路，另外一方面，这样的权责设计是十分分明的，合约和钱包开发团队不需要为用户丢失私钥这一过失而买单。但我认为，我们应当能从智能合约钱包中寻找到更容易理解和更自然的方式。</p><p>一个简单的假设是，我们能否允许智能合约钱包通过特定的 L1 EOA 钱包来操作？或者，我们能否将指南合约钱包设计为一个多签钱包的特定权限操作者，并将受信任的 L1/L2 账户设为 EOA 操作员，允许他们在紧急的情况下更改这一合约的日常操作员的权限？</p><p>事实是，智能合约钱包带来的无限的想象力，对于 EOA 钱包来说，它提供的可编程性，不仅仅能够支持代理 Gas 费用的元交易，还能将钱包彻底从 EOA 单一密钥解放出来：而我认为，这是 Web3 能够被大规模应用的必要条件之一。</p><h3 id="h-3marn" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.多层资产中继网络（MARN）的思考</h3><p>在为 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://checks.finance/">Checks Finance</a> 面向日本市场推出的 Mobile DApp 编码之前，我反复地思考一个问题，如果未来的世界中我们面对着手机中的几百个 DApp，他们部署在多个不同的网络中，我们应当如何管理自己的钱包？</p><p>我们会使用 MetaMask 链接所有的钱包吗？我们的资产在所有 DApp 中，无论它是 DeFi，游戏，还是 NFT 交易市场中，同样重要吗？我们所有的资产都会暴露在网络中被任何人查阅吗？我们会允许自己丢失某个钱包吗？这些问题萦绕在我脑海中，久久无法散去。</p><p>这些问题指向着同两个需要回应的核心：</p><ol><li><p>到底什么是理想的 Web3 产品？</p></li><li><p>我们如何管理纷繁复杂的资产？（会员卡，积分，零钱，储蓄，基金和股票）</p></li></ol><p>我们处在一个多链多层的 Web3 世界中，毫无疑问，这种状况将会持续很长一段时间，这意味着，NFT 玩家会在主网操作他们的 MetaMask 钱包，健身爱好者会在 Solana 参与 StepN 的日常运动，DeFi 用户会穿梭在不同的网络中，同时拥有几十个 EOA 钱包，并管理他们复杂的资产类型，而 DAO 将会变成跨网络的资产合约。</p><p>但是，当 Web3 真正进入大众视野，用户再增长超过一个数量级时，DApp 和钱包还会维持这样的地位吗？</p><p>我的看法是，随着 Layer2 和其他应用层的逐步发展，钱包，一定会变的更加碎片化，钱包所保管的记账资产，也会随之而变的碎片化。如果所有钱包都是 EOA 钱包，它一定会带来比目前更加严重数百倍的「多重钱包噩梦」。</p><p>然而，如果我们把实体经济中的所有资产都搬到 Web3 上，我们会发现，一些资产的重要性明显远不如另外一些资产。我们会允许钱包中的零钱丢失，但我们很可能无法容忍自己存在银行中的储蓄消失。简易、好用的钱包会占据一些市场地位，他们可能随着一些流行的 DApp 被嵌入其中，而不像 EOA 钱包，诸如 MetaMask 那样被广泛使用。</p><p>我认为，这些「不那么重要的」，分布于「应用层」的钱包，可以被一种权限网络所创建，在这个初步的设想中，我把它叫做多层资产资产中继网络（Multi-layer Asset Relay Network）</p><p><strong>MARN 指的是，我们可以通过 L1 的 EOA 钱包来创建，控制 L2（或 LN）的智能合约钱包，并且，允许这些 LN 的钱包成为它的资产缓存层。</strong></p><p>这意味着，通过 L1 → LN 的通信，我们有能力让用户使用一个钱包，管理所有的合约钱包，并且，在不依赖私钥托管的前提下，支持使用恢复操作者来支配 LN 钱包的某些权限。</p><p>例如，当用户登录 DApp 时，我们大部分的合约逻辑基于 L2（比如 StarkNet）我们可以自动为该用户创建一个钱包合约，并在本地记录它的操作者私钥（作为可允许丢失的本地缓存）在创建这个合约时，我们需要该用户提供 L1 的外部账户（使用 MetaMask 登录）并且提供备用邮箱或特定恢复操作员。通过这种方式，当用户本地私钥丢失时，L1 EOA 账户的通信，或备用邮箱的认证，都可以帮助智能合约钱包修改一个新操作员，也就是说，本地随机创建的操作者是可恢复，可替换的。在产品设计上，这种恢复可以不被用户感知到，无论该用户是否记住了私钥，他都可以随时操作这个 LN 钱包。</p><p>通过这种设计，LN 钱包的资产能够作为 L1 EOA 钱包的资产缓存，使用特定的通信，用户能随时从 L1 抽回 LN 钱包的资产（对 StarkNet 来说，这一行为会在 &lt; 30 分钟内到账）这在另一方面加强了合约钱包中资产的安全性，并且赋予了灵活的跨层权限管理。</p><p>MARN 带来了明确的好处：对用户来说，不再需要记录超过一个 EOA 的助记词，并且对 LN 的服务无感知，对平台来说，帮助用户恢复了操作权限，但又不需要承担 Secrets Service 的成本和安全风险，可以说是一举多得。</p><p>MARN 的最终设计目的，应当能帮助用户使用单一外部钱包跨越多层网络而实现无缝的权限控制与资产转移。从这个目标上来看，LN 应当是应用服务首选的基础架构，因为 Layer2 技术能够在最大程度上保证跨链资产的安全性，而无需将这种安全风险交给编写跨链桥合约的应用开发者（就像 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.techtarget.com/searchsecurity/news/252515336/Axie-Infinity-hack-results-in-600M-cryptocurrency-heist">Axie 所遭遇的那样</a>）。</p><p>目前，我对这一概念的思考还在初步的阶段，但我已在 Checks Finance L2 的 DApp 编码中实践这一想法，希望为它的用户提供无缝而安全的钱包体验。对于 MARN，如果你持有类似的想法，或有建设性的建议，欢迎和我在 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/turingou">Twitter</a> 上进行讨论。我也会逐步在 Mirror 更新我对这一想法的具体实践，并将最终产品和代码开源。</p><p>我有一种预感，Web3 的大规模应用可能会在下一个周期内发生，让我们持续 BUIDL，以见证这一全球性的深刻变化。</p>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/ea07925ca7fba877f3a12550b02b5965ee58173890e15d0ffd8f65d9e7c554e6.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Web3 DApp 最佳编程实践指南]]></title>
            <link>https://paragraph.com/@guoyu/web3-dapp</link>
            <guid>6prdjQW7hd80ywRhHXxJ</guid>
            <pubDate>Thu, 12 May 2022 06:06:43 GMT</pubDate>
            <description><![CDATA[自宣布进入创业间隔年以来，CodeforDAO(GitHub) 与 Checks Finance(@checksfinance)两个项目进入了密集而紧张的迭代周期，在合约编写，单元测试，工作流自动化，前端与客户端方面都遇到了较多问题，对此，我总结出了一些经验。当前这两个项目还有大量细节等待优化，尚未正式 landing，我认为将开发过程中的经验和总结与大家进行分享，能帮助更多工程师转向 Web3，也有助于项目的长远发展。 这篇文章将会涉及到开发一个 DApp 所涵盖的几乎所有方面内容，因此，它会非常冗长繁琐，如果你对某一方面特别感兴趣，我建议你可以通过下边这个目录直接跳去感兴趣的章节阅读。另外，这篇文章并不是 Step by Step 的代码教学范例，因此，跳跃章节阅读并不会影响体验。本文中提到的所有项目均列在我的 GitHub Star 清单中，可以在这里统一查阅：guo-yu&#x27;s list / DApp Best Practice StackGitHub is where people build software. More than 150 million pe...]]></description>
            <content:encoded><![CDATA[<p>自宣布进入创业间隔年以来，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mobile.twitter.com/codefordao">CodeforDAO</a>(<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/CodeforDAO/contracts">GitHub</a>) 与 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://checks.finance/">Checks Finance</a>(<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/checksfinance">@checksfinance</a>)两个项目进入了密集而紧张的迭代周期，在合约编写，单元测试，工作流自动化，前端与客户端方面都遇到了较多问题，对此，我总结出了一些经验。当前这两个项目还有大量细节等待优化，尚未正式 landing，我认为将开发过程中的经验和总结与大家进行分享，能帮助更多工程师转向 Web3，也有助于项目的长远发展。</p><p>这篇文章将会涉及到开发一个 DApp 所涵盖的几乎所有方面内容，因此，它会非常冗长繁琐，如果你对某一方面特别感兴趣，我建议你可以通过下边这个目录直接跳去感兴趣的章节阅读。另外，这篇文章并不是 Step by Step 的代码教学范例，因此，跳跃章节阅读并不会影响体验。</p><blockquote><p>本文中提到的所有项目均列在我的 GitHub Star 清单中，可以在这里统一查阅：</p></blockquote><div data-type="embedly" src="https://github.com/stars/guo-yu/lists/dapp-best-practice-stack" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.&quot;,&quot;title&quot;:&quot;guo-yu&apos;s list / DApp Best Practice Stack&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/stars/guo-yu/lists/dapp-best-practice-stack&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/stars/guo-yu/lists/dapp-best-practice-stack" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>guo-yu&#x27;s list / DApp Best Practice Stack</h2><p>GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png"/></div></a></div></div><hr><ol><li><p>认识 DApp 技术栈</p></li><li><p>智能合约编码</p></li><li><p>开发工作流与单元测试</p></li><li><p>前端与客户端开发</p></li><li><p>开发、测试与生产环境调试</p></li><li><p>服务端编码与集成</p></li><li><p>合约部署方案 L1s &amp; L2</p></li><li><p>去中心化储存方案</p></li><li><p>附录</p></li></ol><hr><h2 id="h-1-dapp" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">1. 认识 DApp 技术栈</h2><p>与传统的 App（包括 Web App 与 Mobile App）最大的不同点在于，DApp 的大量功能依赖直接与智能合约（以下简称合约）进行交互。我们无法直接使用前端代码调用合约，因此，在开发 DApp 之前，我们必须理解这一技术栈中存在哪些技术细节以及它们分别扮演何种角色。</p><ol><li><p><strong>智能合约</strong>：通常指代运行在 EVM 兼容网络中的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.soliditylang.org/">Solidity</a> 或其他合约语言代码，他们负责与用户交易我们发行的资产并储存 DApp 的链上状态。</p></li><li><p><strong>DApp</strong>：整合合约接口以及其他功能的应用程序界面，目前，它们大部分是 Web App，你可以用流行的框架例如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://reactjs.org/">React</a>/<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cn.vuejs.org/index.html">Vue</a> 来进行编写。</p></li><li><p><strong>Provider/Signer</strong>: 这是一个 DApp 架构中特殊的角色，它负责与区块链进行通信，并进行合约的读/写操作。<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://metamask.io/">Metamask</a> 是一个流行的 InjectProvider（Web3Provider）你也可以使用其他 JSON-RPC Provider 与区块链进行通信。</p></li><li><p><strong>Relay</strong>: 这个角色隐藏在 Provider/Signer 之后，是真正负责我们与区块链的某一个节点同步状态的服务器集群，它保存了所有账本（全节点）它通常是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://infura.io/">Infura</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.alchemy.com/">Alchemy</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.quicknode.com/">Quicknode</a>、<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://moralis.io/">Moralis</a> 或者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.pokt.network/">Pocket</a> 提供的服务。</p></li><li><p><strong>服务端</strong>（可选）：大部分 DApp 仍然有他们的服务端逻辑，这意味着，你需要自己搭建服务环境，或使用流行的 BasS/FaaS 服务，你可以使用深度整合区块链的 Moralis 来完成服务端的开发，也可以使用成熟的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://firebase.google.com/docs?hl=zh-cn">Firebase</a> 体系。当然，你也可以挑战完全不依赖服务端的方式来构建 DApp，就像 Uniswap 所做的那样。</p></li></ol><p>现在，我们知道编写一个 DApp 大概需要哪些领域的知识，如果你已经决定迈向下一代互联网并打算闯荡一番，我会在接下来的内容中仔细介绍这些角色分别需要理解哪些编程语言，框架和库。</p><hr><p>让我们先进入最重要的部分，<strong>智能合约</strong>。大量程序员望而却步的重要门槛是，他们认为智能合约需要学习一门新的编程语言，<strong>Solidity</strong>，这毫无疑问，我非常推荐入门 Web3 的程序员—— 无论你是从哪一个软件开发领域转型而来 —— 从 Solidity 入手学习 DApp 开发。</p><p>在智能合约的编码方面，我们目前有许多工具，但认识和理解 Solidity 非常有必要，大量的已经存在的，和流行的合约都使用它进行编码，因此，学习 Solidity 不但有助于帮助你理解区块链开发的基本知识和概念，还能让你在许多优秀的开发者已有的卓越工程上快速起步。</p><p>就编程语言而言，在目前的 EVM 兼容链上，你可以使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.soliditylang.org/en/v0.8.13/">Solidity</a> 或 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vyper.readthedocs.io/">Vyper</a> 进行开发，在其他 L1s 区块链上，例如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solana.com/zh">Solana</a>，你可以使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.rust-lang.org/">Rust</a> 来进行合约的开发；在 Layer2 方案 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starkware.co/starknet/">StarkNet</a> 中，你可以使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starkware.co/cairo/">Cairo</a> 来进行开发；在 Arweave 储存网络中，也存在着类似 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/three-em/3em">3em</a> 这样的运行环境支持你使用 JavaScript 来编写合约。</p><p>在这些百花齐放的方案中，实际上存在着两种不同的合约运行环境，EVM 或非 EVM 方案，前者的代码都会被编译成 EVM bytecode，而后者则会采用各种各样的 runtime，各显神通。</p><p>这篇文章不会在合约编程语言上讨论太多，我认为，我们目前正处于合约 runtime 的战国时代，没有人能断言哪种合约编程语言的地位会成为 Web 世界的 JavaScript。但对于智能合约编码来说，我们必须要了解和熟悉 <strong>Solidity</strong>，这是毫无疑问的。</p><p>关于 Solidity，我推荐你从 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solidity-by-example.org/">Solidity by Example</a> 教程开始学习：</p><div data-type="embedly" src="https://solidity-by-example.org/" data="{&quot;provider_url&quot;:&quot;https://solidity-by-example.org&quot;,&quot;title&quot;:&quot;Solidity by Example&quot;,&quot;url&quot;:&quot;https://solidity-by-example.org/&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Solidity-by-example&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"></div><p>这一教程没有繁琐的语法介绍，而根据范例帮助读者掌握基本知识，因此，完成这一教程大约只需要<strong>不到一个工作日</strong>。Solidity 并不是一个特别复杂的语言，在使用它时，我们可以逐步理解每一项语句的语义，我推荐你设置好编码环境后按照网站上的范例来进行实践。当你已经掌握所有范例的写法之后，可以打开 Solidity 语言<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.soliditylang.org/en/v0.8.13/">官方文档</a>（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solidity-cn.readthedocs.io/zh/develop/">中文</a>）对照编码中的错误来进行针对性的学习：</p><div data-type="embedly" src="https://docs.soliditylang.org/" data="{&quot;provider_url&quot;:&quot;https://docs.soliditylang.org&quot;,&quot;title&quot;:&quot;Solidity - Solidity 0.8.30 documentation&quot;,&quot;url&quot;:&quot;https://docs.soliditylang.org/en/v0.8.30/&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Soliditylang&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"></div><hr><p>理解并掌握智能合约后，我们可以进入 DApp 的编码，这是许多互联网行业从业者的强项，我不会在此赘述关于前端编码的经验，如上所述，我们可以使用流行的前端框架，例如 React 或者 Vue 来进行 DApp 的编码。毫无疑问，你会需要一些前端的技术栈知识，主要是 JavaScript 与 CSS。</p><p>在此，我想向大家推荐一些优秀的前端库，使用这些代码库来进行合约交互，会使我们的开发效率事半功倍。</p><p>以 React 为例，我们可以使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wagmi.sh/">wagmi</a> 来帮助我们更好的操作合约，它集成了大量基础但够用的 hooks，并提供了与外部 <code>Provider/Signer</code> 交互的快捷函数。与此同时，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wagmi.sh/">wgami</a> 没有过多的外部依赖，它的核心依赖只有 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ethers.io/v5/">ethers.js</a></p><div data-type="embedly" src="https://github.com/tmm/wagmi" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Reactive primitives for Ethereum apps. Contribute to wevm/wagmi development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - wevm/wagmi: Reactive primitives for Ethereum apps&quot;,&quot;author_name&quot;:&quot;wevm&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/wevm/wagmi&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png&quot;,&quot;author_url&quot;:&quot;https://github.com/wevm&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/tmm/wagmi" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - wevm/wagmi: Reactive primitives for Ethereum apps</h2><p>Reactive primitives for Ethereum apps. Contribute to wevm/wagmi development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png"/></div></a></div></div><p>如果你不是一个框架爱好者，想要从零开始构建应用程序，不可避免的，你需要使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ethers.io/v5/">ethers.js</a> 或者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://web3js.readthedocs.io/en/v1.7.3/">web3.js</a> 来进行基本操作。从我自己的使用经验来看，我更推荐 ethers.js</p><div data-type="embedly" src="https://docs.ethers.io/" data="{&quot;provider_url&quot;:&quot;https://docs.ethers.org&quot;,&quot;description&quot;:&quot;Documentation for ethers, a complete, tiny and simple Ethereum library.&quot;,&quot;title&quot;:&quot;Documentation&quot;,&quot;thumbnail_width&quot;:1280,&quot;url&quot;:&quot;https://docs.ethers.org/v6/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8d250b70269d5cc279fc8f5d00fda99086933fe57d001fc87efbd30595cc0097.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Ethers&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:640,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1280,&quot;height&quot;:640,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8d250b70269d5cc279fc8f5d00fda99086933fe57d001fc87efbd30595cc0097.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8d250b70269d5cc279fc8f5d00fda99086933fe57d001fc87efbd30595cc0097.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.ethers.io/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Documentation</h2><p>Documentation for ethers, a complete, tiny and simple Ethereum library.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.ethers.org</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8d250b70269d5cc279fc8f5d00fda99086933fe57d001fc87efbd30595cc0097.jpg"/></div></a></div></div><div data-type="embedly" src="https://web3js.readthedocs.io/" data="{&quot;provider_url&quot;:&quot;https://web3js.readthedocs.io&quot;,&quot;description&quot;:&quot;web3.js is a collection of libraries that allow you to interact with a local or remote ethereum node using HTTP, IPC or WebSocket.&quot;,&quot;title&quot;:&quot;web3.js - Ethereum JavaScript API - web3.js 1.0.0 documentation&quot;,&quot;url&quot;:&quot;https://web3js.readthedocs.io/en/v1.10.0/&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Web3js&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://web3js.readthedocs.io/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>web3.js - Ethereum JavaScript API - web3.js 1.0.0 documentation</h2><p>web3.js is a collection of libraries that allow you to interact with a local or remote ethereum node using HTTP, IPC or WebSocket.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://web3js.readthedocs.io</span></div></div></a></div></div><p>一般来说，我们并不需要其他的库为我们提供专门的 <code>Provider/Signer</code> 支持，如果你打算支持更多复杂的 Provider，或者同时支持多网络 Provider/Signer 的读写功能，类似 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://apeboard.finance/">Apeboard</a> 为它的用户提供跨区块链的数据展现，可以参考 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NoahZinsmeister/web3-react">react-web3</a> 或者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Web3Modal/web3modal">w3modal</a> 两个流行的模块，这些模块提供了一些好用的功能，但他们的设计不够解耦，有时会带来不必要的 bug，对此，我保持谨慎推荐。</p><div data-type="embedly" src="https://github.com/NoahZinsmeister/web3-react" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;A simple, maximally extensible, dependency minimized framework for building modern Ethereum dApps - Uniswap/web3-react&quot;,&quot;title&quot;:&quot;GitHub - Uniswap/web3-react: A simple, maximally extensible, dependency minimized framework for building modern Ethereum dApps&quot;,&quot;url&quot;:&quot;https://github.com/Uniswap/web3-react&quot;,&quot;author_name&quot;:&quot;Uniswap&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;author_url&quot;:&quot;https://github.com/Uniswap&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/NoahZinsmeister/web3-react" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - Uniswap/web3-react: A simple, maximally extensible, dependency minimized framework for building modern Ethereum dApps</h2><p>A simple, maximally extensible, dependency minimized framework for building modern Ethereum dApps - Uniswap/web3-react</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div></div></a></div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Web3Modal/web3modal">https://github.com/Web3Modal/web3modal</a></p><p>进一步，如果你想不想支持外部 <code>Provider/Signer</code>，而为自己的用户构建一个 Web 钱包，你可以使用 ethers.js 从零开始构建。</p><p>如果你想为用户提供一个 onboard 体验更好（但更不去中心化）的托管钱包系统，让他们可以从普通的账户密码或者社交网络账户来登录你的 DApp，可以选择采用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://web3auth.io/">Web3Auth</a> 或 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://magic.link/">MagicLink</a> 的方案。托管钱包系统是一个非常大的话题，感兴趣的读者可以参考上述两个解决方案自行研究。</p><div data-type="embedly" src="https://web3auth.io/" data="{&quot;provider_url&quot;:&quot;https://web3auth.io&quot;,&quot;description&quot;:&quot;Web3Auth is a simple, non-custodial auth infrastructure that enables Web3 wallets and applications to provide seamless user logins to both mainstream and native Web3 users.&quot;,&quot;title&quot;:&quot;Web3Auth - Key Management SDKs with MPC and AA enabled&quot;,&quot;mean_alpha&quot;:118.195486111,&quot;author_name&quot;:&quot;Web3Auth&quot;,&quot;url&quot;:&quot;https://web3auth.io/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/23840af65813256c764822e43d51f7e3171b947cc35c578489c2529958410900.png&quot;,&quot;thumbnail_width&quot;:2880,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Web3auth&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1440,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:2880,&quot;height&quot;:1440,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/23840af65813256c764822e43d51f7e3171b947cc35c578489c2529958410900.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/23840af65813256c764822e43d51f7e3171b947cc35c578489c2529958410900.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://web3auth.io/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Web3Auth - Key Management SDKs with MPC and AA enabled</h2><p>Web3Auth is a simple, non-custodial auth infrastructure that enables Web3 wallets and applications to provide seamless user logins to both mainstream and native Web3 users.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://web3auth.io</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/23840af65813256c764822e43d51f7e3171b947cc35c578489c2529958410900.png"/></div></a></div></div><div data-type="embedly" src="https://magic.link/" data="{&quot;provider_url&quot;:&quot;https://magic.link&quot;,&quot;description&quot;:&quot;We&apos;ve onboarded 50 million people to the world&apos;s leading apps. We&apos;re trusted by over 200,000 developers. We&apos;re Magic.&quot;,&quot;title&quot;:&quot;Magic Labs | The fastest way to build onchain&quot;,&quot;mean_alpha&quot;:66.4595238095,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://magic.link/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/bf970bf25c9781ea902cf040b7c5e16991950a57eb09d2dae15d3447a610b31d.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Magic&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/bf970bf25c9781ea902cf040b7c5e16991950a57eb09d2dae15d3447a610b31d.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/bf970bf25c9781ea902cf040b7c5e16991950a57eb09d2dae15d3447a610b31d.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://magic.link/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Magic Labs | The fastest way to build onchain</h2><p>We&#x27;ve onboarded 50 million people to the world&#x27;s leading apps. We&#x27;re trusted by over 200,000 developers. We&#x27;re Magic.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://magic.link</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/bf970bf25c9781ea902cf040b7c5e16991950a57eb09d2dae15d3447a610b31d.png"/></div></a></div></div><hr><p>在理解合约以及 DApp 使用何种方式与区块链进行交互后，开发者很快会意识到，我们并没有通过在本地建立一个节点的方式来与区块链进行操作。如果你在本地部署过 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ipfs.io/">IPFS</a>，你会很快发现它会默认在本地同步节点，就像 BT 下载软件那样。这是否意味着我们的 DApp 不够「去中心化」呢？</p><p>实际上，仍然有大量的软件基于本地的全节点来进行交互，只是，对于大部分开发者而言，他们放弃了这样的权利，而转而使用更便利的 <strong>Relay Network</strong> 与区块链进行通信，通过这种方式，我们节省了部署成本，并且不再需要维护节点的状态缓存，对于快速构建 DApp 来说，选择一个靠谱的 Relay，是无可非议的方案。</p><p>使用 Relay Network 不需要特殊的知识，在前端，我们使用上述提及的代码库（ethers.js 或者 web3.js）与 Relay 进行交互；在服务端，如果你使用 Node 运行环境，也可以直接拷贝前端的代码来使用。如果你使用其他的运行环境，你可能会需要一些特定的 JSON-RPC 函数包装，以访问这些 Relay。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://infura.io/"><strong>Infura</strong></a> 是世界上最早和最大的以太坊 Relay Network，它提供一些公开的 Gateway 节点，但一般来说，我们需要获取属于自己的 DApp <strong>Access Key</strong> 并为这些访问权限设置 origin 和 IP 限制，以提升使用我们自己的 DApp 用户的访问速度体验。Infura 目前支持 ETH，ETH2 网络，以及 IPFS 和 Filecoin 两个分布式储存方案。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://infura.io/">https://infura.io/</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.alchemy.com/"><strong>Alchemy</strong></a> 也是一个非常流行的 Relay Network，它在 Infura 的功能上更近一步，为开发者提供了相当多实用的功能，例如调试工具，区块状态推送与丰富的 Webhooks。从某种意义上说，Alchemy 不是一个单纯的 Relay Network，它更像是一个 SaaS 服务，它提供了丰富的自定义 JSON-RPC 方法，实际上，我们的函数库与它的缓存网络进行交互，而不是直接与区块链节点进行交互，这在很大程度上提升了视图（view）方法的访问速度，但依赖 Alchemy 独有的 JSON-RPC 方法，也让 DApp 变得更加中心化了。</p><div data-type="embedly" src="https://www.alchemy.com/" data="{&quot;provider_url&quot;:&quot;https://www.alchemy.com&quot;,&quot;description&quot;:&quot;Whether you&apos;re a beginner developer, startup, web3 market leader, or a large enterprise, Alchemy makes multichain web3 development easy.&quot;,&quot;title&quot;:&quot;Alchemy - the web3 development platform&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.alchemy.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/b7fb6e8a1ba6844a41489e9aa608cab209f0874f7f63dbb825c52e7f5b65f4b9.avif&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Alchemy&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:100,&quot;height&quot;:100,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/b7fb6e8a1ba6844a41489e9aa608cab209f0874f7f63dbb825c52e7f5b65f4b9.avif&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/b7fb6e8a1ba6844a41489e9aa608cab209f0874f7f63dbb825c52e7f5b65f4b9.avif"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.alchemy.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Alchemy - the web3 development platform</h2><p>Whether you&#x27;re a beginner developer, startup, web3 market leader, or a large enterprise, Alchemy makes multichain web3 development easy.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.alchemy.com</span></div><img src="https://storage.googleapis.com/papyrus_images/b7fb6e8a1ba6844a41489e9aa608cab209f0874f7f63dbb825c52e7f5b65f4b9.avif"/></div></a></div></div><p>我不会在这里评判去中心化的「道德问题」，各位读者可以根据自己的开发时间周期，风险偏好和使用习惯来决定何种服务适合自己，并为自己的客户与用户提供更好的服务。</p><p>在 Relay Network 方面，我想再推荐一个服务：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://moralis.io/">https://moralis.io/</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://moralis.io/">Moralis</a> 集成了许多 FaaS 的功能到他们的 Relay Network 中，这使得你可以快速在服务端访问区块链的状态，而不需要反复调用第三方网络的 API，这是一个非常有趣而实用的方案，他们的定位是 Web3 的 Firebase，我希望他们能够将软件质量和可用性真正提升到 Firebase 的水平，那这就会是一件非常棒的事儿。</p><p>在本文编写的过程中，我得知 Google Cloud Platform 也正在组建他们的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.cnbc.com/2022/05/06/googles-cloud-group-forms-web3-product-and-engineering-team.html">Web3 团队</a>，这意味着我们有可能在不久的将来能在 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://firebase.google.com/?hl=zh-cn">Firebase</a> 或者 GAE 服务上使用到 Google 的 Relay 服务，我们可以保持适当的关注。</p><hr><p>服务端方面，你可以使用任何你喜欢的编程语言，运行环境和软件架构，没有什么特殊的限制，只要保证你选择的技术栈能和本地节点或者（通常是）Relay Network 进行交互即可。</p><p>一般来说，我会选择 Node 运行环境。说些题外话，由于大部分合约使用 NPM 来进行包管理，并使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hardhat.org/">hardhat</a> 来做编译和测试工作流，使用 JavaScript 已经成为智能合约编码中必不可少的一个环节。既然如此，在服务端同时使用 JavaScript 语言有助于我们复用代码，留出更多的时间享受人生。</p><p>编写服务端并不意味着我们需要做完所有事，通常，我们使用 DApp 的服务端代码来储存没必要储存在合约中的「链下状态」。在合约中储存数据是十分昂贵的选择（至少目前看来）这种昂贵不仅涉及到我们部署合约中产生的费用，还涉及到每一次修改状态的函数请求带来的，用户需要付出的 gas 成本。所以，大部分时候，我们会使用自己的服务端来储存这些「链下状态」</p><p>使用一个健壮的 FaaS 对许多工程师来说是简单而且实用的选择，我推荐 Firebase，如果你想体验深度集成区块链的 FaaS，也可以参考上述提及的 Moralis。</p><div data-type="embedly" src="https://firebase.google.com/" data="{&quot;provider_url&quot;:&quot;https://firebase.google.com&quot;,&quot;description&quot;:&quot;Discover Firebase, Google&apos;s mobile and web app development platform that helps developers build apps and games that users will love.&quot;,&quot;title&quot;:&quot;Firebase | Google&apos;s Mobile and Web App Development Platform&quot;,&quot;thumbnail_width&quot;:1600,&quot;url&quot;:&quot;https://firebase.google.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aededa719bdef01a351e6b015d18d68704f873f048fea4be8e8cacd03381781.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Firebase&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:800,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1600,&quot;height&quot;:800,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aededa719bdef01a351e6b015d18d68704f873f048fea4be8e8cacd03381781.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aededa719bdef01a351e6b015d18d68704f873f048fea4be8e8cacd03381781.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://firebase.google.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Firebase | Google&#x27;s Mobile and Web App Development Platform</h2><p>Discover Firebase, Google&#x27;s mobile and web app development platform that helps developers build apps and games that users will love.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://firebase.google.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1aededa719bdef01a351e6b015d18d68704f873f048fea4be8e8cacd03381781.png"/></div></a></div></div><p>我选择 Firebase 的主要原因是他们提供成本低廉，服务完善和稳定的健壮 API，同时，他们针对开发者开发了功能齐全的本地模拟测试套件，这会节省我们相当多的时间。</p><div data-type="embedly" src="https://firebase.google.com/docs/emulator-suite" data="{&quot;provider_url&quot;:&quot;https://firebase.google.com&quot;,&quot;description&quot;:&quot;The Firebase Local Emulator Suite is a set of advanced tools for developers looking to build and test apps locally using numerous Firebase product emulators. It provides a rich user interface to help you get running and prototyping quickly.&quot;,&quot;title&quot;:&quot;Introduction to Firebase Local Emulator Suite&quot;,&quot;url&quot;:&quot;https://firebase.google.com/docs/emulator-suite&quot;,&quot;thumbnail_width&quot;:3340,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8f8037b21bfe4243232b871d95e8c3124a6da38123906534957d56f5dc5fcd8d.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Firebase&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:2794,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:3340,&quot;height&quot;:2794,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8f8037b21bfe4243232b871d95e8c3124a6da38123906534957d56f5dc5fcd8d.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8f8037b21bfe4243232b871d95e8c3124a6da38123906534957d56f5dc5fcd8d.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://firebase.google.com/docs/emulator-suite" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Introduction to Firebase Local Emulator Suite</h2><p>The Firebase Local Emulator Suite is a set of advanced tools for developers looking to build and test apps locally using numerous Firebase product emulators. It provides a rich user interface to help you get running and prototyping quickly.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://firebase.google.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8f8037b21bfe4243232b871d95e8c3124a6da38123906534957d56f5dc5fcd8d.png"/></div></a></div></div><p>FaaS 在市面上有太多可选的方案，你可以依赖一个全功能 FaaS，也可以将自己为数不多的「链下状态」储存在 headless CMS 当中，例如 Vercel 或者 Netlify。</p><div data-type="embedly" src="https://vercel.com/" data="{&quot;provider_url&quot;:&quot;https://vercel.com&quot;,&quot;description&quot;:&quot;Vercel gives developers the frameworks, workflows, and infrastructure to build a faster, more personalized web.&quot;,&quot;title&quot;:&quot;Vercel: Build and deploy the best web experiences with the AI Cloud - Vercel&quot;,&quot;mean_alpha&quot;:251.125796178,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://vercel.com&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/6568e93385fb904edb58e934e186d9ffed416ac085dccdc54741f573d1b0123e.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Vercel&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:628,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:628,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/6568e93385fb904edb58e934e186d9ffed416ac085dccdc54741f573d1b0123e.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/6568e93385fb904edb58e934e186d9ffed416ac085dccdc54741f573d1b0123e.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://vercel.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Vercel: Build and deploy the best web experiences with the AI Cloud - Vercel</h2><p>Vercel gives developers the frameworks, workflows, and infrastructure to build a faster, more personalized web.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://vercel.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/6568e93385fb904edb58e934e186d9ffed416ac085dccdc54741f573d1b0123e.png"/></div></a></div></div><div data-type="embedly" src="https://www.netlify.com/" data="{&quot;provider_url&quot;:&quot;https://www.netlify.com&quot;,&quot;description&quot;:&quot;Build with AI or code, deploy instantly. One platform with everything you need to make real apps live.&quot;,&quot;title&quot;:&quot;Push your ideas to the web | Netlify&quot;,&quot;mean_alpha&quot;:87.75,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.netlify.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e84771c68058159611664c7bd225e648ee1d64eebf77e583723a745fc05ea1c5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Www&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e84771c68058159611664c7bd225e648ee1d64eebf77e583723a745fc05ea1c5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e84771c68058159611664c7bd225e648ee1d64eebf77e583723a745fc05ea1c5.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.netlify.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Push your ideas to the web | Netlify</h2><p>Build with AI or code, deploy instantly. One platform with everything you need to make real apps live.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.netlify.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e84771c68058159611664c7bd225e648ee1d64eebf77e583723a745fc05ea1c5.png"/></div></a></div></div><p>或者，如果你希望自己搭建 FaaS 服务器，以获得更完善的控制与更低的成本，我向你推荐一些 Firebase 的开源替代品，例如 Supabase:</p><div data-type="embedly" src="https://github.com/supabase/supabase" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. - supabase/supabase&quot;,&quot;title&quot;:&quot;GitHub - supabase/supabase: The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.&quot;,&quot;url&quot;:&quot;https://github.com/supabase/supabase&quot;,&quot;author_name&quot;:&quot;supabase&quot;,&quot;thumbnail_width&quot;:1200,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f3bfda97027c90962fdd0e30d94ffd0b700cbde2160ddc2a2f455d197042fd8b.png&quot;,&quot;author_url&quot;:&quot;https://github.com/supabase&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f3bfda97027c90962fdd0e30d94ffd0b700cbde2160ddc2a2f455d197042fd8b.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f3bfda97027c90962fdd0e30d94ffd0b700cbde2160ddc2a2f455d197042fd8b.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/supabase/supabase" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - supabase/supabase: The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.</h2><p>The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. - supabase/supabase</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f3bfda97027c90962fdd0e30d94ffd0b700cbde2160ddc2a2f455d197042fd8b.png"/></div></a></div></div><hr><h2 id="h-2" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">2. 智能合约编码</h2><p>在这一章节，我们会从 Solidity 语言入手，理解编写一个智能合约与传统的应用软件或界面有何不同，你可以使用上一章节提到的其他智能合约编程语言，但本章节将使用 Solidity（以下简称 Sol） 作为范例阐述智能合约编码中应当注意的问题。</p><p>在此，我不会逐行逐句解释 Sol 语言的语义细节，因此，阅读这一章要求你有起码的 Sol 语言知识。我建议，在此之前，请参考并读完所有的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solidity-by-example.org/">Solidity Examples</a>：</p><div data-type="embedly" src="https://solidity-by-example.org/" data="{&quot;provider_url&quot;:&quot;https://solidity-by-example.org&quot;,&quot;title&quot;:&quot;Solidity by Example&quot;,&quot;url&quot;:&quot;https://solidity-by-example.org/&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Solidity-by-example&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"></div><h3 id="h-21" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2.1 合约特征</h3><p><strong>事务性</strong>：我们可以将区块链看成是一个事务性数据库，这意味着，要么我们在合约中编写的函数全部被执行，状态依次被修改，要么，所有的状态都会回滚到当初未曾被修改的样子。这意味着，我们在对智能合约进行编码的过程中，要十分注意函数 API 的设计，在具体的函数中，不应当对参数进行重载。同时，也意味着我们在进行错误处理时要十分小心。</p><p><strong>错误处理</strong>：我们可以选择两种常用的错误处理方式，<code>require(condition, ERR_MESSAGE)</code> 或者 <code>revert customError()</code>，前者传入一个字符串代表错误，后者可以自定义错误类型。两种方式并无本质上的不同，并且都会导致 <code>tx</code> 失败。对于前端而言，我们都需要自定义错误类型来捕获这两种错误。</p><p><strong>运行成本</strong>：合约的状态储存会消耗 Gas 费用（区块链的激励机制，作为付给运行节点的计算与储存费用）为此，在设计储存对象时，如何善用声明的内存是需要被考虑的问题之一。简单的法则是，不要为不需要的状态声明过多的内存空间，如果你需要优化一个合约的运行成本，可以考虑参考许多合约使用内联汇编来优化内存占用。</p><p>为此，合约中的复杂数据结构必须声明储存空间位置，例如 <code>storage</code>, <code>memory</code>, <code>calldata</code>，每种位置所产生的费用会有很大不同。合约的函数也会有对应的函数类型声明，<code>view</code> 函数 与 <code>pure</code> 函数在外部调用时不需要承担 gas 费用，但改变状态的函数都需要消耗 gas。</p><blockquote><p>注意：由于合约运行和储存成本高，许多对外部白名单进行管理的最佳实践是使用 MerkleProof，你可以在这里找到它的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.openzeppelin.com/contracts/3.x/api/cryptography#MerkleProof">合约实现</a>和 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/miguelmota/merkletreejs">JavaScript 实现</a>。</p></blockquote><p><strong>不可变</strong>：合约一旦部署，就无法动态替换或进行升级，这意味着，你需要在部署前考虑是否要依赖可升级架构（<code>Proxy</code> 部署方案）这些方案所依赖的合约和抽象合约，都需要遵循同一种初始化范式，才能保证合约的可升级性。</p><p><strong>权限和可见性</strong>：合约不同于服务端代码，它对网络中的所有人是透明的，这里的透明不仅指的是合约的字节码，还包括它的<strong>公开</strong>和<strong>私有状态</strong>。这意味着，你不应当在合约中储存任何敏感数据，也不应当依赖区块当中的任何状态（比如区块高度和时间戳）作为核心业务逻辑的判断基准。</p><p>为此，发布一个未经权限控制的合约是十分危险的，任何外部账户都可以轻易地对某个合约进行修改，并通过发送消耗合约指令将合约中的资产转走。所以，除了特定的治理合约不受权限管制以外，我推荐任何合约都必须至少依赖 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol">Ownable</a> 来进行基本的权限配置，同时，复杂合约可以使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol">AccessControl</a> 来进行管理。</p><p><strong>安全性</strong>：如上所述，合约的安全性是非常重要和严谨的问题，在将合约发布到生产环境网络之前，确保你已阅读 ConsenSys 编写的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ConsenSys/smart-contract-best-practices">合约代码安全最佳实践指南</a>并遵守其中所有的约定，同时，确保合约有足够的测试用例并且较高的测试覆盖度。请不要带有侥幸心理发布未经任何测试的合约代码，并主观地希望它能够正常工作。</p><h3 id="h-22" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2.2 合约依赖与调用</h3><p><strong>依赖引入</strong>：合约可以通过 <code>import</code> 引入依赖的外部合约，抽象合约，Interface 或者库。通常，我们使用 npm 管理合约的外部依赖，管理合约的依赖也有其他办法（例如 git submodule）这会在工作流章节中详细叙述。</p><p><strong>调用</strong>：合约可以调用其他合约，只需知道地址和 ABI，我们就可以在合约内部调用其他合约，需要注意的是，调用合约也是事务性操作，因此，你不需要通过手动管理异步操作的方式来等待返回结果。在合约内部调用其他合约需要消耗额外的 Gas 费用。调用合约可能由于 ABI 错误或者不支持某个函数方法而导致失败，但 Gas 费用并不会返还，我们需要确保在调用其他第三方合约前理解对方合约的接口（包括参数类型，顺序，返回结构）</p><p>如果你试图调试本地合约调用某个生产环境的线上合约，可以使用 fork 的方式将某个高度的区块链下载到本地运行，这会在工作流章节中详细叙述。</p><p><strong>ABI</strong>：也叫应用程序二进制接口（Application Binary Interface）ABI 是我们理解如何操作一个合约的具体方法的描述，通常在 Interface 文件中被定义（如果合约命名为 <code>Membership.sol</code>，那么它的 Interface 文件通常叫做 <code>IMembership.sol</code>）</p><blockquote><p>注意：通过这种方式定义可以让任意合约通过引用 interface 的方式来调用你的合约，但如果你不在 Interface 中文件定义它，编译器也能帮助你编译出 ABI。</p></blockquote><p>我们可以依赖完整的 ABI 来调用合约（对外部调用者来说，ABI 通常被编译成一个 <code>JSON</code> 文件），也可以使用它其中的一部分来调用，只要它满足真实合约所声明的函数（包括参数，参数类型，返回值，返回值类型都一致）后者通常被成为 human-readable ABI，例如：</p><pre data-type="codeBlock" text="calldatas[0] = abi.encodeWithSignature(
  &apos;execTransfer(uint256,address,address[],uint256[])&apos;,
   memberId,
   memberWallet,
   payroll.tokens.addresses,
   payroll.tokens.amounts
);
"><code>calldatas[<span class="hljs-number">0</span>] <span class="hljs-operator">=</span> <span class="hljs-built_in">abi</span>.<span class="hljs-built_in">encodeWithSignature</span>(
  <span class="hljs-string">'execTransfer(uint256,address,address[],uint256[])'</span>,
   memberId,
   memberWallet,
   payroll.tokens.addresses,
   payroll.tokens.amounts
);
</code></pre><p><strong>合约事件</strong>：由于合约的函数调用是事务性的，并且无法为外部调用者（指代 DApp 或钱包用户）提供返回值，合约引入了事件的概念。</p><p>事件通过向日志系统中写入特定数据的方式来实现函数修改的记录。我们可以通过监听和查询的方式列出一个合约注册的所有事件，实现对函数异步结果的查询和前端 UI 状态变更。合约事件以某个单一合约为 key 来进行索引，同时，在声明事件时，我们可以指定不多于三个 <code>index key</code> 来确保 DApp 前端对这些索引 key 的查询效率，例如：</p><pre data-type="codeBlock" text="event ModuleProposalCreated(
  address indexed module,
  bytes32 indexed id,
  address indexed sender,
  uint256 timestamp
);
"><code><span class="hljs-function"><span class="hljs-keyword">event</span> <span class="hljs-title">ModuleProposalCreated</span>(<span class="hljs-params">
  <span class="hljs-keyword">address</span> <span class="hljs-keyword">indexed</span> module,
  <span class="hljs-keyword">bytes32</span> <span class="hljs-keyword">indexed</span> id,
  <span class="hljs-keyword">address</span> <span class="hljs-keyword">indexed</span> sender,
  <span class="hljs-keyword">uint256</span> timestamp
</span>)</span>;
</code></pre><p>如果你期望的查询是非常复杂的，包括一系列相关联的合约事件，更好的方法是采用 Relay 提供的 graph/webhook 来进行查询。</p><p><strong>创建合约</strong>：我们可以通过合约创建其他合约，这意味着，合约可以成为其他合约的工厂合约或者代理合约。我们也可以通过外部调用者（钱包账户）向 <code>0x00</code> 地址发送合约创建操作来新建网络上的合约，这是我们进行测试和依赖工作流创建合约的方法。</p><p>创建合约需要消耗大量 Gas 费用，通常，我们会使用特定工具在创建合约前预估并计算费用，这会在工作流章节中详述。</p><h3 id="h-23" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2.3 合约编程语言特征</h3><p>Sol 需要依赖相应工作流被编译成字节码发布到对应环境的网络中才能被运行，因此，它不像 JavaScript 那样的动态类型语言有随处可见的 runtime，编译器在检查时会帮助我们发现大部分问题，因此，你需要一个 IDE，例如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://code.visualstudio.com/">VSCode</a> 之类的 IDE 或编辑器才能进入合约开发。</p><p>Sol 与大部分编程语言类似，支持基本多种数据类型（但不支持浮点数）、复杂数据结构（例如 <code>map</code>，<code>array</code> 和 <code>struct</code>）、合约支持继承和多重继承（<code>is</code>）、原型方法重写（<code>override</code>）等。合约有特殊的构造函数，合约声明的函数支持修饰器语法。特殊地，合约中可以通过 <code>payable</code> 声明或显示转换来实现对原生 Gas token (ETH) 的资金操作。</p><p>Sol 虽然是图灵完备的语言，但其中复杂结构的操作会带来相应的 gas 消耗，因此，在设计合约中的状态变量时，应当足够清晰和简单。</p><h3 id="h-24" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2.4 阅读优秀的合约代码</h3><p>合约编程虽然不复杂，但大量的运行时限制和非冗余的设计，导致我们在进行合约编码时，不得不参考许多优秀的合约代码，才能保证我们的合约代码质量。</p><p>对于许多其他领域的程序员来说，这一步更是非常必要的。我推荐大家在合约编码的过程中，反复参考优秀合约项目的设计思路和编码思维。在这里，我为大家推荐一些我认为不错的智能合约开源项目。</p><p>首先，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/OpenZeppelin">OpenZeppelin</a> 合约是进入 Web3 领域必须反复的阅读的圣经之一，自 2017 年以来，他们实现了大量的 EIP（以太坊改进提案），并成为了智能合约编码的实际标准。虽然，OZ 的合约在 Gas 费用和效率上存在一些问题，但他们在安全性、代码完成度、可维护性、注释和测试方面都做的很好，是值得信赖的合约基础库。最近，OZ 也发布了他们在 StarkNet 上的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/OpenZeppelin/cairo-contracts">Cairo 语言版本合约</a>。</p><div data-type="embedly" src="https://github.com/OpenZeppelin/openzeppelin-contracts" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;OpenZeppelin Contracts is a library for secure smart contract development. - OpenZeppelin/openzeppelin-contracts&quot;,&quot;title&quot;:&quot;GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.&quot;,&quot;author_name&quot;:&quot;OpenZeppelin&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/OpenZeppelin/openzeppelin-contracts&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3dd1af02b0158489530ad460402b5e9a67959c63eebb12bdbf8ce7675fe699fa.png&quot;,&quot;author_url&quot;:&quot;https://github.com/OpenZeppelin&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3dd1af02b0158489530ad460402b5e9a67959c63eebb12bdbf8ce7675fe699fa.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3dd1af02b0158489530ad460402b5e9a67959c63eebb12bdbf8ce7675fe699fa.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/OpenZeppelin/openzeppelin-contracts" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.</h2><p>OpenZeppelin Contracts is a library for secure smart contract development. - OpenZeppelin/openzeppelin-contracts</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3dd1af02b0158489530ad460402b5e9a67959c63eebb12bdbf8ce7675fe699fa.png"/></div></a></div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Rari-Capital/solmate">Solmate</a> 也提供了一系列对应的 EIP 实现，同时，他们更注重合约的运行效率，优化了执行中的 gas 费用，并且每个合约依赖更少，阅读起来更加简单。</p><div data-type="embedly" src="https://github.com/Rari-Capital/solmate" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Modern, opinionated, and gas optimized building blocks for smart contract development. - transmissions11/solmate&quot;,&quot;title&quot;:&quot;GitHub - transmissions11/solmate: Modern, opinionated, and gas optimized building blocks for smart contract development.&quot;,&quot;author_name&quot;:&quot;transmissions11&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/transmissions11/solmate&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d097e16d17a5799083a85e19f1ff435b0fdc13e76960ff5c3d3d282ce05f15d8.png&quot;,&quot;author_url&quot;:&quot;https://github.com/transmissions11&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d097e16d17a5799083a85e19f1ff435b0fdc13e76960ff5c3d3d282ce05f15d8.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d097e16d17a5799083a85e19f1ff435b0fdc13e76960ff5c3d3d282ce05f15d8.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/Rari-Capital/solmate" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - transmissions11/solmate: Modern, opinionated, and gas optimized building blocks for smart contract development.</h2><p>Modern, opinionated, and gas optimized building blocks for smart contract development. - transmissions11/solmate</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d097e16d17a5799083a85e19f1ff435b0fdc13e76960ff5c3d3d282ce05f15d8.png"/></div></a></div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.erc721a.org/">ERC721A</a> 是知名 NFT 项目 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.azuki.com/zh">Azuki</a> 发布的 ERC721 改善版本，通过特定的位操作，他们实现了内存占用的优化，带来了批量 mint 低 Gas 费用的优势。如果你的项目涉及到大量 NFT 的铸造，可以参考它的合约代码来进行实现。</p><div data-type="embedly" src="https://github.com/chiru-labs/ERC721A" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;https://ERC721A.org. Contribute to chiru-labs/ERC721A development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - chiru-labs/ERC721A: https://ERC721A.org&quot;,&quot;author_name&quot;:&quot;chiru-labs&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/chiru-labs/ERC721A&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/68a594a3fb17c19a7fb3d9d98454647e46e1d62880be45655ca8598c0526bc6c.png&quot;,&quot;author_url&quot;:&quot;https://github.com/chiru-labs&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/68a594a3fb17c19a7fb3d9d98454647e46e1d62880be45655ca8598c0526bc6c.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/68a594a3fb17c19a7fb3d9d98454647e46e1d62880be45655ca8598c0526bc6c.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/chiru-labs/ERC721A" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - chiru-labs/ERC721A: https://ERC721A.org</h2><p>https://ERC721A.org. Contribute to chiru-labs/ERC721A development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/68a594a3fb17c19a7fb3d9d98454647e46e1d62880be45655ca8598c0526bc6c.png"/></div></a></div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://compound.finance/">Compond</a> 是 DeFi 借贷领域的老牌项目，代码质量经过实践的检验，如果你的项目涉及到 DeFi 相关的需求，请务必阅读他们的合约代码。</p><div data-type="embedly" src="https://github.com/compound-finance/compound-protocol" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;The Compound On-Chain Protocol. Contribute to compound-finance/compound-protocol development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - compound-finance/compound-protocol: The Compound On-Chain Protocol&quot;,&quot;url&quot;:&quot;https://github.com/compound-finance/compound-protocol&quot;,&quot;mean_alpha&quot;:254.228777778,&quot;author_name&quot;:&quot;compound-finance&quot;,&quot;thumbnail_width&quot;:4000,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1a640a29960f9c9d3d525fbeb7eec24c11fc18ee35a49c8da524c560aa0354d9.png&quot;,&quot;author_url&quot;:&quot;https://github.com/compound-finance&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:2250,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:4000,&quot;height&quot;:2250,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1a640a29960f9c9d3d525fbeb7eec24c11fc18ee35a49c8da524c560aa0354d9.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1a640a29960f9c9d3d525fbeb7eec24c11fc18ee35a49c8da524c560aa0354d9.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/compound-finance/compound-protocol" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - compound-finance/compound-protocol: The Compound On-Chain Protocol</h2><p>The Compound On-Chain Protocol. Contribute to compound-finance/compound-protocol development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1a640a29960f9c9d3d525fbeb7eec24c11fc18ee35a49c8da524c560aa0354d9.png"/></div></a></div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://uniswap.org/">Uniswap</a> 是世界上最大的 DEX，他们的合约实现的非常优秀，无论你是否有 DeFi 方面的需求，我都建议你完整阅读他们的合约代码。</p><div data-type="embedly" src="https://github.com/Uniswap/v3-core" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;🦄 🦄 🦄 Core smart contracts of Uniswap v3. Contribute to Uniswap/v3-core development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - Uniswap/v3-core: 🦄 🦄 🦄 Core smart contracts of Uniswap v3&quot;,&quot;author_name&quot;:&quot;Uniswap&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/Uniswap/v3-core&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c5fd75b976343035ac3b379bc3ccfb31a73311a826369a08558888f3a34afd6b.png&quot;,&quot;author_url&quot;:&quot;https://github.com/Uniswap&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c5fd75b976343035ac3b379bc3ccfb31a73311a826369a08558888f3a34afd6b.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c5fd75b976343035ac3b379bc3ccfb31a73311a826369a08558888f3a34afd6b.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/Uniswap/v3-core" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - Uniswap/v3-core: 🦄 🦄 🦄 Core smart contracts of Uniswap v3</h2><p>🦄 🦄 🦄 Core smart contracts of Uniswap v3. Contribute to Uniswap/v3-core development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c5fd75b976343035ac3b379bc3ccfb31a73311a826369a08558888f3a34afd6b.png"/></div></a></div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://lens.dev/">Lens</a> 是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://aave.com/">AAVE</a> 推出的以 NFT 为核心的新型社交合约开发套件（或者他们称之为社交合约协议）如果你的项目设计到 SocialFi，可以参考他们的代码实现。</p><div data-type="embedly" src="https://github.com/aave/lens-protocol" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;The Lens Protocol. Contribute to lens-protocol/core development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - lens-protocol/core: The Lens Protocol&quot;,&quot;author_name&quot;:&quot;lens-protocol&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/lens-protocol/core&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/126756f263e25c3d4c349c1a71cf3a7da23260c7d5036d1d5761f5776d33cd9b.png&quot;,&quot;author_url&quot;:&quot;https://github.com/lens-protocol&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/126756f263e25c3d4c349c1a71cf3a7da23260c7d5036d1d5761f5776d33cd9b.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/126756f263e25c3d4c349c1a71cf3a7da23260c7d5036d1d5761f5776d33cd9b.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/aave/lens-protocol" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - lens-protocol/core: The Lens Protocol</h2><p>The Lens Protocol. Contribute to lens-protocol/core development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/126756f263e25c3d4c349c1a71cf3a7da23260c7d5036d1d5761f5776d33cd9b.png"/></div></a></div></div><p>其次，我想给大家推荐的是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zora.co/">Zora</a> v3 版本合约与 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gnosis-safe.io">Gonsis safe</a>，前者是著名的 NFT 交易市场退出的交易合约，后者是著名的多签名钱包合约实现。这些都是我们在使用智能合约能够完成的产品当中非常重要的组成部分：</p><div data-type="embedly" src="https://github.com/ourzora/v3" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Contribute to ourzora/v3 development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - ourzora/v3&quot;,&quot;author_name&quot;:&quot;ourzora&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/ourzora/v3&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2db83b880475a022ce6bfdd10e2c80d52756844f8f5419016ffe77d0e726d28a.png&quot;,&quot;author_url&quot;:&quot;https://github.com/ourzora&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2db83b880475a022ce6bfdd10e2c80d52756844f8f5419016ffe77d0e726d28a.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2db83b880475a022ce6bfdd10e2c80d52756844f8f5419016ffe77d0e726d28a.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/ourzora/v3" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - ourzora/v3</h2><p>Contribute to ourzora/v3 development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2db83b880475a022ce6bfdd10e2c80d52756844f8f5419016ffe77d0e726d28a.png"/></div></a></div></div><div data-type="embedly" src="https://github.com/gnosis/safe-contracts" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Safe allows secure management of blockchain assets. - GitHub - safe-global/safe-smart-account: Safe allows secure management of blockchain assets.&quot;,&quot;title&quot;:&quot;GitHub - safe-global/safe-smart-account: Safe allows secure management of blockchain assets.&quot;,&quot;author_name&quot;:&quot;safe-global&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/safe-global/safe-smart-account&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1b0438b7591b1e139a26866c52dc69605654247700211348611033d34e3697e7.png&quot;,&quot;author_url&quot;:&quot;https://github.com/safe-global&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1b0438b7591b1e139a26866c52dc69605654247700211348611033d34e3697e7.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1b0438b7591b1e139a26866c52dc69605654247700211348611033d34e3697e7.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/gnosis/safe-contracts" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - safe-global/safe-smart-account: Safe allows secure management of blockchain assets.</h2><p>Safe allows secure management of blockchain assets. - GitHub - safe-global/safe-smart-account: Safe allows secure management of blockchain assets.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1b0438b7591b1e139a26866c52dc69605654247700211348611033d34e3697e7.png"/></div></a></div></div><p>最后，如果你对 DAO 和链上治理感兴趣，我推荐你阅读我编写的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/codefordao">CodeforDAO</a> 的合约，在这个项目中，实现了传统的治理模式，多签积极治理与模块化合约。</p><div data-type="embedly" src="https://github.com/CodeforDAO/contracts" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Solidity smart contracts of CodeforDAO. Contribute to CodeforDAO/contracts development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - CodeforDAO/contracts: Solidity smart contracts of CodeforDAO&quot;,&quot;author_name&quot;:&quot;CodeforDAO&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/CodeforDAO/contracts&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png&quot;,&quot;author_url&quot;:&quot;https://github.com/CodeforDAO&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/CodeforDAO/contracts" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - CodeforDAO/contracts: Solidity smart contracts of CodeforDAO</h2><p>Solidity smart contracts of CodeforDAO. Contribute to CodeforDAO/contracts development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png"/></div></a></div></div><hr><h2 id="h-3-yuan" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">3. 开发工作流与单元测试</h2><p>当我们掌握编写智能合约的编程语言后，便可以开始进行工程编码，在这一章节中，我会介绍流行的 DApp 合约开发工作流和编写单元测试的方法。</p><p>智能合于自 2017 年发展至今，已存在相当多的项目支撑合约开发中的工作流，如今，大部分项目使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hardhat.org/">Hardhat</a> 来支持本地开发工作流。</p><div data-type="embedly" src="https://hardhat.org/" data="{&quot;provider_url&quot;:&quot;https://hardhat.org&quot;,&quot;description&quot;:&quot;Hardhat is an Ethereum development environment. Compile your contracts and run them on a development network. Get Solidity stack traces, console.log and more.&quot;,&quot;title&quot;:&quot;Hardhat | Ethereum development environment for professionals by Nomic Foundation&quot;,&quot;mean_alpha&quot;:252.67797619,&quot;thumbnail_width&quot;:2400,&quot;url&quot;:&quot;https://hardhat.org/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Hardhat&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1260,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1260,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://hardhat.org/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Hardhat | Ethereum development environment for professionals by Nomic Foundation</h2><p>Hardhat is an Ethereum development environment. Compile your contracts and run them on a development network. Get Solidity stack traces, console.log and more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://hardhat.org</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png"/></div></a></div></div><p>Hardhat 提供了一种简单的方式创建本地 EVM 兼容区块链开发的环境，并且支持直观的 debug 方式，此外，还有丰富的插件社区，帮助开发者完成一系列特定的需求。</p><p>依赖 Hardhat，我们可以在本地创建 block 快速确认的开发环境，使用公开私钥的调试钱包作为测试用户，编译合约并发布到本地测试网络，编写并在内存网络中快速运行单元测试，如果你是 DApp 开发的入门新手，使用 Hardhat 是作为工作流最简单和直接的方案。</p><p>Hardhat 还支持配置不同的区块链网络并通过工作流部署合约到生产环境，或者将某个高度的区块链 fork 到本地创建集成测试环境。它提供丰富齐全的文档，可以在他们的官网进行参考。</p><h3 id="h-31-hardhat" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.1 整合 Hardhat 工作流</h3><p>有两种方法可以简单将 Hardhat 整合到你的合约项目，最简单的方法是采用 <code>npx hardhat</code> 向导，它会帮助你在本地建立一个特定的脚手架项目并安装对应依赖。</p><p>如果你打算在已经初始化的项目中引入 hardhat 工作流，手动的方式是新建一个配置文件 <code>hardhat.config.js</code> 并安装对应依赖 <code>npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers</code></p><p>hardhat 工作流非常简单，我们不需要花太多时间理解它，对于前端工程师而言，它就像是智能合约领域中的 Webpack（但没有 Webpack 的配置那么复杂）它预设了一系列的 task（任务）帮助你将 Sol 文件编译为字节码并输出对应的 ABI 到本地，当然，它也帮助你整合单元测试环境并运行测试。</p><p><strong>Hardhat 任务：</strong></p><p>对于一般的合约开发而言，常用的任务是：</p><ul><li><p><code>npx hardhat node</code> 运行一个本地区块链节点并将 JSON-RPC endpoint 暴露给客户端。</p></li><li><p><code>npx hardhat test</code> 运行合约的单元测试。</p></li><li><p><code>npx hardhat deploy</code> 发布合约的字节码到某个区块链网络，网络地址和 deployer 账户，这些我们可以在 <code>hardhat.config.js</code> 文件中配置。</p></li></ul><p><strong>整合插件：</strong></p><p>hardhat 工作流还支持插件机制，插件能够将特定逻辑作为 hook function （钩子函数）插入到对应的 task（任务）当中，所以，当我们执行某个任务时，需要确认它是否依赖了某个插件，否则它可能有与预期不同的行为。</p><p>引入插件的方式是，首先使用 npm 安装这个插件，再于 <code>hardhat.config.js</code> 配置文件头部引入即可。</p><p><strong>HRE 运行环境变量：</strong></p><p>当我们在 JS 文件中引入 hardhat 时，HRE 会被插入运行环境。一些插件可能会拓展 HRE，将他们的实用函数方法插入到 HRE 中，类似地，我们也可以使用这种方法构建特定的 hardhat 插件。但一般来说，我们不需要这么做。</p><p>HRE 会在我们执行 <code>npx hardhat run</code> 任务时被自动插入到全局变量中去，我们可以通过这种方法编写某些简单的合约发布脚本或合约交互脚本。</p><h3 id="h-32-yuan" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.2 单元测试</h3><p>编写合约的第二步是编写合约的单元测试。当我们运行 <code>npx hardhat test</code> 任务时，hardhat 会自动寻找 <code>./test</code> 文件夹下的单元测试并运行它们。这个默认的地址可以在 <code>hardhat.config.js</code> 配置文件中使用 <code>path.tests</code> 修改：</p><pre data-type="codeBlock" text="// Rewrite the `./test` folder to `./tests`
paths: {
  tests: &apos;./tests&apos;,
},
"><code>// Rewrite the `./test` folder <span class="hljs-selector-tag">to</span> `./tests`
paths: {
  tests: <span class="hljs-string">'./tests'</span>,
},
</code></pre><p>运行测试所需要安装的依赖可以在这个指南上找到：</p><div data-type="embedly" src="https://hardhat.org/guides/waffle-testing.html" data="{&quot;provider_url&quot;:&quot;https://hardhat.org&quot;,&quot;description&quot;:&quot;Redirecting to Hardhat 2&apos;s documentation, the previous version of Hardhat&quot;,&quot;title&quot;:&quot;Redirecting to Hardhat 2&apos;s docs | Ethereum development environment for professionals by Nomic Foundation&quot;,&quot;mean_alpha&quot;:252.67797619,&quot;thumbnail_width&quot;:2400,&quot;url&quot;:&quot;https://hardhat.org/hardhat2/redirect&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Hardhat&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1260,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1260,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://hardhat.org/guides/waffle-testing.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Redirecting to Hardhat 2&#x27;s docs | Ethereum development environment for professionals by Nomic Foundation</h2><p>Redirecting to Hardhat 2&#x27;s documentation, the previous version of Hardhat</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://hardhat.org</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5dc6911b006eba38291e7dd037f1e1e0526372da0e85f9fa27b1eeabb81c0381.png"/></div></a></div></div><p>与传统的单元测试一样，使用 <code>Mocha</code> 作为单元测试框架。对于合约特定的变量类型，我们使用 <code>Waffle</code> 和 <code>chai</code> 作为断言库。</p><p>一般来说，我们在 <code>hardhat.config.js</code> 配置文件头部引入测试辅助插件 <code>@nomiclabs/hardhat-waffle</code> 可以帮助我们解决大部分问题，而不需要额外手动安装 mocha, waffle 和 chai 并进行配置，与前一小节所提到的 HRE 相关，它们会被自动插入 HRE 运行环境。</p><p>关于合约事件，合约方法调用，BigNumber 等完整的断言库范例可以在这个文档中找到：</p><div data-type="embedly" src="https://ethereum-waffle.readthedocs.io/en/latest/matchers.html" data="{&quot;provider_url&quot;:&quot;https://ethereum-waffle.readthedocs.io&quot;,&quot;description&quot;:&quot;A set of sweet chai matchers, makes your test easy to write and read. Before you can start using the matchers, you have to tell chai to use the solidity plugin:&quot;,&quot;title&quot;:&quot;Chai matchers - waffle documentation&quot;,&quot;url&quot;:&quot;https://ethereum-waffle.readthedocs.io/en/latest/matchers.html&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Ethereum-waffle&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://ethereum-waffle.readthedocs.io/en/latest/matchers.html" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Chai matchers - waffle documentation</h2><p>A set of sweet chai matchers, makes your test easy to write and read. Before you can start using the matchers, you have to tell chai to use the solidity plugin:</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://ethereum-waffle.readthedocs.io</span></div></div></a></div></div><blockquote><p>注意：合约的单元测试中可以使用 <code>contractInstance.connect(signer)</code> 来随意改变调用合约的外部账户。</p></blockquote><h3 id="h-33" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.3 改善测试效率</h3><p>编写单元测试首先需要我们在测试钩子中编写发布合约的代码，这意味着，我们需要在每次 <code>beforeEach</code> 钩子中重新发布我们的合约并使其从零状态开始运行。</p><p>即使 hardhat 支持在内存中运行区块链并整合了单元测试流程，但这样反复的发布合约也会极大拖慢测试速度。</p><p>因此，就单元测试的最佳实践，我向大家推荐 <code>hardhat-deploy</code> 插件。</p><p><code>hardhat-deploy</code> 插件支持使用 <code>evm_snapshot</code> 快速地跳转到某个高度的区块链状态，因此，我们可以使用它在单元测试中维护测试前、中、后以及各种特定高度状态，极大地加快测试速度。</p><div data-type="embedly" src="https://github.com/wighawag/hardhat-deploy" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;hardhat deployment plugin. Contribute to wighawag/hardhat-deploy development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - wighawag/hardhat-deploy: hardhat deployment plugin&quot;,&quot;mean_alpha&quot;:0,&quot;author_name&quot;:&quot;wighawag&quot;,&quot;thumbnail_width&quot;:1280,&quot;url&quot;:&quot;https://github.com/wighawag/hardhat-deploy&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5f5ee950c52f4b017171ec801469460e0844ab1097f834f0e321bf71c4b3488f.png&quot;,&quot;author_url&quot;:&quot;https://github.com/wighawag&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:640,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1280,&quot;height&quot;:640,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5f5ee950c52f4b017171ec801469460e0844ab1097f834f0e321bf71c4b3488f.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5f5ee950c52f4b017171ec801469460e0844ab1097f834f0e321bf71c4b3488f.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/wighawag/hardhat-deploy" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - wighawag/hardhat-deploy: hardhat deployment plugin</h2><p>hardhat deployment plugin. Contribute to wighawag/hardhat-deploy development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5f5ee950c52f4b017171ec801469460e0844ab1097f834f0e321bf71c4b3488f.png"/></div></a></div></div><blockquote><p>注意，引入 <code>hardhat-deploy</code> 插件，需要修改对应的 <code>@nomiclabs/hardhat-ethers</code> 插件来源，这可能会导致在未来的 <code>npm install</code> 中带来版本冲突，如果你遇到了版本冲突，可以使用 <code>npm install --force</code> 跳过版本依赖检查，强制安装两者。</p></blockquote><pre data-type="codeBlock" text="&quot;devDependencies&quot;: {
    &quot;@nomiclabs/hardhat-ethers&quot;: &quot;npm:hardhat-deploy-ethers&quot;,
    &quot;hardhat-deploy&quot;: &quot;^0.11.2&quot;,
    ...
}
"><code><span class="hljs-string">"devDependencies"</span>: {
    <span class="hljs-string">"@nomiclabs/hardhat-ethers"</span>: <span class="hljs-string">"npm:hardhat-deploy-ethers"</span>,
    <span class="hljs-string">"hardhat-deploy"</span>: <span class="hljs-string">"^0.11.2"</span>,
    ...
}
</code></pre><p>简单来说，在单元测试中，我们可以使用：</p><pre data-type="codeBlock" text="await deployments.fixture([&apos;SomeContractName&apos;]);
"><code>await deployments.fixture([<span class="hljs-string">'SomeContractName'</span>]);
</code></pre><p>来确保在测试执行前跳回某个状态。如果你需要更加复杂和自定义的 fixture（而非直接跳回某个合约发布后的干净状态）可以使用 <code>deployments.createFixture</code> 来创建自定义 fixture，具体的范例代码和指南可以在这里寻找到：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/CodeforDAO/contracts/blob/main/utils/helpers.js#L42">https://github.com/CodeforDAO/contracts/blob/main/utils/helpers.js#L42</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/wighawag/hardhat-deploy#creating-fixtures">https://github.com/wighawag/hardhat-deploy#creating-fixtures</a></p><p>值得注意的是，使用 <code>hardhat-deploy</code> 插件会同时改变我们发布合约的代码逻辑（正如其名）它支持在 <code>./deploy</code> 文件夹下编写每个合约的发布脚本。事实上，默认的 <code>deployments.fixture</code> 正会退回这些发布脚本所叙述的合约状态。</p><p>不同于 hardhat 默认的发布脚本（使用 <code>npx hardhat run</code>）我们可以使用 <code>hardhat-deploy</code> 插件提供的功能在发布脚本中做更多工作，例如使用 <code>execute</code> 函数立即修改发布后的合约状态，这会在对权限敏感的合约当中非常有用：</p><pre data-type="codeBlock" text="const { deploy, execute } = deployments;
const shareGovernor = await deploy(&apos;ShareGovernor&apos;, {
    contract: &apos;TreasuryGovernor&apos;,
    from: deployer,
    args: [name + &apos;-ShareGovernor&apos;, share.address, treasury.address, settings.share.governor],
    log: true,
  });

  // Setup governor roles
  // Both membership and share governance have PROPOSER_ROLE by default
  await execute(
    &apos;Treasury&apos;,
    { from: deployer },
    &apos;grantRole&apos;,
    PROPOSER_ROLE,
    membershipGovernor.address
  );
"><code><span class="hljs-keyword">const</span> { deploy, execute } = deployments;
<span class="hljs-keyword">const</span> <span class="hljs-variable constant_">shareGovernor</span> = await <span class="hljs-title function_ invoke__">deploy</span>(<span class="hljs-string">'ShareGovernor'</span>, {
    <span class="hljs-attr">contract</span>: <span class="hljs-string">'TreasuryGovernor'</span>,
    <span class="hljs-attr">from</span>: deployer,
    <span class="hljs-attr">args</span>: [name + <span class="hljs-string">'-ShareGovernor'</span>, share.address, treasury.address, settings.share.governor],
    <span class="hljs-attr">log</span>: <span class="hljs-literal">true</span>,
  });

  <span class="hljs-comment">// Setup governor roles</span>
  <span class="hljs-comment">// Both membership and share governance have PROPOSER_ROLE by default</span>
  await <span class="hljs-title function_ invoke__">execute</span>(
    <span class="hljs-string">'Treasury'</span>,
    { <span class="hljs-attr">from</span>: deployer },
    <span class="hljs-string">'grantRole'</span>,
    PROPOSER_ROLE,
    membershipGovernor.address
  );
</code></pre><p>除此之外，<code>hardhat-deploy</code> 插件还提供了非常多的 HRE 实用函数，例如<code>getNamedAccounts</code> 能帮助我们命名本地测试账户，而非使用数组下标访问它们。你可以参考该插件的 GitHub 主页了解这些实用功能。</p><h3 id="h-34-gas" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.4 测试覆盖率与 Gas 报告</h3><p>当合约的单元测试编码到一定程度之后，我们会希望这些合约被发布到某个测试或生产环境（例如测试网络或 ETH 主网）时是否是健壮和低成本的，在此时，我向你推荐两个 hardhat 插件 <code>hardhat-gas-reporter</code> 与 <code>solidity-coverage</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/ab261790e6f4bc02cf0f7f41aeb616d68bd9833b7d581980207a9862ce24be35.png" alt="hardhat-gas-reporter" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">hardhat-gas-reporter</figcaption></figure><p><code>hardhat-gas-reporter</code> 插件帮助你了解运行单元测试中部署和执行合约方法消耗的 gas 费用，如果在本地环境变量中提供 <code>COINMARKETCAP_API_KEY</code>，它会自动将这些成本折算为美元或其他法币计价。</p><div data-type="embedly" src="https://github.com/cgewecke/hardhat-gas-reporter" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Gas Usage Analytics for Hardhat. Contribute to cgewecke/hardhat-gas-reporter development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - cgewecke/hardhat-gas-reporter: Gas Usage Analytics for Hardhat&quot;,&quot;author_name&quot;:&quot;cgewecke&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/cgewecke/hardhat-gas-reporter&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3e9b121a46d05bf11b93d5ce497843c98cd3abd56b8fee3b73d74ca9d567f2a2.png&quot;,&quot;author_url&quot;:&quot;https://github.com/cgewecke&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3e9b121a46d05bf11b93d5ce497843c98cd3abd56b8fee3b73d74ca9d567f2a2.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3e9b121a46d05bf11b93d5ce497843c98cd3abd56b8fee3b73d74ca9d567f2a2.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/cgewecke/hardhat-gas-reporter" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - cgewecke/hardhat-gas-reporter: Gas Usage Analytics for Hardhat</h2><p>Gas Usage Analytics for Hardhat. Contribute to cgewecke/hardhat-gas-reporter development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3e9b121a46d05bf11b93d5ce497843c98cd3abd56b8fee3b73d74ca9d567f2a2.png"/></div></a></div></div><p><code>solidity-coverage</code> 插件提供单元测试覆盖率报告，这有助于开发团队理解合约是否得到了应有的测试。</p><div data-type="embedly" src="https://github.com/sc-forks/solidity-coverage" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Code coverage for Solidity smart-contracts . Contribute to sc-forks/solidity-coverage development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - sc-forks/solidity-coverage: Code coverage for Solidity smart-contracts&quot;,&quot;author_name&quot;:&quot;sc-forks&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/sc-forks/solidity-coverage&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/28b58dcdd8992c741e74d27e1cd8f5e498715fce61bcab09df5ab690a80c5e87.png&quot;,&quot;author_url&quot;:&quot;https://github.com/sc-forks&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/28b58dcdd8992c741e74d27e1cd8f5e498715fce61bcab09df5ab690a80c5e87.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/28b58dcdd8992c741e74d27e1cd8f5e498715fce61bcab09df5ab690a80c5e87.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/sc-forks/solidity-coverage" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - sc-forks/solidity-coverage: Code coverage for Solidity smart-contracts</h2><p>Code coverage for Solidity smart-contracts . Contribute to sc-forks/solidity-coverage development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/28b58dcdd8992c741e74d27e1cd8f5e498715fce61bcab09df5ab690a80c5e87.png"/></div></a></div></div><h3 id="h-35" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.5 其他实用插件</h3><p>如前所述，hardhat 并不需要以来太多的插件就可以正常工作，满足大部分合约开发团队的需求，我在这里推荐两个其他的使用插件，他们是 <code>@nomiclabs/hardhat-etherscan</code> 和 <code>@tenderly/hardhat-tenderly</code></p><p>这些插件都是可选的，并依赖第三方服务的 API Key，各位读者可以根据自己的情况选择是否使用他们。</p><p><code>hardhat-etherscan</code> 插件将 etherscan 网站的源码 verify 功能整合到发布工作流中，能够将所发布合约的源码和 ABI 都展示在合约地址页面。</p><div data-type="embedly" src="https://github.com/NomicFoundation/hardhat" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. - GitHub - NomicFoundation/hardhat: Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.&quot;,&quot;title&quot;:&quot;GitHub - NomicFoundation/hardhat: Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.&quot;,&quot;author_name&quot;:&quot;NomicFoundation&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/NomicFoundation/hardhat&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1fd59b264b2e5d5e137f535c96d5628c352da35e900ecb83a9893bea96ec2b61.png&quot;,&quot;author_url&quot;:&quot;https://github.com/NomicFoundation&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1fd59b264b2e5d5e137f535c96d5628c352da35e900ecb83a9893bea96ec2b61.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1fd59b264b2e5d5e137f535c96d5628c352da35e900ecb83a9893bea96ec2b61.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/NomicFoundation/hardhat" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - NomicFoundation/hardhat: Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.</h2><p>Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. - GitHub - NomicFoundation/hardhat: Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1fd59b264b2e5d5e137f535c96d5628c352da35e900ecb83a9893bea96ec2b61.png"/></div></a></div></div><p><code>hardhat-tenderly</code> 插件整合了 Tenderly 工作流，后者是一个新兴的 CI/监控 平台，能够帮助我们监控线上合约的状态并提供 debug 建议。</p><div data-type="embedly" src="https://tenderly.co/" data="{&quot;provider_url&quot;:&quot;https://tenderly.co&quot;,&quot;description&quot;:&quot;Integrate a complete, full-stack Web3 infrastructure solution for the entire dapp lifecycle, from development to on-chain scaling. Sign up now!&quot;,&quot;title&quot;:&quot;Full-Stack Web3 Infrastructure Platform | Tenderly&quot;,&quot;mean_alpha&quot;:63.8416666667,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://tenderly.co&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9f0b35e98bbb748d048c981e2b07c68a7ed1d76c7f3be2f4e019a9d082035b3f.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Tenderly&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9f0b35e98bbb748d048c981e2b07c68a7ed1d76c7f3be2f4e019a9d082035b3f.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9f0b35e98bbb748d048c981e2b07c68a7ed1d76c7f3be2f4e019a9d082035b3f.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://tenderly.co/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Full-Stack Web3 Infrastructure Platform | Tenderly</h2><p>Integrate a complete, full-stack Web3 infrastructure solution for the entire dapp lifecycle, from development to on-chain scaling. Sign up now!</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://tenderly.co</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9f0b35e98bbb748d048c981e2b07c68a7ed1d76c7f3be2f4e019a9d082035b3f.png"/></div></a></div></div><div data-type="embedly" src="https://github.com/Tenderly/hardhat-tenderly" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Tenderly plugin for HardHat. Contribute to Tenderly/hardhat-tenderly development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - Tenderly/hardhat-tenderly: Tenderly plugin for HardHat&quot;,&quot;author_name&quot;:&quot;Tenderly&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/Tenderly/hardhat-tenderly&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b042703d7517e607654205517d8659797e0d62c20aef04b19d6bafda36ec9940.png&quot;,&quot;author_url&quot;:&quot;https://github.com/Tenderly&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b042703d7517e607654205517d8659797e0d62c20aef04b19d6bafda36ec9940.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b042703d7517e607654205517d8659797e0d62c20aef04b19d6bafda36ec9940.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/Tenderly/hardhat-tenderly" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - Tenderly/hardhat-tenderly: Tenderly plugin for HardHat</h2><p>Tenderly plugin for HardHat. Contribute to Tenderly/hardhat-tenderly development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b042703d7517e607654205517d8659797e0d62c20aef04b19d6bafda36ec9940.png"/></div></a></div></div><h3 id="h-36-foundry" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.6 更快的工作流方案：Foundry</h3><p>尽管在过去的三年中 hardhat 逐渐垄断了 EVM 兼容链中的智能合约开发工作流市场，但最近也有很多强有力的竞争者出现，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://book.getfoundry.sh/index.html">Foundry</a> 就是其中之一：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://book.getfoundry.sh/index.html">Foundry</a> 由 Rust 语言编写，并在很多方面极大地提升了合约单元测试的运行效率：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/69840489a19047ae0d2679a9d6bf31a4d19596fbb3e8294dc96b2434a45d788f.png" alt="Forge VS Harhat" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Forge VS Harhat</figcaption></figure><p>Foundry 由它的命令行工具 <code>Forge</code> 与 <code>cast</code> 组成，前者帮助我们安装第三方依赖组件（使用 git submodule 方式）运行测试，发布合约，后者帮助我们与合约进行 RPC 通信交互。</p><p>同时，它也改变了我们编写测试的方法，让开发者可以直接编写 Sol 而不再依赖 JavaScript 就可以编写合约的单元测试，测试文件与合约源码在同一个文件夹中管理，通常以 <code>ContractName.t.Sol</code> 特殊后缀结尾。</p><p>它也提供了一系列的测试套件工具帮助我们编写基于 Sol 的单元测试，包括可继承的 <code>Test</code> 合约，和一个特殊的，与 vm 通信的合约 <code>Cheatcodes</code> 帮助我们改变外部调用者地址，进行错误断言等等功能。</p><p>如果你对 Foundry 感兴趣，我推荐你阅读他们的文档，它的学习曲线并不陡峭，但考虑到使用它会改变绝大部分智能合约项目的开发流程，我推荐你在本地分支中支持它并同时兼容 hardhat 工作流。</p><div data-type="embedly" src="https://book.getfoundry.sh/" data="{&quot;provider_url&quot;:&quot;https://getfoundry.sh&quot;,&quot;description&quot;:&quot;Foundry is a smart contract development toolchain. It manages your dependencies, compiles your project, runs tests, deploys, and lets you interact with the chain from the command-line and via Solidity scripts.&quot;,&quot;title&quot;:&quot;foundry - Ethereum Development Framework&quot;,&quot;thumbnail_width&quot;:2048,&quot;url&quot;:&quot;https://getfoundry.sh/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f5218203a84746e82284d272ae46e1dbb6188972bd03a1f5d9e1995d5c9d7669.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Getfoundry&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1032,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:2048,&quot;height&quot;:1032,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f5218203a84746e82284d272ae46e1dbb6188972bd03a1f5d9e1995d5c9d7669.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f5218203a84746e82284d272ae46e1dbb6188972bd03a1f5d9e1995d5c9d7669.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://book.getfoundry.sh/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>foundry - Ethereum Development Framework</h2><p>Foundry is a smart contract development toolchain. It manages your dependencies, compiles your project, runs tests, deploys, and lets you interact with the chain from the command-line and via Solidity scripts.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://getfoundry.sh</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f5218203a84746e82284d272ae46e1dbb6188972bd03a1f5d9e1995d5c9d7669.png"/></div></a></div></div><hr><h2 id="h-4" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">4. 前端与客户端开发</h2><p>由于第三方钱包软件的盛行，Web3 大部分产品（DApp）的用户节目实际上都由前端网页所构成，这与移动互联网的开发流程相悖，但很像早期 Web2.0 历史发展进程的一部分。</p><p>许多 DApp 并不提供 Mobile App 版本，部分原因是由于构建一个跨平台钱包方案过于复杂，以及大部分 Web3 领域内的用户都在使用诸如 MetaMask 这类浏览器插件钱包，而它的移动端 App 体验并不好用。</p><p>我们当然可以使用托管钱包服务来进行开发，让更多不熟悉 Web3 的用户使用邮箱或者密码登录，但这会带来一系列的安全问题与风险，况且，就算我们能够使用简单易用的钱包降低用户准入门槛，在许多国家，用户仍需要复杂的 kyc 才能获取到某些 token。</p><p>所以，我建议你也采用 Web 前端作为第一个 DApp 的界面方案。</p><p>在本章节，我们所涉及到的大部分内容都是基于这样的假设，因此，这部分内容需要你熟悉 JavaScript，React.js/Vue.js 和它们相关的工作流。</p><h3 id="h-41" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4.1 前端框架的选择</h3><p>使用何种视图框架并不会影响你的 DApp 体验，但是，这会影响到开发效率。</p><p>在本文的第一部分「认识 DApp 技术栈」我们介绍了 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ethers.io/v5/">ethers.js</a> 和 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://web3js.readthedocs.io/">web3.js</a>，这两者都是构建 Web 前端的基础类库。如上所述，我建议使用 ethers.js 入门进行开发。</p><p>事实上，相较于 Vue 而言，React 的生态系统中目前拥有较多的活跃 Web3 开发者和相关依赖库，如果你没有特殊的偏好，可以尝试先采用 React 作为框架来进行开发。</p><p>另外，大部分对于 ethers.js/web3.js 的包装项目，诸如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NoahZinsmeister/web3-react">web3-react</a>，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/tmm/wagmi">wagmi</a> 等都依赖你理解 React hooks 的概念，所以在你着手进行编码之前，需要查阅<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh-hans.reactjs.org/docs/hooks-intro.html">它的文档</a>。</p><h3 id="h-42" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4.2 搭建脚手架项目</h3><p>我们可以使用任何蓝图工具创建对应的视图框架的脚手架项目，但是，我们也可以参考现有的 Web App 项目来进行开发。</p><p>在编写前端代码之前，我推荐你参考流行的脚手架项目 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/scaffold-eth/scaffold-eth">scaffold-eth</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/scaffold-eth/scaffold-eth">scaffold-eth</a> 是一个完整的合约脚手架，它的 <code>packages/react-app</code> 文件夹是它的 Web 前端代码，对于熟练合约开发的工程师而言，这个脚手架的组织方式有些不太理想，但对于刚入门 Web3，打算搭建第一个测试项目的朋友来说，这是个很棒的入门工具。</p><div data-type="embedly" src="https://github.com/scaffold-eth/scaffold-eth" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;🏗 forkable Ethereum dev stack focused on fast product iterations - GitHub - scaffold-eth/scaffold-eth: 🏗 forkable Ethereum dev stack focused on fast product iterations&quot;,&quot;title&quot;:&quot;GitHub - scaffold-eth/scaffold-eth: 🏗 forkable Ethereum dev stack focused on fast product iterations&quot;,&quot;mean_alpha&quot;:98.4641823444,&quot;author_name&quot;:&quot;scaffold-eth&quot;,&quot;thumbnail_width&quot;:1201,&quot;url&quot;:&quot;https://github.com/scaffold-eth/scaffold-eth&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b39b9fbd609067a7a31c338fbd484b407432d9e34fd8ec28e3c426b6f0907093.png&quot;,&quot;author_url&quot;:&quot;https://github.com/scaffold-eth&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:691,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1201,&quot;height&quot;:691,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b39b9fbd609067a7a31c338fbd484b407432d9e34fd8ec28e3c426b6f0907093.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b39b9fbd609067a7a31c338fbd484b407432d9e34fd8ec28e3c426b6f0907093.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/scaffold-eth/scaffold-eth" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - scaffold-eth/scaffold-eth: 🏗 forkable Ethereum dev stack focused on fast product iterations</h2><p>🏗 forkable Ethereum dev stack focused on fast product iterations - GitHub - scaffold-eth/scaffold-eth: 🏗 forkable Ethereum dev stack focused on fast product iterations</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b39b9fbd609067a7a31c338fbd484b407432d9e34fd8ec28e3c426b6f0907093.png"/></div></a></div></div><p>当我们决定了使用何种视图框架来开发前端 Web App 之后，就可以着手使用它对应的脚手架 cli 来创建项目了。对于没有任何偏好的读者，我推荐你使用 React + Next.js 来初始化新项目，Next.js 使用 React 作为基础视图框架，并提供了丰富的工作流，简单的路由系统，好用的 SSR 与 FaaS 支持，当然，它也是一个非常好用 site builder 工具。</p><div data-type="embedly" src="https://nextjs.org/" data="{&quot;provider_url&quot;:&quot;https://nextjs.org&quot;,&quot;description&quot;:&quot;Production grade React applications that scale. The world&apos;s leading companies use Next.js by Vercel to build static and dynamic websites and web applications.&quot;,&quot;title&quot;:&quot;Next.js by Vercel - The React Framework&quot;,&quot;mean_alpha&quot;:251.21890625,&quot;thumbnail_width&quot;:2800,&quot;url&quot;:&quot;https://nextjs.org/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/717caeead287123ffce00f654befa210dbd466dcbbe0efe835119c0e81235e27.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Nextjs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:2800,&quot;height&quot;:1600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/717caeead287123ffce00f654befa210dbd466dcbbe0efe835119c0e81235e27.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/717caeead287123ffce00f654befa210dbd466dcbbe0efe835119c0e81235e27.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://nextjs.org/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Next.js by Vercel - The React Framework</h2><p>Production grade React applications that scale. The world&#x27;s leading companies use Next.js by Vercel to build static and dynamic websites and web applications.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://nextjs.org</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/717caeead287123ffce00f654befa210dbd466dcbbe0efe835119c0e81235e27.png"/></div></a></div></div><h3 id="h-43" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4.3 前端与合约的交互流程</h3><p>当我们在 DApp 的业务逻辑编码进行到一定程度后，需要与合约 ABI 进行读写，或者，我们需要连接用户的钱包，为其铸造一个 NFT，这里就涉及到前端与合约的交互。</p><p>在本文的第一章节「认识 DApp 技术栈」中，我们提到与区块链网络进行交互最终会使用 <code>Provider/Signer</code>（前端） + <code>Relay Network</code>（区块链端）因此，这个流程最终会使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ethers.io/v5/">ethers.js</a> 或 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://web3js.readthedocs.io/">web3.js</a> 发送对应的 XHR 请求到 Relay Network 的 API Endpoint。但是，具体而言，开发者和用户如何理解这一与众不同的流程呢？</p><p>一般来说，我们可以将这个交互流程简述为：</p><ol><li><p>用户打开网页，默认进入只读模式。我们只能通过 <code>Provider + Relay Network</code> 访问到我们所设定的默认网络的合约的 <code>view</code> 方法返回值。</p></li><li><p>用户点击「连接钱包」时，我们和对应的 <code>connector</code> 进行通信，获取连接状态。如果用户授权连接，我们可以通过 <code>connector</code> 获取到用户钱包的地址（<code>0x</code>）在此之后，用户钱包的 <code>Provider</code>只读模式将只支持用户钱包中选定的网络，如果网络不符合我们的期望，我们可以通过 <code>connector</code> 的特定通信来请求用户修改它。</p></li><li><p>用户点击某个表单，希望与合约的写操作函数进行交互。此时， <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ethers.io/v5/">ethers.js</a> 或 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://web3js.readthedocs.io/">web3.js</a> 会将交易信息打包发给 <code>connector</code>，后者将引导用户进行签名和确认交易的操作。如果交易成功提交到区块链网络（经由我们配置的 <code>Relay Network</code>）我们需要监听该交易的状态和合约事件，进行下一步前端状态更新。</p></li><li><p>用户进行钱包登录操作或其他签名操作时，我们可以不与合约通信仅在本地请求 <code>connector</code>来发行使用用户钱包私钥签名后的加密数据。</p></li></ol><p>在进行以上所述的流程之前，我们需要回顾 「认识 DApp 技术栈」中的内容，并且准备好 <code>Relay Network</code>的 access key，无论操作是读或者写，我们都需要准备这些 access key 才能为用户提供高质量和稳定的请求访问。</p><p>我们可以通过提供多个 Provider 实体的方式来访问多个区块链网络的合约 ABI，但一般而言，我们只能依赖 <code>connector</code>中用户选定的网络来进行写操作。</p><p>对于合约多个 ABI 的写操作可以合并请求，这样可以减少用户在进行操作时的 Gas 费用，如果你有这个需求，可以参考 Multicall.js 的实现：</p><div data-type="embedly" src="https://github.com/makerdao/multicall.js" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Multicall.js: A JavaScript blockchain state management library for dapps - sky-ecosystem/multicall.js&quot;,&quot;title&quot;:&quot;GitHub - sky-ecosystem/multicall.js: Multicall.js: A JavaScript blockchain state management library for dapps&quot;,&quot;url&quot;:&quot;https://github.com/sky-ecosystem/multicall.js&quot;,&quot;author_name&quot;:&quot;sky-ecosystem&quot;,&quot;thumbnail_width&quot;:1200,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e939dae9e9bef40dc39bf2127c4e0d9c47b442dfe21b62874b1c5417e02626c8.png&quot;,&quot;author_url&quot;:&quot;https://github.com/sky-ecosystem&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e939dae9e9bef40dc39bf2127c4e0d9c47b442dfe21b62874b1c5417e02626c8.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e939dae9e9bef40dc39bf2127c4e0d9c47b442dfe21b62874b1c5417e02626c8.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/makerdao/multicall.js" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - sky-ecosystem/multicall.js: Multicall.js: A JavaScript blockchain state management library for dapps</h2><p>Multicall.js: A JavaScript blockchain state management library for dapps - sky-ecosystem/multicall.js</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e939dae9e9bef40dc39bf2127c4e0d9c47b442dfe21b62874b1c5417e02626c8.png"/></div></a></div></div><h3 id="h-44" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4.4 前端依赖</h3><p>大量的重复工作都建立在优秀的开源项目基础上，在 DApp 编写过程中，我推荐你使用一些优秀的前端库来减少工作量，并实现更好的代码交付质量。</p><p>wagmi 是我推荐的核心依赖之一，它提供了丰富的 React hooks 来完成 DApp Web 前端与合约交互的所有流程。它的实现简单，测试健全，而且没有多余的冗余依赖库。</p><div data-type="embedly" src="https://github.com/tmm/wagmi" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Reactive primitives for Ethereum apps. Contribute to wevm/wagmi development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - wevm/wagmi: Reactive primitives for Ethereum apps&quot;,&quot;author_name&quot;:&quot;wevm&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/wevm/wagmi&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png&quot;,&quot;author_url&quot;:&quot;https://github.com/wevm&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/tmm/wagmi" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - wevm/wagmi: Reactive primitives for Ethereum apps</h2><p>Reactive primitives for Ethereum apps. Contribute to wevm/wagmi development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7b50c57147a1099621a5de830089a9798c850193c6c8106bb5585dc236b4a87b.png"/></div></a></div></div><p>谈到 React hooks，我也推荐 useDApp，相比于 wagmi，它更加复杂，但默认支持 multicall.js</p><div data-type="embedly" src="https://github.com/TrueFiEng/useDApp" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Framework for rapid Dapp development. Simple. Robust. Extendable. Testable - TrueFiEng/useDApp&quot;,&quot;title&quot;:&quot;GitHub - TrueFiEng/useDApp: Framework for rapid Dapp development. Simple. Robust. Extendable. Testable&quot;,&quot;author_name&quot;:&quot;TrueFiEng&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/TrueFiEng/useDApp&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9fe08ed2a5cea32fe1e7a030921a0139ec969f34bb7dea3ba8a179a18e285454.png&quot;,&quot;author_url&quot;:&quot;https://github.com/TrueFiEng&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9fe08ed2a5cea32fe1e7a030921a0139ec969f34bb7dea3ba8a179a18e285454.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9fe08ed2a5cea32fe1e7a030921a0139ec969f34bb7dea3ba8a179a18e285454.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/TrueFiEng/useDApp" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - TrueFiEng/useDApp: Framework for rapid Dapp development. Simple. Robust. Extendable. Testable</h2><p>Framework for rapid Dapp development. Simple. Robust. Extendable. Testable - TrueFiEng/useDApp</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9fe08ed2a5cea32fe1e7a030921a0139ec969f34bb7dea3ba8a179a18e285454.png"/></div></a></div></div><p>如果你的网站将要集成钱包登录的功能，那你则需要考虑引入 Siwe（Sign-In with Ethereum）它实现了 EIP-4361 中的钱包登录流程。</p><div data-type="embedly" src="https://github.com/spruceid/siwe" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Sign-In with Ethereum library. Contribute to spruceid/siwe development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - spruceid/siwe: Sign-In with Ethereum library&quot;,&quot;author_name&quot;:&quot;spruceid&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/spruceid/siwe&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/97471d9e92801605d0c7624c098a2b336a36c2c155c68fa9d0455341cedb660c.png&quot;,&quot;author_url&quot;:&quot;https://github.com/spruceid&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/97471d9e92801605d0c7624c098a2b336a36c2c155c68fa9d0455341cedb660c.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/97471d9e92801605d0c7624c098a2b336a36c2c155c68fa9d0455341cedb660c.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/spruceid/siwe" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - spruceid/siwe: Sign-In with Ethereum library</h2><p>Sign-In with Ethereum library. Contribute to spruceid/siwe development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/97471d9e92801605d0c7624c098a2b336a36c2c155c68fa9d0455341cedb660c.png"/></div></a></div></div><p>如果你的 Next.js DApp 计划提供多语言版本和检测，我推荐你使用 <code>i18next</code> 与 <code>react-i18next</code> 与 <code>i18next-browser-languagedetector</code> 这些依赖与 DApp 的核心交互逻辑没有关系，因此不再赘述。</p><p>在 UI 库方面，我推荐基于 Google Materials UI 设计系统的 MUI 与 NextUI：</p><div data-type="embedly" src="https://mui.com/zh/" data="{&quot;provider_url&quot;:&quot;https://mui.com&quot;,&quot;description&quot;:&quot;MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design.&quot;,&quot;title&quot;:&quot;MUI: The React component library you always wanted&quot;,&quot;thumbnail_width&quot;:2560,&quot;url&quot;:&quot;https://mui.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/03ea110c9966abcc15ce85ca3a6529239ded168600de3989ebffffd8b05c2ea0.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Mui&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1280,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:2560,&quot;height&quot;:1280,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/03ea110c9966abcc15ce85ca3a6529239ded168600de3989ebffffd8b05c2ea0.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/03ea110c9966abcc15ce85ca3a6529239ded168600de3989ebffffd8b05c2ea0.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://mui.com/zh/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>MUI: The React component library you always wanted</h2><p>MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://mui.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/03ea110c9966abcc15ce85ca3a6529239ded168600de3989ebffffd8b05c2ea0.jpg"/></div></a></div></div><div data-type="embedly" src="https://nextui.org/" data="{&quot;url&quot;:&quot;https://www.heroui.com/&quot;,&quot;provider_url&quot;:&quot;https://www.heroui.com&quot;,&quot;provider_name&quot;:&quot;Heroui&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"></div><h3 id="h-45" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4.5 客户端开发</h3><p>客户端开发的方案比较多样，流行的方案是 React Native（跨平台）Flutter（跨平台）Swift（iOS）和 Java (Android) 这些方案都有一些流行的依赖库可以借鉴。</p><p>考虑到 React Native（跨平台）的实现，它的依赖库与 React 应当并无差异，可以使用上述针对 React 的方案。</p><p>对于 Flutter（跨平台） 而言，我推荐你参考这一官方指南：</p><div data-type="embedly" src="https://ethereum.org/en/developers/docs/programming-languages/dart/" data="{&quot;provider_url&quot;:&quot;https://ethereum.org&quot;,&quot;description&quot;:&quot;Learn how to develop for Ethereum using the Dart language&quot;,&quot;title&quot;:&quot;Ethereum for Dart developers | ethereum.org&quot;,&quot;thumbnail_width&quot;:1504,&quot;url&quot;:&quot;https://ethereum.org/developers/docs/programming-languages/dart/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a2f4796307f924bab5bfc9c7cc5d2e56c6d4cd00a64075af07b94771f8b35745.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;ethereum.org&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:940,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1504,&quot;height&quot;:940,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a2f4796307f924bab5bfc9c7cc5d2e56c6d4cd00a64075af07b94771f8b35745.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a2f4796307f924bab5bfc9c7cc5d2e56c6d4cd00a64075af07b94771f8b35745.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://ethereum.org/en/developers/docs/programming-languages/dart/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Ethereum for Dart developers | ethereum.org</h2><p>Learn how to develop for Ethereum using the Dart language</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://ethereum.org</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a2f4796307f924bab5bfc9c7cc5d2e56c6d4cd00a64075af07b94771f8b35745.png"/></div></a></div></div><p>其中，我们可以使用 web3dart 来与区块链 Relay 进行通信：</p><div data-type="embedly" src="https://pub.dev/packages/web3dart" data="{&quot;provider_url&quot;:&quot;https://pub.dev&quot;,&quot;description&quot;:&quot;Dart library to connect to Ethereum clients. Send transactions and interact with smart contracts!&quot;,&quot;title&quot;:&quot;web3dart | Dart package&quot;,&quot;thumbnail_width&quot;:1280,&quot;url&quot;:&quot;https://pub.dev/packages/web3dart&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/df900846dbc2dbe3164b5c2682f1321f64950d7819e0126fee85bef622f0c5d0.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Dart packages&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:640,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1280,&quot;height&quot;:640,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/df900846dbc2dbe3164b5c2682f1321f64950d7819e0126fee85bef622f0c5d0.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/df900846dbc2dbe3164b5c2682f1321f64950d7819e0126fee85bef622f0c5d0.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://pub.dev/packages/web3dart" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>web3dart | Dart package</h2><p>Dart library to connect to Ethereum clients. Send transactions and interact with smart contracts!</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://pub.dev</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/df900846dbc2dbe3164b5c2682f1321f64950d7819e0126fee85bef622f0c5d0.png"/></div></a></div></div><p>对于 Swift（iOS）而言，我们可以使用 Argent labs 团队提供的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/argentlabs/web3.swift">web3.swift</a> 方案：</p><div data-type="embedly" src="https://github.com/argentlabs/web3.swift" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Ethereum Swift API with support for smart contracts, ENS &amp; ERC20 - argentlabs/web3.swift&quot;,&quot;title&quot;:&quot;GitHub - argentlabs/web3.swift: Ethereum Swift API with support for smart contracts, ENS &amp; ERC20&quot;,&quot;author_name&quot;:&quot;argentlabs&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/argentlabs/web3.swift&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fb32a9ed927e1937fabb74caf060531ec799d8d296e5951772ccc0fa5a061f84.png&quot;,&quot;author_url&quot;:&quot;https://github.com/argentlabs&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fb32a9ed927e1937fabb74caf060531ec799d8d296e5951772ccc0fa5a061f84.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fb32a9ed927e1937fabb74caf060531ec799d8d296e5951772ccc0fa5a061f84.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/argentlabs/web3.swift" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - argentlabs/web3.swift: Ethereum Swift API with support for smart contracts, ENS &amp; ERC20</h2><p>Ethereum Swift API with support for smart contracts, ENS &amp; ERC20 - argentlabs/web3.swift</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fb32a9ed927e1937fabb74caf060531ec799d8d296e5951772ccc0fa5a061f84.png"/></div></a></div></div><p>对于 Java (Android) 而言，流行的方案之一是 Web3j：</p><div data-type="embedly" src="https://github.com/web3j/web3j" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Lightweight Java and Android library for integration with Ethereum clients - LFDT-web3j/web3j&quot;,&quot;title&quot;:&quot;GitHub - LFDT-web3j/web3j: Lightweight Java and Android library for integration with Ethereum clients&quot;,&quot;mean_alpha&quot;:255,&quot;author_name&quot;:&quot;LFDT-web3j&quot;,&quot;thumbnail_width&quot;:1280,&quot;url&quot;:&quot;https://github.com/LFDT-web3j/web3j&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1f733b77f12f76f8760ea780c37e52862d551b444a7d8c8b6d7d8dba5831a67a.png&quot;,&quot;author_url&quot;:&quot;https://github.com/LFDT-web3j&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:640,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1280,&quot;height&quot;:640,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1f733b77f12f76f8760ea780c37e52862d551b444a7d8c8b6d7d8dba5831a67a.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1f733b77f12f76f8760ea780c37e52862d551b444a7d8c8b6d7d8dba5831a67a.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/web3j/web3j" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - LFDT-web3j/web3j: Lightweight Java and Android library for integration with Ethereum clients</h2><p>Lightweight Java and Android library for integration with Ethereum clients - LFDT-web3j/web3j</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/1f733b77f12f76f8760ea780c37e52862d551b444a7d8c8b6d7d8dba5831a67a.png"/></div></a></div></div><hr><h2 id="h-5" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">5. 开发、测试与生产环境调试</h2><p>与其他软件一样，DApp 在正式上线过程前也会经过几个环节的调试与测试过程。与其他软件不同的时，我们通常无法简单地在本地搭建所有测试环境。</p><h3 id="h-51" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">5.1 开发环境调试</h3><p>在「开发工作流与单元测试」章节中，我们提到使用 <code>hardhat node</code> 能够快速在本地运行一个自动 mining 的区块链调试网络。那么，我们如何将每次修改的合约 ABI 同步给前端项目呢？</p><p>默认地，hardhat 会将编译后的 ABI 文件和合约字节码放在 <code>./artifacts</code> 文件夹，但不包括合约地址，文件组织方式对前端项目也并不友好。</p><p>借助 <code>hardhat-deploy</code> 插件，我们可以简单地使用 <code>--export-all</code> 导出所有被发布的合约 ABI（包含地址信息）为一个完整的 json 文件，例如：</p><pre data-type="codeBlock" text="npx hardhat node --export-all ../website/contracts/localhost.json
"><code>npx hardhat node <span class="hljs-operator">-</span><span class="hljs-operator">-</span>export<span class="hljs-operator">-</span>all ../website<span class="hljs-operator">/</span>contracts<span class="hljs-operator">/</span>localhost.json
</code></pre><p>这个 json 文件的结构看起来是这样：</p><pre data-type="codeBlock" text="{
  &quot;31337&quot;: [
    {
      &quot;name&quot;: &quot;localhost&quot;,
      &quot;chainId&quot;: &quot;31337&quot;,
      &quot;contracts&quot;: {
         &quot;Membership&quot;: { address: &quot;...&quot;, abi: [...] }
         ...
    }
  ]
}
"><code>{
  <span class="hljs-string">"31337"</span>: [
    {
      <span class="hljs-string">"name"</span>: <span class="hljs-string">"localhost"</span>,
      <span class="hljs-string">"chainId"</span>: <span class="hljs-string">"31337"</span>,
      <span class="hljs-string">"contracts"</span>: {
         <span class="hljs-string">"Membership"</span>: { <span class="hljs-keyword">address</span>: <span class="hljs-string">"..."</span>, <span class="hljs-built_in">abi</span>: [...] }
         ...
    }
  ]
}
</code></pre><p>可以看出，它是一个由 Chain ID（31337 是 hardhat Chain ID）索引的合约 ABI 清单，根据这个清单，我们可以很方便的构建出对应的合约实例并与本地合约进行交互。</p><blockquote><p>注意：前端项目与本地合约进行调试时，请特别注意 <code>Provider/Signer</code> 当前连接的网络。另外，默认地，hardhat 网络的区块确认是即时的，如果你需要模仿公开网络的行为，可以在这里寻找到<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hardhat.org/hardhat-network/explanation/mining-modes.html">修改它的配置</a>。</p></blockquote><h3 id="h-52" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">5.2 测试与生产环境调试</h3><p>当我们的合约准备发布到公开测试网络，例如 Rinkeby, Kovan, Ropsten 或者 Goerli 时，我们只需要在 hardhat deploy 中指定对应的 network 选项即可:</p><pre data-type="codeBlock" text="npx hardhat deploy --network rinkeby
"><code>npx hardhat deploy <span class="hljs-operator">-</span><span class="hljs-operator">-</span>network rinkeby
</code></pre><p>需要注意的是，我们需要确保对应的 deployer 钱包账户中有足够的 Gas Token 余额，对于上述网络来说，即是 ETH 余额。</p><p>合约一旦发布到公开网络，它的状态就不受到我们的控制，任何用户都可以根据我们提供的 ABI 修改某个合约的状态，因此，如果你需要稳定的，某种状态的测试合约充当不同版本的测试环境，确保你在发布之前使用了特殊的权限管理或是地址硬编码。</p><p>如果你不想如此麻烦地管理测试网络，我推荐你使用 <code>hardhat node --fork URI</code> 功能在本地计算机或者服务器集群中 fork 主网状态充当测试环境。你可以在这里找到它的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hardhat.org/hardhat-network/guides/mainnet-forking.html">详细指南</a>。</p><p>公开测试环境中的第三方合约状态是未可知的，因此，我们需要再三确认调用的地址是否正确。其次，大部分流行的协议或者 DEX 在几大公开测试网络都提供了测试合约，包括 OpenSea 在内，部分流行的 DApp 前端也提供了测试网络的版本，以帮助开发者在发布到线上网络前发现问题：</p><div data-type="embedly" src="https://testnets.opensea.io/" data="{&quot;provider_url&quot;:&quot;https://support.opensea.io&quot;,&quot;description&quot;:&quot;Testnets are no longer supported on OpenSea&quot;,&quot;title&quot;:&quot;Farewell, Testnets 👋 | OpenSea Help Center&quot;,&quot;thumbnail_width&quot;:800,&quot;url&quot;:&quot;https://support.opensea.io/en/articles/11833955-farewell-testnets&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c0930229b0560bcc523ee5a7bdde2b7eed9341644b1cb3c0b7fbb934ba6c2c20.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Opensea&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:499,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:800,&quot;height&quot;:499,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c0930229b0560bcc523ee5a7bdde2b7eed9341644b1cb3c0b7fbb934ba6c2c20.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c0930229b0560bcc523ee5a7bdde2b7eed9341644b1cb3c0b7fbb934ba6c2c20.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://testnets.opensea.io/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Farewell, Testnets 👋 | OpenSea Help Center</h2><p>Testnets are no longer supported on OpenSea</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://support.opensea.io</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c0930229b0560bcc523ee5a7bdde2b7eed9341644b1cb3c0b7fbb934ba6c2c20.jpg"/></div></a></div></div><p>此外，你需要一些测试 ETH 才能确保公开测试网络中合约与逻辑正常工作，同时，你的用户也会需要它们。这里是一些可以获得测试 ETH 的网站和服务：</p><div data-type="embedly" src="https://faucet.paradigm.xyz/" data="{&quot;provider_url&quot;:&quot;https://faucet.paradigm.xyz&quot;,&quot;description&quot;:&quot;MultiFaucet funds a wallet with ETH, wETH, DAI, and NFTs across 8 testnet networks, at once.&quot;,&quot;title&quot;:&quot;Paradigm MultiFaucet | Bootstrap your testnet wallet&quot;,&quot;mean_alpha&quot;:127.5,&quot;thumbnail_width&quot;:1012,&quot;url&quot;:&quot;https://faucet.paradigm.xyz/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/49312391389e588da0dc54a8b26161ed9f93e4e0bf6615a378f87d2feb2ae061.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Paradigm&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:506,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1012,&quot;height&quot;:506,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/49312391389e588da0dc54a8b26161ed9f93e4e0bf6615a378f87d2feb2ae061.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/49312391389e588da0dc54a8b26161ed9f93e4e0bf6615a378f87d2feb2ae061.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://faucet.paradigm.xyz/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Paradigm MultiFaucet | Bootstrap your testnet wallet</h2><p>MultiFaucet funds a wallet with ETH, wETH, DAI, and NFTs across 8 testnet networks, at once.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://faucet.paradigm.xyz</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/49312391389e588da0dc54a8b26161ed9f93e4e0bf6615a378f87d2feb2ae061.png"/></div></a></div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rinkebyfaucet.com/">https://rinkebyfaucet.com/</a></p><hr><h2 id="h-6" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">6. 服务端编码与集成</h2><p>服务端一直是 DApp 被认为没那么「去中心化」的原因之一。就我所知，世界上绝大多数 DApp 都有服务端 API 提供支持，只有少数类似 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://app.uniswap.org/">Uniswap</a> 这样的产品，仅依赖前端与合约进行通信。</p><p>但绝大多数 DApp 的 Web UI 实现了去中心化。因此，我们需要区分服务端 API 在 DApp 开发中所属的地位，不能将核心逻辑放在私有服务器中依赖，或者一味使用服务端储存的机器人钱包私钥来操作区块链。</p><p>我们需要编写服务端 API 的原因之一是，链上状态储存的成本过高，以及反复地签名与交互对用户来说体验不佳。另外一些原因是，一些不重要的，可以被丢弃的数据并不需要放在合约中储存。</p><p>DApp 的服务端 API 并不要求特殊配置。因此，你可以使用任何你喜欢的编程语言运行环境来编写它。一般来说，我们使用 Node，因为这样可以复用一部分 <code>Provider/Signer</code> 的前端业务逻辑。</p><h3 id="h-61" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6.1 开发环境</h3><p>如果你的 DApp 并不复杂，不需要储存太多状态，我推荐你使用上述章节提到的 Next.js 方案，它可以直接被 push 到 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vercel.com/">Vercel</a>，后者将能够自动地将你 Next.js 项目中的 API 部署到对应的服务环境。</p><p>如果你的 DApp 依赖较多的数据库和服务，我推荐你使用 FaaS，我常用的一个 FaaS 服务是 Firebase，你可以使用 Firebase 快速连接实时数据库，整合 Twitter 或 GitHub 的第三方登录，它还提供非常好用的本地模拟器工具套件，以及，它能够非常好地支持跨平台。</p><div data-type="embedly" src="https://firebase.google.com/docs/web/setup?hl=zh-cn" data="{&quot;provider_url&quot;:&quot;https://firebase.google.com&quot;,&quot;description&quot;:&quot;请按照本指南中的说明，在您的 Web 应用中使用 Firebase JavaScript SDK，或者将其用作客户端以供最终用户访问（例如，在 Node.js 桌面应用或 IoT 应用中）。 您需要先创建一个 Firebase 项目，并在该项目中注册您的应用，然后才能将 Firebase 添加到您的 JavaScript 应用。在 Firebase 中注册应用后，您将获得一个 Firebase 配置对象，该对象可供您将应用与 Firebase 项目资源相关联。 如需详细了解 Firebase 项目以及将应用添加到项目的最佳做法，请访问 了解 Firebase 项目 。 如果您是 Firebase 或 Google Cloud 的新用户，请按以下步骤操作。 如果您想创建一个全新的 Firebase 项目（以及其底层 Google Cloud 项目），也可以按照这些步骤操作。 点击相应按钮以创建新的 Firebase 项目。 您的项目名称将用作 Firebase 界面中的显示名称，Firebase 会基于该项目名称自动生成唯一的项目 ID。请注意，您现在可以点击&quot;,&quot;title&quot;:&quot;将 Firebase 添加到您的 JavaScript 项目 | Firebase for web platforms&quot;,&quot;url&quot;:&quot;https://firebase.google.com/docs/web/setup?hl=zh-cn&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Firebase&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://firebase.google.com/docs/web/setup?hl=zh-cn" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>将 Firebase 添加到您的 JavaScript 项目 | Firebase for web platforms</h2><p>请按照本指南中的说明，在您的 Web 应用中使用 Firebase JavaScript SDK，或者将其用作客户端以供最终用户访问（例如，在 Node.js 桌面应用或 IoT 应用中）。 您需要先创建一个 Firebase 项目，并在该项目中注册您的应用，然后才能将 Firebase 添加到您的 JavaScript 应用。在 Firebase 中注册应用后，您将获得一个 Firebase 配置对象，该对象可供您将应用与 Firebase 项目资源相关联。 如需详细了解 Firebase 项目以及将应用添加到项目的最佳做法，请访问 了解 Firebase 项目 。 如果您是 Firebase 或 Google Cloud 的新用户，请按以下步骤操作。 如果您想创建一个全新的 Firebase 项目（以及其底层 Google Cloud 项目），也可以按照这些步骤操作。 点击相应按钮以创建新的 Firebase 项目。 您的项目名称将用作 Firebase 界面中的显示名称，Firebase 会基于该项目名称自动生成唯一的项目 ID。请注意，您现在可以点击</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://firebase.google.com</span></div></div></a></div></div><p>服务端编码没有太多与 DApp 开发相关的内容，但其中有两个我们需要提及的部分：</p><ol><li><p>理解使用 Siwe 进行钱包登录的流程</p></li><li><p>在服务端使用 <code>Provider/Signer</code> 与区块链 Relay 进行通信</p></li></ol><p>接下来我们会简单介绍这两部分内容。</p><h3 id="h-62" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6.2 关于钱包登录</h3><p>许多刚入门 Web3 的开发者会认为，钱包登录只需要使用前端脚本连接钱包即可，但这种逻辑很容易被 hack，因为任何客户端状态都能够被低成本修改。</p><p>Siwe（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.login.xyz/general-information/siwe-overview/eip-4361">Sign-In with Ethereum</a>）将 <code>EIP-4361</code> 草案引入了以太坊改进协议，目的是标准化开发者使用钱包登录授权 Off-chain 产品的逻辑。它的流程与 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jwt.io/">JWT</a> 的发行相似。</p><p>Siwe 支持绝大多数编程语言和它们的运行环境（JavaScript, Rust, Python, Golang, Ruby 等）因此你可以直接使用官方提供的依赖库来完成大部分流程。如果你使用 Next.js 也可以采用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://next-auth.js.org/">NextAuth</a> 来快速整合它。</p><p>简单来说，Siwe 通过对服务端发行的随机 <code>nonce</code> 和其他标准输入进行签名，再通过服务端验证签名内容的方式来确认提交方的地址。</p><p>因此，我们需要提供两个 API 来实现 Siwe，分别是 <code>/nonce</code> 和 <code>/vertify</code> 你可以在这里找到它们的代码范例：</p><div data-type="embedly" src="https://github.com/spruceid/siwe-quickstart" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Contribute to spruceid/siwe-quickstart development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - spruceid/siwe-quickstart&quot;,&quot;url&quot;:&quot;https://github.com/spruceid/siwe-quickstart&quot;,&quot;author_name&quot;:&quot;spruceid&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;author_url&quot;:&quot;https://github.com/spruceid&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/spruceid/siwe-quickstart" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - spruceid/siwe-quickstart</h2><p>Contribute to spruceid/siwe-quickstart development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div></div></a></div></div><h3 id="h-63" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6.3 服务端与区块链的通信</h3><p>在某些情况下我们需要在服务端进行与区块链 Relay Network 的通信，如果你使用 Node 作为运行环境，它的逻辑代码和前端是一致的。</p><p>如果服务端只需要使用到 Provider 与 Relay Network 通信（只读模式），比如，我们通过整合区块高度，某个合约状态和订阅事件，来组建我们自己的数据缓存服务并提供 API，那我们只需要按照前端的方式与 Relay Network 建立通信即可。在这种模式下，我们可以把 access key 存放在生产环境的环境变量中，我推荐你使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/motdotla/dotenv">dotenv</a> 去处理它们。</p><div data-type="embedly" src="https://github.com/motdotla/dotenv" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Loads environment variables from .env for nodejs projects. - motdotla/dotenv&quot;,&quot;title&quot;:&quot;GitHub - motdotla/dotenv: Loads environment variables from .env for nodejs projects.&quot;,&quot;mean_alpha&quot;:191.75,&quot;author_name&quot;:&quot;motdotla&quot;,&quot;thumbnail_width&quot;:1280,&quot;url&quot;:&quot;https://github.com/motdotla/dotenv&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e605cc004bc23fb0ad9f8bb44f52ba3703ce40d116880a0132042db09ffb69b4.png&quot;,&quot;author_url&quot;:&quot;https://github.com/motdotla&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:640,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1280,&quot;height&quot;:640,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e605cc004bc23fb0ad9f8bb44f52ba3703ce40d116880a0132042db09ffb69b4.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e605cc004bc23fb0ad9f8bb44f52ba3703ce40d116880a0132042db09ffb69b4.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/motdotla/dotenv" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - motdotla/dotenv: Loads environment variables from .env for nodejs projects.</h2><p>Loads environment variables from .env for nodejs projects. - motdotla/dotenv</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e605cc004bc23fb0ad9f8bb44f52ba3703ce40d116880a0132042db09ffb69b4.png"/></div></a></div></div><p>如果你使用 Next.js 它会自动读取 dotenv 的环境变量文件，因此你可以在 <code>process.env</code> 中快速使用到它们。这里是 Next.js 的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nextjs.org/docs/basic-features/environment-variables#environment-variable-load-order">相关文档</a>。如果你使用其他服务端框架或 FaaS，你可以自己维护这些环境变量文件。</p><p>如果服务端需要使用到 Provider 和 Signer 与 Relay Network 进行通信（读写模式）我们就需要好好考虑如何存放机器人钱包的密钥的问题。</p><blockquote><p>注意：在做这些事情之前，我们应该提前思考为何需要在服务端使用机器人钱包对某些合约进行写操作，以及这样的设计带来的合约权限问题与安全风险。</p></blockquote><p>我认为，将私钥放在环境变量中不是一个好办法，我们无法控制第三方模块是否会将环境变量中的内容计入日志或者远程统计。因此，我们可以采用专业的私钥管理服务来管理，例如使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cloud.google.com/secret-manager">Google Secret Manager</a> 或者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://aws.amazon.com/cn/secrets-manager/">AWS Secrets Manager</a> 来进行管理，而前者可以与 Firebase 很好地进行整合。</p><div data-type="embedly" src="https://cloud.google.com/secret-manager" data="{&quot;provider_url&quot;:&quot;https://cloud.google.com&quot;,&quot;description&quot;:&quot;Secrets and credential management service that lets you store and manage sensitive data such as API keys, usernames, passwords, and certificates.&quot;,&quot;title&quot;:&quot;Secret Manager documentation | Google Cloud&quot;,&quot;mean_alpha&quot;:93.4134920635,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://cloud.google.com/secret-manager/docs&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0ec88e23351289c4bff7320ac0c0d06cd4f62ce135a36f6c498b38f470263bf9.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Google Cloud&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0ec88e23351289c4bff7320ac0c0d06cd4f62ce135a36f6c498b38f470263bf9.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0ec88e23351289c4bff7320ac0c0d06cd4f62ce135a36f6c498b38f470263bf9.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://cloud.google.com/secret-manager" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Secret Manager documentation | Google Cloud</h2><p>Secrets and credential management service that lets you store and manage sensitive data such as API keys, usernames, passwords, and certificates.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://cloud.google.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0ec88e23351289c4bff7320ac0c0d06cd4f62ce135a36f6c498b38f470263bf9.png"/></div></a></div></div><p>通过 Provider 和 Signer 与 Relay Network 进行通信只需要传递钱包私钥给对应的 <code>Provider/Signer</code> 实例即可完成操作，与本地进行单元测试的机器人钱包一样，它不会有额外的确认过程，因此，我们需要确认钱包中有足够的 ETH 或其他 Gas token 余额，否则该交易会失败。</p><p>一般来说，如果我们的服务端接口中有对应的合约写操作，我们不会等待交易完成再返回数据，因此，我们需要返回对应的 <code>tx.hash</code> 方便前端界面处理后续逻辑。</p><h3 id="h-64-sdk" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6.4 实用的 SDK</h3><p>一些 SDK 和对应服务可以帮助我们更方便地在服务端与合约进行通信，例如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://thirdweb.com/">ThirdWeb</a>：</p><div data-type="embedly" src="https://thirdweb.com/" data="{&quot;provider_url&quot;:&quot;https://thirdweb.com&quot;,&quot;description&quot;:&quot;Build on internet capital markets with infrastructure for agents to discover, pay for, and interact with services and APIs.&quot;,&quot;title&quot;:&quot;thirdweb: Infrastructure for AI Agents&quot;,&quot;mean_alpha&quot;:63.8261904762,&quot;thumbnail_width&quot;:3600,&quot;url&quot;:&quot;https://thirdweb.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d6c8f6f5f9d1c8a033f9fc8dd09717f6f015c215da6d2ed40844e6ca5b7fa9de.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Thirdweb&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1890,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:3600,&quot;height&quot;:1890,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d6c8f6f5f9d1c8a033f9fc8dd09717f6f015c215da6d2ed40844e6ca5b7fa9de.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d6c8f6f5f9d1c8a033f9fc8dd09717f6f015c215da6d2ed40844e6ca5b7fa9de.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://thirdweb.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>thirdweb: Infrastructure for AI Agents</h2><p>Build on internet capital markets with infrastructure for agents to discover, pay for, and interact with services and APIs.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://thirdweb.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d6c8f6f5f9d1c8a033f9fc8dd09717f6f015c215da6d2ed40844e6ca5b7fa9de.png"/></div></a></div></div><p>Thirdweb 提供了一个 SaaS 合约开发平台，你可以通过它的前端 App 发布预设功能的合约，例如 NFT Drop 或者 NFT 交易平台，也可以使用它提供的第三方 access key 与已发布的合约进行通信（而无需依赖合约的 ABI）：</p><pre data-type="codeBlock" text="import { ThirdwebSDK } from &quot;@thirdweb-dev/sdk&quot;;

// The RPC url determines which blockchain you want to connect to
const rpcUrl = &quot;https://polygon-rpc.com/&quot;;
// instantiate the SDK as read only on a given blockchain
const sdk = new ThirdwebSDK(rpcUrl);

// access your deployed contracts
const nftDrop = sdk.getNFTDrop(&quot;0x...&quot;);
const marketplace = sdk.getMarketplace(&quot;0x...&quot;);

// Read from your contracts
const claimedNFTs = await nftDrop.getAllClaimed();
const listings = await marketplace.getActiveListings();
"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">ThirdwebSDK</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"@thirdweb-dev/sdk"</span>;

<span class="hljs-comment">// The RPC url determines which blockchain you want to connect to</span>
const rpcUrl <span class="hljs-operator">=</span> <span class="hljs-string">"https://polygon-rpc.com/"</span>;
<span class="hljs-comment">// instantiate the SDK as read only on a given blockchain</span>
const sdk <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> ThirdwebSDK(rpcUrl);

<span class="hljs-comment">// access your deployed contracts</span>
const nftDrop <span class="hljs-operator">=</span> sdk.getNFTDrop(<span class="hljs-string">"0x..."</span>);
const marketplace <span class="hljs-operator">=</span> sdk.getMarketplace(<span class="hljs-string">"0x..."</span>);

<span class="hljs-comment">// Read from your contracts</span>
const claimedNFTs <span class="hljs-operator">=</span> await nftDrop.getAllClaimed();
const listings <span class="hljs-operator">=</span> await marketplace.getActiveListings();
</code></pre><p>你可以在这里找到它的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/thirdweb-dev/typescript-sdk">JavaScript SDK</a>（Typescript）</p><div data-type="embedly" src="https://github.com/thirdweb-dev/typescript-sdk" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Best in class web3 SDK for Browser, Node and Mobile apps - thirdweb-dev/typescript-sdk&quot;,&quot;title&quot;:&quot;GitHub - thirdweb-dev/typescript-sdk: Best in class web3 SDK for Browser, Node and Mobile apps&quot;,&quot;author_name&quot;:&quot;thirdweb-dev&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/thirdweb-dev/typescript-sdk&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/51c0b4a09c3dab4b47aea232e244e952be99ea4b4cce3224b4c373cb786a63d6.png&quot;,&quot;author_url&quot;:&quot;https://github.com/thirdweb-dev&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/51c0b4a09c3dab4b47aea232e244e952be99ea4b4cce3224b4c373cb786a63d6.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/51c0b4a09c3dab4b47aea232e244e952be99ea4b4cce3224b4c373cb786a63d6.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/thirdweb-dev/typescript-sdk" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - thirdweb-dev/typescript-sdk: Best in class web3 SDK for Browser, Node and Mobile apps</h2><p>Best in class web3 SDK for Browser, Node and Mobile apps - thirdweb-dev/typescript-sdk</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/51c0b4a09c3dab4b47aea232e244e952be99ea4b4cce3224b4c373cb786a63d6.png"/></div></a></div></div><h2 id="h-7-l1s-and-l2" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">7. 合约部署方案 L1s &amp; L2</h2><p>在 DApp 开发中，与传统产品最大的不同点之一是我们需要决定将产品核心逻辑的智能合约发布到那个网络（或者哪些网络）这意味着，DApp 需要有「跨平台跨网络」的支持能力。</p><p>对于传统互联网开发人员来说，我们很容易理解「跨平台」，它是指我们需要为 App 界面提供 PC Web/Mobile Web，iOS/Android App 的各种版本。「跨网络」在 DApp 的开发中指的是，我们需要让 DApp 前端/客户端支持多个区块链网络。在那之前，我们需要决定哪些区块链网络是我们首选的发布环境。</p><p>自 2017 年发展至今，目前市场中有大量的区块链网络供我们使用。按照它们的共识证明种类，可以被分为 PoS 和 PoW；按照它们的角色定位，可以分为 L1 与 L2；按照它们对 EVM 兼容的类型，可以分为 EVM 兼容链和非 EVM 兼容链。</p><p>一般来说，我们可以选择发行到这些流行的区块链网络：</p><ol><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/zh/">Ethereum</a> (ETH) 主网：Gas 费用昂贵，但其中储存了大量资产，如果你的项目与 NFT 相关，许多人会选择发布到主网。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://polygon.technology/">Polygon</a> (Matic)：类 ETH 的 PoS 侧链，EVM 兼容，在许多国家都有一定的用户基础，有限的 TPS 支持与可接受的成本，开发者友好。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.bnbchain.world/">BNB Chain</a> (BNB): 币安的区块链网络，EVM 兼容，开发者友好。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solana.com/zh">Solana</a> (SOL): 高性能区块链网络，支持<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solana.com/zh/news/getting-started-with-solana-development">多种编程语言</a>编写合约，EVM 兼容（使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://neon-labs.org/">Neon</a>）</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.avax.network/">AVAX C-chain</a> (AVAX)：AVAX 的应用链，EVM 兼容，提供快速区块确认，相当程度的 TPS，可以自己搭建 C-chain 作为应用链 sub-chain（例如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://defikingdoms.com/crystalvale/">DFK Crystalvale</a>）</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cosmos.network/">Cosmos</a>(ATOM): 连接应用链的区块链网络，非 EVM 兼容（Evmos 除外）提供快速的 IBC 跨链桥支持，可以自定义应用链的 Gas token，适合 GameFi 与需要定制 TPS 的大型应用。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://near.org/zh/">Near</a> (NEAR)：提供完善的开发者套件和网页钱包一整套方案，因此用户入门难度最低，非 EVM 兼容（使用 Rust 编写合约）。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://starkware.co/starknet/">StarkNet</a> (ETH Layer2): 使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.zkrollups.xyz/">zkRollup</a> 技术支持的 L2 网络，非 EVM 兼容，由 Starkware 提供技术支持（它同时支持了 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.immutable.com/">IMX</a> 与衍生品 DEX <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dydx.exchange/">DyDx</a>）支持与 L1 的合约进行通信，支持使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/NethermindEth/warp">warp</a> 工具将 Sol 代码转换为 Cario 语言的合约代码。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zksync.io/">zkSync2.0</a> (ETH Layer2): 使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.zkrollups.xyz/">zkRollup</a> 技术支持的 L2 网络，同时支持了 DEX <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://info.zigzag.exchange/">ZigZag</a>。支持与 L1 的合约进行通信。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://scroll.io/">scroll</a> (ETH Layer2): 使用 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.zkrollups.xyz/">zkRollup</a>(zkEVM)技术支持的 L2 网络。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.xdaichain.com/">xDai</a>(Gnosis Chain): 它支持了著名的到场证明合约 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://poap.xyz/">POAP</a>。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.harmony.one/">Harmony</a>(ONE)：高性能区块链，它支持了 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://defikingdoms.com/">DFK</a> 的第一个版本。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dfinity.org/">Dfinity</a> (ICP)： 一个完整的 DApp 生态系统。</p></li></ol><p>我们可以选择发布到某个区块链网络，或者发布到所有支持 EVM 兼容的网络中。不过，不同的区块链网络中的合约无法直接通信，资产也无法随意互换（可以采用跨链桥合约进行锁定和重新铸造）目前，大部分 DApp 只会选择某一个区块链网络进行发布。</p><p>如果你的项目涉及到 NFT，我会推荐发布到 ETH 主网或储存了相当数量资产的网络，如果你的项目涉及 GameFi，可以考虑 TPS 高的区块链网络。如果你考虑 TPS 又同时注重资产安全，可以考虑使用 Layer2 网络。</p><p>我们正处于一个区块链网络的战国时代，因此，选择部署的网络不存在绝对的最佳实践，可以参考个人的需求进行选择。</p><hr><h2 id="h-8" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">8. 去中心化储存方案</h2><p>在 DApp 开发中，我们通常会将资产的元数据、DApp UI 界面等储存在去中心化储存网络当中，以防止单点故障导致的资产损失和不可用。</p><p>简单来说，资产的元数据通常指的是 NFT 中合约储存的 <code>tokenURI()</code> 返回的内容，它可能是一个 JSON 编码的字符串，将这些字符串储存在合约当中需要耗费相当大的成本，因此，最佳实践是将他们部署到去中心化储存网络中，再保存储存对象的索引 ID（例如 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ipfs.io/concepts/content-addressing/">IPFS CID</a>）</p><p>流行的去中心化储存方案有：</p><ol><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ipfs.io/">IPFS</a>：最早和最流行的去中心化储存网络。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://filecoin.io/zh-cn/">Filecoin</a>：以 IPFS 为基础的储存网络。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.arweave.org/">Arweave</a>(AR)：去中心化的永存网络，一次写入付费，读数据免费。你正在阅读的这篇文章即由 Mirror 代为保存在 AR 上。</p></li></ol><p>由于 IPFS 等方案需要多个节点保持（Pin）储存对象的状态，因此，上述服务都有针对开发者的高级包装储存服务（类似 AWS S3）我向大家推荐：</p><ol><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://web3.storage/">Web3.storage</a> 基于 Filecoin 的免费储存服务。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nft.storage/">NFT.storage</a> Web3.storage 提供的 NFT 元数据针对性储存服务，提供网页界面上传与 SDK。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://filebase.com/">Filebase</a> 整合了多个去中心化储存网络的服务，接口类似 AWS S3，提供丰富的 SDK 与 API，支持信用卡付费。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.bundlr.network/">Bundlr</a> 基于 Arweave 构建的永久储存服务，支持用多链 token 结算。</p></li></ol><p>如果你考虑为 NFT 元数据寻找去中心化储存方案，需要<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.opensea.io/docs/metadata-standards">确保</a> OpenSea 支持它们，否则你的 NFT 与合约将无法正常在 OpenSea 页面中显示。OpenSea 目前支持 IPFS 与 Arweave 的储存协议。</p><p>另外，如果你在编写合约时预先硬编码写入 NFT 和其他元数据，可以考虑使用 IPFS CAR（Content-Addressed Archive） 来预先计算他们的 CID hash，这有助于保存一些 OpenSea 要求的非标准数据，例如 NFT 合约描述和 Banner 背景图地址。</p><div data-type="embedly" src="https://car.ipfs.io/" data="{&quot;provider_url&quot;:&quot;https://car.ipfs.io&quot;,&quot;title&quot;:&quot;IPFS Content Addressed Archiver&quot;,&quot;url&quot;:&quot;https://car.ipfs.io/&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Ipfs&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"></div><hr><h2 id="h-9" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">9. 附录</h2><p>本文中提到的所有项目均列在我的 GitHub Star 清单中，可以在这里统一查阅：</p><div data-type="embedly" src="https://github.com/stars/guo-yu/lists/dapp-best-practice-stack" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.&quot;,&quot;title&quot;:&quot;guo-yu&apos;s list / DApp Best Practice Stack&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/stars/guo-yu/lists/dapp-best-practice-stack&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/stars/guo-yu/lists/dapp-best-practice-stack" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>guo-yu&#x27;s list / DApp Best Practice Stack</h2><p>GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cce5637a12dab29fbb626104026c19fb1d34a781e8426fb9f2a03e70c21a8a15.png"/></div></a></div></div><p>此外，附录中列出了许多我认为有助于帮我们理解 DApp 与智能合约开发的指南，如果你感兴趣，可以参阅这些指南（这个列表也会不定时更新）：</p><ol><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://consensys.github.io/smart-contract-best-practices/">合约安全风险指南 Ethereum Smart Contract Security Best Practices</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/iskdrews/awesome-solidity-gas-optimization">合约 Gas 优化指南 Awesome Solidity Gas-Optimization</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/eth-brownie/brownie">brownie</a>：一个 Python 语言的合约工作流工具。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/gakonst/ethers-rs">ethers-rs</a>：一个 Rust 的钱包实现。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/jbx-protocol/juice-interface">juice-interface</a>：著名众筹网站 juicebox 的前端界面。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/0xs34n/starknet.js">starknet.js</a>: StarkNet 的 JS SDK。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/DefiKingdoms/contracts">DFK/contracts</a>: 著名 DeFi 游戏 DFK 的智能合约。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/thirdweb-dev/contracts">thirdweb-dev/contracts</a>: ThirdWeb 开源的合约代码。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/OpenZeppelin/nile">OpenZeppelin/nile</a>: OZ 为 StartNet Cairo 语言编写的工作流工具。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/argentlabs/argent-x">Argent X</a>：StarkNet 的开源钱包。</p></li></ol>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/77fbb6738b919d61415adcd0fe86a1c3f0ec9390abafcfa6b1e21a651a5afc0d.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[CodeforDAO 的诞生与自组织的互联网未来]]></title>
            <link>https://paragraph.com/@guoyu/codefordao</link>
            <guid>fFrtNXZxXRm5p0a35SPc</guid>
            <pubDate>Tue, 29 Mar 2022 16:17:36 GMT</pubDate>
            <description><![CDATA[自从今年 1 月 9 日我在 Mirror 上宣布进入创业间隔年以来，安全度过第一季度几乎是地狱般的困难。起初，我花了一些时间适应从完全无规律的退休生活转向每日有计划的进行编码，但在 2 月，这一努力随着每日 5、6 场的融资电话会议被打乱，从 2 月 13 日到 3 月 2 日，这样的会面节奏对我个人的身体状态也产生了负面影响，我意识到自己需要更稳定的生活方式来持续贡献代码，而不是对所有知名机构投资者阐述我的宏伟计划。 魔鬼般的节奏带来了一些好处，我认识了约 30 家 VC 的投资经理，其中不少是这些机构的投资合伙人，此外，我和 OpenSea 的天使投资人张睿也有远程会面，并和 Gumi Crypto 的 CEO 国光先生在神田 WeWork 进行了现场会面，在疫情行动受控的时期，这是为数不多的难得而宝贵的交流体验。 Checks Finance 因为这样的融资节奏收获了一些 Offer，但大部分来自于机构中的个人投资者，很遗憾，我没有收到 Gumi 的进一步邀请，考虑再三，我决定搁置天使轮融资的计划，将主要精力投入到 Checks 与 CodeforDAO 这两个项目的编码...]]></description>
            <content:encoded><![CDATA[<p>自从今年 1 月 9 日我在 Mirror 上宣布进入<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://guoyu.mirror.xyz/FvkF4cUcHI449aq5isP_WWzPAjAbkYuzcsVbLtkTw-A">创业间隔年</a>以来，安全度过第一季度几乎是地狱般的困难。起初，我花了一些时间适应从完全无规律的退休生活转向每日有计划的进行编码，但在 2 月，这一努力随着每日 5、6 场的融资电话会议被打乱，从 2 月 13 日到 3 月 2 日，这样的会面节奏对我个人的身体状态也产生了负面影响，我意识到自己需要更稳定的生活方式来持续贡献代码，而不是对所有知名机构投资者阐述我的宏伟计划。</p><p>魔鬼般的节奏带来了一些好处，我认识了约 30 家 VC 的投资经理，其中不少是这些机构的投资合伙人，此外，我和 OpenSea 的天使投资人张睿也有远程会面，并和 Gumi Crypto 的 CEO 国光先生在神田 WeWork 进行了现场会面，在疫情行动受控的时期，这是为数不多的难得而宝贵的交流体验。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/checksfinance">Checks Finance</a> 因为这样的融资节奏收获了一些 Offer，但大部分来自于机构中的个人投资者，很遗憾，我没有收到 Gumi 的进一步邀请，考虑再三，我决定搁置天使轮融资的计划，将主要精力投入到 Checks 与 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/codefordao">CodeforDAO</a> 这两个项目的编码中去。</p><p>当我意识到这一点时，我所面临的交付压力已经和 1 月无法同日而语。因此，整个 3 月，我几乎保持每日稳定的编码节奏，大部分时间，我都住在安曇野，白天，会有一些外出时间，通常在傍晚时刻进入编码状态，一直工作到深夜，每隔两天，作为重设个人压力状态的有效方法，我会去附近的温泉乡泡温泉。一周中可能有一天，我会开车去白马滑雪。这样的生活方式下，项目在 3 月有了明显的进展，与此同时，我恢复了去年低碳水为主的饮食方案，这让体重减少了 5kg，能够更加专注地进行编码。</p><p>当我们准备做一件事情时，通常会对事情的进度保持极度乐观，但真正着手于事情本身时，总会遇到一些意外的难题。我很高兴自己跨过了这些困难，由于这些琐碎的生活经历，我得以在今日与大家分享一个 CodeforDAO 的雏形，昨天晚上，我在 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/CodeforDAO/contracts">GitHub 开源了它的代码</a>，这意味着至少在目前，我完成了一个不起眼却十分重要的里程碑，如果你感兴趣的话，可以在阅读完这篇文章后看看它的代码，这些代码尚未经过审计或 Gas 优化，但它至少能更具体地代我阐明我对 CodeforDAO 的长远规划。</p><p>2021 年以来，DAO 的概念进入了公众视野，我曾在 Mirror 上写过一篇文章「<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://guoyu.mirror.xyz/cj7GHFkl4wW8qk2m9y_tESMHrQ8CeLd9SaU6FhkojyQ">DAO 与最佳组织的迷思</a>」那篇文章中，我曾提及或许我们可以使用 DAO 的方法论来改善创业公司的架构，甚至，能否再进一步，允许任何人轻易地创建一个自组织的链上公司。</p><p>为了达成这个目标，首先我需要知道业内有哪些聪明人正在做一些他们认可的事情，我翻阅了 Aragon 的开源合约代码，体验了他们的线上服务，除了 Aragon 之外，我还体验了许多尚未发行 utility token 的 DAO 服务，这些服务解决了一个重要的问题：任何用户可以通过使用钱包连接他们的 Web 界面从而创建一个完整的 DAO，但我也注意到这些服务背后都有相似的缺点，一些开发团队正在尝试解决那些问题，但另外一些开发团队决定将重心转移到代币的营销和其他更赚钱的事情上去，有意地将缺点忽略。</p><p>首先，这些产品似乎并非为小型效率组织而设计，在发表这个观点之前，我想重申我目前观察到的关于 DAO 的现状：互联网上已经有相当多的 DAO，但大部分 DAO 似乎并不依赖于他们的基础合约而运行，换句话说，许多 DAO 采用<strong>广泛的人治</strong>，而<strong>有限地</strong>依赖<strong>合约治理</strong>。这些治理的目的都相当宏观，譬如，是否允许使用 DAO 金库的一些钱来完成一笔投资，或者是制定一个复杂的 Roadmap，由于目的过于宏观，这些治理大部分使用 snapshot 的链下投票来完成，它有点像我们熟悉的代议制民主：可以参与投票，但没有人能保证提案目的是否会得到完整执行。</p><p>这样的组织与 DAO 最吸引我的特点相悖。关于这种现状，存在许多解释，譬如链上治理极其昂贵，大部分用户也无法理解议题将如何被自动执行（他们甚至不会打开提案的日志查阅交易参数）关于这个问题，Aragon 提供了一种插件生态结构，这非常棒，如果他们优化提案和交易的 Web UI，这会帮助更多人参与真正的自动化治理。但我在这里想说的是，CodeforDAO 更关心的是我们能否借助 DAO 来实现去中心化的，高效和受信任的组织，我想，我可以先从<strong>小型组织</strong>来入手，而这正是我感兴趣的部分。</p><p>整个三月，我几乎保持着每天编码的节奏，由于这种努力，目前为止我们有了一个 CodeforDAO 的雏形，在这里，我不会解释具体的技术细节，但我想为大家阐述一下我如何理解「将 DAO 变成小型高效组织的效率工具」这一话题。</p><p>CodeforDAO 的核心概念是<strong>多层积极治理</strong>与<strong>模块化提案</strong>。这些术语看起来不知所云，但我使用创业公司来举例，我们能更加容易理解它。</p><p>当你创办一家科技型创业公司时，通常有这几种角色：持有技术股份的创始人，使用资本入股的股东，参与期权池的早期雇员，获取稳定薪酬的普通雇员与临时薪酬的外部雇员。于此对应的是，你会拥有一家注册在本地的法人实体与对应的法人账户。</p><p>大部分时候，作为创始人，你不会希望每个会议都扩大到所有人，除非，这些会议影响到几乎所有人的利益。这是我们所说的「<strong>科层制</strong>」的权力关系，DAO 的概念在某种程度上将这种权力关系打平，但世界并非如此理想化，因为，无论是在最激进的科技公司或成功的 DAO 的角度来看，这些组织都有一个精英化的决策中心，通常，这个决策中心的结构类似董事会。</p><p>这就意味着，治理必须是<strong>分层</strong>而且<strong>积极</strong>的。分层意味着关于组织治理需要划定<strong>操作者</strong>。积极意味着并非所有时刻我们都需要进行全员投票（如上所述，除非该投票影响到所有人的利益）</p><p>于此对应的，我们需要为分层积极治理设计模块化的提案。这是最让我感兴趣的一部分：<strong>将公司事务都抽象为智能合约</strong>，并最终将他们<strong>完全自动化</strong>。看起来，这个目的有些理想化，但当我们面对实际问题时，我发现的确存在一些可行方案。</p><p>例如，当初创公司要进行薪酬分发时，通常，我们需要专业的财务人员来进行月度规划，并且在发薪日之前手动校验这些数据，再将信息同步到银行的批量转账系统中去。对于 DAO 来说，发放固定薪酬是个非常常见的需求，但这些薪酬并不会设计到 DAO 的投票（并且这也不太可能实现）他们被设计成了链下的决策，再手动被加入到资产负债表中作为成本。</p><p>我们可以让这些事情变得更自动化，透明，而且受到所有成员的信任。CodeforDAO 的设计是抽象一个 Payroll 模块，允许部分操作员对这个模块进行确认（类似财务人员的授权）每个模块拥有自己的时间锁金库，通过授权的方式从 DAO 金库获得部分资产，而非直接利用它们，在一个结算周期后，模块的时间锁金库将会清零，这也意味着所有的成本支出都进入了 DAO 金库的账单，我们不需要再进行手动对账，便能将 DAO 的事务稳妥地运行。</p><p>于此同时，在这个雏形中，我也设计了期权模块，期权模块可以将激励通过模块的时间锁金库线性释放给雇员。</p><p>模块允许 DAO 中存在分层的积极治理，这些<strong>操作员</strong>未来会形成某种树状结构（这有点想提案中对某个提案的依赖）我们可以根据<strong>决策指令结构</strong>来设计 OKR 模块，确保所有人的短期目的都面向一个方向，让我们换个角度思考，OKR 中的 360 度环向评价其实也是一种匿名投票，而我们可以根据投票结果来给出成员的绩效基准线。</p><p>模块与 DAO 的合约是解耦设计，任何成员可以决定将模块挂载到 DAO 的金库合约上，从而建立关系，但任何关于模块时间锁金库的授权都需要进行 DAO 的投票过程，这可以确保模块无法私自滥用 DAO 的资产。</p><p>此外，CodeforDAO 还设计了一套 NFT 工卡合约和股份合约，并支持两种治理方式共同管理金库（分别是成员 NFT 投票与股份投票）金库合约开箱便默认支持外部投资者使用 ETH 与 ERC20 Token 进行投资，并自动获取对应的折价股份，与此同时，外部投资者会得到一份特殊的，被标记为「投资者」的NFT 工卡，从而拥有 NFT 投票的资格。</p><p>目前，CodeforDAO 的合约还非常初级，我使用了大量未经 Gas 优化的 OpenZeppelin 合约作为基准合约，这意味着在主网部署它会非常昂贵，不过，短时间内，我可能不会将 Gas 优化作为 CodeforDAO 的主要目标，因为我们会在近期上线配套的 off-chain 服务，并将合约部署到 zkSync2.0 和其他测试网络，届时，NFT 会员卡的白名单将能够自助申请，在界面上，我花费了许多精力让它变得高效与好用，相信大家一定会对 DAO 的崭新工具感到新鲜和兴奋，但我们还有相当多的构建代码需要完成。</p><p>这两个月以来，我在 CodeforDAO 和 Checks 花费了大量的精力，以避免技术债务的累积，提升交付效率，尽可能地将产品打磨的足够好用。我独自完成了 CodeforDAO 的所有代码，包括合约，前端和后端代码，但这并不意味着我有能力一直这么做，如果你对这个项目感兴趣，也欢迎加入到代码贡献者的行列中来，目前，CodeforDAO 的合约测试覆盖率是 61%，这还远远没到线上产品质量的水平，如果你能贡献单元测试，我也非常感谢。</p><p>这篇文章稍微有点冗长，但我很兴奋和大家分享我在这两个项目中遇到的问题，我仍然坚信，今年将会对是所有 Web3 参与者和贡献者都至关重要的一年，我们会经历 ETH 的重要升级，并且获得比以往更加有效率的 Layer2 方案，所有在可预见的未来发生的一切都有利于 Web3 的广泛和全面技术采用，所以，让我们废话少说，为实现一个高效而自组织的未来互联网，Keep BUIDL！</p><div data-type="embedly" src="https://github.com/CodeforDAO/contracts" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Solidity smart contracts of CodeforDAO. Contribute to CodeforDAO/contracts development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - CodeforDAO/contracts: Solidity smart contracts of CodeforDAO&quot;,&quot;author_name&quot;:&quot;CodeforDAO&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/CodeforDAO/contracts&quot;,&quot;thumbnail_url&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png&quot;,&quot;author_url&quot;:&quot;https://github.com/CodeforDAO&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/CodeforDAO/contracts" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - CodeforDAO/contracts: Solidity smart contracts of CodeforDAO</h2><p>Solidity smart contracts of CodeforDAO. Contribute to CodeforDAO/contracts development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f140433a89bfc31547ccfa32bfd0dc48e812065c86dfaae8f5f012bafcb5ad95.png"/></div></a></div></div>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e9670ed1c0d32f9ccbda83c0a26002bc9aa5cf1007edb1188a1d71c2b85e864d.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[日本 Web3 创业迈入战国时代]]></title>
            <link>https://paragraph.com/@guoyu/web3-3</link>
            <guid>3IUg1fQ2ExQ7m9cUANwC</guid>
            <pubDate>Sun, 23 Jan 2022 08:56:59 GMT</pubDate>
            <description><![CDATA[随着市场对美联储加息政策的普遍担忧，以纳斯达克为主的美股科技成长股与全球加密货币市场，在过去的三周内都经历了较大幅度的回落，一些分析师认为我们进入了「技术性熊市」。在我宣布将今年设为「创业间隔年」这篇文章中，我提到我们正在经历一个周期的结束，但一些变化可能深藏在时间跨度更大的某个周期之中。 最为代表性的故事是，Web3 的故事正在进入千家万户。 与二级市场资金的清冷状况相比，人们正以异常的热情关注着 NFT 和所有下一代互联网的基础技术概念。这些变化不仅发生在北美和中国，甚至也发生在日本。 作为世界上较早接受 CEX 并制定交易所合规法律的资本主义国家之一，日本在加密货币市场的发展可以说是「起了大早，赶了晚集」。日本金融厅对 CEX 的强监管，不仅包括冷钱包，KYC，法币出入金税收政策这几个方面，甚至平台支持的加密货币交易对也受到监管，CEX 每支持一种加密货币交易对，都需要向金融厅提出特定审批流程。 这样的监管情况在 NFT 面前发生了变化。这种无法充分定价的资产的法律地位更像是收藏品而非证券类金融产品，任何公司无需持牌便能参与 NFT 的发行与交易，由于 DeFi 的普遍流行...]]></description>
            <content:encoded><![CDATA[<p>随着市场对美联储加息政策的普遍担忧，以纳斯达克为主的美股科技成长股与全球加密货币市场，在过去的三周内都经历了较大幅度的回落，一些分析师认为我们进入了「技术性熊市」。在我宣布将今年设为「创业间隔年」<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://guoyu.mirror.xyz/FvkF4cUcHI449aq5isP_WWzPAjAbkYuzcsVbLtkTw-A">这篇文章</a>中，我提到我们正在经历一个周期的结束，但一些变化可能深藏在时间跨度更大的某个周期之中。</p><p>最为代表性的故事是，Web3 的故事正在进入千家万户。</p><p>与二级市场资金的清冷状况相比，人们正以异常的热情关注着 NFT 和所有下一代互联网的基础技术概念。这些变化不仅发生在北美和中国，甚至也发生在日本。</p><p>作为世界上较早接受 CEX 并制定交易所合规法律的资本主义国家之一，日本在加密货币市场的发展可以说是「起了大早，赶了晚集」。日本金融厅对 CEX 的强监管，不仅包括冷钱包，KYC，法币出入金税收政策这几个方面，甚至平台支持的加密货币交易对也受到监管，CEX 每支持一种加密货币交易对，都需要向金融厅提出特定审批流程。</p><p>这样的监管情况在 NFT 面前发生了变化。这种无法充分定价的资产的法律地位更像是收藏品而非证券类金融产品，任何公司无需持牌便能参与 NFT 的发行与交易，由于 DeFi 的普遍流行，与 NFT 的链上关联交易实质上已成为了日本市场的监管飞地。</p><p>稳定币发行商也蠢蠢欲动，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jpyc.jp/">$JPYC</a> 尝试使用古物商許可解释他们在 Polygon 和其他几个流行的网络上提供的稳定币服务，日本交易所 CoinBest 将在今年 2 月<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.coinbest.com/news/92">上线 $DAI 的交易对</a>，新入场的日元稳定币玩家 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.coinshop.jp/tora/">$TORA</a> 的运营法人甚至不是一家<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pprp-japan.org/">公司</a>，而是一般社团法人。</p><p>对加密世界一无所知的日本年轻人，也正以 OpenSea 和 Polygon 网络作为入口，兴致勃勃地希望将他们擅长的事情铸造成各种各样的 NFT。24 岁的素人插画师<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/onigiriman1998">おにぎりまん</a>在 OpenSea 的作品流通额达到了 229 个 ETH， 这个故事登上了<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/onigiriman1998/status/1448146544750780422?ref_src=twsrc%5Etfw">日本杂志 SPA!</a>，涩谷街头出现了 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/_NaokiSaito/status/1482977012151058432">NFT 广告牌</a>，将 WAGMI 带入现实世界，与此同时，表参道的一些展板使用权被<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://kaleidodao.org/spaces/QmTfnDaRzFKbPrq5v8yJDE3stCJ6FS4h3GbMDYJwwtpkqp">打包成 NFT 拍卖</a>，不仅乐天与 Line 这样的互联网公司近期有发行 NFT 的计划，就连传统地产商三井集团甚至都有计划<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.nikkei.com/article/DGXZQOUC075090X01C21A2000000/">发行自己的 NFT</a>。</p><p>与每日 FOMO 头部资金盘的投资者不同的是，这些非加密领域用户接触 Web3 的目的是将他们所擅长的事情与这些价值网络相结合，而这正是我希望看到的积极变化。</p><p>周期性的热钱像一条巨龙蛰伏在网络上，这个怪物吸引着所有人的注意力，我很庆幸市场给了我们一个短暂的回调，在我看来，现在正是构建用户产品的绝佳时间窗口。在这篇文章中，我列出了一些日本市场的创业公司，他们围绕 Web3 所提供的基础技术框架，尝试将消费，文化，商务与旅行相关的需求与下一代互联网进行整合。现在我们不需要紧盯 K 线，自由畅想 Web3 将如何改变我们的生活。</p><hr><h3 id="h-saas-nft-as-a-service" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">SaaS, NFT as a Service</h3><p>在 SaaS 方面，我关注到 NFT 的发行服务成为了一门简单而实用的生意，一些软件服务公司已为他们的客户了类似的功能，并且正在将这种服务拓展到链上所有的基础设施。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://kyuzan.com/">Kyuzan</a> 发布了他们的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.mintnft.jp/">mintNFT</a> 服务，它的月费是 7 万日元，软件接入费是 20 万日元，同时收取每笔交易 10% 的手续费，听起来不可思议，但对 NFT 发行服务感兴趣的中小商家应该很乐意接入这样的服务。它支持 ETH，BSC 与 Polygon 网络，提供素材管理，发行平台与 SDK。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://financie.jp/">FiNANCiE</a> 通过为项目方提供平台，帮助他们以 Token 形式众筹资金，并能够方便地让项目方与粉丝（客户）进行项目的沟通，可以看成是他们在 Web3 基础上提供了一个众筹工具。你可以在 App Store 下载到它的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://apps.apple.com/jp/app/financie-%E3%83%95%E3%82%A3%E3%83%8A%E3%83%B3%E3%82%B7%E3%82%A7-%E3%83%89%E3%83%AA%E3%83%BC%E3%83%A0%E3%82%B7%E3%82%A7%E3%82%A2%E3%83%AA%E3%83%B3%E3%82%B0%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9/id1470196162?mt=8">产品</a>，FiNANCiE 支持发布的项目包括偶像团体，球队和各种线下活动组织。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://adam.jp/">Adam by GMO</a> 为它的客户提供 NFT 发行服务，包括服务的网页托管。这家公司知名的合作方之一是坂本龍一先生，后者的乐谱 NFT 发行时一度导致 Adam 的服务宕机。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://sbinft.co.jp/">SBINFT</a> 是一家综合性 NFT 技术支持公司，它提供 NFT 交易平台的技术支持，NFT 技术咨询服务，DApp 咨询服务，并提供一个钱包 App GO!WALLET。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ttx.tltk.io/">TTX</a> 是一个 NFT 发行服务，主要关注领域是流量明星和演员，目前为诸如<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/asukakiraran">明日花キララ</a>这样的 AV 女优<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/ttx_japan/status/1472839462858428424">提供 NFT 发行服务</a>，它的 App 还提供直播之类的功能，帮助在艺人和粉丝之间构筑沟通平台。</p><h4 id="h-nft" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">NFT 交易市场</h4><p>在 NFT 交易市场方面，日本创业公司主要集中在垂直领域，专注于将他们身边能够利用的 IP 资源进行封装。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://miime.io/">miime</a> 是一个 NFT 交易市场，主要面向的是 GameFi 中的游戏道具，支持使用钱包登录，目前主要接入了 9 个主流的 Metaverse 游戏，这个平台由日本规模较大的一家 CEX Coincheck 研发。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nft-studio.com/ja">NFTstudio</a> 是一个 NFT 交易市场，主要面向动漫领域。它支持 Polygon 网络与 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blockchain.line.me/">Line Blockchain</a>，拥有相当强大的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nft-studio.com/ja/illustrators">漫画创作者资源</a>。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://anifty.jp/zh">Anifty</a> 是一个 NFT 交易市场，主要面向的领域也是二次元绘画创作。它支持钱包登录，也有认证画师（公認絵師）的机制保证市场中的作品质量，Anifty 试图从日本动漫领域挖掘出有价值的内容创作者，并为他们提供 Web3 的盈利模式。值得一提的是，这家公司由东京大学区块链加速计划所孵化。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nanakusa.io/">nanakusa</a> 是一家 NFT 交易市场，特点是它只允许经认证的艺术家和有合作关系的发行商发布自己的 NFT 作品，市场中也会列出他的合作伙伴市场中的所有 NFT。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mkt.rakuza.io/">楽座</a> 是一个 NFT 交易市场，主要面向二次元动漫作品的原画拍卖，平台会对拍卖的产品提供鉴定书，比如这副<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mkt.rakuza.io/ja/product-details/337">宮崎駿的作品</a>。楽座在有楽町マルイ7F开设了他们的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rakuza.io/gallerylabo/">NFT 快闪店</a>，以实体画框的形式将他们发行的 NFT 挂在画廊中，便于消费者来场体验。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nft.rhizomatiks.com/about/">Rhizomatiks NFT Experiment</a> 是一个品牌 NFT 交易市场，是由真鍋大度创办的知名数字媒体艺术公司 Rhizomatiks 所做的 NFT 发行实验，这个市场中只有 Rhizomatiks 发行的 NFT 艺术品。真鍋大度设计了知名电音乐团 Perfume 的惊艳舞台视觉特效。这个网站由 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://kyuzan.com/">Kyuzan</a> 提供 NFT 发行和交易的技术支持。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wallet.bitmax.me/">NFTマーケットβ</a> 一个基于 LINE 钱包产品 BITMAX 构建的 NFT 交易市场，使用的 Token 是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blockchain.line.me/">Line Blockchain</a> 的 $LINK，主要应用场景是移动端。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.tokenlink.io/index.html">Token Link</a> 是一个 GameFi NFT 交易市场，它主要面向 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://iost.io/">IOST</a> 网络上的 NFT 游戏道具，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://play.google.com/store/apps/details?id=com.platinumegg.crosslink&amp;a=10">CrossLink</a> 是其支持的一个手游，这个游戏中发布的 NFT 道具都可以在 Token Link 进行交易。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zaiko.io/nft">ZAIKO NFT</a> 是一个 NFT 交易市场， 借助于 ZAIKO 的票务资源，ZAIKO NFT 主要的市场切入点是乐队演唱会与粉丝之间的纪念收藏品 NFT 的发行和交易服务。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://habet.me/">habet</a> 是一个数字卡牌 NFT 交易市场，支持使用信用卡交易卡牌。这里的卡牌并非指代游戏卡牌，指的是广义的卡牌收藏品。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jp.thenftrecords.com/">THE NFT Records</a> 是一个音乐 NFT 交易市场。The NFT Records 支持的作曲家和歌手均为日本本土艺术家，这些 NFT 不仅是 Token 的交易，一些作品还包括曲目作品 CD 的邮送服务。大部分 Records NFT 价格都很亲民。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://market.uniqys.net/">ユニマ</a> 是一个 NFT 交易市场，支持使用信用卡以日元形式购买 NFT，并帮助买家保存这些 NFT（在某个冷钱包中） 目前它支持在 ETH 主网发布 NFT，并将所发布的作品的著作权，商业权和版权作为单独的类目进行分类，方便买家在购买时有目的的进行区分。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://fantop.jp/">FanTop</a> 是一个 NFT 交易市场，主要专注在艺人明星发行的数字收藏品和卡牌交易。它支持钱包登录，同时支持使用信用卡购买 NFT。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://tofunft.com/ja">tofuNFT</a> 是一个专注于 GameFi 和收藏品的 NFT 市场，是 BSC 上最大的 NFT 交易市场之一，它并非日本市场的创业公司，但提供了数十种公链方案的支持，也有许多日本用户。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://harti.tokyo/">HARTi</a> 是一家邀请制 NFT 交易市场，主要面向移动端用户。除此之外，HARTi 也尝试通过线下展览的形式将 OpenSea 中知名的日本艺术家作品在表参道原宿的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/hartiofficial/status/1464393180774760455">线下展厅</a>进行售卖。HARTi 的 App 目前正在测试发布中，他们将在 2 月初发布这一产品。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://kaleidodao.org/en">Kaleido</a> 是一家面向日本线下广告市场的拍卖平台，他们致力于将线下广告使用权打包为 NFT 的形式进行线上拍卖，帮助 DAO 等组织也能通过链上经济进行线下广告投放。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://corp.rakuten.co.jp/">Rakuten NFT</a> 是日本最大的积分发行商之一乐天的 NFT 事业计划，目前还未上线。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://xyza.io/">XYZA</a> 是一家东京本土的数字艺术家创建的 NFT 交易市场。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://leadedge-c.com/">LEAD EDGE</a> 是一个综合性 NFT 交易市场。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://airdrop.metamart.space/">MetaMart</a> 是一个专注在 3D/AR 领域的 NFT 交易市场。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://marketplace.tokkyo.ai/">IPマーケットプレイス</a> 是一个针对知识产权的 NFT 交易平台。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://1block.world/">1Block</a> 是一个专注于 3D 数字艺术品的 NFT 交易市场。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nft-bankers.com/">NFT バンカーズ</a> 一个综合性 NFT 交易市场</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dot-mura.com/">mura</a> 是一个音乐 NFT 交易市场，但并不支持钱包登录。</p><h4 id="h-nft" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">品牌 NFT 发行</h4><p>一些日本市场的品牌正尝试在 NFT 领域发行他们的限定收藏品，或者转型于提供线上的品牌形象。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://molcar-nft.com/">PUI PUI モルカー NFTマーケット</a> 是一个品牌 NFT 系列，他们基于经典 IP PUI PUI モルカー 发行了一系列 NFT 并在官网上支持交易。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nftjp.org/">NFT 鳴門美術館</a> 是一家建立了 20 年的地域美术馆，位于德岛，原名为鳴門ガレの森美術館，2021 年 8 月，这家美术馆改以 NFT 的形式展览他们的收藏品。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rizinfc.com/teaser/index.html">RIZIN FIGHTING COLLECTION</a> 是一个搏击俱乐部的品牌 NFT 数字收藏品系列。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/saburokufuji">36 BLOCKS OF FUJI</a> 是由富岳三十六景启发的 NFT 收藏品系列。由日本 NFT 早期参与者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/mera_takeru">mera takeru</a> 和 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/toshiaki_takase">Toshiaki Takase</a> 运营。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/cryptoninja_nft">CryptoNinja</a> 是在 OpenSea 发行的系列收藏品，由日本早期 NFT 参与者 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/IHayato">ikehaya</a> 创办。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://unicask.jp/">Unicask</a> 是将威士忌樽作为 NFT 藏品发行的品牌平台。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/_cryptocrystal">CryptoCrystal</a> 是一个发源于日本市场的 GameFi 收藏品系列 NFT。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://prtimes.jp/main/html/rd/p/000000002.000091556.html">浄楽寺御朱印 NFT</a> 是一个由神奈川県横須賀市浄楽寺发行的印章纪念品 NFT 系列，由 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://crypto-and.com/">Crypto&amp;</a> 提供技术支持。</p><h4 id="h-gamefi" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">GameFi</h4><p>日本长期以来是游戏大国，在未来可预见的时间内，应当会有相当多的游戏借助 NFT 实现他们的价值转化。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dea.sg/jp/">DEAP</a> 是一个 P2E 的经济模型和代币发行商，同时也提供一家 NFT 交易平台。他的代币 DEAPcoin 已在日本 CEX BitPoint 上线交易对。目前他们支持着 JobTribes 这一游戏的链上业务。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://1blockland.world/">1Block LAND</a> 一个 Metaverse 游戏，1Block NFT 市场支持交易它的游戏道具。</p><h4 id="h-" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">其他基础设施</h4><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://getlinks.jp/">Links</a> 是一个流行的多链钱包应用，它的产品功能有点像币信，提供 IM（即时通讯）功能，低手续费应用内转账和 Robot IM。同时，它也是 $JPYC 的关联公司。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blockchain.line.me/">Line Blockchain</a> 是 LINE 的区块链解决方案，主要用以支持 LINE App 内的 DApp，也提供移动端的钱包。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blockchain.bitflyer.com/">Bitflyer Blockchain</a>（Miyabi） 是日本最大 CEX Bitflyer 提出的公链方案。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/AstarNetwork">Astar/Shiden Network</a> 是 Polkadot 链上的姐妹网络。由<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/WatanabeSota">渡辺創太</a>的团队 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/staketech">Stake Technologies</a> 建立，Astar 支持在波卡网络中兼容 EVM 进行开发。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jpyc.co.jp/jpycoin">$JPYC</a> 是一个基于日元的稳定币发行商。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.coinshop.jp/tora/">$TORA</a> 是一个日本稳定币发行商。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wraptag.io/">Wraptag</a> 提供了一种方法将 NFT 的发行与 NFC 标签相结合，用以帮助实体商户发行与实物商品相关的 NFT 收藏品。</p><h4 id="h-" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">加密媒体</h4><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.neweconomy.jp/">あたらしい経済</a>（新经济）是一家线上加密媒体。由株式会社幻冬舎运营。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.coinjinja.com/coinview">CoinView</a>（コイン相場）是一个移动端 Token 价格看板，也提供市场情报，媒体资讯与聊天功能。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nft-media.net/">NFT Media</a> 是一家线上加密媒体，主要面向领域是 NFT 新闻。由株式会社トレジャーコンテンツ运营。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nft-review.io/">NFT Review</a> 是一家线上加密媒体，主要关注 NFT Collection 新闻，同时也提供一个交易平台。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nftranking.jp/">NFT Ranking</a> 是一家专注于为日本 NFT 头部项目排名的加密媒体。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://coinpost.jp/">CoinPost</a> 是一家线上加密媒体，报道日本和世界各地的加密领域新闻。这家公司也是 Links 的关联公司之一。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/0xPolygonJapan">Polygon ($MATIC) Japan</a> 是 Polygon 网络在日本的运营媒体。由于 OpenSea 的流行，Polygon 网络是目前在日本比较流行的 PoS 方案之一。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://crypto-times.jp/">Crypto Times</a> 是一家综合性线上加密媒体。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://open-token.com/">Open Token</a> 是一家日本地区的线上加密媒体。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/_NFTJPN_">NFTJPN</a> 是一家在 Twitter 上发掘日本优秀 NFT 作品的自媒体。</p><h4 id="h-dao" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">DAO</h4><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://supersapienss.com/?fbclid=IwAR1DGyogF6om_oUER54sZjr0ml-1m9xt0q0U4JKyNU0-WtS2E4RoI6fgBGM">SUPER SAPIENSS</a> 是一个由堤幸彦、本広克行、佐藤祐市等知名导演组建的泛娱乐领域 DAO 组织，由 FiNANCiE 提供技术支持。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/CodeforDAO">CodeforDAO</a> 是我创立的邀请制程序员社群，CodeforDAO 会在全球领域开发 DAO 的效率与协同工具，并在日本市场（主要是东京）定期举办线下活动。CodeforDAO 将在今年 2 月上旬上线。</p><hr><p>在以上的介绍中，我列出了目前观察到的 58 家创业团队，日本作为一个发达的商业社会，拥有其独特的文化市场，我认为，Web3 的商业与产品理念如何和消费品市场进行结合，会是下个周期中受到关注的主要议题之一。</p><p>Web3 究竟会如何改变我们的生活？站在 2022 这个关键的时间点，如同站在社交网络大流行前的 2008 年与中国移动互联网爆发前的 2011 年，我相信，答案会随着时间而揭开，It&apos;s time to build，让我们在下一个周期再会。</p>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8ef8ce5250ac8b99af3b56a75a0f64b2bb90a33546d40628d712213cd2757ac0.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[The indelible hash]]></title>
            <link>https://paragraph.com/@guoyu/the-indelible-hash</link>
            <guid>6kRbVr7ptZAxMlv2rVyV</guid>
            <pubDate>Sun, 16 Jan 2022 11:06:34 GMT</pubDate>
            <description><![CDATA[This novel was original written in Chinese.1. A wrong transactionJiang Hanhe slumped on his desk for a while, trying to relieve the fatigue that came from nowhere. Like countless ordinary working days, he didn&apos;t get up too early, because he lived in an old-fashioned residential house near the company, he could leisurely buy a cup of coffee, walk slowly and faithfully through the neighborhood park, and sit on the bench in front of the kindergarten for a while, which was probably the most ...]]></description>
            <content:encoded><![CDATA[<p>This novel was original written in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/guoyu.eth/mvHfMsijE3IoBwD05fgQ2v0fwg4BfeyNPRuHC-SDjxI">Chinese</a>.</p><h3 id="h-1-a-wrong-transaction" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1. A wrong transaction</h3><p>Jiang Hanhe slumped on his desk for a while, trying to relieve the fatigue that came from nowhere. Like countless ordinary working days, he didn&apos;t get up too early, because he lived in an old-fashioned residential house near the company, he could leisurely buy a cup of coffee, walk slowly and faithfully through the neighborhood park, and sit on the bench in front of the kindergarten for a while, which was probably the most comfortable and cozy time of his day. Sometimes he thinks that he should probably have a child, but then he thinks that he might not be able to afford to adopt a child, so maybe it would be better to get a pet for company, but he always has an inexplicable anxiety that he can&apos;t make a real choice in this and countless other small things, and he can&apos;t say where this strange energy comes from and where it disappears, as if at this moment, he has to slumped on desk for a while, trying to let this unexplained fatigue to fade away, so that he can continue this day after day boring work.</p><p>As an employee of NetShield Inc., it was Jiang&apos;s job to check if the deep learning models were working well, and if not, to modify the parameters again and rerun the models. This company is employed by the government and specializes in the development of multi-layer link penetration technology. Of course, Jiang is not a core developer, he knows nothing about these models; the only thing he can understand is that these models have fickle personalities and tricky effects, for which he often has to work late at night, adjusting parameters and testing the environment. As one of the lowest-level programmer in this company, Jiang needs to build compliant blockchain networks for these deep learning models, and this is one of his few privileges: to create test subnets within the authorized scope.</p><p>&quot;Would you like some coffee? A new coffee shop has been found for you, not far from the office&quot; Jiang Hanhe tried to hold up his tired eyelids and looked around, but there was no one in sight. He tapped the keyboard helplessly and tried to turn off the alert from the auxiliary work system, but it didn&apos;t work. If it was just a plug-in for the auxiliary system, it wasn&apos;t that troublesome, he thought, these annoying AI&apos;s were, I&apos;m afraid, dynamic programs deployed on the BioID Network, a project group was said to be developing similar software recently, and his own biochip address might have just happened to be included in the test list for the grayscale release, which meant he couldn&apos;t turn off the push.</p><p>Jiang had to open this push notification, the system recommended two cafes for him, he decided to use this opportunity to go downstairs for a stroll, he thought so, while picking up the phone, ready to go downstairs.</p><p>The coffee wasn&apos;t more delicious than expected, but it wasn&apos;t bad either, it was the only small thing that made him feel today that his life wasn&apos;t in an endless cycle. Coincidentally, he saw a kid in the cafe who paid with cash. This little boy must have stolen cash hidden somewhere in his house, Jiang thought to himself.</p><p>After returning to the office, he checked the test results as usual. Not surprisingly, the build <code>2317</code> model continued to have an unsatisfactory recall rate, even the worst in the last 10 releases, and according to the workbook, Jiang had to shut down all subnets and parallel networks as soon as the test was over, these blockchains sometimes reached thousands of layers and had to be shut down in turn after manually checking the snapshots. It was one of his least favorite tasks, both tedious and lengthy, a tedious two-hour-long operation that only involved dealing with a bunch of hash blocks and test wallet addresses.</p><p>In the calm afternoon, the exhaust fan made a regular and uninteresting noise, the air conditioner was adjusted to 16 degrees Celsius, and as if the electricity was free and unlimited, everything in the office could feel cold, even this boring test job.</p><p>Before checking into the <code>728th</code> layer of the network, Jiang felt that his life had come to an end when he joined this company, but this boring and tiresome afternoon, there was something unusual in the <code>728th</code> layer of the network, and at first, he just thought that these unusual things would cause him to have to apply for temporary overtime and not be able to catch the a reality show that started tonight. But when he fully understood the matter, Jiang Hanhe&apos;s body became parched, and he realized that this coincidental accident would bring about a huge change in his life that would turn his life upside down.</p><p>Among the thousands of layers of the network, the test wallet of the <code>728th</code> layer network received a transfer of $500 million <code>USDX</code> from an unfamiliar address, a stable currency pegged to the US dollar and strictly monitored by the main network. Without more time to think about what happened, Jiang made the decision that everyone would have chosen: he backed up the private key of this test wallet and network RPC information with his phone and pretended that nothing had happened.</p><p>After deleting all the remaining test networks, he finally worked up the courage to go home from work and collapsed on the couch.</p><hr><h3 id="h-2-the-indelible-hash" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2. The indelible hash</h3><p>The BioID Network is a great innovation.</p><p>The era before biometric networks, we call it the ancient Internet, when all economic behavior was not directly related to the Internet, and people used the Internet to participate in discussions, browse videos of dogs and cats, and that was all. When Dr. Fang first proposed the idea of constructing a biometric network based on the blockchain infrastructure, so many people thought it was a far-fetched dream, a fool&apos;s errand. But today, just 50 years later, no one uses ancient Internet anymore.</p><p>The BioID network is based on blockchain technology and consists of a large main network of authenticator nodes consisting of a biometric chip (BioID) implanted in the human body and network access points. The BioID uses bioenergy to generate electricity and comes with a Bio Beacon to exchange biometric information in the chip and wallet signatures with the beacon access points.</p><p>All natural citizens are implanted with this chip by the Fertility Center at the time of their birth. In the event of their unfortunate death, the fertility center recovers and destroys the chip at the first opportunity to prevent the private key of the wallet from being used by others. However, it is said that some staff members of the fertility center have hidden the chip that should have been destroyed, thus continuing to use the property of deceased citizens, which should have been automatically transferred to the legal heirs by their designated succession contract, of course, no one has really seen such a thing, and everything is just speculation among the public.</p><p>BioID network has truly moved the economy to the Internet, and arguably, it is a greater invention than the Internet. In the distant days of the Internet, people needed to register their accounts with their cell phone numbers to access websites or apps, and when accessing some sensitive information, they even had to confirm that the account belonged to them by uploading proof of identity. On the one hand, such a verification process is very tedious and consumes a lot of communication costs, and anyone can use the loopholes to prove that he or she is someone else, and on the other hand, because a large number of behaviors are difficult to authenticate, the trajectory of the social economy cannot be traced through the network, which makes the response of economic and monetary policies extremely lagging and cannot accurately reflect market conditions.</p><p>Every citizen who has a BioID, all economic actions in his life, from buying a Coke at a convenience store to applying for a housing loan, are paid for through the chip signature, and these chips are connected to the main network by connecting countless access points (Bio Bridge). The function of the chip itself is not complicated, it is only responsible for storing the private key, calculating the signature, the public key of the chip is the citizen&apos;s ID number, which is a long string of hash, no one can remember their ID number, of course, they do not have to remember, everything is automatic and convenient.</p><p>In addition, the chip&apos;s address records all of a citizen&apos;s lifetime achievements and tickets, such as college diplomas, personal credit history, hotel reservations and flight tickets. As an identifier, this data is stored in the form of an NFT in the citizen&apos;s network address, and authorized access points are able to read some of the identifiers, making impersonation impossible.</p><p>Since the invention of the Internet, many of the problems people have encountered on the web have been solved by BioID network: social networks no longer have bad online reviews, malicious skimming and other anonymous violations. Thieves and human trafficking, the evils of the old society, have naturally disappeared from society, and thanks to BioID chips that sense each other&apos;s presence through beacons, addressing citizens to each other is as simple as the Airtag introduced by Apple in the early twenty-first century, allowing people to locate any of their friends through a mobile app with mutual authorization and consent. If necessary, through specific access points in police stations, the network is able to automatically search for the location of addresses of immediate family members, the problem of missing persons is completely solved.</p><p>Standing in the 60th year of the 21st century, it is hard to imagine the inconvenient conditions people lived in before the main network went online. The day when the main network was launched was designated as a national holiday, and on that day, countless people would gather in front of the home of Dr. Fang Xinxing, the main scientist who invented the BioID network, to commemorate this great pioneer. A bronze statue stands in front of his home, at the base of the statue is engraved the address of the first block of the mainnet when it was launched, and the public key of the great man&apos;s chip:</p><p>an indelible hash。</p><hr><h3 id="h-3-letter-from-a-stranger" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3. Letter from a stranger</h3><p>When he got home, Jiang Hanhe made a great effort to find the workbook that NetShield Inc. had issued on the day of the orientation from the bottom of the storage cabinet. it was too heavy, even during the training, the instructor did not have time to tell them everything in the manual: his job was just a model tester, and he did not need to know specific and detailed information.</p><p>According to the warning in Chapter 1, Article 10 of the workbook, he should report to his superiors as soon as any traces of non-interrogation are found in the network, but obviously, Jiang did not do so today.</p><p>After sitting paralyzed on the sofa for a while, Jiang recalled his life once in his own brain on the fly. From his childhood, his grades were not good, his parents chose a stable profession for him, he barely passed the exam and got a college diploma, this diploma was not much rare, but it was enough for him to pass the tester review of NetShield Inc, which was the first job of his life. boring, repetitive and uninteresting, but because of this job, he had a small home, after his parents died of illness, he had lost for a while, he had no wife, not even a pet, the only relatives became two death certificates and estate transfer records on the mainnet.</p><p>Thinking about this, he felt annoyed, why such a problem would fall on such an ordinary and common person like him, why he couldn&apos;t live a simple life without any trouble: eating breakfast every day at the park bench hill in front of the kindergarten, struggling whether to adopt a pet, escaping from work in a simple and casual way, and then dying in the dead of night, in In his own little world, he has no legacy and no estate contract on the mainnet, which means all his income will fall silently into the abyss as his body dies, turning into a dead end in the BioID network, a black hole of the soul. Is this the life I want, Jiang thought, this may not be the life he wants, but it is the life he cannot help but accept.</p><p>Jiang read the workbook carefully, far more meticulously than even he had done in his induction training, he studied every sentence, every paragraph, and thought about the possible scenarios therein. He could not manage to inform his superiors of such a large sum of money, and besides, it was undoubtedly too late to so remedy the situation that if he chose to report it to his superiors now, he would surely lose the job, and as a thirty-five-year-old program tester, it would already be too difficult for him to find another job, not to mention his mortgage, a thought that forced him to seek a solution to extract this unexpected transfer in some way. There seemed to be no other viable way but to take the risk.</p><p>If I had the wallet&apos;s private key and network address, I could theoretically dispose of the funds, Jiang Hanhe thought to himself, but from where could I securely access this subnet? Jiang had never seen anyone capable of accessing a network outside the main net in his short life, except for the SDK he had used to test the subnet within the company.</p><p>Creating a new wallet address on the mainnet is a serious crime, and the network police program scans for unauthorized wallet addresses and potentially risky transactions 7x24. Even if I could access the subnet and safely dispose of the money, how would I transfer it to the mainnet, Jiang Hanhe thought, Cross-chain Bridge technology has long since disappeared into the code graveyard with the popularity of the mainnet, not to mention the risk of doing so: all non-national fiat assets in citizens&apos; wallets are strictly regulated, and such a huge sum of money is simply impossible to possible to safely launder into one&apos;s mainnet wallet.</p><p>When feeling headless, Jiang Hanhe always has some subconscious behavior: he has a certain degree of anxiety disorder. When he feels irritable and restless, he can only tidy up his room and clean the house in such a way to make inner peace. But few people would clean the house late at night, so perhaps the evil mind made him feel that he was being watched by an imperceptible program, and he could only move his body as slightly as possible. Maybe start by tidying up the filing cabinet, he thought, as he took the thick pile of papers out of the cabinet, sorting out the outdated ones to one side and putting the ones that still made sense on the other.</p><p>In the early days of the BioID network, paper documents were still popular with most people. Many people born before the mainnet went online still had the old time habit of writing letters and these paper letters were delivered through the post office, an extremely primitive method where people distinguished the sender and destination of the letters by the naked eye and sorted them manually before they were delivered to the mailbox of the destination through the postal system (a manual logistics system), a process that could last for days or even a week, and sometimes the letters were get lost with the sorting. From the mid-21st century, with the popularity of the mainnet and the movement to abolish the postal system, no one delivered paper mail anymore, and naturally, the letters became collector&apos;s items, and many pawnshops supported the scanning of these letters to be cast into the mainnet NFT and commissioned by customers for public auction. The mainnet was already online when Jiang Hanhe was born, which means he never had the life experience of handwritten letters, but he did read some of them, a legacy left to him by his parents.</p><p>Deep in the filing cabinet is a small box Jiang&apos;s parents left for him. In the box, apart from some jewelry, the rest are letters, and he starts to look through them. When he felt anxiety, he always read intently to relieve his mind of the unresolved worries, like a battle with the trapped beast of self. His parents and relatives would often send him paperbacks from the late 20th century, such as classic literature, and these stories built an important part of Jiang Hanhe&apos;s heart, a part he could not talk about and did not expect others to understand.</p><p>The paper of most of the letters is yellowed, indicating that they are of a very old age. The letters are private correspondence between Jiang Hanhe&apos;s parents, a small portion of which are love letters, which Jiang never wrote. In his time, the marriage certificate was automatically issued through the Civil Affairs Bureau&apos;s access point NFT deposited into the biochip&apos;s wallet address, and a smart contract automatically generated a multi-signature wallet representing the family&apos;s assets on the main network, and the newlyweds used a mobile app to share the marriage certificate to social networks to receive friends and family&apos;s blessings. Nowadays, Jiang thinks, it is difficult for people to put their emotions on a thin piece of paper. The parents&apos; love letters were few, but they were the most interesting part of the letters. At the end of the letters, His mother&apos;s diary lay quietly in the box, a very traditional diary with a small brass lock, a physical lock that could not be opened by the signature of a biochip, and had to have a key. This key, was scattered in the corner of the jewelry box.</p><p>Jiang had never opened this diary; reading his mother&apos;s private diary seemed immoral to him. If a letter is a conversation between two people, a diary is the inner world of the self. He did not want to pry into his mother&apos;s inner world, but had a remarkable interest in this diary that he had never read before. The lock was also part of his childhood, and in those days there were still things in the house protected by real locks. Thinking of this, he picked up the key anyway, and with a gentle turn of his fingertips, the small lock of the diary was unlocked.</p><blockquote><p><em>November 13, 2065 / Light Rain</em></p><p>Outside the ward there was the sound of rain, dripping, like the atrium of the family cottage when I was a child.</p><p>Body is getting more and more uncomfortable, and this uncomfortable seems to be reaching the end. I used to be unable to understand that someone can predict when they will leave this world, but now I finally have this feeling. I want to write a lot of words to my son, but my hand hurts so much that I can no longer hold the pencil. I hope that Hanhe&apos;s future life will be safe and smooth, and that he will not endure the pain like I did. I think my time is up and I just want to rest now.</p><p><em>November 12, 2065 / Sunny</em></p><p>Had a checkup today and Dr. Liu said the recovery was poor and asked if there was anything I wanted to eat, I said I didn&apos;t have much of an appetite and he agreed to prescribe some more nutritional supplements and sedatives.</p><p>Confirmed the contracted address left to my son&apos;s and it was as usual. Hope to sleep better at night.</p></blockquote><p>Unlike ordinary books, the first page of the diary is the last entry of his mother&apos;s life, the diary is written from the right side, a traditional writing convention. The lady did not leave any special words, perhaps more words pale when she knew she was going to pass away. It had been three years since his mother had left, but he rarely felt any grief, instead he felt a faint sense of longing. As a son, he failed in his duty to see her off.</p><p>Jiang turned to the next page with tears in his eyes, but saw the handwriting that did not belong to his mother.</p><blockquote><p>An Yun：</p><p>How have you been? I know your news from Jiang Hao, why do you want to deliberately hide it from us, although a long time no contact, you’ve get such a serious illness, we have to get to the hospital to take care of you, my son and I bought the ticket at 13th, once get off the plane, we will go directly to you, a long time no see, I hope you do not dislike our wind and dust.</p><p>Your son has grown up and is about to graduate from college, and I have not seen you for several years, and I think that he has not seen you for too long and has forgotten that you are his mother. I&apos;ve been out of town and working a lot, he&apos;s been studying a lot, he&apos;s facing graduation, there&apos;s a lot of chores, he&apos;s doing well, his grades are good, his job is set soon, he&apos;s less wild than when I was young, he&apos;s more bookish, more like you. I am quite happy about it.</p><p>It is difficult to say, I am writing to let you know how our life is going on, but there is another scandal that I have to ask for your help, I know you are not well, but we really have no choice, our son&apos;s college fee, wedding expenses, I had no choice but to borrow some money with the underground network, about a year ago. I didn&apos;t think I&apos;d have to find a new job this year because I&apos;m unemployed now, and we&apos;re all having a hard time. I don&apos;t know any other way to get through this, An Yun, we have been through all these things between us, you have to believe me.</p><p>I&apos;ll write this much in the letter first, and I&apos;ll tell you more about it when we meet, so be sure to read and destroy this letter. I hope you will be well.</p><p>Yours, Zhi An</p></blockquote><p>Zhi&apos;an, a name he had never heard of, Jiang Hanhe finished reading the letter with tears in his eyes, but found that he had mistakenly entered a private place inside his mother&apos;s soul. Strangely, he did not feel annoyed, nor did he blame his mother for never mentioning this half-brother to him. On the contrary, this accident made him think that he might still have blood relatives in this world, and this thought revived him.</p><p>Perhaps the answer he was seeking is in this letter from a stranger.</p><hr><h3 id="h-4-the-brain-in-a-fish-tank" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4. The brain in a fish tank</h3><p>Jiang Hanhe went through his childhood transfer records with his parents and finally found his mother&apos;s biochip address, a long string of hashes that represented all the footprints of the woman who gave birth to him and raised him in her short life.</p><p>Usually, when a fertility center recovers a deceased person&apos;s chip, it desensitizes the more private transactions in it, which are managed by a controlled multi-layer network of Zero Knowledge Proof during life, but when the chip fails, these original records are uploaded to the main network in the form of a snapshot, which serves as the citizen&apos;s final digital legacy and facilitates access by public authorities. As An Yun&apos;s immediate family member, Jiang Hanhe&apos;s biochip signature had permission to browse all the contents in the snapshot, and he quickly found the record of Zhi An&apos;s address, which was also his mother&apos;s last transfer.</p><p>In the BioID network, once the public key address of the chip is determined, finding the location of the person becomes very easy, and too many access points have such access. Jiang Hanhe can easily get the geographical location of this address as long as he can prove that he has a collateral blood relationship with Zhian and walk towards the police station for help, however, since he is not a officer, the location will not be precise to the meter, but enough to find his target.</p><p>The address given by the police was not far from the city where Jiang lived, which surprised him. Perhaps after his mother&apos;s death, the man named Zhi&apos;an also moved to the city due to guilt, or maybe it was some other coincidence that caused this strange &apos;father&apos; to have to settle in the city and reestablish his life. Jiang spent the weekend planning his trip, he had to keep his company colleagues from being curious about this unexpected trip, and he had to make up some stories to avoid the original weekend&apos;s scheduled arrangements.</p><p>On Saturday morning, Jiang packed his bags, and he even prepared some rations for unexpected surprises. nothing else could be considered an accident than a huge transfer received in the test wallet of some mysterious subnet, so he had to be prepared for anything. In order to prevent the exact beacon trail from being discovered by the company, he chose to ride a bicycle to his destination, thus being able to freely bypass crowded areas, a course of action that would not easily allow the main network bio-beacons to identify the exact final location.</p><p>Due to too many detours, he arrived at his destination in the late afternoon. It was a plain concrete building, only two floors, nestled between a deserted park and a clutter of old, dilapidated small houses from the last century, with locked gates and seemingly no signs of people living there. This made him feel puzzled and reconfirmed the location given by the police, a two hundred meter radius, there seemed to be no other possibility that the person called Zhian, must have been active or living nearby, Jiang decided to start with the nearby homes and knock on the door one by one to ask.</p><p>Jiang pretended that he was a staff member of the community insurance company and they could receive airdrops simply by participating in the registration. This old-school approach was very effective, and since this kind of old and dilapidated small residential houses were basically inhabited by elderly people, they could not help but take the bait once there was an opportunity to make money for free. Soon, Jiang Hanhe found people who knew Zhian.</p><p>&quot;There is a man named Zhian, I forget his last name, he works in that bar over there,&quot; said an old man with a face of about seventy. &quot;Bar? Is that the small two-floor building?&quot; Jiang Hanhe asked.&quot;That building is not open during the day and it&apos;s noisy at night, not a place for old men like us. &quot;Thank you very much, and don’t forget to pick up airdrop tomorrow&quot; Jiang Hanhe did not expect to find a clue so quickly, hastily said goodbye to this old man.</p><p>This bar has no name, the only iron door is locked, knocking on the door also has no response, Jiang thought, maybe only here until the night, can go in to explore the truth, thinking here, he decided to go to the nearby deserted park for a rest. He found a clean-looking lounge chair to sit down, autumn is getting thick, but the wind in the park is not too strong, the whole day of exhaustion and sleepiness and high mental tension, so he just want a short sleep.</p><p>When he woke up again, there was a black figure in the hazy night, getting closer and closer, until the figure came to him, he realized that he could not see who the other person was, nor could he make a sound. The soreness of his muscles gradually passed to Jiang&apos;s brain as he regained consciousness, and he realized that his body was extremely twisted: he was being tied backwards to a stool.</p><p>&quot;Who are you? What&apos;s the purpose?&quot; The figure questioned. &quot;Can you... Help me untie first...&quot; Jiang Hanhe felt a bitter tightness in his chest and could hardly breathe. &quot;Tell me first who you are and why you are here?&quot; The strange figure looked impatient. &quot;I&apos;m here to find Zhi An, please, I&apos;m An Yun&apos;s son,&quot; Jiang Han He begged. &quot;.......&quot; The figure was silent for a while, and with the sound of rapid breathing, Jiang fell into a deep sleep once more.</p><p>After an unknown amount of time, Jiang realized that he was struggling to wake up from a dream that was so long that he felt his body very tired. He struggled to open his eyes and realized that he was in an open room, dim and soft lights illuminated a corner of the room, some instruments were beeping regularly, he did not know where he was, but he could understand that he was not in a threatening situation: he was sleeping in a stranger&apos;s bed.</p><p>&quot;Sorry,&quot; the stranger approached from the corner of the room, &quot;You&apos;re finally awake, maybe the dose of Valium was too high.&quot; &quot;You are?&quot; Jiang Hanhe tried to ask. &quot;I&apos;m the Zhian you&apos;re looking for, but I&apos;m actually his son&quot; the stranger said &quot;You can call me Zhiyun&quot;</p><p>Jiang Hanhe tried to sit up, the image of the stranger in front of him became concrete, he has a still immature and tender face, it seems that due to a long time without enough light, the skin is miserable white, the body is also slightly thin, but the eyes reflect a certain perseverance.</p><p>&quot;I need to find your father, I&apos;ve read his letters to my mother, I need to know something&quot; Jiang Hanhe said. &quot;My father is dead&quot; the young man pointed to a corner of the room &quot;Now you have to ask me&quot;</p><p>Jiang Hanhe looked towards the corner of the room, a transparent fish tank connected to the apparatus, flashing regular lights, the fish tank, there was a faintly trembling brain on display, Jiang was not wrong, this is the first time he saw such a frightening scene, a living human brain, was parasitic in the fish tank, biometric chip connected to this brain, emitting a soft and wonderful green light ...</p><hr><h3 id="h-5-escape-to-the-underground-network" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">5. Escape to the underground network</h3><p>Jiang Hanhe still hasn&apos;t reacted from the extreme shock.</p><p>He could not understand what was happening in front of him, nor could he understand the boy called Zhiyun, who seemed to be accustomed to all this and did not feel any discomfort. Jiang thought to himself that maybe he could get the answers he wanted from the boy. But for some reason, he felt that Zhiyun was the only person he could trust in this world, not only because what had happened to him was far beyond Jiang’s understanding, but also because they had some kind of subtle connection in their bloodline.</p><p>Jiang Hanhe tried to describe to Zhiyun in clear and complete language all the things he had encountered, including the huge wrong transfer of money from the testing network, the letter Zhian wrote to his mother, and his attempts to find Zhian. Jiang could feel that the boy listening to this story in front of him had an extreme power of concentration, he was not only listening, but also judging the seriousness of the problem and the situation at all times. At first, he just showed a keen interest, but at the end of hearing the story, he realized that something was wrong and hurriedly stood up, took some cards from his desk, hurriedly walked out of the room, and after a while, hurried back again.</p><p>&quot;We don&apos;t have much time, we have to get out of here&quot; Zhiyun said: &quot;You&apos;ve been unconscious for two days, it&apos;s a working day, NetShield has probably contacted the police department to find your location, they will be here soon&quot; &quot;I&apos;m sorry, I didn&apos;t know I would get you into trouble&quot; Jiang Hanhe said. &quot;Now is not the time to talk about it&quot; Zhiyun threw him a backpack: &quot;You have bigger problems to deal with than this, we have to move to a safe place right away&quot;</p><p>Another door in the basement connected to the garage, where a pickup truck that looked like it hadn&apos;t been used in years was stored. Zhiyun carefully secured the brain in the tank to the car, and then got into the driver&apos;s seat and skillfully started the car. Soon, they drove out of the residential area and into the countryside.</p><p>&quot;We have to access the underground network right away&quot; Zhiyun said, &quot;There are devices there that can block the chip so they can&apos;t track our exact location&quot; &quot;You mean there is a way to block the beacon signal of the biometric network now?&quot; Jiang Hanhe asked in disbelief, these days, too many things happened outside of his expectation. &quot;Yes, it&apos;s the only way they can&apos;t find our exact location&quot; Zhiyun said, &quot;But your disappearance has caught the attention of the police, and I think you no longer need this identity&quot;</p><p>Jiang Hanhe turned his head to look at the horizon, the huge city was getting farther and farther away from their view, slowly, even the tall buildings disappeared below the horizon, he did not know what he could do in such a situation, except to trust the only brother in the world, Jiang could not find any way out. He chose to give up thinking, and again felt from the bottom of his heart a deep freedom, a freedom he had never experienced in his thirty years of life.</p><p>The pickup truck eventually stopped at a country farm that seemed off the beaten track. Jiang didn&apos;t know how far they were from the city now, and he didn&apos;t want to know, it gave him a sense of security he had never felt before, as if he had been here before. They settled into their luggage and the brain in the tank, and Zhiyun took him to meet his friends at this farm. Jiang Hanhe realized that this country farm was far more prosperous than he had imagined: huge clubs were built under these vegetable barns, and this bar was even ten times larger than the one Zhiyun ran.</p><p>&quot;Do you even have a DJ?&quot; Jiang Hanhe was puzzled. &quot;It&apos;s not like you&apos;ve never been to a bar before, don&apos;t look around like a kid,&quot; Zhiyun replied. &quot;Welcome bro, generally speaking we don&apos;t take non-club members&quot; Zhiyun&apos;s friend said, &quot;but Zhiyun and I talked about you, we&apos;ll prepare a new identity for you, and I&apos;m sure you have enough money to pay for this.</p><p>Jiang surveyed this big man beside him, a stout man with a mosaic green dragon tattooed on his left arm and a BTC logo tattooed on his right arm, which in his impression was an extremely old cryptocurrency, used by some early believers in cryptocurrencies well before the mainnet went online. Although this man had a fierce face, his voice was very gentle.</p><p>&quot;A new identity... what is that?&quot; Jiang Hanhe didn&apos;t understand.&quot;We can prepare a new biometric chip for you so you can be free to do whatever you want&quot; said the big man &quot;You have enough money to be able to live freely anyway, so why not? Hahaha&quot; &quot;I know... But the money is in a weird subnet, I don&apos;t even know if this network really exists...&quot; Jiang Hanhe asked. &quot;No money will appear out of thin air&quot; the big guy said with a smile &quot;If some idiot transferred the wrong money to you, you should happy about it, we don&apos;t have such good luck! &quot;Don&apos;t worry, as long as you can pay enough money, he can wash out any network for you, hahaha&quot; Zhiyun patted Jiang Hanhe&apos;s left shoulder &quot;This is not only the most luxurious bar in the neighborhood, but also the largest liquidity farm in North China region, no worries!&quot;</p><p>Perhaps it was the alcohol, Jiang was a little disoriented, he looked at the two laughing young people around him, as if he had a close friend for the first time in his short life, their happiness was pure and selfish, so much so that Jiang was also infected by this emotion. Now he finally realizes that he may have the ability to start a brand new life, that he no longer needs to return to that boring and uninteresting cycle, and that no one has to say goodbye.</p><p>For the first time in his thirty-five years of life, Jiang Hanhe thought to himself, he was living out of himself.</p><hr><h3 id="h-6-a-pass-on-the-paper" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6. A Pass on the paper</h3><p>&quot;I checked the network address you gave me, and it&apos;s not the chain we maintain…… By the way, I haven&apos;t introduced myself to you, people here call me Cyberpunk Dog, or CPD, or Punk Dog, whatever you want to call it, hahaha! &quot;I don&apos;t know, this was originally a test network I opened...&quot;Jiang Hanhe replied &quot;The address of the test network is usually random, I didn&apos;t know they could connect to networks other than the main network...&quot; &quot;It&apos;s generally unlikely, because the mainnet nodes and the underground network operate on different mechanisms. I don&apos;t know how your NetShield model works, do you have the code?&quot; said CPD. &quot;No, I&apos;m just a test guy...&quot; Jiang said, &quot;I don&apos;t have access to the model code...&quot; &quot;It&apos;s okay, we don&apos;t know when the network is on, but we have the address and port, I&apos;ll write a program to detect when it&apos;s on&quot; CPD said, &quot;There&apos;s always a time when it&apos;s on, and if we&apos;re lucky, we might be able to turn the network on in a week or two and to swap out the money in the network in, you have <code>USDX</code> in your wallet, don&apos;t worry, we have a big enough liquidity pool here. &quot;What do you mean?&quot; Jiang Hanhe wondered &quot;Is it the BioID mainnet?&quot; &quot;How is that possible,&quot; said CPD, &quot;You seem to have a lot of things to catch up!</p><p>While CPD was writing the code, Jiang Hanhe found Zhiyun and asked him about the background knowledge he should know. Zhiyun made a cup of coffee and started to introduce the origins of parallel networks in detail.</p><p>As far back as 2017, blockchain-based parallel networks are created, on top of the old Internet, people started building lots of Internet-based economic systems. Each system has one or more tokens that represent a currency, which is kind of like the <code>bioid</code> token you use in the mainnet, except that these come in very many forms. In a parallel network, there are usually hundreds of different currencies at the same time, some with stable prices and some with fluctuating prices. This is the background foundation of our current main network.</p><p>Of course, after the advent of BioID networks, fiat currencies were tokenized and all economic systems were forced to migrate to the mainnet. Like we are all of the generation born after the main network, so we would take this for granted, but before the invention of the main network, many parallel networks existed in this world, and in the era of multi-chain parallel networks, up to thousands of blockchains existed, each one specializing in a different function, and currencies were interchanged between networks through collapsing chain bridge technology, which of course is supported by the underground networks we run now . Also, in the era of multi-chain parallel networks, creating wallets is completely arbitrary and anonymous. You can imagine that one person can have as many wallets as you want, and you can hide your income and expenses as long as you want, which, of course, is now strictly forbidden by the mainnet nowadays.</p><p>Even today, parallel networks exist. Zhiyun continued, I believe there are many other people maintaining other underground networks, such as the one that transferred the wrong money to you. If they have such a large scale of funds to get it wrong, it means that their pool is far larger than the network we operate. However, it is more difficult to find them, and conversely, if you are mixing coins in our farms, it is also difficult for them to find you. However, this is not something you have to worry about, even if they can find you, it will be after you have taken the money and run away.</p><p>However, I have an idea, Zhiyun said, instead of living in fear in the suburbs, you should use the money to buy a ship ticket to Mars. I&apos;ve heard that Mixed Coin Bridge now supports direct transfers to <code>MARSX</code>, a parallel network on Mars, if you have a <code>MARSX</code> wallet address, but CPD can help you get that, piece of cake! He can also help you change to a new identity, Zhiyun pointed to the brain in the tank, so that you can move freely to the Starship launch base. It might cost a lot to buy a ticket and change your identity, Zhiyun said, but you might consider it, so that the problem is solved once and for all, so many <code>USDX</code> we can&apos;t help you wash into the BioID mainnet, no such possibility, even if a hundred brand new identities, Zhiyun added: If you don&apos;t want to have fun every day on the underground network like we do, why not just fly there!</p><p>&quot;Mars...? I&apos;ve never thought about it&quot; Jiang Hanhe said &quot;Is it suitable for human life there?&quot; &quot;I&apos;ve never been there,&quot; said Zhiyun, &quot;but it&apos;s been under development for more than 30 years. It may not be as convenient as the mainnet, but you can do whatever you want without worrying about chips. &quot;Can you really buy a ticket to Mars on the underground network?&quot; Jiang asked. &quot;Brother, as long as you have money, nothing is impossible&quot; Zhiyun said &quot;Don&apos;t worry!&quot;</p><p>In the evening, CPD had already written the scanning script, and after Jiang Hanhe exchanged ideas with him, he agreed to help.</p><p>&quot;I can try, it should not be difficult to buy&quot; CPD said &quot;Before that, you have to give me a private key&quot; He brought a piece of paper: &quot;You&apos;d better write it on paper, so no one can hack it, and when you get on Mars, then just find a phone to recover it, it&apos;s absolutely safe!</p><p>Jiang Hanhe borrowed paper and a pen and sat down in front of the computer, the cursor of an old LCD monitor flickered, and a long paragraph of private keys popped up in the command line interface, which he copied onto paper lump by lump; he hadn&apos;t written for too long, much less been able to understand what this ancient way of keeping keys meant. The laughter of the bar was noisy, and under the dim neon lights, a single word was scrawled on white paper, all in what seemed to be some mysterious ritual.</p><p>He could vaguely feel that this lengthy code on the paper determined his unknown fate.</p><hr><h3 id="h-7-the-promised-land-of-freedom" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">7. The Promised Land of Freedom</h3><p>&quot;Flight STR2065 will depart in one hour, please check in as soon as possible.&quot;</p><p>Jiang Hanhe was wearing a straight suit, he hadn&apos;t dressed so formally for too long, and in a trance, he felt as if he was about to enter a marriage hall instead of running to an unfamiliar planet. In the center of the empty boarding hall stood a giant white tower, the elevator to board the starship&apos;s cabin, and the only way to travel to a strange planet.</p><p>&quot;Dr. Tendo, welcome aboard,&quot; the ground staff greeted, &quot;We have checked your ticket, your seat is 31A, please take your seat.”</p><p>Jiang Hanhe was not yet comfortable with his new identity. He had no idea what this Dr. Tendo had experienced in his life, but he had enough time to be able to access this brand-new identity&apos;s life on the mobile app: where he had eaten breakfast, what kind of gifts he had bought for his children, or what day he graduated from a university, and these unfamiliar experiences kept popping up from the app. Jiang felt a little guilty that he was not familiar enough with this stranger and had to continue using his life.</p><p>This is the last journey in Dr. Tendo&apos;s life, but it is the brand new beginning of Jiang Hanhe&apos;s life at the age of thirty-five.</p><p>STR2065 was a weathered starship, its scorched black shell proving that the rocket had flown back and forth between Earth and Mars for at least billions of kilometers. As the hatch closed smoothly, the starship began to vibrate slowly and regularly, a vibration that went from shallow to deep, slow to fast, and eventually became a loud roar. Jiang turned his head to look out the porthole, and the rocket, wrapped in flames on the outside, was trying to lead them out of all the bonds of this blue planet and fly to the unknown promised land of freedom.</p><p>He felt a wave of vertigo and remembered the sedative pills that starship had distributed during boarding, but he had forgotten to take. He struggled to get up, tried to take out the pills in his jacket pocket, and swallowed them in one gulp before he was completely weightless. He sat back down in his seat, making sure his seat belt was fastened and the piece of paper with his wallet&apos;s private key was lying quietly in the compartment of his shirt.</p><p>During this long journey into the void, he felt a heartfelt love. Where this feeling came from, he could not know, perhaps because of weightlessness, perhaps due to the effects of sedatives, he floated in the vastness of space, confused and happy, like a slightly drunken man, alone, not connected to anyone, not dependent on any network to survive. In this brief moment, he touches his purest self.</p><p>Jiang Hanhe finally drifted off to sleep, his biochip flashing a dull red light as the lone starship finally broke away from the mainnet and sailed deeper into space. The cell phone in his jacket pocket emitted a faint but constant vibration, and unbeknownst to Jiang Hanhe, among the countless unread messages sent to Dr. Tendo, there was one message that came because of him.</p><p>In his peaceful dream, the tiny blue planet drifted away with its back to him and eventually became a point of light that was annihilated in the infinite universe. In that point of light, all people embraced with all people, they closely connected to each other, and they used their past, present and future lives to build an impenetrable wall, a network where is no escape, and a segment of indelible hash.</p><hr><p>Illustrations by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/1418062710Wala">Wala</a>. All rights reserved.</p><h4 id="h-the-indelible-hash-series" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">The indelible hash series:</h4><ol><li><p>The indelible hash (original in Chinese).</p></li></ol><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/guoyu.eth/mvHfMsijE3IoBwD05fgQ2v0fwg4BfeyNPRuHC-SDjxI">https://mirror.xyz/guoyu.eth/mvHfMsijE3IoBwD05fgQ2v0fwg4BfeyNPRuHC-SDjxI</a></p><p>2. The indelible hash series and my Web3 writing experiment (original in Chinese).</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/guoyu.eth/-IiesCxFBk9ENEP9Uvdu3Z9cy4zVQHFJz07OFWh6r2s">https://mirror.xyz/guoyu.eth/-IiesCxFBk9ENEP9Uvdu3Z9cy4zVQHFJz07OFWh6r2s</a></p>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0f769cf706e3c67f04b4683f619d924bbdba9e011424e2d25e3d09ecd3256b81.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[2022 我的创业间隔年]]></title>
            <link>https://paragraph.com/@guoyu/2022</link>
            <guid>ijBX25j2xBBrgcjIN79J</guid>
            <pubDate>Sat, 08 Jan 2022 19:09:47 GMT</pubDate>
            <description><![CDATA[两年前的 2 月 14 日，恰逢情人节，我在飞书上提出了远程离职，彼时新冠疫情刚开始，还未席卷全球，亚洲只有一些零星的地区受到波及，我正在日本旅行，热海的早樱已然盛放。卸下重担后，我买了人生第一辆宾利，这台香槟色的敞篷欧陆 GT，在随后的日子里陪伴我走过了许多地方。 退休后的生活，是现实与充实的，伴随着疫情的扩大，我在退休信中提到的近十年人生规划，在某些方面成了空话，旅游业的复苏漫长而痛苦，由于面向外国人游客的旅行业务迟迟无法恢复，我暂停了株式会社山月夜的运作，专心经营自己的生活。 两年间，我和朋友游历了许多温泉，探访了小笠原群岛，体验了世界最豪华的列车四季岛，在山形合宿考取了手动挡驾照，买了手动挡 718 Spyder 与吉姆尼，体验了汽车露营和徒步野营，做了近视手术，考取了一级船舶驾照，在城市画报开通了专栏，甚至还规划了日本国内赛车执照和摩托车驾照的考试，后者虽然由于诸多原因没有及时付出实践，这两年的退休生活依然十分精彩。除了前年六月短暂的退休风波，我在这个陌生的岛国彻底活成了社会边缘人。 事情从去年 11 月开始发生变化。我开始意识到，除了周期投资者涌入的热钱，某种转变正...]]></description>
            <content:encoded><![CDATA[<p>两年前的 2 月 14 日，恰逢情人节，我在飞书上提出了远程离职，彼时新冠疫情刚开始，还未席卷全球，亚洲只有一些零星的地区受到波及，我正在日本旅行，热海的早樱已然盛放。卸下重担后，我买了人生第一辆宾利，这台香槟色的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/status/4494488015343607">敞篷欧陆 GT</a>，在随后的日子里陪伴我走过了许多地方。</p><p>退休后的生活，是现实与充实的，伴随着疫情的扩大，我在<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://weibo.com/1644105187/ItPEX1g3I">退休信</a>中提到的近十年人生规划，在某些方面成了空话，旅游业的复苏漫长而痛苦，由于面向外国人游客的旅行业务迟迟无法恢复，我暂停了株式会社山月夜的运作，专心经营自己的生活。</p><p>两年间，我和朋友游历了许多温泉，探访了<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/1644105187/4530941956989380">小笠原群岛</a>，体验了世界最豪华的列车<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/1644105187/4548472407592055">四季岛</a>，在山形合宿考取了<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/1644105187/4630355099259091">手动挡驾照</a>，买了<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/status/4676304055829211">手动挡 718 Spyder</a> 与<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/1644105187/4644051313495266">吉姆尼</a>，体验了汽车<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/1644105187/4672918293055304">露营</a>和徒步野营，做了<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/1644105187/4654919813171142">近视手术</a>，考取了一级<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://m.weibo.cn/status/4683192454614831">船舶驾照</a>，在城市画报<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mp.weixin.qq.com/s/uo6fj_rcWm92No40X1QPyA">开通了专栏</a>，甚至还规划了日本国内赛车执照和摩托车驾照的考试，后者虽然由于诸多原因没有及时付出实践，这两年的退休生活依然十分精彩。除了前年六月<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mp.weixin.qq.com/s/PrYSlD-TsTnjJay5RM0SWw">短暂的退休风波</a>，我在这个陌生的岛国彻底活成了社会边缘人。</p><p>事情从去年 11 月开始发生变化。我开始意识到，除了周期投资者涌入的热钱，某种转变正在加密行业内外发生，我大约花了两个月的时间研究各个公链方案，各种 DApp，查阅它们的技术文档和代码，作为记录，我写了<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/guoyu.eth/f2yLu59TJ4u07FQ13UmiN4-cLELv3g-qQirY7YF_Qyw">一篇文章</a>，将分布在行业内各个领域的变化总结成几个故事。</p><p>简单来说，世界上最聪明的头脑和大量资本正涌入这个行业，与几年前的 ICO 热潮不同的是，不仅产品所叙述的故事发生了变化，真正改变行业本质的代码也随处可见。在上一个周期中火热的项目，有一些已经被开发者抛弃，另外一些，比如 OpenSea，它挺过了周期中最难熬的部分，在 2021 年获得了举世瞩目的成长。</p><p>说实话，我感到一种焦虑。这种焦虑并非来自于周期能为投资者带来什么丰厚的回报，恰恰相反，我想我们正处于一个周期的结束。我所焦虑的是，一旦我叙述的几个故事成立，世界会发生多么巨大的变化，这种变化影响之深远，移动互联网浪潮或许都无法望其项背。</p><p>作为一个开发者，我的本能让我在感受到变化时，成为做出改变的那批人。这像是一种无法逃避的宿命。但对我而言，一旦决定要做一些事情，这些事情必须是有意义的，与此同时，我也难以在工作与退休生活之中获得平衡。</p><p>反复思索后，我决定将 2022 年设为我的创业间隔年。</p><p>与大部分人相反，退休仍然是我人生的主线，间隔年是脱离主线的一种方式，它让我能够暂时离开生活的核心，离开舒适区，有能力以新的立场体验人生。从今年开始，我会将大部分时间投入到加密领域，以一切可能的方式创建下一代互联网的平台与产品。</p><p>简单来说，我会成立以下两个项目：</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/ChecksFinance">Checks Finance</a></p><p>这家法人实体在日本的公司将致力于为所有中小商户提供 Web3 服务套件，这家公司的目标是通过深度整合，将线下商业中的经济行为纳入下一代互联网，并提供 NFT / Token Points 的发行，交易服务与流动性支持。Checks Finance 的长期目标是将所有实体经济中的交易与价值传递到 Web3。</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/CodeforDAO">CodeforDAO</a></p><p>一个邀请制 10x 开发者社群，它的目标是为所有优秀的独立开发者提供一个共同筑造下一代互联网基础设施和 DApp 的孵化与服务平台。CodeforDAO 会围绕 DAO 的新型组织形态开发一系列平台产品，以提高 DAO 的运作效率，这些项目将在 CodeforDAO 官网上线后逐步发布。</p></li></ul><p>这两个项目将会占据我今年绝大多数时间，这意味着，我会以前所未有的投入开展这些事业，并全力招募领域内最有热情和意愿的开发者，设计师，产品经理一起工作，如果你对这些项目感兴趣，可以在 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/turingou">Twitter</a> 上找到我。</p><p>我相信 2022 年对我和我的朋友们来说，都将是一个见证巨大变化的年份，在加密领域，周期性热钱正随着加息预期的增长而逐渐消退，但越来越多的普通人，正关注到 NFT 为他们的生活带来的变化，我感到幸运，时代的变化永远是最年轻的人们引领的，在加密世界的一个又一个浪潮中，年轻的开发者持之以恒地构建，为我们带来了无数崭新的可能。</p><p>我看到，站在海浪之巅的冒险者欢呼雀跃地呼喊着，他们是乘浪而上的幸运儿，层层叠叠的波涛之下，暗流汹涌而澎湃地鼓动着：</p><p>跃入海中，成为巨浪。</p>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2a1b77cc53ef27f408b8b3850699d5b054dade4ba524174295b474271ae80f54.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[小说「永不消逝的哈希」与我的 Web3 写作实验]]></title>
            <link>https://paragraph.com/@guoyu/web3-2</link>
            <guid>Iq59hatepbBjAcsm9lXC</guid>
            <pubDate>Wed, 05 Jan 2022 17:53:18 GMT</pubDate>
            <description><![CDATA[在小说「永不消逝的哈希」中，我尝试描绘一个基于区块链技术的未来世界，在那个世界，我们所有人的链上地址是法定且唯一的，于出生时确定，在死亡时销毁，每个人一生的轨迹都会以交易块的形式呈现在网络中。 「永不消逝的哈希」是一系列故事的开篇，在这些故事中，我想探讨的话题是，如果本设计用于抵抗审查的系统，反而剥夺了人们抵抗审查的能力，我们的世界会发展成什么样？ 几乎所有小说中出现的技术都在存在于我们的现实世界，因此，这个问题是现实而残酷的。 作为小说所设定的主要背景之一，生物识别网络（BioID Network）是一切的基础，这个被称作「主网」的区块链网络由各种授权子网组成，负责为所有公民的经济行为提供网络基础设施，包括法定加密货币的流通（ERC-20），各种身份证明（NFT），公民经济行为合约（Smart Contract）等等，植入每个公民的生物芯片（BioID）和网络接入点共同组成着验证者节点，国家为所有主网的交易支付 Gas 费用，作为代价，私自新建钱包，使用跨链桥和平行于主网的其他区块链网络被严格禁止。 在某些角度来看，这不是一部科幻小说，而是一篇典型的乌托邦小说，我想再次强调，几...]]></description>
            <content:encoded><![CDATA[<p>在小说「<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/guoyu.eth/mvHfMsijE3IoBwD05fgQ2v0fwg4BfeyNPRuHC-SDjxI">永不消逝的哈希</a>」中，我尝试描绘一个基于区块链技术的未来世界，在那个世界，我们所有人的链上地址是法定且唯一的，于出生时确定，在死亡时销毁，每个人一生的轨迹都会以交易块的形式呈现在网络中。</p><p>「永不消逝的哈希」是一系列故事的开篇，在这些故事中，我想探讨的话题是，如果本设计用于抵抗审查的系统，反而剥夺了人们抵抗审查的能力，我们的世界会发展成什么样？</p><p>几乎所有小说中出现的技术都在存在于我们的现实世界，因此，这个问题是现实而残酷的。</p><p>作为小说所设定的主要背景之一，生物识别网络（BioID Network）是一切的基础，这个被称作「主网」的区块链网络由各种授权子网组成，负责为所有公民的经济行为提供网络基础设施，包括法定加密货币的流通（ERC-20），各种身份证明（NFT），公民经济行为合约（Smart Contract）等等，植入每个公民的生物芯片（BioID）和网络接入点共同组成着验证者节点，国家为所有主网的交易支付 Gas 费用，作为代价，私自新建钱包，使用跨链桥和平行于主网的其他区块链网络被严格禁止。</p><p>在某些角度来看，这不是一部科幻小说，而是一篇典型的乌托邦小说，我想再次强调，几乎所有小说中出现的技术都存在于我们的现实世界，因此，这篇小说所叙述的世界可以被看为是某种符合逻辑的预言，我会在后续的故事中逐步阐述这些预言，没有人对未来有着绝对的把握，但我想提供一种逻辑自洽的可能性，毕竟自 2020 年以来，世界发生了太多变化，而一些巨大而深刻的改变或许酝酿于其中。</p><p>「永不消逝的哈希」将由 10 篇短篇小说组成，在创作这些故事的途中，我意识到我与这部小说的读者可以通过崭新的方式来协作，一起推动着故事的发展。</p><p>在传统的出版方式中，作者的主要收入来自于印刷作品的版税，这种收入方式存在着一种明显的滞后性：它取决于销量，而它与体裁和渠道密切相关。实际上，不仅写作与出版行业，任何内容产业早期都存在着巨大的不可预知成本：没有人知道自己的作品是否会受到欢迎，因此，创作者不得不付出巨大的机会成本进行创作。</p><p>Web3 的基础设施让这种窘境发生了一些变化。我意识到，我们可以通过为这种生产关系增添流动性的方式来共同铸就一部完成度极高的作品：如果我们把作品的未来价值想象成是一个流动性交易对的左侧，而另外一侧则由读者的版税和收藏品收益而组成，这个模式将 DeFi 的 LP 引入了内容创作者的生产关系，作为小说的读者，在小说的创作的前期能够参与「流动性挖矿」，这些交易对产生的流动性和未来作品的版税收益将共同被锁定，直到一部作品完成，参与读者能够开启他们被锁定的流动性，并获得独一无二的 NFT 勋章。</p><p>在实际操作时，这种模式会比我所叙述的形态更为复杂。但它拥有一个非常简单的逻辑：如果读者能够在作品的早期发掘于他们认为有潜力的内容创作者，他们也会有能力激励创作者将读者喜爱的作品完成。我想，没有任何一个时代，作者与读者的关系能如此紧密：他们能共同推动一部作品，所有人都能参与故事的创作，并分享优秀作品成长的价值。这将会是写作与出版的革命。 ​​​</p><p>现在，我拥有一个机会来实践这种猜想是否成立，借助于 Mirror 所提供的功能，我们可以在一定范围内进行这个实验（当然，我还得编写一些合约代码）具体来说，我会在以下几个方面进行这场有趣的 Web3 写作实验：</p><ol><li><p>所有在 Mirror 参与购买「永不消逝的哈希」系列作品 NFT 的读者（包括这篇文章）在小说集共 10 篇作品完成后，都能按照贡献比率收取到这部作品集所有 NFT 销售额的 <code>25%</code> 作为空投。特别地，在所有参与活动的读者中，其中 10 个钱包地址将会平分销售额的<code>5%</code>作为大奖（考虑到定价，这将是一个较大的数字）</p></li><li><p>这个空投将由一个智能合约判断和发放，并在 ETH 主网以 <code>BIO</code> 形式的 ERC-20 Token 形式存入符合条件的读者购买 NFT 时填写的钱包地址。我将提供一个足够的流动性池，以方便所有读者将这些 Token 兑换为 ETH 或者其他 ERC-20 稳定币。</p></li><li><p>参与活动的读者（条件同1）在小说集完成后，同时将能够领取一个 NFT 空投，这个 NFT 以 ERC-721 形式在 ETH 主网合约免费 Mint，用以代表读者共同参与此作品集的勋章，这些勋章并不是统一的，根据购买不同价格的 Mirror Entry NFT，读者将会收到不同的勋章，但每种类型的 NFT 勋章，同一钱包地址只能 Mint 一枚。这些勋章发放于 ETH 主网，这意味着读者可以非常方便地在 OpenSea 等平台交易。</p></li><li><p>除此之外「永不消逝的哈希」系列作品将在 OpenSea 发放限量故事插图 NFT，在这些插图中，存在某些尚未出现于 10 篇小说中叙述的场景，只有仔细阅读作品的读者，才能辨别出这些隐藏的场景。每枚插图 NFT 售价为 0.1 ETH，每枚插图发行数量为 10 枚。</p></li><li><p>持有隐藏场景插图 NFT 的读者，如果同时获得了作品完成勋章 NFT，能够在合约内免费铸造一枚珍贵的金色完成度勋章 NFT。</p></li><li><p>持有故事插图 NFT 的读者，如果参与购买 Mirror 文章 NFT 的钱包是同一个地址，合约会将插图 NFT 的售价算入空投比率。这意味着，使用任何形式参与推动这部作品的完成都是有意义的。</p></li></ol><p><em>*合约交互的 Gas 费用将由读者承担</em></p><p>这个实验的规则并不复杂，但这能够使用我们手头现有的 Web3 工具来创建读者和作者之间的桥梁。在 Web3 这些有趣的工具出现之前，没有一种行之有效的方式，可以让读者自动地从写作者的版税和签售中分得收益，如果这个实验获得成功，我相信，这会是一种有效激励创作者的方式，或许，我们可以将这种方式拓展成为一个写作者平台。</p><p>在这个实验中，NFT 既是一种身份标识，也是收藏品和可兑付资产。智能合约能够以简单的方式判断参与者，而不需要作者进行额外的联络和确认。写作者能够关注他应当完成的内容，读者则通过一种有趣的方式参与到作品的构建中，并分享作品成长的收益。</p><p>我相信，在「永不消逝的哈希」系列作品完成时，我与所有系列作品的读者都能够体会到共同参与这项工作的乐趣：我们专注地创造，切实地拥有，开放地分享，而所有的这一切，正以非凡的效率构筑着一个全新的互联网。</p><hr><h4 id="h-" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">「永不消逝的哈希」系列作品集：</h4><p>一，永不消逝的哈希（发表于 2022 年 1 月 4 日）</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/guoyu.eth/mvHfMsijE3IoBwD05fgQ2v0fwg4BfeyNPRuHC-SDjxI">https://mirror.xyz/guoyu.eth/mvHfMsijE3IoBwD05fgQ2v0fwg4BfeyNPRuHC-SDjxI</a></p><p>附录：小说「永不消逝的哈希」与我的 Web3 写作实验</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/guoyu.eth/-IiesCxFBk9ENEP9Uvdu3Z9cy4zVQHFJz07OFWh6r2s">https://mirror.xyz/guoyu.eth/-IiesCxFBk9ENEP9Uvdu3Z9cy4zVQHFJz07OFWh6r2s</a></p>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/cf9f81636ef134bf0eb9b0251a587a29c630c6b16708c6c407a7b47ac11c314d.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[永不消逝的哈希]]></title>
            <link>https://paragraph.com/@guoyu/1SC3fNIsIR68kwQWQ6DG</link>
            <guid>1SC3fNIsIR68kwQWQ6DG</guid>
            <pubDate>Tue, 04 Jan 2022 12:06:27 GMT</pubDate>
            <description><![CDATA[1. 一次错误的转账江寒河在办公桌上趴了一会，试图缓解不知从哪儿来的疲劳，与无数个普通的工作日一样，他起得不算早，因为住在公司附近的老式民宅，他可以悠闲的买上一杯咖啡，慢悠悠地信步穿过小区公园，在幼儿园门口的长凳坐上一会，这可能是他一天中最舒适惬意的时间。有时他觉得，自己也许应当要个孩子，但转念想到可能无法支付领养孩子的费用，或许买个宠物做伴会更好，不过，他总有一种莫名的焦虑，在这件事情上和无数细微的事情上，他感受到自己无法做出真正的选择，也说不上这股奇怪的劲头从何而来，又在何处消失，就好像此时此刻，他不得不在冰冷的办公桌上趴那么一会，试图让这没来由的疲倦好自为之地走开，这样他就能继续这日复一日枯燥的工作。 作为网盾网络的雇员，寒河的工作是检查深度学习模型是否工作顺利，如果没有，就得再次修改参数重跑模型。这家公司受雇于政府，专门做多层链路穿透技术的研发，当然，寒河并不是核心研发人员，所以他对这些模型一无所知，他唯一能够理解的，是这些模型有着变幻莫测的性格和诡谲难辨的效果，为此，他不得不常在深夜加班，调整参数和测试环境。作为这家公司最底层的技术人员之一，寒河需要为这些深度学习模式建...]]></description>
            <content:encoded><![CDATA[<h3 id="h-1" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1. 一次错误的转账</h3><p>江寒河在办公桌上趴了一会，试图缓解不知从哪儿来的疲劳，与无数个普通的工作日一样，他起得不算早，因为住在公司附近的老式民宅，他可以悠闲的买上一杯咖啡，慢悠悠地信步穿过小区公园，在幼儿园门口的长凳坐上一会，这可能是他一天中最舒适惬意的时间。有时他觉得，自己也许应当要个孩子，但转念想到可能无法支付领养孩子的费用，或许买个宠物做伴会更好，不过，他总有一种莫名的焦虑，在这件事情上和无数细微的事情上，他感受到自己无法做出真正的选择，也说不上这股奇怪的劲头从何而来，又在何处消失，就好像此时此刻，他不得不在冰冷的办公桌上趴那么一会，试图让这没来由的疲倦好自为之地走开，这样他就能继续这日复一日枯燥的工作。</p><p>作为网盾网络的雇员，寒河的工作是检查深度学习模型是否工作顺利，如果没有，就得再次修改参数重跑模型。这家公司受雇于政府，专门做多层链路穿透技术的研发，当然，寒河并不是核心研发人员，所以他对这些模型一无所知，他唯一能够理解的，是这些模型有着变幻莫测的性格和诡谲难辨的效果，为此，他不得不常在深夜加班，调整参数和测试环境。作为这家公司最底层的技术人员之一，寒河需要为这些深度学习模式建立符合要求的区块链网络，这也是他为数不多的特权之一：在授权的范围内创建测试子网。</p><p>「要不要来点咖啡？已为您寻找到了一家新开业的咖啡店，就在公司不远处」江寒河试图撑起疲惫的眼皮，环顾四周，也没看到半个人影。他无奈地敲击键盘，试图关闭来自辅助工作系统的提醒，但这并不起作用。如果只是辅助系统的插件，还没那么麻烦，他想，这些烦人的 AI 恐怕是部署在生物识别网络上（BioID Network）的动态程序，据说最近公司内部有个项目组正在开发类似的软件，自己的生物芯片地址或许正好被灰度发布纳入了测试名单，这意味着他无法关闭这个推送。</p><p>江寒河只好打开这个推送通知，系统为他推荐了公司楼下的两家咖啡馆，他决定利用这个机会下楼逛逛，毕竟一旦有能摸鱼的机会，江寒河绝不含糊，要是绩效系统中这次离岗被记录，有这条推送也方便解释，他这么想，一边拿起手机，准备下楼。</p><p>咖啡没有超出预期的美味，但也不算坏，不过，这是今天唯一让他感受到自己的生活不处于一个无尽循环中的小事，巧合的是，他在咖啡馆里看到一个使用现金付款的小孩，这个小男孩肯定是偷了家里不知道藏在哪里的钞票，江寒河心想。</p><p>回到办公室之后，他照常检查测试结果，不出意外，<code>build 2317</code> 版本的模型依旧保持着不尽人意的召回率，甚至是近 10 个版本中最差的测试结果，按照工作手册，寒河必须在测试结束后尽快关闭所有子网和平行网络，这些区块链有时达到数千层之多，只能手动检查快照后依次关闭。这是他最不喜欢的工作之一，既枯燥又冗长，长达两小时的繁琐作业，只能面对一堆哈希块和测试钱包地址。</p><p>平静的午后，排风扇发出规律而无趣的噪音，空调被调整到了 16 摄氏度，仿佛电力是免费而无限的，办公室里的一切都能让人感受到冰冷，连这份无聊的测试工作也是。</p><p>在检查到第 <code>728</code> 层网络之前，江寒河觉得他的人生在加入这家公司之时就走到了尽头，但这个无聊而烦闷的下午， <code>728</code> 层网络中有一些不寻常的东西，起初，他只是觉得这些不寻常的东西会导致他不得不申请临时加班，而无法赶上今晚开播的恋爱真人秀。但当他完全理解了这件事情之后，江寒河的身体变得燥热，他意识到这个巧合的意外，将给他的人生带来天翻地覆的巨大变化。</p><p>在数千层网络之中，<code>728</code> 层网络的测试钱包收到了陌生地址转来的 5 亿美元 <code>USDX</code>，这是一种与美元挂钩的稳定货币，受到主网的严格监控。他没有更多时间思考发生了什么，江寒河做了所有人都会选择的决定：他用手机备份了这个测试钱包的私钥和测试网络 RPC 信息，装作什么都没有发生。</p><p>删除了剩余所有测试网络之后，他终于鼓起勇气下班回家，瘫倒在了沙发上。</p><hr><h3 id="h-2" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2. 永不消逝的哈希</h3><p>生物识别网络（BioID Network）是一个伟大的创举。</p><p>生物识别网络出现前的时代，我们称它为远古互联网时代，那时，所有的经济行为和互联网并无直接的关系，人们使用互联网参与讨论，浏览猫狗视频，仅此而已。当方博士第一次提出基于区块链范式构造生物识别网络这个构想时，许多人认为这是一个遥不可及的梦想，是痴人说梦。但在短短 50 年后的今天，没有人再使用远古互联网。</p><p>生物识别网络的基础是区块链技术，这个网络由一个庞大的主网所构成，主网验证者节点由植入人体的生物识别芯片（BioID）和网络接入点所组成，BioID 使用生物能发电，并且自带一个生物信标 （Bio Beacon）用来与信标接入点交换芯片中生物信息与钱包签名。</p><p>所有自然人公民在出生时，都会由生育中心植入这块芯片。一旦他们不幸死亡，生育中心会在第一时间回收并销毁芯片，以防钱包私钥被他人冒用。不过，据说生育中心的一些工作人员藏有本应被销毁的芯片，从而继续使用已故公民的财产，这些财产本应该由他们所指定的继承合约自动转移给法定继承人，当然，没人真正见过这种事情，一切只是坊间的猜想。</p><p>生物识别网络真正地将经济搬到了互联网上，可以说，这是比互联网更伟大的发明。在远古互联网时代，人们访问网站或者 App 需要用手机号码注册账户，当访问一些敏感信息时，他们甚至不得不通过上传身份证明的方式来确认账户属于自己。在今天看来，这种模式简直幼稚的不可思议：一方面这样的验证过程十分繁琐，需要消耗大量的沟通成本，而且任何人能利用其中的漏洞证明自己是他人，另外一方面，由于大量的行为难以实名认证，社会经济的运行轨迹无法通过网络来追寻，这使得经济和货币政策的反应极其滞后，无法准确得反应市场情况。</p><p>每一个拥有生物识别芯片的公民，一生中所有的经济行为，小到在便利店买可乐，大到申请住房贷款，都通过芯片签名支付，这些芯片通过连接无数不在的接入点（Bio Bridge）连接到主网。芯片本身的功能并不复杂，它只负责储存私钥，计算签名，芯片的公钥便是公民的身份证号码，这是一串冗长的哈希，没人能记住自己的身份证号码，当然，他们也并没有必要记住，一切都是自动而便利的。</p><p>除此之外，芯片的地址还记录着公民一生当中的所有成就和票据，譬如大学毕业证、个人信用记录、酒店预约和航班机票。作为身份标识，这些数据以 NFT 的形式保存在公民的网络地址内，经过授权的接入点能够读取某部分身份标识，这样的设计使得冒充他人变得不再可能。</p><p>自从互联网发明以来，人们在网络上遇到的诸多问题，都被生物识别网络一一解决了：社交网络不再有网络恶评，恶意刷单和其他匿名违法行为。小偷与人口贩卖，这些旧社会的罪恶自然而然的也从社会中消失了，由于生物识别芯片相互通过信标感应到对方存在，公民之间的寻址非常简单，就像二十一世纪早期 Apple 公司推出的 Airtag 一样，在互相授权同意后，人们可以通过手机应用定位自己的任何好友。必要时，通过警察局的特定接入点，网络能够自动搜寻直系亲属的地址位置，这样的设计，让人口失踪的问题被彻底解决。</p><p>站在二十一世纪的第 60 个年代，我们很难想象主网在上线前，人们生活在怎样不便的环境下。国家将主网上线的日子定为了法定节假日，那天，无数群众会聚集在发明生物识别网络的主要科学家，方心省博士的故居前，以纪念这位伟大的先驱者。博士的故居前耸立着一尊铜像，铜像的基座，镌刻着主网上线时的第一个区块地址，和这位伟人的芯片公钥：</p><p>一段永不消逝的哈希。</p><hr><h3 id="h-3" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3. 陌生人的来信</h3><p>回到家之后，江寒河废了九牛二虎之力，从储藏柜底下找出网盾网络在入职培训那天发放的工作手册。因为太过厚重，即便在培训时，讲师也没空将手册中的内容事无巨细的告诉他们：他的工作仅仅是模型测试员，并不需要知道特定而详尽的情况。</p><p>按照工作手册中第一章第十条的警告，一旦在网络中发现任何不审踪迹，他都应当第一时间向上级报告，但很显然，江寒河今天没有这样做。</p><p>在沙发上瘫坐一会儿之后，寒河在自己的大脑中飞快地回忆了一次人生，从小到大，他的成绩不算好，父母为他选择了一份稳定的专业，他勉勉强强通过了考试，拿到了大学文凭，这份文凭谈不上多么稀有，但足够让他通过了网盾网络的测试员审查，这是他人生的第一份工作。枯燥，重复而无趣，但因为这份工作，他有了一个稳定的小家，父母因病去世后，他曾失落过一段时间，他没有妻子，甚至没有宠物，唯一的亲人成了主网上的两段死亡证明和遗产转账记录，那不是一笔巨款，但也是二老在他们短暂的一生中为寒河留下的一份心，想到这里，他无法自拔地陷入一种悲伤的情绪，他不知道怎么解决这个问题，他感到烦躁，为什么这样的问题会落在他这么平凡而普通的人头上，为什么自己不能毫无烦恼地过完简单的一生：每天在幼儿园门口的公园长凳山吃早餐，纠结是否要领养一只宠物，用简单随意的方式逃避工作，然后在某个夜深人静的晚上死去，在自己的一片小小天地之中，他没有什么遗产，也没有在主网上签署遗产合约，这意味着他的所有收入都将沉寂地随着躯体死亡而坠入深渊，变成生物识别网络中的一个死胡同，一处灵魂的黑洞。这是我想要的人生吗，江寒河心想，这也许不是自己想要的人生，但这是自己无法不接受的人生。</p><p>江寒河仔细地阅读工作手册，甚至远比他在入职培训中都更加细致地研读，他研究每一句话，每一段文字，思考其中可能存在的方案。他无法做到将这样一笔巨款通报给上级，况且，毫无疑问如此补救已然太迟，如果他现在选择报告上级，一定会丢掉这份工作，作为一个三十五岁的程序测试员，他已经太难再找到一份合适的工作，更别提他的房贷，这种想法让他不得不寻求一种方案将这笔意外的转账通过某种方式提取出来，除了冒险，似乎没有其他可行的方法。</p><p>如果我有钱包的私钥和网络地址，理论上我能支配这笔资金，江寒河心想，但是从哪里能安全的接入这个子网呢，江寒河除了在公司内部测试子网时使用过统一的开发者套件，在他短暂的三十多年人生中，他从来没看见过谁有能力接入主网之外的网络。</p><p>在主网上创建新的钱包地址是严重的违法犯罪行为，网警程序会 7x24 小时扫描未经授权的钱包地址和有潜在风险的交易记录。退一万步说，就算我能接入子网，安全地支配这笔钱，我怎么把它转到主网上来呢，江寒河心想，跨链桥（Cross-chain Bridge）技术早就随着主网的普及消失在了代码坟墓中，更别提这样做的风险：所有公民钱包中的非本国法币资产都受到严格监管，这样巨大的一笔钱根本不可能安全地洗到自己的主网钱包中去。</p><p>当感到走头无路时，江寒河总有一些下意识的行为：他有一定程度的焦虑症。当他觉得烦躁不安，只能用收拾房间和打扫屋子这样的方式来让内心平静。但很少会有人在深夜打扫房子，也许作恶的心态让他感觉到自己正被着一种无法察觉的程序监视，他只能尽量轻微地移动身体。或许先从收拾文件柜开始做起，他想，一边从文件柜中取出厚厚的一沓文件，他把过期的文件整理到一边，把仍然有保存意义的放到另一边。</p><p>在生物识别网络出现的早期，纸质文件仍然受到大部分人的欢迎。许多人出生在主网上线之前，仍有旧时代的习惯，他们有时会写信，这些纸质信件通过邮局来传递，这是一种极其原始的方法，人们通过肉眼来分辨信件的发送者和目的地，并手动分类，再通过邮政系统（一种人工物流系统）送到目的地的邮箱中，这个过程可能会持续几天甚至一周，有时信件会随着分拣而丢失，从 21 世纪中期开始，随着主网的普及和废除邮政系统的运动，已经无人再传递纸质邮件，自然而然的，这些信件就成了收藏品，许多当铺支持扫描这些信件铸造成主网 NFT，并由客户委托公开拍卖。江寒河出生时，主网已经上线，这意味着他从没有手写信件的人生经历，但他的确看过一些信，这是他父母给他留下的遗产。</p><p>文件柜的深处，是江寒河父母为他留下的一个小盒子，盒子中除了一些首饰，余下的都是信件，他开始翻阅这些信件。当他感受到焦虑时，总是通过专注地阅读来排解自己心中无法解决的烦恼，如同与自我的困兽之斗。江寒河从小就非常喜欢读书，他的父母和亲戚经常会寄给他 20 世纪末的发行的纸本书籍，比如经典文学作品，这些故事构筑着江寒河内心的一个重要部分，一个他无法与别人诉说，也不指望他人理解的部分。</p><p>大部分信件的纸张都已泛黄，说明这些信件的时代非常久远。信中的内容是江寒河父母之间的私人通信，其中一小部分是情书，江寒河从来没有写过情书，在他的时代，结婚证通过民政局的接入点自动发行 NFT 存入生物芯片的钱包地址中，智能合约会自动在主网上产生一个代表家庭资产的多签钱包，新人们使用手机 App 分享结婚证明到社交网络，接受亲朋好友的祝福。江寒河想，现在的时代，人们已经很难将情感寄托到一方薄纸上。父母的情书不多，但却是这些信件中最有趣的一部分，在信件的最后，江寒河母亲的日记本静静地躺在盒子中，这是一个非常传统的日记本，有着一个铜制的小锁，一把实体的锁，它不能通过生物芯片的签名打开，必须要有一把钥匙。这把钥匙，正散落在首饰盒的角落里。</p><p>江寒河从没有打开过这本日记，阅读母亲的私人日记在他看来是不道德的。如果说信件是两个人的谈话，日记则是自我的内心世界，他不想去窥探母亲的内心世界，但又对这本从没阅读过的日记抱有非凡的兴趣，这把锁也是他童年的一部分，在那个时代，家中还有一些东西由真正的锁而保护着，想到这里，他还是拾起钥匙，指尖轻轻一转，日记本的小锁便解开了。</p><blockquote><p><em>2065 年 11 月 13 日 / 小雨</em></p><p>病房外边有雨声，滴滴答答，像小时候家里平房的中庭。</p><p>身子越来越难受，而且这种难受似乎将要抵达终点，以前无法理解有人能预测自己何时离开人世，现在却终于有了这种感觉。想给儿子写的话很多，但手疼地已无法握住铅笔，希望寒河以后的人生能平安顺利，别像我这样忍耐痛苦。我想我的时间到了，现在只想休息。</p><p><em>2065 年 11 月 12 日 / 晴</em></p><p>今天做了一次检查，主治刘医生说恢复的不佳，问我有没有想吃的东西，我说没有太多胃口，他同意再开一些营养剂和镇静剂。</p><p>确认了留给儿子遗嘱的合约地址，一切照常。 希望晚上能睡好一些。</p></blockquote><p>和一般书籍不同，日记的第一页是母亲生前最后的记录，或者说，这本日记是从右侧开始书写的，这是一种更为传统的书写习惯。母亲并没有留下什么特殊的话，也许当她知道自己将要离世而去时，更多的语言也苍白无力。寒河的母亲已经离开三年了，但他很少感到悲痛，取而代之的，是一种淡淡的思念，在他的人生中，母亲和他相处的时间很少，但当他阅读至亲的日记时，仍然止不住眼泪，母亲在一生中最后的时刻，已难以提笔，却还思念担心着自己。作为儿子，他却没有尽到送终的责任。</p><p>江寒河含着眼泪翻到下一页，却看到了不属于母亲的字迹：</p><blockquote><p>安芸：</p><p>近来可好？从江昊那里知道你的消息，为何要故意瞒着我们，虽然很久未有联系，生了这样严重的病，我们还是有必要去医院照顾你，我和儿子买了十三号的机票，一下飞机，就直接去你那里，很久未见，希望你不要嫌弃我们风尘仆仆。</p><p>儿子长大了，马上要大学毕业，想你也几年未见，心里念想着，他也太久没见你，都快忘了还有你这个妈妈。没办法，一直在外地，工作缠身，他学业也繁重，面临毕业，琐事很多，他挺好的，成绩也好，工作马上定了，比我年少时少了些狂气，多了些书卷气，更像你。我蛮高兴。</p><p>虽然难以启齿，写信来，一方面想让你知道我们的生活近况，一方面，还有另外一件丑事，不得不请你帮忙，我知道你身体不好，可是我们实在也是没有办法，儿子大学用的钱，加上给他准备房子，婚事的开支，我迫不得已，和地下网络借了点钱，大概一年前的事情了，本来觉得我的工作没问题，没想到今年遇到失业，不得不重找工作，大家日子都很苦，他们最近找上门来，你知道的，这种事情我没法给你在主网上发消息，只好给你写了信。我不知道有什么其他办法能度过这个难关，安芸，我们之间经历过的风风雨雨，你要相信我。</p><p>信里先写这么多，见了面我再同你细说，这封信务必读完销毁。另，希望你能好好的</p><p>勿念，知安。</p></blockquote><p>知安，一个从未听说过的名字，江寒河眼含泪水读完这封信，却发现自己误打误撞闯进了母亲内心的一处私有地。奇怪的是，他并没有感到恼怒，也不责怪母亲为何从来没有向他提到过这个同母异父的兄弟，相反地，这个意外让他想到，自己也许在这世上还有血缘关系的亲人，这个想法让他重新振作起来。</p><p>或许，江寒河所要寻求的答案，就在这一封陌生人的来信之中。</p><hr><h3 id="h-4" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4. 缸中之脑</h3><p>江寒河翻阅童年时与父母的转账记录，终于找到了母亲的生物识别芯片地址，这一长串的哈希，代表了生他养他的女人，短暂一生中的所有足迹。</p><p>通常，当生育中心回收亡者芯片时，会将其中较为隐私的交易进行脱敏，这些交易在生前由一个零知识证明（ZK Proof）的受控多层网络所管理，但当芯片失效后，这些原始记录会以快照形式被上传到主网中，作为公民最终的数字遗产，也便于公共机关的调阅。作为安芸的直系亲属，江寒河的生物芯片签名有权限浏览快照中的所有内容，他很快找到了知安的地址记录，这也是母亲的最后一笔转账。</p><p>在生物识别网络中，一旦确定了芯片的公钥地址，寻找人的位置就变得非常轻松，太多接入点有这样的权限。江寒河只要能证明与他与知安有着旁系血缘关系，走向警察局寻求帮助，就可以很轻松地获得这个地址的地理位置，不过，由于他并非刑侦人员，位置不会精确到米，但足够他寻找到自己的目标。</p><p>民警给的地址离江寒河所住的城区并不远，这让他感到意外，也许在母亲去世后，这个叫知安的人由于愧疚也搬来了这个城市，也许是什么其他的巧合，导致这个陌生的「父亲」不得不在城里落脚，重新建立自己的生活。江寒河花了一个周末的时间规划行程，他得让公司同事不对这次意料之外的出行感到好奇，他还得编造一些故事，用以逃避原本周末预定的安排。</p><p>周六早上，江寒河收拾好行李，他甚至准备了一些口粮，以应对突发的意外情况，在他看来，比起某个神秘子网的测试钱包中收到一笔天价转账，其他事情的发生都不能算做意外，因此必须做好万全的准备。为了防止确切的信标踪迹被公司发现，他选择骑自行车前往目的地，这样便能够自由绕开人多的区域，这种行动轨迹不容易让主网生物信标识别到准确的最终位置。</p><p>由于绕路太多，他在午后才抵达目的地，这是一处平平无奇的混凝土建筑，只有两层，坐落在一片荒废的公园和杂乱的上世纪的老破小民房之间，大门紧锁，看起来没有人们生活的迹象。这让他感到疑惑，并再次确认了民警给的位置，方圆两百米，似乎没有其他的可能性，那个叫知安的人，一定在附近活动或者生活过，江寒河决定先从附近的民居开始，一家家敲门询问。</p><p>江寒河假装自己是社区保险公司的工作人员，只需参与登记就能领取空投，这个老派的做法很有效，由于这种老破小民房居住的基本都是老年人，一旦有免费赚钱的机会，他们都会情不自禁的上钩。很快，江寒河发现了认识知安的人。</p><p>「有个叫什么知安的人，姓什么我给忘了，他就在那边那个酒吧里工作」一个面相约有七十的老者说。 「酒吧？是那个两层小楼吗？」江寒河问。「对对，那个楼白天不开门，晚上闹哄哄的，不是我们这种老头子去的地方，有一次酒吧找保洁，我进去过一次，那个叫什么知安的人，好像是那边的管事的噢」老者说。 「非常感谢，明天保险公司空投时您记得领取」江寒河没想到这么快就找到了线索，匆匆告别了老人。</p><p>这个酒吧没有名字，唯一的铁门紧锁，敲门也没有任何反应，江寒河想，也许只有在这里等到晚上，才能进去一探究竟，想到这里，他决定去旁边荒废的公园短暂休息。他找了个看起来还算干净的躺椅坐下，秋意渐浓，好在公园里风还不算大，一整天的疲惫困倦与高度的精神紧张，让江寒河只想短暂地睡上一觉。</p><p>再醒来时，朦胧的夜色中有一个黑色的身影，越走越近，直到身影走到他身前，他才发现自己即无法看清对方是谁，也没法发出声音。肌肉的酸疼随着神志恢复逐渐传递到江寒河的大脑，他意识到自己的身体极度扭曲：他正被反绑在凳子上。</p><p>「你是谁？有什么目的？」这个身影发出质问。 「你能不能...先帮我解开...」江寒河感到胸口一阵苦闷，难以呼吸。 「你先说你是谁，为什么出现在这？」陌生的身影显得不耐烦。 「我来找知安，求你了，我是安芸的儿子」江寒河乞求道。 「.......」那个身影一阵沉默，随着急促的呼吸声，江寒河再一次陷入了沉睡。</p><p>不知过了多久，江意识到自己正在梦中挣扎着醒来，这个梦太长了，以至于他感受到身体十分的疲倦，他努力睁开眼睛，意识到自己处在一个开阔的房间中，昏暗而柔和的灯光照亮了房间一角，一些仪器正发出有规律的蜂鸣，他不知道自己在哪里，但他能理解到自己并不处于威胁之中：他正睡在一个陌生人的床上。</p><p>「抱歉」陌生人从房间的一角走近「你终于醒了，可能是我用的安定剂剂量太大了」 「...你是？」江寒河试图询问。 「我是你要找的知安，不过，其实我是他儿子」陌生人说到「你可以叫我知云」</p><p>江寒河试图坐起来，眼前这个陌生人的形象变得具体，他有着一副尚未成熟的稚嫩面容，似乎由于长时间没有足够的光照，皮肤惨白，身板也略显单薄，但眼神中折射出某种坚毅。</p><p>「我需要找到你父亲，我读过他写给我妈的信，我需要知道一些事情」江寒河说。 「我爸早就死了」年轻人指了指房间一角「现在你只能问我了」</p><p>江寒河往房间的角落望去，一个透明的鱼缸连接着仪器，闪烁着规律的灯光，鱼缸之中，赫然陈列着一个微微颤动的大脑，江寒河没有看错，这是他第一次看到如此惊悚的场景，一个活生生的人类大脑，被寄养在鱼缸之中，生物识别芯片连接着这个大脑，发出柔和而美妙的绿光...</p><hr><h3 id="h-5" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">5. 逃往地下网络</h3><p>江寒河仍未从极度震惊中反应过来。</p><p>他无法理解面前发生的一切，也无法理解这个叫做知云的男孩，似乎对这一切习以为常，未有觉得任何不适。江寒河心想，也许他能从男孩那里得到自己想要的答案。但不知为何，他觉得知云是他在这个世界上唯一可以信任的人，不仅因为发生在他身上的事情远超江寒河能理解的范围，更是因为他们在血脉之中，有着某种微妙的联系。</p><p>江寒河试图用清晰而完整的语言向知云描述了他遇到的所有事情，包括测试网络的天价错误转账，知安写给母亲的书信，和他试图寻找知安的过程。江寒河能感受到，面前聆听这个故事的男孩有一种极度专注的力量，他不仅在倾听，还在时刻判断问题的严重性和局势的变化，一开始，他只是表现出了浓厚的兴趣，但听到故事的最后，他意识到什么事情不对，急忙站起来，从办公桌上取走一些卡片，匆匆走出房门，过了一会儿，又匆匆回来。</p><p>「我们时间不多了，得赶紧离开这里」知云说：「你已经昏迷了两天，今天是工作日，网盾公司很可能已经联系了警察局，去寻找你的位置，他们很快会到这里来」 「抱歉，我不知道我会给你带来麻烦」江寒河说。 「现在不是说这个的时候」知云丢了一个背包给他：「比起这个，你有更大的问题要处理，我们得马上转移到安全的地方去」</p><p>地下室的另一扇门连接着车库，这里存放着一台看起来多年未曾使用的皮卡，知云小心翼翼地将缸中之脑固定在汽车上，而后坐上驾驶座熟练地发动汽车。很快，他们驶出居民区，开向郊外。</p><p>「我们得马上接入地下网络」知云说道：「那里有可以屏蔽芯片的设备，这样他们就无法追踪到我们的具体位置」 「你是说，现在有一种办法可以屏蔽生物识别网络的信标信号？」江寒河不解的问，这些天，太多事情在他的意料之外发生。 「是的，只有这样他们才无法找到我们的确切位置」知云说：「但你的失踪引起了警方的注意，我想，你已经不再需要这个身份了」</p><p>江寒河转头望向地平线，巨大的城市在他们的视野中越来越远，慢慢的，就连高楼也消失在地平线之下，他不知道自己在这样的处境下有什么办法，除了信任世上唯一的兄弟，江寒河找不到任何出路。他选择放弃思考，又从心底感受到一种深切的自由，在他三十多年的人生中，从未体验过的自由。</p><p>皮卡最终在一处郊野农场停下，这里似乎人迹罕至，江寒河不知道现在他们离城市有多远，他也不想知道，这里给他一种从未有过的安全感，好似曾经来过。他们安顿好行李和缸中之脑，知云带着他去见这个农场的朋友，江寒河这才意识到，这个郊野农场远比自己想象的更加繁华：巨大的俱乐部建立在这些蔬菜大棚之下，这个酒吧的规模甚至比知云经营的酒吧规模还要大上十倍。</p><p>「你们甚至有驻场 DJ ？」江寒河疑惑。 「你不是没来过酒吧，别像个小孩子一样到处看」知云回答。 「欢迎欢迎，一般来讲我们不接非俱乐部成员」知云的朋友说：「但知云和我说了你的事情，我们会给你准备一个新的身份，我想，你肯定有钱支付这个。」</p><p>江寒河打量这身边这个大块头，这个身形魁梧的男人，左臂的纹身是一条马赛克青龙，右臂纹着一个 BTC 的标志，在江寒河的印象中，这是一种极其古老的加密货币，远在主网上线之前，就有一些加密货币的早期信徒在使用这种货币。这个男人虽然面相凶狠，声线却非常温柔。</p><p>「新的身份... 指的是？」江寒河不解。 「我们可以为你准备一个新的生物识别芯片，这样你就可以自由的做任何你想做的事情」大块头说「反正你有足够的钱能够自由的活着，为什么不呢？哈哈哈」 「我知道... 但这些钱在一个奇怪的子网中，我甚至不知道这个网络是不是真的存在...」江寒河问。 「没有钱会凭空出现」大块头笑着说「如果哪个傻子转错了钱给你，你应该偷着乐，我们可没有这种好运气！」 「别担心，只要你能付足够多的钱，什么网络他都能给你洗出来，哈哈哈」知云拍了拍江寒河的左肩「这里不仅仅是附近最豪华的酒吧，还是华北区域最大的流动性农场（Yield Farm）你放心！」</p><p>或许是酒精的作用，江寒河有些迷离，他看着身边两个嬉笑的年轻人，仿佛自己在短暂的人生中第一次有了挚友，他们的快乐纯粹而自我，以至于江寒河也被这种情绪所感染。现在，他终于意识到自己也许有能力开启一段崭新的生活，他不再需要回到那个枯燥而无趣的循环中去，也没有人必须告别。</p><p>三十五年的人生中，江寒河心想，他第一次活出了自我。</p><hr><h3 id="h-6" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6. 纸上的通行证</h3><p>「我看了你给的网络地址，这不是我们维护的平行网络」大块头说「对了，我还没和你介绍，这儿的人都喊我 Cyberpunk Dog，简称 CPD，或者朋狗，随便你怎么喊，哈哈哈！」 「我不知道，这原本是我开启的一个测试网络…」江寒河回答道「测试网络的地址通常是随机的，我不知道他们竟然能和到主网以外的网络连接上…」 「一般是不太可能，因为主网节点和地下网络的运行机制不一样，那些狗娘样的把区块链的开源代码协议改的乱七八糟」朋狗说「我不知道你们网盾公司的模型是怎么运行的，你有代码吗？」 「没有，我也只是个做测试的…」江寒河说「我没权限接触到模型代码…」 「没事儿，虽然不知道这个网络何时开启，不过我们有了地址和端口，我会写个程序来检测它何时开启」朋狗说「总能碰到它开启的时候，如果我们运气好，可能一两周就能把这个网络里的钱交换出来，你的钱包里存着 <code>USDX</code>，不用担心，我们这有足够大的流动性池子」 「交换出来。。指的是？」江寒河不解「是 BioID 主网吗？」 「怎么可能」朋狗说「看来你要补课的知识还有很多！」</p><p>趁着 CPD 写代码的时候，江寒河找到知云询问他应该了解的背景知识。知云泡了一杯咖啡，开始事无巨细地介绍平行网络的由来：</p><p>远在 2017 年，基于区块链的平行网络就出现了，你可以这么理解，在远古互联网之上，人们开始构建了一些基于互联网的经济系统。每个系统中有一种或多种代表货币的代币，这有点像你在主网中使用的法币 <code>bioid</code>，只是这些货币的形式非常多。一个平行网络中，通常同时存在几百种不同的货币，有些价格稳定，有些价格波动。这个是我们现在主网的背景基础。</p><p>当然，在生物识别网络出现后，法币被代币化了，所有的经济体系被迫迁移到主网中来。像我们都是主网后出生的一代人，所以我们会认为这理所当然，但在主网发明之前，这个世界上存在着许多平行网络，在多链平行网络时代，多达数千种区块链存在，每个平行网络所擅长的功能是不一样的，网络之间的货币通过垮链桥技术来互换，当然，我们现在运行的地下网络也支持这种技术。还有，多链平行网络的时代里，创建钱包是完全随意而且匿名的，你想象一下，一个人可以拥有很多个钱包，只要你想，你可以隐藏自己的收入和支出，当然，现在这是被主网严格禁止的行为。</p><p>即使在今天，平行网络也是存在的。知云继续说，我相信还有很多人在维护者其他的地下网络，比如给你转错钱的那个网络，如果他们有这么大的资金规模都能弄错，说明他们的池子远比我们经营的网络要大。不过，要寻找到他们比较困难，反过来说，如果你在我们的农场进行混币，他们要寻找到你也是很困难的。不过，这不是你要担心的问题，就算他们能找到你，也是在你拿了钱跑路之后的事情。</p><p>不过，我有一个想法，知云说，与其担惊受怕地在郊区生活，你不如用这笔钱买个去火星的船票得了。我听说现在混币桥支持直接转到火星的平行网络 <code>MARSX</code>，前提是你得有个<code>MARSX</code>的钱包地址，不过 CPD 能帮你搞来这个，小菜一碟！他还可以帮你换一个新的身份，知云指了指缸中之脑，这样你就可以自由移动到星舰发射基地去。买船票和换身份可能需要一大笔钱，知云说，不过你可以考虑一下，这样解决问题一劳永逸，这么多 <code>USDX</code> 我们是没法帮你洗到生物识别主网上去的，没这个可能，就算一百个全新身份也不可能，知云补充道：如果你不想每天像我们这样在地下网络找乐子，不如直接飞去那得了！</p><p>「火星...? 我从没想过这个问题」江寒河说「那儿适合人类生活吗？」 「可能不太行，毕竟我也没去过」知云说「但那边已经大开发三十多年了，可能不如主网方便，但是你想干啥就能干啥，不用担心芯片的事儿，听说还有不少中餐厅，上海菜湖南菜都有...」 「地下网络真的能买到去火星的船票？」江寒河问。 「兄弟，只要你有钱，没啥不可能的」知云说「你放心！」</p><p>傍晚，CPD 已经写好了扫描脚本，江寒河与他交换了想法后，他答应帮忙。</p><p>「我可以试试看，只要筹码多，应该不难买」CPD 说「在这之前，你得给我记一个私钥」 他拿来一张纸：「你最好写在纸上，这样谁都 Hack 不到，等你到了火星那个鬼地方，再随便找个手机恢复就可以了，绝对安全！」</p><p>江寒河借过纸和笔，在电脑面前端坐，一台老式液晶显示器的光标闪烁，命令行界面中弹出了一段长长的私钥，寒河一顿一顿地将它抄写在纸上，他太久没有写字，更无法理解这种古老的密钥保存方式意味着什么。酒吧的欢笑声吵吵闹闹，在昏暗的霓虹灯下，一个个单字被涂写在白纸上，这一切似乎是某种神秘的仪式：</p><p>他隐约能感觉到，白纸上这段冗长的编码，决定着自己未知的人生命运。</p><hr><h3 id="h-7" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">7. 自由应许之地</h3><p>「STR2065 航班将在一小时之后起飞，请还未办理登舰手续的旅客尽快办理手续」广播的回音萦绕在登机大厅。</p><p>江寒河穿着一身笔挺的西装，他已经太久没有穿着如此正式，恍惚中，他感觉自己似乎将要步入婚姻殿堂，而非奔向陌生的星球。空荡的候机大厅的中央，耸立着一个巨型的白色高塔，那是登上星舰船舱的电梯，也是前往一个陌生星球唯一的通道。</p><p>「天童博士，欢迎您登机」地勤人员殷勤地问候到「已经为您查验好船票，您的位置是 31A，请务必按照自己的位置就坐」</p><p>江寒河还不适应自己的新身份，他不知道这位天童博士曾经的人生经历过什么，但他有足够的时间，能在手机 App 上查阅这个崭新的身份曾经辉煌的人生：他在哪里吃过早餐，曾经为孩子买过什么样的礼物，又或者哪一天从某个大学毕业，这些陌生的经历不断从 App 中弹出。江寒河觉得有些愧疚，他还没有足够熟悉这个陌生人，就不得不继续使用他的人生。</p><p>这是天童博士人生中最后的旅途，却是江寒河三十五岁人生崭新的开始。</p><p>STR2065 是一艘饱经风霜的星舰，它焦黑的外壳证明着这艘火箭在地球与火星之间至少来回飞行了数十亿公里。随着舱门的顺利关闭，星舰开始有规律地缓慢振动，这种振动由浅入深，由慢至快，最终变成一种巨大的轰鸣，江寒河转头望向舷窗，火箭外侧包裹着烈焰，正试图带领着他们脱离这个蓝色星球的所有束缚，飞向未知的自由应许之地。</p><p>江寒河感到一阵眩晕，想起星舰在登机时发放的镇静药，自己却忘了服用。他挣扎着起身，试图拿出上衣口袋中的药丸，趁着尚未完全失重，一口气吞了下去。他重新端坐在座位上，确认安全带已扣好，记载着钱包私钥的纸片也静静地躺在衬衣夹层中，舷窗外已是一片死寂的黑夜，巨大的噪音消失在永恒宇宙之中，黑暗代替天空成为人们立足的大地，一切归于宁静。</p><p>在这飞向虚空的漫长旅途中，他却感受到一种由衷的爱。这种感觉从何而来，他也无法自知，或许因为失重，或许由于镇静剂的药效，他迷糊而幸福得飘在浩瀚无迹的太空之中，像个微醺的醉鬼，孤身一人，不与任何人连接，不依赖任何网络生存。在这短暂的一刻，他触摸到最为纯粹的自我。</p><p>江寒河终于沉沉睡去，他的生物芯片闪烁着黯淡的红光，孤独的星舰终于脱离了主网，驶入太空更深处。上衣口袋里的手机发出微弱而持续的振动，江寒河不知道，在无数发给天童博士的未读消息之中，有一条信息是因他而来。</p><p>在他安详的梦境之中，渺小的蓝色星球背向着他飘往远处，最终变成某个湮灭在无垠宇宙中的光点，在那个光点之中，所有人与所有人拥抱在一起，彼此紧密联系，他们用过去，现在与未来的人生，构筑了一堵难以逾越的高墙，一个无从逃避的网络，一段段永不消逝的哈希。</p><hr><p>插图作者：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/1418062710Wala">Wala</a> 版权所有，未经授权，不得转载。</p>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/0f769cf706e3c67f04b4683f619d924bbdba9e011424e2d25e3d09ecd3256b81.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[关于Web3: 退休这两年我错过的技术趋势]]></title>
            <link>https://paragraph.com/@guoyu/web3</link>
            <guid>uh1lZdAYldUvXac4KkU8</guid>
            <pubDate>Mon, 27 Dec 2021 13:07:43 GMT</pubDate>
            <description><![CDATA[如果你想听一听关于我的故事，我会很愿意用柴禾生一堆篝火，最好是夏季尚未来临时，空气中仍然飘散着丝丝凉意，时间最好是傍晚，这时黄昏的霞光正装饰着远峰的山脊，我们坐在湖边，远处有一些孩子嬉闹的声音传来，这声音可能来自湖的对岸，那里有一片广阔的黑色沙滩，几处帐篷旁的灯火悠悠晃晃，微凉的夜晚如期而至。 网络上有各种关于我的故事，这里一个版本，那里一个版本，无外乎是一些相似的事情组合而成，关于选择，幸运和财富。但如果让我来说一个版本，我想从更遥远的某一天开始，那是一个很长很长的故事，关于一个内向的小男孩试图改变自己，却又固执地选择了与代码相伴的人生。在没有选择而不得不做出选择的时代，那是一个彻头彻尾的关于逃避的故事，它冗长，无奈而略带悲情，与我们当下所发生的剧烈变化相比，既无趣又无足轻重，它又是私人的，情绪化与莽撞的。 十三年前的一个夏天，我开始学习写代码，那也是我第一次接触 Web，与很多人一样，我们曾对未知的事物抱有强烈的好奇心，但并不能预知未来，也就是十三年后的当下，这些技术能在多大程度改变我们的社会。人们经常把 Make the world a better place 当做程序员...]]></description>
            <content:encoded><![CDATA[<p>如果你想听一听关于我的故事，我会很愿意用柴禾生一堆篝火，最好是夏季尚未来临时，空气中仍然飘散着丝丝凉意，时间最好是傍晚，这时黄昏的霞光正装饰着远峰的山脊，我们坐在湖边，远处有一些孩子嬉闹的声音传来，这声音可能来自湖的对岸，那里有一片广阔的黑色沙滩，几处帐篷旁的灯火悠悠晃晃，微凉的夜晚如期而至。</p><p>网络上有各种关于我的故事，这里一个版本，那里一个版本，无外乎是一些相似的事情组合而成，关于选择，幸运和财富。但如果让我来说一个版本，我想从更遥远的某一天开始，那是一个很长很长的故事，关于一个内向的小男孩试图改变自己，却又固执地选择了与代码相伴的人生。在没有选择而不得不做出选择的时代，那是一个彻头彻尾的关于逃避的故事，它冗长，无奈而略带悲情，与我们当下所发生的剧烈变化相比，既无趣又无足轻重，它又是私人的，情绪化与莽撞的。</p><p>十三年前的一个夏天，我开始学习写代码，那也是我第一次接触 Web，与很多人一样，我们曾对未知的事物抱有强烈的好奇心，但并不能预知未来，也就是十三年后的当下，这些技术能在多大程度改变我们的社会。人们经常把 Make the world a better place 当做程序员自嘲的范本，因为对于很多人来说，这样理想化的目标不太可能成为现实，但我的想法会有一些不同，我不知道我们能不能将世界变得更好，但是在某些周期的开始，We can make a difference.</p><p>在我的十几年的程序员人生中，我能感受到一些事情的发生，并意识到这些事情可能带来的重要性远超我的想象。这些时刻是美妙的。譬如 iPhone，社交网络，基于深度学习的推荐系统等等，这些时刻有时是微小的火花，乍看似乎只是对现有技术的整合，但在这些技术的背后，都酝酿着庞大而与众不同的故事。</p><p>但没有一个故事，如同 Web3 这样宏大，天翻地覆而事无巨细地，想要重新构筑我们赖以生存的互联网。</p><hr><p>时间回到 2013 年 4 月，当浏览 Hacker News 时，我被一个称为 Bitcoin 的加密货币算法所吸引，这篇文章发布时，Bitcoin 的价格正好达到了 100 美元。那一周，在我主持的支付宝体验技术部周末分享会 ATP 上，我把这个消息写到了 PPT 里，我尝试下载钱包并花了相当长的时间同步所有账本记录，几天之后，这个钱包收到了朋友的一笔转账。</p><p>短短半年之后，这个故事几乎以同样的方式又发生了一次。只不过，这次的价格超过了 1000 美元。由于国内外交易所价格有相当大的时间差，我花了两天写了一个简单的命令行价格查询看板，以 btc 名义发布在 npm 上，虽然很久不再维护，但这个项目至今还留存在社区中 <code>$npm install btc</code></p><p>然后是 2017 年，这个故事又发生了，我们看到了惊人的『价格泡沫』与 ICO 乱象。那一年，也是我第一次尝试编写智能合约。当然，在我的其他时间线上，那也是充满困难和曙光的一年，抖音获得了巨大的成功，这意味着我的生活或许面临着一些新的可能。</p><p>如果一个故事以同样的方式发生三次，那么几乎可以断定它还会再次发生。只是，我们无法想象它会以什么形式到来。2020 年 2 月我选择退休后，许多事情打乱了原有的计划，全球疫情的持续，让我不得不把除了写作之外的所有计划都暂时搁置，专心经营自己的生活。对于我来说，这是无比安静的两年，但在 Web3 的世界，这却是惊涛拍浪的两年。</p><p>在华丽的泡沫之外，又有什么发生了变化，甚至可能引领着变革？</p><hr><p>一些都要从 2020 年的 DeFi Summer 说起。</p><p>电影「时代精神」中曾经提到，维持着现代雇佣关系的根本，在于美联储如何「凭空」创造出原本不存在的美元，这个行为定义着债务，也定义了资产。如果我们无法向大众证明 ERC-20 token 不仅仅只在技术上存在流通价值，而只是徒有白皮书的空中楼阁，我们就无法将这个泡沫吹的更大。DeFi 巧妙地将银行的事务通过合约自动化，成了事实上的「链上银行」。这个变化使得稳定币池像海绵一般不断地吸入链下资产，甚至商业银行本身，有的也成了 DeFi 的用户。</p><p>随着链上锁定的稳定币池越来越大，故事的走向发生了变化。原本我们认为 BTC 或 ETH 应当做到的事情，正由越来越多的 ERC-20 稳定币来完成，这些 token 拥有货币的一切属性：自由流动，价值稳定，并且可以通过「流动性挖矿」被「凭空」创造出来。这些交易行为就像不同水系中流动的水一般，交汇，融合，分流与告别，通过灵活的组合，二级市场和衍生品市场自然而然地形成了。</p><p>与此同时，由于协议的一致性，实质上的美元可以通过跨链桥被自由流动到任何平行网络（指代区块链和它的二层方案）这意味着，美元霸权随着稳定币规模的增长而被延伸到区块链，延伸到每个平行网络的衍生品市场，并被长期锁定在网络内。如果投资者能够 7x24 小时在链上获得稳定而透明的报酬，我们为什么还需要银行？DeFi 在逻辑上叙述了这样一个坚不可摧的故事，所有人都能理解，并且乐于理解。</p><p>我想，这个故事或许成了之后发生的所有事情的基础。</p><hr><p>如果 ERC-20 能代表稳定货币，为什么它不能代表股权？如果连复杂的银行事务都能被合约自动化替代，还有什么组织不可以被智能合约替代？</p><p>毫无疑问，DeFi 开启了人们对以 ETH 为代表的这一核心架构的想象力。而这一想象力甚至比任何互联网上发生的变化都要重大。</p><p>作为这个蓝色星球的主宰，人类最强的能力在于组织能力。我们拥有极富想象力和执行力的大脑，可以将任何困难分解成简单而细密的任务，并逐一破解，通过组织这个星球上最强的大脑，我们可以获得的能力比世界上已知的任何一种有机体都要强大。</p><p>DAO 是这种想象力的产物。我们可以把一个 DAO 理解为「链上公司」，它的基本运作依赖一些智能合约，这些合约可以将决策，薪酬，成本支出，股权资本等事务进行透明而自动的执行，它的资产存放于若干跨链钱包中，它的成员可以通过某种特定方式（是否持有 DAO 的治理 token）进行认证，从而实现自主的参与和退出，反过来，由于 token 协议的一致性和跨链方案的完善，任何 DAO 发行的公开市场股权（它的治理 token）都可以被平行网络的任何投资者买入进行投资，这相当于 DAO 在诞生时，就已经是一个全球化的上市公司。</p><p>如今，许多加密货币领域的投资案件都以 token 的形式支付，这似乎旁证了 DAO 的治理代币价值已被市场所广泛认可。DAO 的价值代币对 DeFi 形成了一种有力的补充：投资者可以使用大量现金在市场中寻求稳定的投资机会，也可以将一部分资产用于投资成长中的创新组织 DAO，以博取可观的未来收益。</p><hr><p>随着平行网络锁定价值的增长，人们的经济行为会愈来愈依赖网络本身，这不仅仅意味着投资，还意味着交易和购买。如果我们必须依赖场外交易（OTC）或者中心化交易所将 token 转换为法币才有购买力，这一切行为就显得毫无意义。</p><p>虚拟世界的经济已经随着互联网运行了数十年之久，但对平行网络来说，当务之急是确立虚拟商品的产权。我们在互联网上创造价值，并不仅仅因为我们将商品摆到网络上销售，我们所创造的图片，文本，视频甚至代码本质上都是商品。在 Web2 的世界里，这些商品几乎无法得到版权保证，不仅因为我们的账户属于商业公司，内容的「免费」与盈利模式的转嫁也是传统互联网产品的重要特征之一。</p><p>以 ERC-721 为代表的 NFT 是这个故事的主人公。2021 年，随着 NFT 交易规模的爆发性增长，几乎所有人都曾听过 OpenSea 的成长故事，但即使做到了全球交易规模第一的 OpenSea，也不过是传统艺术品拍卖市场的规模的 1/100。与货币不同，商品具有独一无二的属性，尤其对于虚拟世界的商品来说，这种独特性比刚性消费品更胜一筹，我认为，NFT 的长尾效应可能还没有完全显现出来。</p><p>产权是经济理论中最重要的基础之一。有的时候，它不一定代表商品，还代表纪念品或者个人身份，NFT 的应用广度，在于它能像 DAO 一样诉说一个庞大的，极具想象力的故事。门票可以是 NFT，工牌也可以是 NFT，它可以不代表价格，但它会拥有独一无二的价值，这些价值可能并不会通过 ERC-721 协议体现出来，而更可能是在它的拓展协议中，通过它不可模仿的元数据系统体现出来。</p><hr><p>如果说产权通证只是从技术上确立了虚拟商品的产权，那还无法形容 Web3 所带来的产权革命。由于 DApp 都构筑于统一的协议，注册与登录不再必要，用户所有的行为数据都存放在任何产品能够读取的公共网络上，当然，用户的个人资产都是离线而安全的。</p><p>钱包的战争仍未打响，但 Web3 钱包成了事实上的网络入口，商业公司不再拥有用户数据表，也失去了这一重要的护城河。反过来说，任何产品能够读取并理解平行网络中的交易数据，这意味着，DApp 不需要设计私有 API 就能向其他产品提供服务，虽然在很长一段时间内纯粹的 DApp 都不可能成为巨型平台的主流选择，但长远来看，这样的范式能将大部分公司的业务从非核心的事务中解放出来，而专注为用户提供优质的服务，最终，这样的产品会赢得用户和市场份额。</p><p>如果一家公司想要拥抱 Web3，那么它不得不接入钱包（或者为用户创建一个钱包）理想地来看，这会创造一个全新的触达用户的方式，因为人们的交易行为比其他行为更加能够形容一个群体，而这正是诸如淘宝这类巨型平台最大的壁垒之一（私有的用户消费数据）我认为，商业公司不太可能放弃这个优势去寻求拥抱新的平行网络，但一些新的服务会随着 Web3 的发展成长成为新的基础设施，直到这些大型平台不得不适应这种变化。</p><p>许多人认为 DApp 只不过是传统 Web 界面与智能合约的交互形式，但它所隐含的故事是，在 Web3 的世界中，不同产品能以前所未有的效率进行组合和合作，用户可以无缝地在不同产品中迁徙身份与资产，互联网没有任何一个时代能够如此顺畅，毕竟我们连邮箱 HTML 渲染逻辑都未曾达成过一致。</p><hr><p>如果你看到了这里，不免会产生困惑，因为我们在短时间内接触了大量的新概念。在上述的一些故事中，我尽量避免提到具体的公司和产品，因为有非常多优秀的工程师正在创造一些眼花缭乱的新东西，让人应接不暇，无法专注于思考问题。</p><p>而我认为，在这短短的两年中发生的变化，我们已经无法用「泡沫」一词来形容，它们与 2011，2013，2017 年所发生的故事有所相似，却全然不同。</p><p>让我们再捋一捋现在发生的变化：随着多链格局的形成和 DeFi 的热潮，大量资产逐渐被锁定在平行网络内，人们在网络内通过稳定投资获取利息，购买商品和虚拟艺术品，并且创建以智能合约为基础的分布式组织，这些组织分布在世界各地，成员通过网络协同工作，并以 token 的形式分配薪酬和股权，而所有这些产品都只需要通过同一个 Web3 钱包即可登录。</p><p>这看起来像是几个故事通过乐高组合到了一起，按照中国互联网人的说法，他们形成了「闭环」我觉得这正是 Web3 的魅力之处，这些组合而成的故事，并非是一家独大的商业公司所创造的「闭环」，而是不同产品，不同的 DAO，通过相互兼容的协议所创建出来的全新网络。这也是我为什么一直称其为「平行网络」的原因。</p><p>与传统互联网不同的是，这个平行网络自身是价值流动的网络。而承载这些价值的，是以 ETH 为启发的各种协议，这些纷繁复杂的共识层，计算层，储存层和应用层协议，将支持着下一代互联网，他们虽然实现方法有异，但都面向着同一个确定性的未来：</p><p>一个更加开放自由，用户享有的互联网，一个包容万象，浩瀚永恒的 Matrix。</p><hr><p><strong>推荐参考</strong></p><p>这里列出了这几个月我关注和研究过的部分项目，仅供参考。</p><p><strong>DeFi</strong></p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://compound.finance/">Compound</a> 提供借入和借出的流动性资金池</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://makerdao.com/en/">MakerDAO</a> 创造了算法稳定币 DAI</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://uniswap.org/">Uniswap</a> 去中心化交易协议，用于创建各种 Token 交易对</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://curve.fi/">Curve Finance</a> 专为高效交易稳定币而设计的去中心化交易协议</p></li></ul><p><strong>DAO</strong></p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://deepdao.io/#/deepdao/dashboard">Deepdao</a> DAOs 生态浏览器</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://daolist.fyi/">Daolist</a> DAOs 列表</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://aragon.org/">Aragon</a> DAO UI &amp; SDK</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gitcoin.co/">Gitcoin</a> 开发者 DAO</p></li></ul><p><strong>DApp</strong></p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ens.domains/">ENS</a> ETH 域名服务</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://walletconnect.com/">Wallet Connect</a> 支持多种 Web3 钱包登录的 SDK</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://thirdweb.com/">Thirdweb</a> 为 DApp 提供一键创建基本合约和模块的服务</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://openzeppelin.com/">OpenZeppelin</a> 智能合约 SDK 与代码审计</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mixbytes.io/">MixBytes</a>/<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.quantstamp.com/">Quantstamp’s</a>/<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://sigmaprime.io/">Sigmaprime</a> 智能合约代码审计</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://oneclickdapp.com/">One Click App</a> 一键将智能合约打包成 DApp</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://fleek.co/">Fleek</a> DApp 整合方案提供商</p></li></ul><p><strong>各种平行网络协议</strong></p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.avax.network/">Avalanche</a> 高 TPS 低成本多子网公链方案</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.arweave.org/">Arweave</a> 提供永久分布式储存的公链方案</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://filebase.com/">filebase</a> 提供应用层分布式储存解决方案</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ipfs.io/">IPFS</a>/<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://filecoin.io/">filecoin</a>/<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://siasky.net/">Skynet</a> 分布式储存方案</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rendertoken.com/">Render network</a> 分布式渲染</p></li></ul>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/dbff5b9225dbdca7c4a0ee3850f63a170d52f64242da29b2f24326f64ae439c0.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[DAO 与最佳组织的迷思]]></title>
            <link>https://paragraph.com/@guoyu/dao</link>
            <guid>Iy8X2C7UG7lGp7KAi7Fv</guid>
            <pubDate>Tue, 14 Dec 2021 08:35:29 GMT</pubDate>
            <description><![CDATA[2014 年春，我在一些变故后决定北上，参与振宇位于苏州街的创业公司，那是我人生第一次走进中关村，正如你们现在所看到的一样，七年前的中关村并没有什么不同，从海淀黄庄地铁站走到苏州街的一小段路上，会经过 e 世界大楼，微软北京，朔黄大厦，最后是海淀图书城，在那时，海淀图书城外聚集着诸多快递员和小贩，每日分拣清点通过网络书店卖出的图书，在这一番忙碌的景象之外，车库咖啡吸引着越来越多本不属于北京的年轻人，他们居无定所，每晚花12元人民币在车库咖啡过夜，这笔费用包括一杯饮料和从天花板上拉下的插座，每一个插座都满满当当地插着各种各样的充电器，通常是一台电脑和几台手机。 对程序员来说，那是一个梦幻般的时代。只要你会写代码，你就拥有了在那个时代构筑一些从来不存在的产品的能力，所有的产品仿佛都拥有一种确定性的未来，我们知道中国还有至少一半的用户没有连接互联网，而廉价的安卓手机将是他们踏上这一未知旅途的三等舱船票，那时一个极具创意的泡沫时代。 夏季来临时，我和朋友在海淀图书城外的大街上吃烧烤，我们通常工作到凌晨三点，夜晚的人流撑起了几个流动摊位，即使北方寒冷的冬天来临，这些小贩也会坚守着出摊到凌晨...]]></description>
            <content:encoded><![CDATA[<p>2014 年春，我在一些变故后决定北上，参与振宇位于苏州街的创业公司，那是我人生第一次走进中关村，正如你们现在所看到的一样，七年前的中关村并没有什么不同，从海淀黄庄地铁站走到苏州街的一小段路上，会经过 e 世界大楼，微软北京，朔黄大厦，最后是海淀图书城，在那时，海淀图书城外聚集着诸多快递员和小贩，每日分拣清点通过网络书店卖出的图书，在这一番忙碌的景象之外，车库咖啡吸引着越来越多本不属于北京的年轻人，他们居无定所，每晚花12元人民币在车库咖啡过夜，这笔费用包括一杯饮料和从天花板上拉下的插座，每一个插座都满满当当地插着各种各样的充电器，通常是一台电脑和几台手机。</p><p>对程序员来说，那是一个梦幻般的时代。只要你会写代码，你就拥有了在那个时代构筑一些从来不存在的产品的能力，所有的产品仿佛都拥有一种确定性的未来，我们知道中国还有至少一半的用户没有连接互联网，而廉价的安卓手机将是他们踏上这一未知旅途的三等舱船票，那时一个极具创意的泡沫时代。</p><p>夏季来临时，我和朋友在海淀图书城外的大街上吃烧烤，我们通常工作到凌晨三点，夜晚的人流撑起了几个流动摊位，即使北方寒冷的冬天来临，这些小贩也会坚守着出摊到凌晨五点，等待最后一批下班的工程师，为他们提供足够的能量。这种不健康的工作方式持续了几乎一年，我们在苏州街的大河庄苑小区租住了一处两室一厅民房，透过客厅的窗户，就是小区的幼儿园，从那年春天到冬季，我的寝室就是位于办公桌下方的一处床垫，我仍然记得我在中关村的沃尔玛超市购入了一些生活必需品，彻底打扫了一番浴室之后，这里就成了我在北京的第一个家。</p><p>那是我作为程序员的人生最开心的一段时光。我们依照硅谷的工作方式协作，没有人确定上下班时间，自我驱动，能够在短时间内尝试各种目标，周末时，我们会去参加在海淀各处举办的黑客马拉松，认识新朋友并与他们交换创意和想法，很长的时间之内，我们公司只有3-5个雇员，其中一些人还是以在校实习生的身份参与，但这不妨碍我们做了许多有意义的事情，很难说这些事情哪些取得了商业上的成功，但这些事情导向了一个美好的结果，在2014年的12月，我从振宇那里得知我们被今日头条收购，我们无法设想这家公司未来的走向，但这些都成为了那段美好时光的后话。</p><p>在这个结果发生之前，我曾经设想过有没有一种可能，我们可以维持这样的生活方式：一个小巧精悍的团队，有效且快速的尝试，技术导向，并且如果有可能，所有成员都能拥有决策和享受利润的权利。互联网的发展赋予了我们每个个体愈来愈强大的能力，但站在2021年的视角回望这段几乎理想化的时光，大部分小的公司在一轮又一轮的泡沫中淘汰或合并了，就像我们的结局一样，成为另一家大型平台的一部分，这当然是个美好的结局，但是在这样美好的结局之后，我们所有人都需要付出代价，完全竞争的市场是极端残酷的，这不仅仅体现在大公司与小团队的竞争当中，当这样的竞争充分且变得白热化时，残酷的竞争也会渗透到大公司的不同团队当中去。</p><p>每当我回忆那段美好时光之时，我最关心的并不是我们能否成长为一个巨型企业，而是我们能否在极低的成本之下运作，又是否能在某一个小行业立足，将这样的生活方式持续更长一些的时间。幸运的是，现在我们似乎有了这样的机会，确立虚拟产权这一共识似乎颠覆了一些行业获取利润的方法，一旦这些方法被改变，公司与组织的行程似乎也会随之变化，现在，我们有了某种「链上公司」的组织形态，这就是 DAO。</p><p>DAO 能解决所有问题吗？我很怀疑，但依助于它，我们确实前进了一大步。在我看来，所有的产品意义上的成功都取决于某种高效的组织形式，组织确保了我们如何获取和使用资源，即使在传统的组织当中，这些效率并不是自发的，或者换句话来说，当组织成长到一定的形态，它的自发效率会降低到几乎可被忽视的空间，直到它被另外一种更加具有效率的组织形式所替代。</p><p>硅谷的组织形态描述了一种理想化的方式：以工程师为中心的组织。但硅谷的组织形态并没有将工程师创造的利润以某种确切的方式回馈给他们，在这里，我们总能提到 IPO，在一轮又一轮的赌注之后，幸运的企业能以一种冠冕堂皇的方式发行他们的一部分流动股份，以换取投资人和早期员工的退出机会，这样的退出无疑是光彩夺目的，像我们曾经经历过的无数中概股的故事一样，成功的人们定义了对成功心心念念的人们的既定路线，但在这之外，IPO 也遇到了它长久以来的困境，关于这种困境有足够多的文章在描述，这不是我们（工程师）的能力可以左右的命运，我无法对这个问题给出一个确切的回答，但至少 DAO 给了我们一个全新的回答。</p><p>把自己的命运交于他人，或是完全掌控于自身，虚拟经济已不再是金钱流动在一些看不见的网络里这么简单的故事，我和一些人相信，它所塑造的东西，正在重新定义人与组织的价值配比，我们的确需要一种方式，可以更好，更持久地为互联网做出贡献，DAO 也许会为这个时代翻开新的一篇，谁知道呢？我希望我的理想主义幻想能够成为理想主义的现实，我相信会有更多人在心中构筑这样的理想，人们协作，创造，享有，即使他们属于不同的国家，年龄，甚至不同的星球。</p><p>我热爱泡沫，不仅因为它发出柔和与美妙的光芒，而在它之后，有着童真而炽热的心。</p>]]></content:encoded>
            <author>guoyu@newsletter.paragraph.com (郭宇)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b944e57d4de6350363a85e8bac8419ab5e07d7959836ba9f54df897d800ba1de.jpg" length="0" type="image/jpg"/>
        </item>
    </channel>
</rss>