Difference between revisions of "Introduction to ICP"

From Internet Computer Wiki
Jump to: navigation, search
Line 28: Line 28:
 
* Persists data automatically in memory which eliminates the need for database servers and storage management, improves computational efficiency, and simplifies software development.
 
* Persists data automatically in memory which eliminates the need for database servers and storage management, improves computational efficiency, and simplifies software development.
 
* Simplifies the technology stack that IT organizations need to integrate and manage which improves operational efficiency.
 
* Simplifies the technology stack that IT organizations need to integrate and manage which improves operational efficiency.
 +
 +
==Key Concepts==
  
 
===Smart Contracts & Dapps===
 
===Smart Contracts & Dapps===

Revision as of 21:57, 20 April 2023

Introduction

ICP is a general-purpose blockchain that hosts canister smart contracts. It is designed to provide a World Computer that can replace traditional IT and host a new generation of Web3 services and applications that run solely from the blockchain, without the need for traditional IT. It can also play the role of Web3 orchestrator, by interacting with traditional blockchains.

It has a completely unique design that reflects a ground-up rethink of blockchain architecture and the application of modern cryptography, which can be traced back to 2015. It was built by the largest ongoing R&D effort in crypto, which has employed many notable cryptographers, computer science researchers and engineers. The blockchain underwent genesis in May 2021 and became part of the public internet.

The Internet Computer blockchain's protocols leverage novel chain key cryptography to combine multiple subnet blockchains into a single blockchain. This allows it to horizontally scale the total volume of hosted canister smart contract, and their computations and data, without limit. These smart contracts run at web speed, and with web-levels of efficiency, and uniquely, thanks to the blockchain architecture enabled by chain key crypto, can process HTTP requests and directly and securely serve interactive web experiences to the end-users of web3 services, without need for trusted intermediaries (whereas on other blockchains, the web experience users interact with is generally built on centralized, insecure and trusted servers or cloud computing services).

Through these kinds of unique capabilities, the Internet Computer provides a platform that can be used to build mass market web3 services that run 100% on-chain, without any need for traditional IT, such as web servers and databases running on cloud computing services. The longer-term objective is that the Internet Computer will completely replace traditional IT, creating a blockchain singularity, in which everything runs fully on-chain in powerful new forms where it is unstoppable and cannot be hacked.

The development of the Internet Computer has heralded numerous notable technological developments, such as chain key cryptography and programming languages such as Motoko. In another notable advance, the Internet Computer hosts an advanced DAO within its protocols, called the Network Nervous System, which provides the community with direct control over network governance, and can upgrade the protocol running on its network nodes, without requiring the network to fork. The network's utility token is ICP (see Roles of the ICP utility token).

A recent new technological advance has extended the Internet Computer's chain key cryptography protocols. This has enabled smart contracts hosted on the Internet Computer to directly interact with other blockchains, without need for dangerous centrally-controlled bridges or wrapping (see trustless multi-chain web3 using the IC, and extending Bitcoin, Ethereum and other blockchains).

For example, a canister smart contract hosted on the Internet Computer can create bitcoin addresses, and directly send and receive bitcoins on the Bitcoin ledger as though it were hosted by the Bitcoin network itself. This is possible because chain key crypto enables blockchains to create public "chain keys", for which their nodes can create corresponding signatures. Recent work has now made it possible to create ECDSA chain keys. Since ECDSA is the signature scheme used by most other blockchains, this means the Internet Computer can create TX on other blockchains.

Future work will enable its smart contracts to directly interact with other important blockchains such as Ethereum. This also leverages other important features such as HTTPS outcalls. As a consequence, many believe that the Internet Computer will play the role of an orchestration layer that combines different blockchains in the web3 environment, and helps combine them with off-chain services and systems, such as Web 2.0 services and enterprise systems, in a trustless way.

Why build the Internet Computer?

For end-users, accessing Internet Computer-based services is largely transparent, the experience of interacting with a decentralized application is the same as it is on a public or private cloud.

For the people creating and managing those Internet Computer-based services, however, the Internet Computer eliminates many of the costs, risks, and complexities associated with developing and deploying modern applications and microservices. In addition, its secure protocol guarantees reliable message delivery, transparent accountability, and resilience without relying on firewalls, backup facilities, load balancing services, or failover orchestration.

In some ways, building the Internet Computer is about restoring the Internet to its open, innovative, and creative roots. To focus on a few specific examples, the Internet Computer does the following:

  • Supports interoperability, shared functions, permanent APIs, and ownerless applications which reduces platform risk and encourages innovation and collaboration.
  • Persists data automatically in memory which eliminates the need for database servers and storage management, improves computational efficiency, and simplifies software development.
  • Simplifies the technology stack that IT organizations need to integrate and manage which improves operational efficiency.

Key Concepts

Smart Contracts & Dapps

ICP was designed to improve the user experience of interacting with smart contracts and dapps running on a blockchain. Smart contracts Dapps on the IC are able to serve web content, allowing users to interact with the dapps through their browser. Dapps themselves are run by canisters (dapps/smart contracts) on the IC with the robustness and security guarantees it affords. Developers create dapps in programming languages such as Rust or Motoko, compile them to WebAssembly byte code, and deploy the WebAssembly modules into canisters on the Internet Computer. A canister comprises a WebAssembly module and persisted memory. For more information or to start using dapps on the IC see:

Tokens

The Internet Computer uses a utility token ICP. Holders can stake ICP, allowing them to participate in the governance of the Internet Computer and earn voting rewards. ICP can also be converted into cycles and used to power computation, communication and storage costs of canisters. The blockchain incorporates a "reverse gas" model, in which smart contracts pay for their own computation, and must be pre-charged with cycles to run in much the same way an electric car must be pre-charged with electricity to drive. This ensures that end-users of dapps, systems and services can interact with them over the web without needing tokens to pay for the computations that they initiate. The Internet Computer maintains a floating conversion rate so that 1 Trillion cycles costs approximately 1 IMF SDR in ICP.

Web speed

Smart contracts on ICP are fast and performant to allow developers to build anything. The design goal is that developers can build consumer-facing experiences that are as fast as they would expect from centralized servers. Dapp developers do not need to choose between "smart contracts" and "fast." In short, dapp users experience is so fast that users should not notice if their web experience is running on a blockchain or centralized provider.

From a blockchain POV, Internet Computer Performance performance tests shows the IC latency at 200 milliseconds for query calls (reads) and 2 seconds for update calls (writes). As of December 1, 2021, The Internet Computer can handle 250,000 queries per second and 11,500 update calls per second.

Environment and cost

Low direct costs

Unlike most blockchains, the efficiency and costs of the Internet Computer approaches the traditional IT stack so its is economically feasible to host dapps with lots of data and content.

For comparison:

Blockchain Storage Costs
Ethereum $350,000,000 USD per GB per year
Internet Computer $5 USD per GB per year

Low indirect costs

Smart contracts as "secure-by-default" that comes with data replication removes a lot of software complexity that developers do not need to build. The design intent of the IC is to make development and deployment simple to reduce the time necessary to build and maintain software compared to traditional systems.

Network scales without limit

Most blockchains have transactions limits baked into the protocol (e.g. adding more servers to Bitcoin does not increase its transaction volume) and need cumbersome workarounds to address scaling. The Internet Computer can process unbounded volumes of smart contract data and computation natively because it can grow in capacity by adding more nodes. That is how the network went from 19 blocks per second in July 2021 to 30 blocks per second by December 2021.

See Internet Computer Dashboard: https://dashboard.internetcomputer.org/

Network scaling is transparent to systems

Network scaling is transparent to smart contract code which means that dapp developers do not need to worry about details about the network in order for their dapps to operate or scale. For example:

Although subnets are the fundamental building blocks of the overall Internet Computer network, they’re transparent to users and software. Users and canister software only need to know the identity of a canister to call the functions that it offers.

Source: https://medium.com/dfinity/a-technical-overview-of-the-internet-computer-f57c62abc20f

Web serving

Dapp code hosted and executed on-chain

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.

Reverse Gas Model (AKA "canister pays")

In dapps built on Ethereum (as an example), users require 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 have he "Reverse Gas model" where 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/

Internet Identity

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.

Users can create identity "anchors" to which they assign compatible cryptographically enabled devices, such as the fingerprint sensor on a laptop, the face ID system on a phone, or a portable HSM, such as a YubiKey or Ledger wallet. Thereafter, they can signup and authenticate to any dapp running on the Internet Computer using any of the devices they have assigned to their anchor. This provides a high level of convenience, allowing users to authenticate to dapps they are interested in with a very low level of friction, while benefiting from the highest level of cryptographic security, but without the need to directly manage or handle cryptographic key material themselves, which prevents mistakes and the theft of their key material. The system is anonymizing towards dapps, and whenever an anchor is used to interact with a dapp, the dapp sees a specially generated pseudonym, which prevents users being tracked across the various dapps they use. A user can create as many identity anchors as they wish.

Unlike most authentication methods, Internet Identity does not require users to set and manage passwords or provide any personal identifying information to dapps or to Internet Identity.

To read more about Internet Identity, or to generate an anchor, see:

Network Nervous System

The Network Nervous System (NNS) is the control center where the Internet Computer’s nodes and subnets are organized, tracked, and managed. The NNS is an automated in-protocol governance system that makes the network self-directed. Unlike Bitcoin or Ethereum, this means the Internet Computer blockchain can update itself via community-led proposals so the community controls the network.

Advantages of the NNS:

  • Seamless community-driven evolution and governance without disruptive hard forks
  • Gives control of the network to token holders as well as node providers (in Bitcoin or Ethereum, only nodes affect the upgrades of the network)
  • Accelerates the number of improvements or updates to the network. In 2021, the Internet Computer had dozens of updates, giving the IC very fast development iterations while also being decentralized.

Novel “canister” smart contract framework

Smart contracts have proven to be powerful new types of software programs because of their tamperproof nature. They can host financial contracts and systems with billions of dollars in value. However, as the scope of smart contracts increase, performance really matters. Building an "airbnb clone" entirely with Ethereum smart contracts would be impractical due to performance bottlenecks on individual smart contracts, but it is easy with the Internet Computer's canisters (dapps/smart contracts). A rough but helpful analogy may be "you can build complex calculations and logic with an excel spreadsheet, but you would not build Twitter by cobbling up many spreadsheets."

Attributes that make Internet Computer smart contracts powerful ways of building dapps:

  • Orthogonal persistence (data lives in persistent memory pages) making managing data much easier
  • Actor model gives dapps a time-tested model for concurrency that scales (deterministic parallelism, internally and externally)
  • Dapps get access to system APIs uncommon in Ethereum smart contracts (but common tools in centralized solutions) such as public randomness
  • Integration with other blockchains e.g. canisters will be able to have Bitcoin addresses in the future

Service Nervous System (SNS) economic framework for dapps

The Internet Computer’s SNS feature will allow developers to create decentralized, token-based governance systems for their dapps.

This unlocks a few possibilities:

  • An advanced DAO can take control of a dapp
  • Dapps run under the control of a community (full decentralization)
  • Dapps run as extensions of the blockchain (microeconomy with macroeconomy)
  • Dapps can raise funds into the SNS; funds controlled by community

The Internet Computer is a “general-purpose” blockchain that provides a public platform for hosting tokens and decentralized applications (dapps). It acts as a complete technology stack, such that systems and services can be built that run entirely from the blockchain.

See Also