Difference between revisions of "Web Serving"

From Internet Computer Wiki
Jump to: navigation, search
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Dapp code hosted and executed on-chain==
+
'''The Internet Computer (IC) is the only blockchain that can host a full dapp; frontend, backend, and data included. This is a crucial and distinguishing feature allowing dapps to run 100% on-chain inheriting the security and decentralization of blockchain without sacrificing speed or affordability. This is possible because nodes of the IC can securely serve HTTP requests and by leveraging the reverse gas model.'''
Smart contracts on the Internet Computer serve web content directly to users. This is a distinguishing feature, on other blockchains a small part of the dapp logic runs in a smart contract, but the actual consumer-facing web or interface is hosted on a centralized cloud provider (e.g. AWS) instead of being served directly from the blockchain.
 
  
The Internet Computer serving dapps whose code is hosted and executed entirely on-chain unlocks the Web3 potential of smart contracts.  
+
===Enabling true web3===
 +
Today, most dapps built on other blockchains rely on centralized cloud providers (e.g. AWS, GCP) to host their frontend, amongst other parts, which introduces a single point of failure. An example pattern in the industry is to have a smart contract performing some computation, yet, the frontend is often served from a Node server. This not only includes security risks by possible tampering with the frontend, but dapps running on centralized servers can be taken down at any point, which negates the censorship resistant nature of blockchain. Web3 requires that all parts of a dapp are realized by smart contracts.
 +
Further, Web3 functionality is only achievable by blockchain applications running fully decentralized, which includes smart contract logic, on-chain data storage and serving frontend to the user’s browser.
  
==Reverse Gas Model (i.e. the "canister pays")==
+
Hosting dapps 100% on-chain provides the additional benefit of letting DAOs launched on the Internet Computer to completely control these applications with on-chain governance and not only the backend logic. This lets users be fully in control of these dapps realizing complete decentralization and democratization of web applications.
In dapps built on Ethereum (for example), users are required to connect a wallet or tokens to use it. This slows down adoption of dapps because using a dapp is not as simple as clicking on a website link; it requires users to buy tokens, install browser plugins, etc. Internet Computer dapps run on a "Reverse Gas model" users can interact with a dapp without having to pay in tokens since the canister can store a certain amount of [[cycles]] and pay for the user.
 
  
As an example, the Motoko Playground dapp is hosted and executed entirely on-chain and it does not require visitors to pay for the computation: https://m7sm4-2iaaa-aaaab-qabra-cai.raw.ic0.app/
+
===Processing HTTP requests===
 +
Blockchains differ in their processing of computation from regular web servers, which makes serving web a difficult task. To overcome this, the Internet Computer introduces something called [https://wiki.internetcomputer.org/wiki/Boundary_Nodes boundary nodes]. These nodes act as a layer that translates HTTP requests from users to messages that can be processed by smart contracts running on the Internet Computer. This allows users to update the state of the blockchain simply by interacting with a browser.
  
==Internet Identity==
+
===Reverse Gas Model===
  
[[Internet_Identity_technical_overview|Internet Identity]] is a blockchain authentication system that enables you to sign in securely and pseudonymously to dapps on the Internet Computer. This makes logging into dapps easy and safe for consumers.
+
Requiring users to have tokens in order to use applications and pay gas fees is an enormous barrier of entry. One key feature of the Internet Computer that allows users to directly interact with the blockchain through a browser for free is the reverse gas model. Simply put, canisters pay for their own computation and storage costs using cycles. In other words it is the developers and not the end-users who pay for gas.
 +
 
 +
This offers a very similar model to Web2 applications, whose hosting is taken care of by developers. The reverse gas fee model allows users to experiment with dapps for free and allows dapps to scale infinitely by not putting up a wall in front of their users at the very first interaction.
 +
 
 +
===Internet Identity===
 +
Users should not have to set up wallets in order to interact with dapps. To remove this hurdle the Internet Computer offers an alternative anonymous authentication solution called the Internet Identity. With it users can login to dapps running on the Internet Computer by simply using a biometric sensor on their device. In the background, Internet Identity uses novel cryptography and creates new ids for each dapp one authenticates with. This is a simple way for users to login and use dapps running on the Internet Computer without having to create a wallet, while they remain anonymous and untraceable across different applications.

Revision as of 13:36, 21 November 2022

The Internet Computer (IC) is the only blockchain that can host a full dapp; frontend, backend, and data included. This is a crucial and distinguishing feature allowing dapps to run 100% on-chain inheriting the security and decentralization of blockchain without sacrificing speed or affordability. This is possible because nodes of the IC can securely serve HTTP requests and by leveraging the reverse gas model.

Enabling true web3

Today, most dapps built on other blockchains rely on centralized cloud providers (e.g. AWS, GCP) to host their frontend, amongst other parts, which introduces a single point of failure. An example pattern in the industry is to have a smart contract performing some computation, yet, the frontend is often served from a Node server. This not only includes security risks by possible tampering with the frontend, but dapps running on centralized servers can be taken down at any point, which negates the censorship resistant nature of blockchain. Web3 requires that all parts of a dapp are realized by smart contracts. Further, Web3 functionality is only achievable by blockchain applications running fully decentralized, which includes smart contract logic, on-chain data storage and serving frontend to the user’s browser.

Hosting dapps 100% on-chain provides the additional benefit of letting DAOs launched on the Internet Computer to completely control these applications with on-chain governance and not only the backend logic. This lets users be fully in control of these dapps realizing complete decentralization and democratization of web applications.

Processing HTTP requests

Blockchains differ in their processing of computation from regular web servers, which makes serving web a difficult task. To overcome this, the Internet Computer introduces something called boundary nodes. These nodes act as a layer that translates HTTP requests from users to messages that can be processed by smart contracts running on the Internet Computer. This allows users to update the state of the blockchain simply by interacting with a browser.

Reverse Gas Model

Requiring users to have tokens in order to use applications and pay gas fees is an enormous barrier of entry. One key feature of the Internet Computer that allows users to directly interact with the blockchain through a browser for free is the reverse gas model. Simply put, canisters pay for their own computation and storage costs using cycles. In other words it is the developers and not the end-users who pay for gas.

This offers a very similar model to Web2 applications, whose hosting is taken care of by developers. The reverse gas fee model allows users to experiment with dapps for free and allows dapps to scale infinitely by not putting up a wall in front of their users at the very first interaction.

Internet Identity

Users should not have to set up wallets in order to interact with dapps. To remove this hurdle the Internet Computer offers an alternative anonymous authentication solution called the Internet Identity. With it users can login to dapps running on the Internet Computer by simply using a biometric sensor on their device. In the background, Internet Identity uses novel cryptography and creates new ids for each dapp one authenticates with. This is a simple way for users to login and use dapps running on the Internet Computer without having to create a wallet, while they remain anonymous and untraceable across different applications.