Difference between revisions of "Web Serving"

From Internet Computer Wiki
Jump to: navigation, search
Line 1: Line 1:
Serving web content on-chain requires to serve both the backend computation, and the frontend interface from the blockchain. For a full web serving system, the blockchain should also facilitate full interaction (i.e. via tokens) and authentication.
+
The Internet Computer is currently the only blockchain whose canister smart contracts can securely serve web content directly to the user’s browser. This is a crucial and distinguishing feature of the Internet Computer that allows dapps to run 100% on-chain inheriting the security of blockchain without sacrificing speed or affordability.
  
===Dapp code hosted and executed on-chain===
+
===Enabling true web3===
Canister 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.
+
True 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. Relying on centralized cloud providers (e.g. AWS, GCP) to host the frontend of dapps introduces a single point of failure. 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.
  
The Internet Computer serving dapps whose code is hosted and executed entirely on-chain unlocks the Web3 potential of smart contracts.  
+
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.
  
===Reverse Gas Model (i.e. the "canister pays")===
 
In dapps built on Ethereum (for example), users are required to connect a wallet or tokens to use them. 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, and again requires the user to engage with cloud hosted services. Internet Computer dapps run on a "Reverse Gas model" whereby users can interact with a dapp without having to pay in tokens since the canister can store a certain amount of [[Glossary#cycles|cycles]] to pay for the user's needs.
 
  
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 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===
 
===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.
[[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 users without requiring any reliance on cloud service providers.
 

Revision as of 16:12, 30 August 2022

The Internet Computer is currently the only blockchain whose canister smart contracts can securely serve web content directly to the user’s browser. This is a crucial and distinguishing feature of the Internet Computer that allows dapps to run 100% on-chain inheriting the security of blockchain without sacrificing speed or affordability.

Enabling true web3

True 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. Relying on centralized cloud providers (e.g. AWS, GCP) to host the frontend of dapps introduces a single point of failure. 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.

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.