ICP Developer Guide -Chapter 1

In the previous post, you learned about the fundamental concepts of the Internet Computer Protocol (ICP), a third-generation blockchain designed to power the next evolution of the internet. At its core, ICP functions as a decentralized cloud, enabling developers to build and deploy applications entirely on-chain without relying on traditional centralized servers like AWS or Google Cloud.

You might be wondering—how is this even possible? To clear up any doubts, I will walk you through the process of creating and deploying an application on the Internet Computer. Unlike conventional web hosting, ICP allows you to launch apps without registering a domain name or provisioning a cloud server, leveraging blockchain-native web hosting for a truly decentralized experience.

Prerequisite

To start coding in IC(Internet Computer) , there are some prerequisites you need to set up or install before you can jump into developing your first app. Following are the prerequisites:

  • Ensure you have the supporting operating system-
    • Windows 10 or 11 with WSL2 installed with Ubuntu Linux v20.04
    • Mac OSX 12 or above
    • Ubuntu Linux v20.04
  • NodeJs v20
  • GitHub Account
  • IC SDK
  • Visual Studio Code IDE
  • Basic programming knowledge- JavaScript, CSS, HTML

Here are the references to install the or set up the prerequisites:

You must install IC SDK before you can start coding. Use the following command in the WSL ubuntu terminal to install the SDK:

·sh -ci “$(curl -fsSL https://internetcomputer.org/install.sh)”

After installation, check its version using the command dfx –version, you should see something like dfx 0.24.3

*·If you are using a machine running Apple silicon, you will need to have Rosetta installed. You can install Rosetta by running softwareupdate –install-rosetta in your terminal.

The next step is to create an account in IC. In ICP, authentication requires a key pair consisting of a private and a public key, while the account itself is identified by a unique principal ID. Additionally, a ledger is needed to store accounts and transactions. This ledger is a smart contract known as a system canister. Each user will have a ledger account identifier, also called an account ID, which is used to hold ICP tokens. Furthermore, a wallet must be created to store cycles and facilitate sending cycles to and from canisters.

Creating ICP Account

To create an account in IC, using the following command:

dfx identity new <identity_name>

·💡Identity names must use alphanumeric characters comprising uppercase and lower letters, numbers and special characters. Example: My_chatb@t

·ℹ️Most importantly, REMEMBER to back up the 24-word account/identity seed phrase. This is essential for restoring your account if you forget your password or need to access it from another device. Additionally, you can create multiple accounts on your device.

Principal ID

Having created your account, you can obtain your principal id using the following commands:

dfx identity use <identity_name>

dfx identity get-principal

Your account’s principal ID will resemble this:

zxyfn-yljyi-bn6dy-ixi7n-jez74-nk723-pvj3m-jykes-dhqon-3ktql-uae

Ledger Account ID

You can also obtain your ledger account id using the following commands:

dfx identity use <identity_name>

dfx ledger account-id

Your Ledger account ID will resemble this :

1370f0ea74b35f33d2a2fee64a7a8c53cd52d6dd82c1cdfe08712dcd863692ab

Importing Account

In case you have changed your device and need to use the same account to develop ICP apps, you may import the 24-word seed phrase you have saved as a plaintext into your new development environment using the following command:

dfx identity import –seed-file <seedfile.txt> <Identity Name>

ICP Token Balance

To check the ICP token balance in ledger account on ICP Main Network, use the following commend:

dfx ledger –network ic balance

·💡–network ic or –ic: Connect to ICP Main Network, without this parameter, it will connect to the local network

Internet Identity

Internet Identity is a decentralized authentication system for the ICP. If you haven’t already, set up an Internet Identity:

  • Go to the Internet Identity portal: https://identity.ic0.app/.
  • Click “Create New” to create a new identity.
  • Follow the prompts to register your device . For Windows 10 user, require to use your mobile phone to scan the QR Code to store the credential information in the mobile phone. For Android device, recommend to use Google Lens to perform Passkey QR code scanning.
  • Note down your Internet Identity number (e.g., 12345).

 ICP Account Address

To receive ICP tokens, you need an ICP account address associated with your Internet Identity. Here’s how to get it:

  • Go to the Network Nervous System (NNS) Dapphttps://nns.ic0.app/.
  • Authenticate using your Internet Identity.
  • Once logged in, navigate to the “Accounts” section.

Plug Wallet

You may also use the Plug Wallet to store your ICP tokens. Plug wallet can be installed as a browser extension on a laptop or can be installed as a mobile app on your phone. You can download Plug Wallet using the link below.

https://plugwallet.ooo/

Network Nervous System

The Network Nervous System (NNS) is the decentralized governance system aka DAO that controls and manages the Internet Computer (ICP), a blockchain-based computing platform developed by the DFINITY Foundation. The NNS is one of the most critical components of the Internet Computer, as it enables the network to operate autonomously and evolve over time through community participation.


Key Functions of the NNS

  1. Governance:
    • The NNS allows ICP token holders to participate in the governance of the Internet Computer by submitting and voting on proposals.
    • Proposals can cover a wide range of topics, such as upgrading the protocol, adjusting network parameters, or funding ecosystem projects.
  2. Token Economics:
    • The NNS manages the ICP utility token, including its minting, burning, and distribution.
    • It also handles the creation of cycles, which are used to pay for computation and storage on the Internet Computer.
  3. Node Management:
    • The NNS oversees the addition, removal, and configuration of node machines that power the Internet Computer.
    • It ensures the network remains secure, scalable, and efficient.
  4. Canister Management:
    • The NNS manages the lifecycle of canisters (smart contracts) on the Internet Computer, including their creation, upgrading, and deletion.
  5. Network Upgrades:
    • The NNS facilitates seamless upgrades to the Internet Computer protocol without requiring hard forks or downtime.
    • This is achieved through a decentralized voting process.

What is Web3?

Web3 and metaverse have been two buzzwords for the year 2022, but according to the World Economic Forum, Web 3 is essentially a synonym for the metaverse. Therefore, I wish to discuss the two concepts together instead of writing two articles.

What is Web3.0? It can simply be understood from the following aspects:

  • Web1.0 is “read-only”;
  • Web2.0 is “readable + writable” (read + write);
  • Web3 is “read+write+own” (read+write+own).

Firstly, web1.0 is represented by websites Yahoo and Sina, which solely provide information to users . During this era, most users can only read information on the web while very few website developers could create content, I was one of them. I created my first website in 1995 titled ‘Visual Basic Tutorial” which still ranks top in Google search for the keyword ‘Visual Basic’. Web2.0 is an interactive web comprising blogs, social media like Facebook, Instagram, Twitter, Whatsapp, WeChat, Tiktok and more, which users can interact and generate content. On the other hand, web3.0 not only allows users to generate content but the content data is owned by the user, not controlled by the platform.

Secondly, we can define the web revolution by the degree of decentralization. Simply put, web1.0 is semi-centralized, Web2.0 is centralized and web3 is fully decentralized.

Comparison between Web 1.0, Web 2.0 and Web 3.0

In the Web1.0 era, decentralized personal websites formed half of the Web while the other half were centralized, both sides formed a semi-decentralized ecosystem. In the Web2.0 era, information islands are formed, and large companies such as FAANG monopolize the web and control users’ data and while numerous individual and SME websites formed a small portion of the web. On the other hand, web3.0 will be purely decentralized where data is owned and controlled by users. Web 3 is a concept for the next generation of the internet. It is the evolution of how users are able to control and own their creations and online content, digital assets and online identities. In Web 3, however, users can create content while owning, controlling and monetizing them through the implementation of blockchain and cryptocurrencies.

Data privacy is another issue of the current Web 2.0 internet. While the centralized entities have full control over the access to the service, they have full control over the users’ data. Users register to access a service and give up their precious private data and content in exchange for the convenience of the service, by agreeing to the terms of services. However, in Web3, not a single entity has control over the access to the service as it’s open to everyone. No registration is needed, users then have complete control over their private data, but at the same time, users have to take the responsibility to protect their own data and assets as they will become the only custodians.

The third aspect:

Web1.0 and Web2.0 are information Internet while Web3 is the Internet of Value. Web1.0 and Web2.0 are essentially transmitting information and focusing on consumption; while Web3 is transmitting value and creating wealth. Therefore, Web3 can be simply understood as the Internet powered by blockchain technology. It will solve the current Internet “central monopoly” problem, help users regain their data sovereignty, and recreate a better ecosystem in the digital world. Internet world. If you really understand the above changes, then you will understand that Web3 is revolutionary.

Key features of Web3 are:

Decentralized

Web3 data are typically stored in decentralized ledger like blockchain, so no single system has access to it all. It is dispersed across multiple platforms. This facilitates decentralized access and eliminate single point of failure .

Permissionless

The decentralized web can be accessed by users without requiring special permissions and KYC. Users will not need to disclose their personal information to access specific services. There will be no need to compromise privacy or share any other information.

Secure

Web 3 is more secure since decentralization makes it more difficult for hackers to target specific databases. Besides that, all data are encrypted based on cryptographic hash which add a security layer to the distributed database system.

Why we don’t call web3 as web3.0? Because they are fundamentally different.

Differences between web3 and web3.0

Web 3.0 aka semantic web focuses on efficiency and intelligence by reusing and linking data across websites. Web3 aka the decentralized web, however, puts a strong emphasis on security and empowerment by returning control of data and identity to users.

Semantic web uses a central place called the solid pod to store all user data, enabling users to handle third-party access to their data. Solid pods also issue a unique WebID for users that act as an identity within the ecosystem. In the blockchain-based web3, users can store their data in a cryptocurrency wallet, which they can access using their private keys.

Additionally, they both use different technologies to implement their purpose of data security. Web3 uses blockchain technology, while in web 3.0, certain data interchange technologies like RDF, SPARQL, OWL, and SKOS are used.

Data in web3 is difficult to modify or delete since it is scattered across multiple nodes; however, data in web3.0 can be changed effortlessly. Furthermore, the data stored in the solid pod is centralized, while the keys stored in crypto wallets provide access to the data of assets that reside on a blockchain

The differences are summarised in the following table:

ParameterWeb3Web3.0
Distribution ModelDecentralized peer-to-peerClient/Server
ProtocolBlockchain/ipfshttp/https
Relationship to World Wide WebAn Alternative to the World Wide WebThe continuation of the World Wide Web
VisionEliminates intermediaries and emphasis on security and empowerment by returning control of data and identity to users.  Evolving to a semantic web to make web content machine readable.


To learn more about Web3, please check out my book:

Reference