プリンキピア

第11章Webアプリケーション開発

Web 3.0 Application ChallengesWeb 3.0アプリケーションの課題
Blockchains currently have a scaling problem. The average size of a block has increased over the years, and transaction fees are associated with each transaction. A common fee is the gas price, which is the cost of validating transactions and updating ledgers. Additionally, negative performance can occur on a blockchain with large amounts of transactions.
英語のヒント
現在、ブロックチェーンには規模の拡大に関する問題がある。ブロックの平均的な大きさは年々増え、各取引には手数料がかかる。一般的な手数料はガス価格と呼ばれ、取引の検証と台帳の更新の費用である。また、大量の取引があるブロックチェーンでは、性能が悪化することもある。
One approach to help with scaling is the use of sidechains. A sidechain is a secondary (i.e., level 2 or L2) blockchain that increases the blockchain network performance by aggregating transactions off-chain (i.e., off the mainnet/Ethereum network) and committing them to the mainnet at once. Polygon is a popular L2 scaling system for sidechaining. Other L2 scaling techniques include blockchain rollups, which are protocols designed to enable high throughput and lower costs. They address scaling by bundling transactions and reducing data sizes to increase transaction efficiency and limit storage costs. Examples of blockchain rollups include optimistic and zero-knowledge rollups. An optimistic rollup is a protocol that increases transaction output by bundling multiple transactions into batches, which are processed off-chain. In this case, transaction data is recorded on the mainnet via data compression techniques that lower cost and increase transaction speed. Optimistic rollups on Ethereum can improve scalability by a factor of 10 to 100. A zero-knowledge rollup (zk-rollup) is a protocol that bundles transactions into batches that are executed off the mainnet. For every batch, a zk-rollup operator submits a summary of required changes once the transactions in the batch have been executed. Operators have also produced validity proofs that demonstrate that the changes are accurate. These proofs are significantly smaller than transaction data so it is quicker and cheaper to verify them. Additionally, zk-rollups are used on Ethereum to reduce transaction data size via compression techniques, which ends up reducing user fees.
英語のヒント
規模の拡大を助ける方法の1つに、サイドチェーンの利用がある。サイドチェーンは、副次的な(レベル2、またはL2の)ブロックチェーンである。オフチェーン、すなわちメインネットであるEthereumネットワークの外で取引をまとめ、一度にメインネットへ反映することで、ブロックチェーンネットワークの性能を高める。Polygonは、サイドチェーン向けの、よく使われるL2の拡張システムである。ほかのL2拡張技術には、高い処理量と低い費用を実現するために設計されたプロトコルである、ブロックチェーンのロールアップがある。取引をまとめ、データの大きさを減らすことで、取引の効率を高め、保存費用を抑え、規模の拡大に対応する。オプティミスティック・ロールアップとゼロ知識ロールアップが、その例である。オプティミスティック・ロールアップは、複数の取引をバッチにまとめ、オフチェーンで処理することで、取引の処理量を増やすプロトコルである。この場合、取引データは、費用を減らして取引速度を高めるデータ圧縮技術によって、メインネットに記録される。Ethereum上のオプティミスティック・ロールアップは、スケーラビリティを10〜100倍に向上させることができる。ゼロ知識ロールアップ(zk-rollup)は、メインネットの外で実行するバッチへ取引をまとめるプロトコルである。各バッチの取引が実行されると、zk-rollupの運用者は、必要な変更の要約を提出する。運用者は、変更が正しいことを示す妥当性証明も作成する。これらの証明は取引データよりはるかに小さいため、検証は速く、安価になる。さらに、Ethereumではzk-rollupを使い、圧縮技術によって取引データの大きさを減らすことで、利用者の手数料を削減している。
Figure 11.12 shows the addition of sidechains to the architecture to mitigate some of the challenges associated with Web 3.0 DApps. Notice how the user’s interaction with the Web 3.0 app has grown from mostly reading content in a Web 1.0 model to more fully participating in the content and functionality of the Web 3.0 app.
英語のヒント
図11.12は、Web 3.0のDAppに伴う課題の一部を軽減するため、アーキテクチャにサイドチェーンを追加した様子を示している。Web 1.0モデルでは主に内容を読むだけだった利用者の関わり方が、Web 3.0アプリでは、その内容や機能へより全面的に参加する形へ広がっていることに注目しよう。
Figure 11.12

attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license · CC BY 4.0 · Source出典

Figure 11.12 The user’s interaction with the full Web 3.0 application is highlighted here. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license)
図11.12 完全なWeb 3.0アプリケーションにおける、利用者のやり取りに焦点を当てている。(出典:Copyright Rice University, OpenStax、CC BY 4.0ライセンス)
As you can see, the architecture has become rather complex to support DApps effectively. However, Web 3.0 is still in a nascent phase, and currently there are several solutions and tools being developed to make building and deploying Web 3.0 DApps even easier. Hardhat is a developer ecosystem for building and deploying smart contracts on a local network for testing.
英語のヒント
このように、DAppを効果的に支えるため、アーキテクチャはかなり複雑になった。しかしWeb 3.0は、まだ初期の段階にある。現在、Web 3.0のDAppの構築と配置をさらに容易にするため、さまざまな仕組みやツールが開発されている。Hardhatは、テストのためにローカルネットワーク上でスマートコントラクトを構築・配置する、開発者向けのエコシステムである。
This architecture focused on blockchains and used Ethereum as the principal implementation. However, there are other DLT solutions. Hashgraph is an approach where only selected nodes store the entire blockchain, and voting mechanisms are introduced to validate if the blocks are correct. Stacks is another DLT where only the smart contracts are decentralized, and the data is controlled by its owner. Owners can share or remove it—ensuring data privacy.
英語のヒント
このアーキテクチャでは、ブロックチェーンに焦点を当て、Ethereumを主な実装として使った。しかし、ほかのDLTの仕組みもある。Hashgraphは、選ばれたノードだけがブロックチェーン全体を保存し、ブロックが正しいかを検証するために投票の仕組みを導入する手法である。Stacksは別のDLTであり、スマートコントラクトだけを分散させ、データは所有者が管理する。所有者はデータを共有したり削除したりでき、データのプライバシーを確保できる。
TECHNOLOGY IN EVERYDAY LIFE日常生活の中の技術
Use of Frameworksフレームワークの利用
Web applications are used today to power commercial websites that are accessed by people to complete online transactions to buy goods of any kind. Mobile web applications and native versions of such are also available on smartphones and watches to help do the same. How does using web and native application frameworks help people in everyday life? Provide a couple of illustrative scenarios to explain your opinion. Your scenarios should not be limited to describing how the frameworks are used, but rather describe situations where these frameworks are applied in real life.
英語のヒント
今日、Webアプリケーションは、あらゆる種類の商品をオンラインで購入するために人々がアクセスする、商用Webサイトを動かしている。同じことを行うためのモバイルWebアプリケーションや、そのネイティブ版も、スマートフォンや腕時計で利用できる。Webアプリケーションやネイティブアプリケーションのフレームワークの利用は、日常生活で人々にどのように役立つか。意見を説明するための具体的な場面を、2つほど挙げなさい。フレームワークの使い方の説明にとどめず、それらが実生活で適用される状況を述べること。

Hybrid Web 2.0/3.0 ApplicationsWeb 2.0/3.0を組み合わせたアプリケーション

Due to the qualities and limitations of Web 2.0 and 3.0 architectures, it is likely that we’ll see solutions that are a combination of the two approaches and leverage their best attributes. One way to do this would be to have workflow processes that require a high rate of change implemented in a Web 2.0 architecture, while processes that would benefit from using a distributed ledger being executed in Web 3.0. For example, traditional commercial websites can keep using the Web 2.0 architecture, while payment solutions can be extended by accessing the Web 3.0 architecture to make payments using cryptocurrencies (e.g., Bitcoin).
英語のヒント
Web 2.0と3.0のアーキテクチャには、それぞれの特性と限界があるため、両方の手法を組み合わせ、優れた属性を活用する仕組みが現れる可能性が高い。その方法の1つは、頻繁な変更を必要とするワークフローの処理をWeb 2.0のアーキテクチャで実装し、分散台帳の利用から利点を得られる処理をWeb 3.0で実行することである。たとえば、従来の商用WebサイトはWeb 2.0のアーキテクチャを使い続けながら、決済機能についてはWeb 3.0のアーキテクチャへアクセスして拡張し、Bitcoinなどの暗号通貨で支払えるようにできる。
Let’s consider an app for generating AI artwork. Many solutions exist today for doing this; however, we want our app to give “ownership” to the digital artwork a person generates. AI models are trained to recognize existing artwork (e.g., paintings available via the wikiart.org API) that may be copyrighted—so ownership is still being determined in the courts. Here, the term ownership is used to attribute AI image creation and nothing more. While AI models are very popular, some companies do not want to share data with AI model creators and prefer to have the AI models deployed in their own infrastructure to ensure full privacy. A non-fungible token (NFT) is a unique digital identifier on a blockchain that a user may want to create of their image and possibly sell (i.e., transfer ownership) on a marketplace. A common use case for this app might be:
英語のヒント
AIによる芸術作品を生成するアプリを考えてみよう。今日、そのための仕組みは数多くあるが、ここでは、ある人が生成したデジタル作品について、その人に「所有権」を与えるアプリを作りたい。AIモデルは、wikiart.orgのAPIから利用できる絵画など、既存の作品を認識するように学習する。その作品には著作権がある場合があり、所有権の問題は、まだ裁判で判断されている最中である。ここでは「所有権」という言葉を、AI画像の作成者を示すという意味だけで使う。AIモデルは非常に人気があるが、AIモデルの開発者とデータを共有したくない企業もある。そのような企業は、完全なプライバシーを確保するため、自社のインフラ内にAIモデルを配置することを望む。非代替性トークン(NFT)は、ブロックチェーン上の一意なデジタル識別子である。利用者は、自分の画像のNFTを作り、マーケットプレイスで販売する、すなわち所有権を移すことを望むかもしれない。このアプリの一般的なユースケースは、次のようになる。
1. A user logs in to the website and enters a prompt to generate an image.
1. 利用者がWebサイトにログインし、画像を生成するためのプロンプトを入力する。
2. After several rounds of adjusting their prompts, they end up with an image they want.
2. プロンプトを何度か調整した後、望んでいた画像が得られる。
3. The user pays to have a non-fungible token created of the image, which is stored on a blockchain marketplace for sale.
3. 利用者が料金を支払い、その画像のNFTを作成する。NFTは、販売のためにブロックチェーンのマーケットプレイスへ保存される。
As you can imagine, running an AI image generator on a blockchain might not perform well. Likewise, creating NFTs without blockchain technologies is counterintuitive. Therefore, the architecture for this solution needs to encompass both Web 2.0 and 3.0 approaches.
英語のヒント
想像できるように、ブロックチェーン上でAI画像生成器を動かしても、十分な性能が得られないかもしれない。同様に、ブロックチェーン技術を使わずにNFTを作るのは、直感に反する。そのため、この仕組みのアーキテクチャには、Web 2.0と3.0の両方の手法を含める必要がある。
Figure 11.13 shows how the APIs will do the heavy lifting of working with the AI model to generate the artwork. Once the user is satisfied, they will interact with aspects of the UI that execute smart contracts to generate and add the NFT to the blockchain. Transactions will happen on the blockchain. APIs may interact directly with the blockchain, looking for similar works.
英語のヒント
図11.13は、AIモデルと連携して作品を生成する、主要な作業をAPIがどのように担うかを示している。利用者が満足すると、UIのうち、スマートコントラクトを実行してNFTを生成しブロックチェーンへ追加する部分を操作する。取引はブロックチェーン上で行われる。APIは、類似作品を探すため、ブロックチェーンと直接やり取りする場合もある。
Figure 11.13

attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license · CC BY 4.0 · Source出典

Figure 11.13 This outlines the user’s interaction with a hybrid Web 2.0/3.0 application. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license)
図11.13 Web 2.0/3.0を組み合わせたアプリケーションにおける、利用者のやり取りの概要。(出典:Copyright Rice University, OpenStax、CC BY 4.0ライセンス)
This model still has a centralized Web 2.0 server for artwork generation and account management; however, portions that deal with NFT ownership and selling of that ownership are managed within the Web 3.0 blockchain infrastructure. This approach serves the needs of many businesses that want to take advantage of Web 3.0 features while preserving their original Web 2.0 websites.
英語のヒント
このモデルでは、作品の生成とアカウント管理のために、中央集約型のWeb 2.0サーバーがまだ存在する。一方、NFTの所有権とその販売を扱う部分は、Web 3.0のブロックチェーン基盤の中で管理する。この手法は、元のWeb 2.0サイトを維持しながらWeb 3.0の機能を活用したい、多くの企業の必要に応える。