<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.internetcomputer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Satya.vusirikala</id>
	<title>Internet Computer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.internetcomputer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Satya.vusirikala"/>
	<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/wiki/Special:Contributions/Satya.vusirikala"/>
	<updated>2026-04-13T09:09:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3956</id>
		<title>Proof of Personhood</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3956"/>
		<updated>2022-12-13T18:02:40Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Call State at Various Stages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This page is still work in progress =&lt;br /&gt;
&lt;br /&gt;
== Proof of Personhood ==&lt;br /&gt;
Decentralized protocols generally rely on voting to make decisions. Anyone can create an identity and cast their vote on a proposal. A naïve implementation of this leads to a sybil attack, where one attacker creates many identities and casts many votes in his favor.&lt;br /&gt;
&lt;br /&gt;
Proof of work and proof of stake are the most commonly implemented sybil attack resistance mechanisms. In proof of work, each identity has to invest some computational power to cast votes. The identity&#039;s voting power is proportional to its computational power. In proof of stake, each identity has to purchase some tokens and stake it in the protocol. The identity&#039;s voting power is proportional to its stake. In both cases, people with more money gets higher voting power and can alter the decisions of the decentralized protocol. &lt;br /&gt;
&lt;br /&gt;
Proof of personhood is an alternate solution to solve the sybil attack problem. The goal of the system is to make sure each real person gets voting power of (close to) only 1. Even if the person creates many identities, he cannot have a higher voting power. In this system, anyone create an identity but its voting power is 0 by default. After the identity proves that it is controlled by a real person, it is assigned a non-zero voting power. There are many well-known techniques such as CAPTCHA to verify that someone is a real person. However, a motivated person could still manually create many identities, manually prove each of them is controlled by a real person and get a high voting power. To protect against this attack, the system needs to satisfy a second requirement -- If a single person controls many identities, the sum of voting power of all the identities is still (close to) 1. Essentially, an attacker doesn&#039;t gain any advantage by creating many identities and proving each of them is controlled by a real person. The second requirement is quite difficult to satisfy. &lt;br /&gt;
&lt;br /&gt;
This article describes the &#039;&#039;people parties&#039;&#039; project currently under development at Dfinity Foundation.&lt;br /&gt;
&lt;br /&gt;
== People Parties ==&lt;br /&gt;
People parties&amp;lt;ref&amp;gt;https://medium.com/dfinity/ultimate-decentralization-using-virtual-people-parties-that-deliver-proof-of-personhood-at-de575522c80&amp;lt;/ref&amp;gt; are a mechanism for obtaining proof of personhood (also referred to as proof of humanity) built on and for the Internet Computer. &lt;br /&gt;
&lt;br /&gt;
Each people party takes place at one specific point in time. Prior to that time, each prospective participant commits to a location that they will visit for the time of the party. At the beginning of the party, participants are assigned to small, random subgroups, and meet in a real-time video call with other participants assigned to the same group. The video call, however, does not show the participants’ faces; instead, participants show their surroundings, proving that they are at the place they committed to. As locations chosen by different participants must have a certain minimum distance, and no participant can be physically present at two locations simultaneously, the proof of personhood even guarantees the uniqueness of the validated persons.&lt;br /&gt;
&lt;br /&gt;
The main purpose of people parties is democratization. Each validated participant can designate a neuron in the [[Network Nervous System]] that receives increased voting power; this improves the relative voting power of the “many” vs. the “heavy”. It also provides additional voting rewards to all validated participants, which further motivates people to participate in the parties. The validated personhood also benefits the Internet Computer ecosystem more broadly: Open Internet Systems, which are dapps that are controlled by a decentralized governance system, will be able to profit from the improved decentralization similarly to the Internet Computer itself. And any dapp will be able to use the validation information in order to, e.g., differentiate between bots and actual human users.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
The architecture of the people parties project involves 3 components. &lt;br /&gt;
* Client&lt;br /&gt;
* People party canister&lt;br /&gt;
* Signaling server&lt;br /&gt;
&lt;br /&gt;
===== Client =====&lt;br /&gt;
The client is a device that is used by the participants who want to validate their identity. The client can be a desktop, laptop or a mobile device with a web browser.&lt;br /&gt;
&lt;br /&gt;
===== People party canister =====&lt;br /&gt;
People party canister is a canister (software program) hosted on the Internet Computer. The canister maintains the information related to all the people parties and identities. This includes &lt;br /&gt;
* The longitude boundaries of the participants allowed for the party&lt;br /&gt;
* List of participants in the party&lt;br /&gt;
* The state of each call in the party&lt;br /&gt;
* Validation results of each participant&lt;br /&gt;
* Personhood score (voting power) of each identity&lt;br /&gt;
&lt;br /&gt;
The client queries people party canister to obtain the list of all the upcoming parties. The client can then register or deregister for any party by calling the people party canister. During the registration, the client specifies the latitude and longitude coordinates of the location he will be during the party. &lt;br /&gt;
&lt;br /&gt;
A few minutes before a party commences, the client calls people party canister to join the party. Throughout the party, the client repeatedly calls the people party canister to obtain the state of the call. During the call, each participant streams a video that they are in the promised location. Other participants verify this by simultaneously glancing at the google street view of the location, and send an approve/decline vote to the people party canister. After the call ends, the client queries the people party canister to know if the client was approved/declined by others. The client later calls the people party canister to withdraw 1 ICP it deposited to register for the party.&lt;br /&gt;
&lt;br /&gt;
===== Signaling server =====&lt;br /&gt;
Signaling server is used to facilitate video calls amongst the participants.&lt;br /&gt;
&lt;br /&gt;
== People Party Canister Interface == &lt;br /&gt;
We describe the interface supported by the people party canister here. &lt;br /&gt;
&lt;br /&gt;
 get_parties: () -&amp;gt; (vec record { PartyId; PartySpecification; }) query;&lt;br /&gt;
 register: (id: PartyId, place: Location) -&amp;gt; (RegistrationResponse);&lt;br /&gt;
 deregister: (id: PartyId) -&amp;gt; (DeregistrationResponse);&lt;br /&gt;
 withdraw: (destination: AccountIdentifier) -&amp;gt; (WithdrawResult);&lt;br /&gt;
 join: (id: PartyId, key: blob) -&amp;gt; (JoinResponse);&lt;br /&gt;
 vote: (id: PartyId, vote: record { Vote; ParticipantName; }) -&amp;gt; (VoteResponse);&lt;br /&gt;
 http_request: (request: HttpRequest) -&amp;gt; (HttpResponse) query;&lt;br /&gt;
 get_person_profile: () -&amp;gt; (opt PersonProfile) query;&lt;br /&gt;
 get_call_state: (id: PartyId) -&amp;gt; (PublicCallState) query;&lt;br /&gt;
 get_call_result: (id: PartyId) -&amp;gt; (CallResult) query;&lt;br /&gt;
&lt;br /&gt;
When a user enters the people party website, the frontend calls &amp;lt;code&amp;gt;get_parties&amp;lt;/code&amp;gt; endpoint to display the information of all the parties. The &amp;lt;code&amp;gt;PartySpecification&amp;lt;/code&amp;gt; for each people party is described as follows. &lt;br /&gt;
 type PartySpecification =&lt;br /&gt;
  record {&lt;br /&gt;
   registration_start: Time;&lt;br /&gt;
   registration_end: Time;&lt;br /&gt;
   call_start : Time;&lt;br /&gt;
   longitude_min : float64;&lt;br /&gt;
   longitude_max : float64;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The user can then then register or deregister for a party by calling &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;deregister&amp;lt;/code&amp;gt; endpoints. The canister responds with the status of registration. When the user registers for a party, he specifies the the Location (latitude and longitude) of where the user will be when the party starts. &lt;br /&gt;
&lt;br /&gt;
A few minutes before the party starts, the user joins the party by calling &amp;lt;code&amp;gt;join&amp;lt;/code&amp;gt; endpoint. After the user joins a call, the user sends one vote (approve/decline) for each of the other participants by calling &amp;lt;code&amp;gt;vote&amp;lt;/code&amp;gt; endpoint. &lt;br /&gt;
&lt;br /&gt;
At any point in time, one can call &amp;lt;code&amp;gt;get_person_profile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;get_call_result&amp;lt;/code&amp;gt; endpoints to obtain the information about the list of parties, a person&#039;s profile, state of a call and result of a call respectively.&lt;br /&gt;
&lt;br /&gt;
The profile of a person is described by&lt;br /&gt;
 type PersonProfile = record {&lt;br /&gt;
   upcoming_parties: vec record { PartyId; Location; };&lt;br /&gt;
   validation_score: nat64;&lt;br /&gt;
   past_parties: vec PartyId;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
When the user registers for a party, he needs to deposit 1 ICP. After the party ends, the user can withdraw this amount by calling &amp;lt;code&amp;gt;withdraw&amp;lt;/code&amp;gt; endpoint. The user can only withdraw if he hasn&#039;t registered for any upcoming party. Once the user withdraws the amount, he cannot register again until he deposits 1 ICP.&lt;br /&gt;
&lt;br /&gt;
== Party Flow == &lt;br /&gt;
The below flow describing a call. Say the call is scheduled to start at 10am. Then the timeline should be as follows:&lt;br /&gt;
&lt;br /&gt;
* Until 9:55am, users can enroll with the &#039;&#039;register&#039;&#039; endpoint. Since the assignment to groups has not been made, calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return what is in case 0 below.&lt;br /&gt;
* At 9:55am, the canister closes the registration phase and calling the &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; endpoint for the current party is not allowed anymore.&lt;br /&gt;
* From 9:55am to 10am, users are allowed to join. For this, there is a join endpoint that accepts a key – a blob. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 1 below. &lt;br /&gt;
* At 10am, the canister generates the random setup of all calls. From this time onward, calling the join endpoint is not allowed anymore, and clients are supposed to set up the WebRTC connections.&lt;br /&gt;
* Between 10am and 10:01am, the canister returns the call setup state as described in step 1.5 below.&lt;br /&gt;
* At 10:01am, the actual calls start.&lt;br /&gt;
* From 10:01am to 10:11am, the actual party is supposed to take place and users can submit votes. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 2 below.&lt;br /&gt;
* At 10:11am, the canister closes all calls and makes the tally. From this point onward, calling vote is not allowed anymore.&lt;br /&gt;
* From 10:11am, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 3 below.&lt;br /&gt;
&lt;br /&gt;
== Call State at Various Stages == &lt;br /&gt;
The people parties canister stores the state of each call, and updates the state during each phase of the party. The canister exposes the &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; method that returns the state of the call. &lt;br /&gt;
&lt;br /&gt;
==== Before Registration ====&lt;br /&gt;
This is returned for parties that do not exist:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_created};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Joining – Before call starts ==== &lt;br /&gt;
This is returned from the point in time where the groups are assigned but before the point in time when the call is scheduled to start. The state transition from 1 to 1.5 is defined by the canister computing the random assignment.&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_started = record {    &lt;br /&gt;
     joined = true; ← so the UI can show that the user is in the waiting room&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Starting the call ====&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{starting = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{&lt;br /&gt;
       record{&lt;br /&gt;
         name = “adhesive bread”;&lt;br /&gt;
         location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               };&lt;br /&gt;
       record{&lt;br /&gt;
         Name = “stinky tofu”;&lt;br /&gt;
         Location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               ...&lt;br /&gt;
     };&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== After call starts – before call ends ====&lt;br /&gt;
If the user hasn’t successfully joined the call, then the following is returned:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_joined};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
If the user has successfully joined the call, then the following is returned:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{active = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{&lt;br /&gt;
       record{&lt;br /&gt;
         name = “adhesive bread”;&lt;br /&gt;
         location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
       };&lt;br /&gt;
       ...&lt;br /&gt;
     };&lt;br /&gt;
     round = 0;&lt;br /&gt;
     remaining_seconds = 42;&lt;br /&gt;
     voters_in_round = vec{“chilly mustard”; “angry fox”;};&lt;br /&gt;
   }}&lt;br /&gt;
 };&lt;br /&gt;
State in later round:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{active = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{ ... };&lt;br /&gt;
     round = 1;&lt;br /&gt;
     remaining_seconds = 22;&lt;br /&gt;
     voters_in_round = vec{“adhesive bread”; “angry fox”;};&lt;br /&gt;
   }}&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== After call ends ====&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{ended};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== Personhood Score ==&lt;br /&gt;
Each identity in the Internet Computer is assigned a personhood score. If an identity hasn’t participated in any people party, its personhood score is 0. As the identity participates in people parties and is successfully validated to be a person, its personhood score increases. &lt;br /&gt;
&lt;br /&gt;
Any canister will be able to query and obtain the personhood score of an identity. One can potentially use the personhood score to determine the voting power of an identity in an election/voting program.&lt;br /&gt;
&lt;br /&gt;
===== Requirement #1 ===== &lt;br /&gt;
An Internet Computer user is naturally inclined to increase his voting power. He is therefore motivated to create many identities and attend a people party with each identity. This gives him control of many identities with a positive personhood score, and thereby a higher voting power. We would like to avoid this. We would like to design the personhood score in such a way that an IC user is motivated to attend each people party with the same identity rather than creating a new identity for each people party. &lt;br /&gt;
&lt;br /&gt;
===== Requirement #2 ===== &lt;br /&gt;
Suppose Alice attended many parties with her identity, and Bob attended only one recent party. Alice and Bob’s personhood scores should still be close. Alice should not have a significant advantage by attending many parties. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #1 =====&lt;br /&gt;
Suppose personhood score of an identity = 1 if the identity is successfully validated in at least one party. This personhood score violates our Requirement #1. &lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #2 =====&lt;br /&gt;
Suppose personhood score of an identity = number of parties in which the identity is successfully validated. This personhood score violates our Requirement #2. &lt;br /&gt;
&lt;br /&gt;
===== Successful Attempt =====&lt;br /&gt;
After a party ends, the personhood score of an identity is composed of three components: &lt;br /&gt;
* Recent party result (RPR):   This value is 1 if the identity is accepted to be a person in the recent party. The value is 0 if the identity did not participate or is rejected in the recent party. &lt;br /&gt;
* Decay function of previous personhood score: The decay function is a monotonically non-increasing function. It is computed on the old personhood score (the score before the recent party started). The decay lets us give more weightage to the validation in the recent party over the previous parties. &lt;br /&gt;
* Bonus reward function: If the identity is accepted in the most recent party and is successfully accepted in some parties before, a bonus reward is given to the identity. This bonus component is added to incentivize IC users to participate in all the parties using the same identity rather than creating a different identity for each party. &lt;br /&gt;
&lt;br /&gt;
Suppose the personhood score of an identity is PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt; before a party starts. The trust score PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt;  of the identity after the party ends is calculated as follows. &lt;br /&gt;
&lt;br /&gt;
PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + bonus(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  decay(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where Recent Party Result (RPR) is 1 iff the identity is accepted in the party.&lt;br /&gt;
&lt;br /&gt;
Through empirical evidence, we found that &lt;br /&gt;
* bonus(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * x) and &lt;br /&gt;
* decay(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + x) &lt;br /&gt;
work pretty well. That is, &lt;br /&gt;
&lt;br /&gt;
	PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
Consider 2 scenarios. &lt;br /&gt;
* Scenario A: The user enters each party with the same identity, and the user is accepted in each of the parties. &lt;br /&gt;
* Scenario B: The user enters each party with a new identity, and the user is accepted in each of the parties. &lt;br /&gt;
&lt;br /&gt;
Let us compare the personhood scores of the user in each of the scenarios. In Scenario B, we sum up the personhood scores of all the identities controlled by the user. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of personhood scores of a user in Scenarios A &amp;amp; B&lt;br /&gt;
|-&lt;br /&gt;
!  !! Scenario A !! Scenario B&lt;br /&gt;
|-&lt;br /&gt;
| Initial Score || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| After 1st party || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| After 2nd party || 1.398 || 1.301&lt;br /&gt;
|-&lt;br /&gt;
| After 3rd party || 1.510 || 1.415&lt;br /&gt;
|-&lt;br /&gt;
| After 4th party || 1.539 || 1.462&lt;br /&gt;
|-&lt;br /&gt;
| After 5th party || 1.546 || 1.482&lt;br /&gt;
|-&lt;br /&gt;
| After 6th party || 1.548 || 1.491&lt;br /&gt;
|-&lt;br /&gt;
| After 7th party || 1.548 || 1.494&lt;br /&gt;
|-&lt;br /&gt;
| After 8th party || 1.548 || 1.496&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3955</id>
		<title>Proof of Personhood</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3955"/>
		<updated>2022-12-13T18:01:05Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Call State at Various Stages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This page is still work in progress =&lt;br /&gt;
&lt;br /&gt;
== Proof of Personhood ==&lt;br /&gt;
Decentralized protocols generally rely on voting to make decisions. Anyone can create an identity and cast their vote on a proposal. A naïve implementation of this leads to a sybil attack, where one attacker creates many identities and casts many votes in his favor.&lt;br /&gt;
&lt;br /&gt;
Proof of work and proof of stake are the most commonly implemented sybil attack resistance mechanisms. In proof of work, each identity has to invest some computational power to cast votes. The identity&#039;s voting power is proportional to its computational power. In proof of stake, each identity has to purchase some tokens and stake it in the protocol. The identity&#039;s voting power is proportional to its stake. In both cases, people with more money gets higher voting power and can alter the decisions of the decentralized protocol. &lt;br /&gt;
&lt;br /&gt;
Proof of personhood is an alternate solution to solve the sybil attack problem. The goal of the system is to make sure each real person gets voting power of (close to) only 1. Even if the person creates many identities, he cannot have a higher voting power. In this system, anyone create an identity but its voting power is 0 by default. After the identity proves that it is controlled by a real person, it is assigned a non-zero voting power. There are many well-known techniques such as CAPTCHA to verify that someone is a real person. However, a motivated person could still manually create many identities, manually prove each of them is controlled by a real person and get a high voting power. To protect against this attack, the system needs to satisfy a second requirement -- If a single person controls many identities, the sum of voting power of all the identities is still (close to) 1. Essentially, an attacker doesn&#039;t gain any advantage by creating many identities and proving each of them is controlled by a real person. The second requirement is quite difficult to satisfy. &lt;br /&gt;
&lt;br /&gt;
This article describes the &#039;&#039;people parties&#039;&#039; project currently under development at Dfinity Foundation.&lt;br /&gt;
&lt;br /&gt;
== People Parties ==&lt;br /&gt;
People parties&amp;lt;ref&amp;gt;https://medium.com/dfinity/ultimate-decentralization-using-virtual-people-parties-that-deliver-proof-of-personhood-at-de575522c80&amp;lt;/ref&amp;gt; are a mechanism for obtaining proof of personhood (also referred to as proof of humanity) built on and for the Internet Computer. &lt;br /&gt;
&lt;br /&gt;
Each people party takes place at one specific point in time. Prior to that time, each prospective participant commits to a location that they will visit for the time of the party. At the beginning of the party, participants are assigned to small, random subgroups, and meet in a real-time video call with other participants assigned to the same group. The video call, however, does not show the participants’ faces; instead, participants show their surroundings, proving that they are at the place they committed to. As locations chosen by different participants must have a certain minimum distance, and no participant can be physically present at two locations simultaneously, the proof of personhood even guarantees the uniqueness of the validated persons.&lt;br /&gt;
&lt;br /&gt;
The main purpose of people parties is democratization. Each validated participant can designate a neuron in the [[Network Nervous System]] that receives increased voting power; this improves the relative voting power of the “many” vs. the “heavy”. It also provides additional voting rewards to all validated participants, which further motivates people to participate in the parties. The validated personhood also benefits the Internet Computer ecosystem more broadly: Open Internet Systems, which are dapps that are controlled by a decentralized governance system, will be able to profit from the improved decentralization similarly to the Internet Computer itself. And any dapp will be able to use the validation information in order to, e.g., differentiate between bots and actual human users.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
The architecture of the people parties project involves 3 components. &lt;br /&gt;
* Client&lt;br /&gt;
* People party canister&lt;br /&gt;
* Signaling server&lt;br /&gt;
&lt;br /&gt;
===== Client =====&lt;br /&gt;
The client is a device that is used by the participants who want to validate their identity. The client can be a desktop, laptop or a mobile device with a web browser.&lt;br /&gt;
&lt;br /&gt;
===== People party canister =====&lt;br /&gt;
People party canister is a canister (software program) hosted on the Internet Computer. The canister maintains the information related to all the people parties and identities. This includes &lt;br /&gt;
* The longitude boundaries of the participants allowed for the party&lt;br /&gt;
* List of participants in the party&lt;br /&gt;
* The state of each call in the party&lt;br /&gt;
* Validation results of each participant&lt;br /&gt;
* Personhood score (voting power) of each identity&lt;br /&gt;
&lt;br /&gt;
The client queries people party canister to obtain the list of all the upcoming parties. The client can then register or deregister for any party by calling the people party canister. During the registration, the client specifies the latitude and longitude coordinates of the location he will be during the party. &lt;br /&gt;
&lt;br /&gt;
A few minutes before a party commences, the client calls people party canister to join the party. Throughout the party, the client repeatedly calls the people party canister to obtain the state of the call. During the call, each participant streams a video that they are in the promised location. Other participants verify this by simultaneously glancing at the google street view of the location, and send an approve/decline vote to the people party canister. After the call ends, the client queries the people party canister to know if the client was approved/declined by others. The client later calls the people party canister to withdraw 1 ICP it deposited to register for the party.&lt;br /&gt;
&lt;br /&gt;
===== Signaling server =====&lt;br /&gt;
Signaling server is used to facilitate video calls amongst the participants.&lt;br /&gt;
&lt;br /&gt;
== People Party Canister Interface == &lt;br /&gt;
We describe the interface supported by the people party canister here. &lt;br /&gt;
&lt;br /&gt;
 get_parties: () -&amp;gt; (vec record { PartyId; PartySpecification; }) query;&lt;br /&gt;
 register: (id: PartyId, place: Location) -&amp;gt; (RegistrationResponse);&lt;br /&gt;
 deregister: (id: PartyId) -&amp;gt; (DeregistrationResponse);&lt;br /&gt;
 withdraw: (destination: AccountIdentifier) -&amp;gt; (WithdrawResult);&lt;br /&gt;
 join: (id: PartyId, key: blob) -&amp;gt; (JoinResponse);&lt;br /&gt;
 vote: (id: PartyId, vote: record { Vote; ParticipantName; }) -&amp;gt; (VoteResponse);&lt;br /&gt;
 http_request: (request: HttpRequest) -&amp;gt; (HttpResponse) query;&lt;br /&gt;
 get_person_profile: () -&amp;gt; (opt PersonProfile) query;&lt;br /&gt;
 get_call_state: (id: PartyId) -&amp;gt; (PublicCallState) query;&lt;br /&gt;
 get_call_result: (id: PartyId) -&amp;gt; (CallResult) query;&lt;br /&gt;
&lt;br /&gt;
When a user enters the people party website, the frontend calls &amp;lt;code&amp;gt;get_parties&amp;lt;/code&amp;gt; endpoint to display the information of all the parties. The &amp;lt;code&amp;gt;PartySpecification&amp;lt;/code&amp;gt; for each people party is described as follows. &lt;br /&gt;
 type PartySpecification =&lt;br /&gt;
  record {&lt;br /&gt;
   registration_start: Time;&lt;br /&gt;
   registration_end: Time;&lt;br /&gt;
   call_start : Time;&lt;br /&gt;
   longitude_min : float64;&lt;br /&gt;
   longitude_max : float64;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The user can then then register or deregister for a party by calling &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;deregister&amp;lt;/code&amp;gt; endpoints. The canister responds with the status of registration. When the user registers for a party, he specifies the the Location (latitude and longitude) of where the user will be when the party starts. &lt;br /&gt;
&lt;br /&gt;
A few minutes before the party starts, the user joins the party by calling &amp;lt;code&amp;gt;join&amp;lt;/code&amp;gt; endpoint. After the user joins a call, the user sends one vote (approve/decline) for each of the other participants by calling &amp;lt;code&amp;gt;vote&amp;lt;/code&amp;gt; endpoint. &lt;br /&gt;
&lt;br /&gt;
At any point in time, one can call &amp;lt;code&amp;gt;get_person_profile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;get_call_result&amp;lt;/code&amp;gt; endpoints to obtain the information about the list of parties, a person&#039;s profile, state of a call and result of a call respectively.&lt;br /&gt;
&lt;br /&gt;
The profile of a person is described by&lt;br /&gt;
 type PersonProfile = record {&lt;br /&gt;
   upcoming_parties: vec record { PartyId; Location; };&lt;br /&gt;
   validation_score: nat64;&lt;br /&gt;
   past_parties: vec PartyId;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
When the user registers for a party, he needs to deposit 1 ICP. After the party ends, the user can withdraw this amount by calling &amp;lt;code&amp;gt;withdraw&amp;lt;/code&amp;gt; endpoint. The user can only withdraw if he hasn&#039;t registered for any upcoming party. Once the user withdraws the amount, he cannot register again until he deposits 1 ICP.&lt;br /&gt;
&lt;br /&gt;
== Party Flow == &lt;br /&gt;
The below flow describing a call. Say the call is scheduled to start at 10am. Then the timeline should be as follows:&lt;br /&gt;
&lt;br /&gt;
* Until 9:55am, users can enroll with the &#039;&#039;register&#039;&#039; endpoint. Since the assignment to groups has not been made, calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return what is in case 0 below.&lt;br /&gt;
* At 9:55am, the canister closes the registration phase and calling the &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; endpoint for the current party is not allowed anymore.&lt;br /&gt;
* From 9:55am to 10am, users are allowed to join. For this, there is a join endpoint that accepts a key – a blob. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 1 below. &lt;br /&gt;
* At 10am, the canister generates the random setup of all calls. From this time onward, calling the join endpoint is not allowed anymore, and clients are supposed to set up the WebRTC connections.&lt;br /&gt;
* Between 10am and 10:01am, the canister returns the call setup state as described in step 1.5 below.&lt;br /&gt;
* At 10:01am, the actual calls start.&lt;br /&gt;
* From 10:01am to 10:11am, the actual party is supposed to take place and users can submit votes. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 2 below.&lt;br /&gt;
* At 10:11am, the canister closes all calls and makes the tally. From this point onward, calling vote is not allowed anymore.&lt;br /&gt;
* From 10:11am, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 3 below.&lt;br /&gt;
&lt;br /&gt;
== Call State at Various Stages == &lt;br /&gt;
The people parties canister stores the state of each call, and updates the state during each phase of the party. The canister exposes the &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; method that returns the state of the call. &lt;br /&gt;
&lt;br /&gt;
==== Before Registration ====&lt;br /&gt;
This is returned for parties that do not exist:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_created};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Joining – Before call starts ==== &lt;br /&gt;
This is returned from the point in time where the groups are assigned but before the point in time when the call is scheduled to start. The state transition from 1 to 1.5 is defined by the canister computing the random assignment.&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_started = record {    &lt;br /&gt;
     joined = true; ← so the UI can show that the user is in the waiting room&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Starting the call ====&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{starting = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{&lt;br /&gt;
       record{&lt;br /&gt;
         name = “adhesive bread”;&lt;br /&gt;
         location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               };&lt;br /&gt;
       record{&lt;br /&gt;
         Name = “stinky tofu”;&lt;br /&gt;
         Location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               ...&lt;br /&gt;
     };&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== After call starts – before call ends ====&lt;br /&gt;
If the user hasn’t successfully joined the call, then the following is returned:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_joined};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
If the user has successfully joined the call, then the following is returned:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{active = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{&lt;br /&gt;
       record{&lt;br /&gt;
         name = “adhesive bread”;&lt;br /&gt;
         location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
       };&lt;br /&gt;
       ...&lt;br /&gt;
     };&lt;br /&gt;
     round = 0;&lt;br /&gt;
     remaining_seconds = 42;&lt;br /&gt;
     voters_in_round = vec{“chilly mustard”; “angry fox”;};&lt;br /&gt;
   }}&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== After call ends ====&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{ended};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== Personhood Score ==&lt;br /&gt;
Each identity in the Internet Computer is assigned a personhood score. If an identity hasn’t participated in any people party, its personhood score is 0. As the identity participates in people parties and is successfully validated to be a person, its personhood score increases. &lt;br /&gt;
&lt;br /&gt;
Any canister will be able to query and obtain the personhood score of an identity. One can potentially use the personhood score to determine the voting power of an identity in an election/voting program.&lt;br /&gt;
&lt;br /&gt;
===== Requirement #1 ===== &lt;br /&gt;
An Internet Computer user is naturally inclined to increase his voting power. He is therefore motivated to create many identities and attend a people party with each identity. This gives him control of many identities with a positive personhood score, and thereby a higher voting power. We would like to avoid this. We would like to design the personhood score in such a way that an IC user is motivated to attend each people party with the same identity rather than creating a new identity for each people party. &lt;br /&gt;
&lt;br /&gt;
===== Requirement #2 ===== &lt;br /&gt;
Suppose Alice attended many parties with her identity, and Bob attended only one recent party. Alice and Bob’s personhood scores should still be close. Alice should not have a significant advantage by attending many parties. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #1 =====&lt;br /&gt;
Suppose personhood score of an identity = 1 if the identity is successfully validated in at least one party. This personhood score violates our Requirement #1. &lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #2 =====&lt;br /&gt;
Suppose personhood score of an identity = number of parties in which the identity is successfully validated. This personhood score violates our Requirement #2. &lt;br /&gt;
&lt;br /&gt;
===== Successful Attempt =====&lt;br /&gt;
After a party ends, the personhood score of an identity is composed of three components: &lt;br /&gt;
* Recent party result (RPR):   This value is 1 if the identity is accepted to be a person in the recent party. The value is 0 if the identity did not participate or is rejected in the recent party. &lt;br /&gt;
* Decay function of previous personhood score: The decay function is a monotonically non-increasing function. It is computed on the old personhood score (the score before the recent party started). The decay lets us give more weightage to the validation in the recent party over the previous parties. &lt;br /&gt;
* Bonus reward function: If the identity is accepted in the most recent party and is successfully accepted in some parties before, a bonus reward is given to the identity. This bonus component is added to incentivize IC users to participate in all the parties using the same identity rather than creating a different identity for each party. &lt;br /&gt;
&lt;br /&gt;
Suppose the personhood score of an identity is PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt; before a party starts. The trust score PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt;  of the identity after the party ends is calculated as follows. &lt;br /&gt;
&lt;br /&gt;
PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + bonus(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  decay(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where Recent Party Result (RPR) is 1 iff the identity is accepted in the party.&lt;br /&gt;
&lt;br /&gt;
Through empirical evidence, we found that &lt;br /&gt;
* bonus(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * x) and &lt;br /&gt;
* decay(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + x) &lt;br /&gt;
work pretty well. That is, &lt;br /&gt;
&lt;br /&gt;
	PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
Consider 2 scenarios. &lt;br /&gt;
* Scenario A: The user enters each party with the same identity, and the user is accepted in each of the parties. &lt;br /&gt;
* Scenario B: The user enters each party with a new identity, and the user is accepted in each of the parties. &lt;br /&gt;
&lt;br /&gt;
Let us compare the personhood scores of the user in each of the scenarios. In Scenario B, we sum up the personhood scores of all the identities controlled by the user. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of personhood scores of a user in Scenarios A &amp;amp; B&lt;br /&gt;
|-&lt;br /&gt;
!  !! Scenario A !! Scenario B&lt;br /&gt;
|-&lt;br /&gt;
| Initial Score || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| After 1st party || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| After 2nd party || 1.398 || 1.301&lt;br /&gt;
|-&lt;br /&gt;
| After 3rd party || 1.510 || 1.415&lt;br /&gt;
|-&lt;br /&gt;
| After 4th party || 1.539 || 1.462&lt;br /&gt;
|-&lt;br /&gt;
| After 5th party || 1.546 || 1.482&lt;br /&gt;
|-&lt;br /&gt;
| After 6th party || 1.548 || 1.491&lt;br /&gt;
|-&lt;br /&gt;
| After 7th party || 1.548 || 1.494&lt;br /&gt;
|-&lt;br /&gt;
| After 8th party || 1.548 || 1.496&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3954</id>
		<title>Proof of Personhood</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3954"/>
		<updated>2022-12-13T18:00:25Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Call State at Various Stages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This page is still work in progress =&lt;br /&gt;
&lt;br /&gt;
== Proof of Personhood ==&lt;br /&gt;
Decentralized protocols generally rely on voting to make decisions. Anyone can create an identity and cast their vote on a proposal. A naïve implementation of this leads to a sybil attack, where one attacker creates many identities and casts many votes in his favor.&lt;br /&gt;
&lt;br /&gt;
Proof of work and proof of stake are the most commonly implemented sybil attack resistance mechanisms. In proof of work, each identity has to invest some computational power to cast votes. The identity&#039;s voting power is proportional to its computational power. In proof of stake, each identity has to purchase some tokens and stake it in the protocol. The identity&#039;s voting power is proportional to its stake. In both cases, people with more money gets higher voting power and can alter the decisions of the decentralized protocol. &lt;br /&gt;
&lt;br /&gt;
Proof of personhood is an alternate solution to solve the sybil attack problem. The goal of the system is to make sure each real person gets voting power of (close to) only 1. Even if the person creates many identities, he cannot have a higher voting power. In this system, anyone create an identity but its voting power is 0 by default. After the identity proves that it is controlled by a real person, it is assigned a non-zero voting power. There are many well-known techniques such as CAPTCHA to verify that someone is a real person. However, a motivated person could still manually create many identities, manually prove each of them is controlled by a real person and get a high voting power. To protect against this attack, the system needs to satisfy a second requirement -- If a single person controls many identities, the sum of voting power of all the identities is still (close to) 1. Essentially, an attacker doesn&#039;t gain any advantage by creating many identities and proving each of them is controlled by a real person. The second requirement is quite difficult to satisfy. &lt;br /&gt;
&lt;br /&gt;
This article describes the &#039;&#039;people parties&#039;&#039; project currently under development at Dfinity Foundation.&lt;br /&gt;
&lt;br /&gt;
== People Parties ==&lt;br /&gt;
People parties&amp;lt;ref&amp;gt;https://medium.com/dfinity/ultimate-decentralization-using-virtual-people-parties-that-deliver-proof-of-personhood-at-de575522c80&amp;lt;/ref&amp;gt; are a mechanism for obtaining proof of personhood (also referred to as proof of humanity) built on and for the Internet Computer. &lt;br /&gt;
&lt;br /&gt;
Each people party takes place at one specific point in time. Prior to that time, each prospective participant commits to a location that they will visit for the time of the party. At the beginning of the party, participants are assigned to small, random subgroups, and meet in a real-time video call with other participants assigned to the same group. The video call, however, does not show the participants’ faces; instead, participants show their surroundings, proving that they are at the place they committed to. As locations chosen by different participants must have a certain minimum distance, and no participant can be physically present at two locations simultaneously, the proof of personhood even guarantees the uniqueness of the validated persons.&lt;br /&gt;
&lt;br /&gt;
The main purpose of people parties is democratization. Each validated participant can designate a neuron in the [[Network Nervous System]] that receives increased voting power; this improves the relative voting power of the “many” vs. the “heavy”. It also provides additional voting rewards to all validated participants, which further motivates people to participate in the parties. The validated personhood also benefits the Internet Computer ecosystem more broadly: Open Internet Systems, which are dapps that are controlled by a decentralized governance system, will be able to profit from the improved decentralization similarly to the Internet Computer itself. And any dapp will be able to use the validation information in order to, e.g., differentiate between bots and actual human users.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
The architecture of the people parties project involves 3 components. &lt;br /&gt;
* Client&lt;br /&gt;
* People party canister&lt;br /&gt;
* Signaling server&lt;br /&gt;
&lt;br /&gt;
===== Client =====&lt;br /&gt;
The client is a device that is used by the participants who want to validate their identity. The client can be a desktop, laptop or a mobile device with a web browser.&lt;br /&gt;
&lt;br /&gt;
===== People party canister =====&lt;br /&gt;
People party canister is a canister (software program) hosted on the Internet Computer. The canister maintains the information related to all the people parties and identities. This includes &lt;br /&gt;
* The longitude boundaries of the participants allowed for the party&lt;br /&gt;
* List of participants in the party&lt;br /&gt;
* The state of each call in the party&lt;br /&gt;
* Validation results of each participant&lt;br /&gt;
* Personhood score (voting power) of each identity&lt;br /&gt;
&lt;br /&gt;
The client queries people party canister to obtain the list of all the upcoming parties. The client can then register or deregister for any party by calling the people party canister. During the registration, the client specifies the latitude and longitude coordinates of the location he will be during the party. &lt;br /&gt;
&lt;br /&gt;
A few minutes before a party commences, the client calls people party canister to join the party. Throughout the party, the client repeatedly calls the people party canister to obtain the state of the call. During the call, each participant streams a video that they are in the promised location. Other participants verify this by simultaneously glancing at the google street view of the location, and send an approve/decline vote to the people party canister. After the call ends, the client queries the people party canister to know if the client was approved/declined by others. The client later calls the people party canister to withdraw 1 ICP it deposited to register for the party.&lt;br /&gt;
&lt;br /&gt;
===== Signaling server =====&lt;br /&gt;
Signaling server is used to facilitate video calls amongst the participants.&lt;br /&gt;
&lt;br /&gt;
== People Party Canister Interface == &lt;br /&gt;
We describe the interface supported by the people party canister here. &lt;br /&gt;
&lt;br /&gt;
 get_parties: () -&amp;gt; (vec record { PartyId; PartySpecification; }) query;&lt;br /&gt;
 register: (id: PartyId, place: Location) -&amp;gt; (RegistrationResponse);&lt;br /&gt;
 deregister: (id: PartyId) -&amp;gt; (DeregistrationResponse);&lt;br /&gt;
 withdraw: (destination: AccountIdentifier) -&amp;gt; (WithdrawResult);&lt;br /&gt;
 join: (id: PartyId, key: blob) -&amp;gt; (JoinResponse);&lt;br /&gt;
 vote: (id: PartyId, vote: record { Vote; ParticipantName; }) -&amp;gt; (VoteResponse);&lt;br /&gt;
 http_request: (request: HttpRequest) -&amp;gt; (HttpResponse) query;&lt;br /&gt;
 get_person_profile: () -&amp;gt; (opt PersonProfile) query;&lt;br /&gt;
 get_call_state: (id: PartyId) -&amp;gt; (PublicCallState) query;&lt;br /&gt;
 get_call_result: (id: PartyId) -&amp;gt; (CallResult) query;&lt;br /&gt;
&lt;br /&gt;
When a user enters the people party website, the frontend calls &amp;lt;code&amp;gt;get_parties&amp;lt;/code&amp;gt; endpoint to display the information of all the parties. The &amp;lt;code&amp;gt;PartySpecification&amp;lt;/code&amp;gt; for each people party is described as follows. &lt;br /&gt;
 type PartySpecification =&lt;br /&gt;
  record {&lt;br /&gt;
   registration_start: Time;&lt;br /&gt;
   registration_end: Time;&lt;br /&gt;
   call_start : Time;&lt;br /&gt;
   longitude_min : float64;&lt;br /&gt;
   longitude_max : float64;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The user can then then register or deregister for a party by calling &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;deregister&amp;lt;/code&amp;gt; endpoints. The canister responds with the status of registration. When the user registers for a party, he specifies the the Location (latitude and longitude) of where the user will be when the party starts. &lt;br /&gt;
&lt;br /&gt;
A few minutes before the party starts, the user joins the party by calling &amp;lt;code&amp;gt;join&amp;lt;/code&amp;gt; endpoint. After the user joins a call, the user sends one vote (approve/decline) for each of the other participants by calling &amp;lt;code&amp;gt;vote&amp;lt;/code&amp;gt; endpoint. &lt;br /&gt;
&lt;br /&gt;
At any point in time, one can call &amp;lt;code&amp;gt;get_person_profile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;get_call_result&amp;lt;/code&amp;gt; endpoints to obtain the information about the list of parties, a person&#039;s profile, state of a call and result of a call respectively.&lt;br /&gt;
&lt;br /&gt;
The profile of a person is described by&lt;br /&gt;
 type PersonProfile = record {&lt;br /&gt;
   upcoming_parties: vec record { PartyId; Location; };&lt;br /&gt;
   validation_score: nat64;&lt;br /&gt;
   past_parties: vec PartyId;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
When the user registers for a party, he needs to deposit 1 ICP. After the party ends, the user can withdraw this amount by calling &amp;lt;code&amp;gt;withdraw&amp;lt;/code&amp;gt; endpoint. The user can only withdraw if he hasn&#039;t registered for any upcoming party. Once the user withdraws the amount, he cannot register again until he deposits 1 ICP.&lt;br /&gt;
&lt;br /&gt;
== Party Flow == &lt;br /&gt;
The below flow describing a call. Say the call is scheduled to start at 10am. Then the timeline should be as follows:&lt;br /&gt;
&lt;br /&gt;
* Until 9:55am, users can enroll with the &#039;&#039;register&#039;&#039; endpoint. Since the assignment to groups has not been made, calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return what is in case 0 below.&lt;br /&gt;
* At 9:55am, the canister closes the registration phase and calling the &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; endpoint for the current party is not allowed anymore.&lt;br /&gt;
* From 9:55am to 10am, users are allowed to join. For this, there is a join endpoint that accepts a key – a blob. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 1 below. &lt;br /&gt;
* At 10am, the canister generates the random setup of all calls. From this time onward, calling the join endpoint is not allowed anymore, and clients are supposed to set up the WebRTC connections.&lt;br /&gt;
* Between 10am and 10:01am, the canister returns the call setup state as described in step 1.5 below.&lt;br /&gt;
* At 10:01am, the actual calls start.&lt;br /&gt;
* From 10:01am to 10:11am, the actual party is supposed to take place and users can submit votes. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 2 below.&lt;br /&gt;
* At 10:11am, the canister closes all calls and makes the tally. From this point onward, calling vote is not allowed anymore.&lt;br /&gt;
* From 10:11am, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 3 below.&lt;br /&gt;
&lt;br /&gt;
== Call State at Various Stages == &lt;br /&gt;
The people parties canister stores the state of each call, and updates the state during each phase of the party. The canister exposes the &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; method that returns the state of the call. &lt;br /&gt;
&lt;br /&gt;
==== Before Registration ====&lt;br /&gt;
This is returned for parties that do not exist:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_created};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Joining – Before call starts ==== &lt;br /&gt;
This is returned from the point in time where the groups are assigned but before the point in time when the call is scheduled to start. The state transition from 1 to 1.5 is defined by the canister computing the random assignment.&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_started = record {    &lt;br /&gt;
     joined = true; ← so the UI can show that the user is in the waiting room&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Starting the call ====&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{starting = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{&lt;br /&gt;
       record{&lt;br /&gt;
         name = “adhesive bread”;&lt;br /&gt;
         location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               };&lt;br /&gt;
       record{&lt;br /&gt;
         Name = “stinky tofu”;&lt;br /&gt;
         Location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               ...&lt;br /&gt;
     };&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== After call starts – before call ends ====&lt;br /&gt;
If the user hasn’t successfully joined the call, then the following is returned:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_joined};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
If the user has successfully joined the call, then the following is returned:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{active = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{&lt;br /&gt;
       record{&lt;br /&gt;
         name = “adhesive bread”;&lt;br /&gt;
         location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
       };&lt;br /&gt;
       ...&lt;br /&gt;
     };&lt;br /&gt;
     round = 0;&lt;br /&gt;
     remaining_seconds = 42;&lt;br /&gt;
     voters_in_round = vec{“chilly mustard”; “angry fox”;};&lt;br /&gt;
   }}&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== Personhood Score ==&lt;br /&gt;
Each identity in the Internet Computer is assigned a personhood score. If an identity hasn’t participated in any people party, its personhood score is 0. As the identity participates in people parties and is successfully validated to be a person, its personhood score increases. &lt;br /&gt;
&lt;br /&gt;
Any canister will be able to query and obtain the personhood score of an identity. One can potentially use the personhood score to determine the voting power of an identity in an election/voting program.&lt;br /&gt;
&lt;br /&gt;
===== Requirement #1 ===== &lt;br /&gt;
An Internet Computer user is naturally inclined to increase his voting power. He is therefore motivated to create many identities and attend a people party with each identity. This gives him control of many identities with a positive personhood score, and thereby a higher voting power. We would like to avoid this. We would like to design the personhood score in such a way that an IC user is motivated to attend each people party with the same identity rather than creating a new identity for each people party. &lt;br /&gt;
&lt;br /&gt;
===== Requirement #2 ===== &lt;br /&gt;
Suppose Alice attended many parties with her identity, and Bob attended only one recent party. Alice and Bob’s personhood scores should still be close. Alice should not have a significant advantage by attending many parties. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #1 =====&lt;br /&gt;
Suppose personhood score of an identity = 1 if the identity is successfully validated in at least one party. This personhood score violates our Requirement #1. &lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #2 =====&lt;br /&gt;
Suppose personhood score of an identity = number of parties in which the identity is successfully validated. This personhood score violates our Requirement #2. &lt;br /&gt;
&lt;br /&gt;
===== Successful Attempt =====&lt;br /&gt;
After a party ends, the personhood score of an identity is composed of three components: &lt;br /&gt;
* Recent party result (RPR):   This value is 1 if the identity is accepted to be a person in the recent party. The value is 0 if the identity did not participate or is rejected in the recent party. &lt;br /&gt;
* Decay function of previous personhood score: The decay function is a monotonically non-increasing function. It is computed on the old personhood score (the score before the recent party started). The decay lets us give more weightage to the validation in the recent party over the previous parties. &lt;br /&gt;
* Bonus reward function: If the identity is accepted in the most recent party and is successfully accepted in some parties before, a bonus reward is given to the identity. This bonus component is added to incentivize IC users to participate in all the parties using the same identity rather than creating a different identity for each party. &lt;br /&gt;
&lt;br /&gt;
Suppose the personhood score of an identity is PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt; before a party starts. The trust score PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt;  of the identity after the party ends is calculated as follows. &lt;br /&gt;
&lt;br /&gt;
PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + bonus(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  decay(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where Recent Party Result (RPR) is 1 iff the identity is accepted in the party.&lt;br /&gt;
&lt;br /&gt;
Through empirical evidence, we found that &lt;br /&gt;
* bonus(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * x) and &lt;br /&gt;
* decay(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + x) &lt;br /&gt;
work pretty well. That is, &lt;br /&gt;
&lt;br /&gt;
	PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
Consider 2 scenarios. &lt;br /&gt;
* Scenario A: The user enters each party with the same identity, and the user is accepted in each of the parties. &lt;br /&gt;
* Scenario B: The user enters each party with a new identity, and the user is accepted in each of the parties. &lt;br /&gt;
&lt;br /&gt;
Let us compare the personhood scores of the user in each of the scenarios. In Scenario B, we sum up the personhood scores of all the identities controlled by the user. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of personhood scores of a user in Scenarios A &amp;amp; B&lt;br /&gt;
|-&lt;br /&gt;
!  !! Scenario A !! Scenario B&lt;br /&gt;
|-&lt;br /&gt;
| Initial Score || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| After 1st party || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| After 2nd party || 1.398 || 1.301&lt;br /&gt;
|-&lt;br /&gt;
| After 3rd party || 1.510 || 1.415&lt;br /&gt;
|-&lt;br /&gt;
| After 4th party || 1.539 || 1.462&lt;br /&gt;
|-&lt;br /&gt;
| After 5th party || 1.546 || 1.482&lt;br /&gt;
|-&lt;br /&gt;
| After 6th party || 1.548 || 1.491&lt;br /&gt;
|-&lt;br /&gt;
| After 7th party || 1.548 || 1.494&lt;br /&gt;
|-&lt;br /&gt;
| After 8th party || 1.548 || 1.496&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3953</id>
		<title>Proof of Personhood</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3953"/>
		<updated>2022-12-13T17:59:13Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Call State at Various Stages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This page is still work in progress =&lt;br /&gt;
&lt;br /&gt;
== Proof of Personhood ==&lt;br /&gt;
Decentralized protocols generally rely on voting to make decisions. Anyone can create an identity and cast their vote on a proposal. A naïve implementation of this leads to a sybil attack, where one attacker creates many identities and casts many votes in his favor.&lt;br /&gt;
&lt;br /&gt;
Proof of work and proof of stake are the most commonly implemented sybil attack resistance mechanisms. In proof of work, each identity has to invest some computational power to cast votes. The identity&#039;s voting power is proportional to its computational power. In proof of stake, each identity has to purchase some tokens and stake it in the protocol. The identity&#039;s voting power is proportional to its stake. In both cases, people with more money gets higher voting power and can alter the decisions of the decentralized protocol. &lt;br /&gt;
&lt;br /&gt;
Proof of personhood is an alternate solution to solve the sybil attack problem. The goal of the system is to make sure each real person gets voting power of (close to) only 1. Even if the person creates many identities, he cannot have a higher voting power. In this system, anyone create an identity but its voting power is 0 by default. After the identity proves that it is controlled by a real person, it is assigned a non-zero voting power. There are many well-known techniques such as CAPTCHA to verify that someone is a real person. However, a motivated person could still manually create many identities, manually prove each of them is controlled by a real person and get a high voting power. To protect against this attack, the system needs to satisfy a second requirement -- If a single person controls many identities, the sum of voting power of all the identities is still (close to) 1. Essentially, an attacker doesn&#039;t gain any advantage by creating many identities and proving each of them is controlled by a real person. The second requirement is quite difficult to satisfy. &lt;br /&gt;
&lt;br /&gt;
This article describes the &#039;&#039;people parties&#039;&#039; project currently under development at Dfinity Foundation.&lt;br /&gt;
&lt;br /&gt;
== People Parties ==&lt;br /&gt;
People parties&amp;lt;ref&amp;gt;https://medium.com/dfinity/ultimate-decentralization-using-virtual-people-parties-that-deliver-proof-of-personhood-at-de575522c80&amp;lt;/ref&amp;gt; are a mechanism for obtaining proof of personhood (also referred to as proof of humanity) built on and for the Internet Computer. &lt;br /&gt;
&lt;br /&gt;
Each people party takes place at one specific point in time. Prior to that time, each prospective participant commits to a location that they will visit for the time of the party. At the beginning of the party, participants are assigned to small, random subgroups, and meet in a real-time video call with other participants assigned to the same group. The video call, however, does not show the participants’ faces; instead, participants show their surroundings, proving that they are at the place they committed to. As locations chosen by different participants must have a certain minimum distance, and no participant can be physically present at two locations simultaneously, the proof of personhood even guarantees the uniqueness of the validated persons.&lt;br /&gt;
&lt;br /&gt;
The main purpose of people parties is democratization. Each validated participant can designate a neuron in the [[Network Nervous System]] that receives increased voting power; this improves the relative voting power of the “many” vs. the “heavy”. It also provides additional voting rewards to all validated participants, which further motivates people to participate in the parties. The validated personhood also benefits the Internet Computer ecosystem more broadly: Open Internet Systems, which are dapps that are controlled by a decentralized governance system, will be able to profit from the improved decentralization similarly to the Internet Computer itself. And any dapp will be able to use the validation information in order to, e.g., differentiate between bots and actual human users.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
The architecture of the people parties project involves 3 components. &lt;br /&gt;
* Client&lt;br /&gt;
* People party canister&lt;br /&gt;
* Signaling server&lt;br /&gt;
&lt;br /&gt;
===== Client =====&lt;br /&gt;
The client is a device that is used by the participants who want to validate their identity. The client can be a desktop, laptop or a mobile device with a web browser.&lt;br /&gt;
&lt;br /&gt;
===== People party canister =====&lt;br /&gt;
People party canister is a canister (software program) hosted on the Internet Computer. The canister maintains the information related to all the people parties and identities. This includes &lt;br /&gt;
* The longitude boundaries of the participants allowed for the party&lt;br /&gt;
* List of participants in the party&lt;br /&gt;
* The state of each call in the party&lt;br /&gt;
* Validation results of each participant&lt;br /&gt;
* Personhood score (voting power) of each identity&lt;br /&gt;
&lt;br /&gt;
The client queries people party canister to obtain the list of all the upcoming parties. The client can then register or deregister for any party by calling the people party canister. During the registration, the client specifies the latitude and longitude coordinates of the location he will be during the party. &lt;br /&gt;
&lt;br /&gt;
A few minutes before a party commences, the client calls people party canister to join the party. Throughout the party, the client repeatedly calls the people party canister to obtain the state of the call. During the call, each participant streams a video that they are in the promised location. Other participants verify this by simultaneously glancing at the google street view of the location, and send an approve/decline vote to the people party canister. After the call ends, the client queries the people party canister to know if the client was approved/declined by others. The client later calls the people party canister to withdraw 1 ICP it deposited to register for the party.&lt;br /&gt;
&lt;br /&gt;
===== Signaling server =====&lt;br /&gt;
Signaling server is used to facilitate video calls amongst the participants.&lt;br /&gt;
&lt;br /&gt;
== People Party Canister Interface == &lt;br /&gt;
We describe the interface supported by the people party canister here. &lt;br /&gt;
&lt;br /&gt;
 get_parties: () -&amp;gt; (vec record { PartyId; PartySpecification; }) query;&lt;br /&gt;
 register: (id: PartyId, place: Location) -&amp;gt; (RegistrationResponse);&lt;br /&gt;
 deregister: (id: PartyId) -&amp;gt; (DeregistrationResponse);&lt;br /&gt;
 withdraw: (destination: AccountIdentifier) -&amp;gt; (WithdrawResult);&lt;br /&gt;
 join: (id: PartyId, key: blob) -&amp;gt; (JoinResponse);&lt;br /&gt;
 vote: (id: PartyId, vote: record { Vote; ParticipantName; }) -&amp;gt; (VoteResponse);&lt;br /&gt;
 http_request: (request: HttpRequest) -&amp;gt; (HttpResponse) query;&lt;br /&gt;
 get_person_profile: () -&amp;gt; (opt PersonProfile) query;&lt;br /&gt;
 get_call_state: (id: PartyId) -&amp;gt; (PublicCallState) query;&lt;br /&gt;
 get_call_result: (id: PartyId) -&amp;gt; (CallResult) query;&lt;br /&gt;
&lt;br /&gt;
When a user enters the people party website, the frontend calls &amp;lt;code&amp;gt;get_parties&amp;lt;/code&amp;gt; endpoint to display the information of all the parties. The &amp;lt;code&amp;gt;PartySpecification&amp;lt;/code&amp;gt; for each people party is described as follows. &lt;br /&gt;
 type PartySpecification =&lt;br /&gt;
  record {&lt;br /&gt;
   registration_start: Time;&lt;br /&gt;
   registration_end: Time;&lt;br /&gt;
   call_start : Time;&lt;br /&gt;
   longitude_min : float64;&lt;br /&gt;
   longitude_max : float64;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The user can then then register or deregister for a party by calling &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;deregister&amp;lt;/code&amp;gt; endpoints. The canister responds with the status of registration. When the user registers for a party, he specifies the the Location (latitude and longitude) of where the user will be when the party starts. &lt;br /&gt;
&lt;br /&gt;
A few minutes before the party starts, the user joins the party by calling &amp;lt;code&amp;gt;join&amp;lt;/code&amp;gt; endpoint. After the user joins a call, the user sends one vote (approve/decline) for each of the other participants by calling &amp;lt;code&amp;gt;vote&amp;lt;/code&amp;gt; endpoint. &lt;br /&gt;
&lt;br /&gt;
At any point in time, one can call &amp;lt;code&amp;gt;get_person_profile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;get_call_result&amp;lt;/code&amp;gt; endpoints to obtain the information about the list of parties, a person&#039;s profile, state of a call and result of a call respectively.&lt;br /&gt;
&lt;br /&gt;
The profile of a person is described by&lt;br /&gt;
 type PersonProfile = record {&lt;br /&gt;
   upcoming_parties: vec record { PartyId; Location; };&lt;br /&gt;
   validation_score: nat64;&lt;br /&gt;
   past_parties: vec PartyId;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
When the user registers for a party, he needs to deposit 1 ICP. After the party ends, the user can withdraw this amount by calling &amp;lt;code&amp;gt;withdraw&amp;lt;/code&amp;gt; endpoint. The user can only withdraw if he hasn&#039;t registered for any upcoming party. Once the user withdraws the amount, he cannot register again until he deposits 1 ICP.&lt;br /&gt;
&lt;br /&gt;
== Party Flow == &lt;br /&gt;
The below flow describing a call. Say the call is scheduled to start at 10am. Then the timeline should be as follows:&lt;br /&gt;
&lt;br /&gt;
* Until 9:55am, users can enroll with the &#039;&#039;register&#039;&#039; endpoint. Since the assignment to groups has not been made, calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return what is in case 0 below.&lt;br /&gt;
* At 9:55am, the canister closes the registration phase and calling the &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; endpoint for the current party is not allowed anymore.&lt;br /&gt;
* From 9:55am to 10am, users are allowed to join. For this, there is a join endpoint that accepts a key – a blob. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 1 below. &lt;br /&gt;
* At 10am, the canister generates the random setup of all calls. From this time onward, calling the join endpoint is not allowed anymore, and clients are supposed to set up the WebRTC connections.&lt;br /&gt;
* Between 10am and 10:01am, the canister returns the call setup state as described in step 1.5 below.&lt;br /&gt;
* At 10:01am, the actual calls start.&lt;br /&gt;
* From 10:01am to 10:11am, the actual party is supposed to take place and users can submit votes. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 2 below.&lt;br /&gt;
* At 10:11am, the canister closes all calls and makes the tally. From this point onward, calling vote is not allowed anymore.&lt;br /&gt;
* From 10:11am, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 3 below.&lt;br /&gt;
&lt;br /&gt;
== Call State at Various Stages == &lt;br /&gt;
The people parties canister stores the state of each call, and updates the state during each phase of the party. The canister exposes the &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; method that returns the state of the call. &lt;br /&gt;
&lt;br /&gt;
==== Before Registration ====&lt;br /&gt;
This is returned for parties that do not exist:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_created};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Joining – Before call starts ==== &lt;br /&gt;
This is returned from the point in time where the groups are assigned but before the point in time when the call is scheduled to start. The state transition from 1 to 1.5 is defined by the canister computing the random assignment.&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_started = record {    &lt;br /&gt;
     joined = true; ← so the UI can show that the user is in the waiting room&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Starting the call ====&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{starting = record{&lt;br /&gt;
     myself = “adhesive bread”;&lt;br /&gt;
     participants = vec{&lt;br /&gt;
       record{&lt;br /&gt;
         name = “adhesive bread”;&lt;br /&gt;
         location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               };&lt;br /&gt;
       record{&lt;br /&gt;
         Name = “stinky tofu”;&lt;br /&gt;
         Location = …&lt;br /&gt;
         key = [30, 57, 30, …];&lt;br /&gt;
               ...&lt;br /&gt;
     };&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== Personhood Score ==&lt;br /&gt;
Each identity in the Internet Computer is assigned a personhood score. If an identity hasn’t participated in any people party, its personhood score is 0. As the identity participates in people parties and is successfully validated to be a person, its personhood score increases. &lt;br /&gt;
&lt;br /&gt;
Any canister will be able to query and obtain the personhood score of an identity. One can potentially use the personhood score to determine the voting power of an identity in an election/voting program.&lt;br /&gt;
&lt;br /&gt;
===== Requirement #1 ===== &lt;br /&gt;
An Internet Computer user is naturally inclined to increase his voting power. He is therefore motivated to create many identities and attend a people party with each identity. This gives him control of many identities with a positive personhood score, and thereby a higher voting power. We would like to avoid this. We would like to design the personhood score in such a way that an IC user is motivated to attend each people party with the same identity rather than creating a new identity for each people party. &lt;br /&gt;
&lt;br /&gt;
===== Requirement #2 ===== &lt;br /&gt;
Suppose Alice attended many parties with her identity, and Bob attended only one recent party. Alice and Bob’s personhood scores should still be close. Alice should not have a significant advantage by attending many parties. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #1 =====&lt;br /&gt;
Suppose personhood score of an identity = 1 if the identity is successfully validated in at least one party. This personhood score violates our Requirement #1. &lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #2 =====&lt;br /&gt;
Suppose personhood score of an identity = number of parties in which the identity is successfully validated. This personhood score violates our Requirement #2. &lt;br /&gt;
&lt;br /&gt;
===== Successful Attempt =====&lt;br /&gt;
After a party ends, the personhood score of an identity is composed of three components: &lt;br /&gt;
* Recent party result (RPR):   This value is 1 if the identity is accepted to be a person in the recent party. The value is 0 if the identity did not participate or is rejected in the recent party. &lt;br /&gt;
* Decay function of previous personhood score: The decay function is a monotonically non-increasing function. It is computed on the old personhood score (the score before the recent party started). The decay lets us give more weightage to the validation in the recent party over the previous parties. &lt;br /&gt;
* Bonus reward function: If the identity is accepted in the most recent party and is successfully accepted in some parties before, a bonus reward is given to the identity. This bonus component is added to incentivize IC users to participate in all the parties using the same identity rather than creating a different identity for each party. &lt;br /&gt;
&lt;br /&gt;
Suppose the personhood score of an identity is PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt; before a party starts. The trust score PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt;  of the identity after the party ends is calculated as follows. &lt;br /&gt;
&lt;br /&gt;
PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + bonus(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  decay(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where Recent Party Result (RPR) is 1 iff the identity is accepted in the party.&lt;br /&gt;
&lt;br /&gt;
Through empirical evidence, we found that &lt;br /&gt;
* bonus(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * x) and &lt;br /&gt;
* decay(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + x) &lt;br /&gt;
work pretty well. That is, &lt;br /&gt;
&lt;br /&gt;
	PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
Consider 2 scenarios. &lt;br /&gt;
* Scenario A: The user enters each party with the same identity, and the user is accepted in each of the parties. &lt;br /&gt;
* Scenario B: The user enters each party with a new identity, and the user is accepted in each of the parties. &lt;br /&gt;
&lt;br /&gt;
Let us compare the personhood scores of the user in each of the scenarios. In Scenario B, we sum up the personhood scores of all the identities controlled by the user. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of personhood scores of a user in Scenarios A &amp;amp; B&lt;br /&gt;
|-&lt;br /&gt;
!  !! Scenario A !! Scenario B&lt;br /&gt;
|-&lt;br /&gt;
| Initial Score || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| After 1st party || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| After 2nd party || 1.398 || 1.301&lt;br /&gt;
|-&lt;br /&gt;
| After 3rd party || 1.510 || 1.415&lt;br /&gt;
|-&lt;br /&gt;
| After 4th party || 1.539 || 1.462&lt;br /&gt;
|-&lt;br /&gt;
| After 5th party || 1.546 || 1.482&lt;br /&gt;
|-&lt;br /&gt;
| After 6th party || 1.548 || 1.491&lt;br /&gt;
|-&lt;br /&gt;
| After 7th party || 1.548 || 1.494&lt;br /&gt;
|-&lt;br /&gt;
| After 8th party || 1.548 || 1.496&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3952</id>
		<title>Proof of Personhood</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3952"/>
		<updated>2022-12-13T17:57:30Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Call State at Various Stages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This page is still work in progress =&lt;br /&gt;
&lt;br /&gt;
== Proof of Personhood ==&lt;br /&gt;
Decentralized protocols generally rely on voting to make decisions. Anyone can create an identity and cast their vote on a proposal. A naïve implementation of this leads to a sybil attack, where one attacker creates many identities and casts many votes in his favor.&lt;br /&gt;
&lt;br /&gt;
Proof of work and proof of stake are the most commonly implemented sybil attack resistance mechanisms. In proof of work, each identity has to invest some computational power to cast votes. The identity&#039;s voting power is proportional to its computational power. In proof of stake, each identity has to purchase some tokens and stake it in the protocol. The identity&#039;s voting power is proportional to its stake. In both cases, people with more money gets higher voting power and can alter the decisions of the decentralized protocol. &lt;br /&gt;
&lt;br /&gt;
Proof of personhood is an alternate solution to solve the sybil attack problem. The goal of the system is to make sure each real person gets voting power of (close to) only 1. Even if the person creates many identities, he cannot have a higher voting power. In this system, anyone create an identity but its voting power is 0 by default. After the identity proves that it is controlled by a real person, it is assigned a non-zero voting power. There are many well-known techniques such as CAPTCHA to verify that someone is a real person. However, a motivated person could still manually create many identities, manually prove each of them is controlled by a real person and get a high voting power. To protect against this attack, the system needs to satisfy a second requirement -- If a single person controls many identities, the sum of voting power of all the identities is still (close to) 1. Essentially, an attacker doesn&#039;t gain any advantage by creating many identities and proving each of them is controlled by a real person. The second requirement is quite difficult to satisfy. &lt;br /&gt;
&lt;br /&gt;
This article describes the &#039;&#039;people parties&#039;&#039; project currently under development at Dfinity Foundation.&lt;br /&gt;
&lt;br /&gt;
== People Parties ==&lt;br /&gt;
People parties&amp;lt;ref&amp;gt;https://medium.com/dfinity/ultimate-decentralization-using-virtual-people-parties-that-deliver-proof-of-personhood-at-de575522c80&amp;lt;/ref&amp;gt; are a mechanism for obtaining proof of personhood (also referred to as proof of humanity) built on and for the Internet Computer. &lt;br /&gt;
&lt;br /&gt;
Each people party takes place at one specific point in time. Prior to that time, each prospective participant commits to a location that they will visit for the time of the party. At the beginning of the party, participants are assigned to small, random subgroups, and meet in a real-time video call with other participants assigned to the same group. The video call, however, does not show the participants’ faces; instead, participants show their surroundings, proving that they are at the place they committed to. As locations chosen by different participants must have a certain minimum distance, and no participant can be physically present at two locations simultaneously, the proof of personhood even guarantees the uniqueness of the validated persons.&lt;br /&gt;
&lt;br /&gt;
The main purpose of people parties is democratization. Each validated participant can designate a neuron in the [[Network Nervous System]] that receives increased voting power; this improves the relative voting power of the “many” vs. the “heavy”. It also provides additional voting rewards to all validated participants, which further motivates people to participate in the parties. The validated personhood also benefits the Internet Computer ecosystem more broadly: Open Internet Systems, which are dapps that are controlled by a decentralized governance system, will be able to profit from the improved decentralization similarly to the Internet Computer itself. And any dapp will be able to use the validation information in order to, e.g., differentiate between bots and actual human users.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
The architecture of the people parties project involves 3 components. &lt;br /&gt;
* Client&lt;br /&gt;
* People party canister&lt;br /&gt;
* Signaling server&lt;br /&gt;
&lt;br /&gt;
===== Client =====&lt;br /&gt;
The client is a device that is used by the participants who want to validate their identity. The client can be a desktop, laptop or a mobile device with a web browser.&lt;br /&gt;
&lt;br /&gt;
===== People party canister =====&lt;br /&gt;
People party canister is a canister (software program) hosted on the Internet Computer. The canister maintains the information related to all the people parties and identities. This includes &lt;br /&gt;
* The longitude boundaries of the participants allowed for the party&lt;br /&gt;
* List of participants in the party&lt;br /&gt;
* The state of each call in the party&lt;br /&gt;
* Validation results of each participant&lt;br /&gt;
* Personhood score (voting power) of each identity&lt;br /&gt;
&lt;br /&gt;
The client queries people party canister to obtain the list of all the upcoming parties. The client can then register or deregister for any party by calling the people party canister. During the registration, the client specifies the latitude and longitude coordinates of the location he will be during the party. &lt;br /&gt;
&lt;br /&gt;
A few minutes before a party commences, the client calls people party canister to join the party. Throughout the party, the client repeatedly calls the people party canister to obtain the state of the call. During the call, each participant streams a video that they are in the promised location. Other participants verify this by simultaneously glancing at the google street view of the location, and send an approve/decline vote to the people party canister. After the call ends, the client queries the people party canister to know if the client was approved/declined by others. The client later calls the people party canister to withdraw 1 ICP it deposited to register for the party.&lt;br /&gt;
&lt;br /&gt;
===== Signaling server =====&lt;br /&gt;
Signaling server is used to facilitate video calls amongst the participants.&lt;br /&gt;
&lt;br /&gt;
== People Party Canister Interface == &lt;br /&gt;
We describe the interface supported by the people party canister here. &lt;br /&gt;
&lt;br /&gt;
 get_parties: () -&amp;gt; (vec record { PartyId; PartySpecification; }) query;&lt;br /&gt;
 register: (id: PartyId, place: Location) -&amp;gt; (RegistrationResponse);&lt;br /&gt;
 deregister: (id: PartyId) -&amp;gt; (DeregistrationResponse);&lt;br /&gt;
 withdraw: (destination: AccountIdentifier) -&amp;gt; (WithdrawResult);&lt;br /&gt;
 join: (id: PartyId, key: blob) -&amp;gt; (JoinResponse);&lt;br /&gt;
 vote: (id: PartyId, vote: record { Vote; ParticipantName; }) -&amp;gt; (VoteResponse);&lt;br /&gt;
 http_request: (request: HttpRequest) -&amp;gt; (HttpResponse) query;&lt;br /&gt;
 get_person_profile: () -&amp;gt; (opt PersonProfile) query;&lt;br /&gt;
 get_call_state: (id: PartyId) -&amp;gt; (PublicCallState) query;&lt;br /&gt;
 get_call_result: (id: PartyId) -&amp;gt; (CallResult) query;&lt;br /&gt;
&lt;br /&gt;
When a user enters the people party website, the frontend calls &amp;lt;code&amp;gt;get_parties&amp;lt;/code&amp;gt; endpoint to display the information of all the parties. The &amp;lt;code&amp;gt;PartySpecification&amp;lt;/code&amp;gt; for each people party is described as follows. &lt;br /&gt;
 type PartySpecification =&lt;br /&gt;
  record {&lt;br /&gt;
   registration_start: Time;&lt;br /&gt;
   registration_end: Time;&lt;br /&gt;
   call_start : Time;&lt;br /&gt;
   longitude_min : float64;&lt;br /&gt;
   longitude_max : float64;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The user can then then register or deregister for a party by calling &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;deregister&amp;lt;/code&amp;gt; endpoints. The canister responds with the status of registration. When the user registers for a party, he specifies the the Location (latitude and longitude) of where the user will be when the party starts. &lt;br /&gt;
&lt;br /&gt;
A few minutes before the party starts, the user joins the party by calling &amp;lt;code&amp;gt;join&amp;lt;/code&amp;gt; endpoint. After the user joins a call, the user sends one vote (approve/decline) for each of the other participants by calling &amp;lt;code&amp;gt;vote&amp;lt;/code&amp;gt; endpoint. &lt;br /&gt;
&lt;br /&gt;
At any point in time, one can call &amp;lt;code&amp;gt;get_person_profile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;get_call_result&amp;lt;/code&amp;gt; endpoints to obtain the information about the list of parties, a person&#039;s profile, state of a call and result of a call respectively.&lt;br /&gt;
&lt;br /&gt;
The profile of a person is described by&lt;br /&gt;
 type PersonProfile = record {&lt;br /&gt;
   upcoming_parties: vec record { PartyId; Location; };&lt;br /&gt;
   validation_score: nat64;&lt;br /&gt;
   past_parties: vec PartyId;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
When the user registers for a party, he needs to deposit 1 ICP. After the party ends, the user can withdraw this amount by calling &amp;lt;code&amp;gt;withdraw&amp;lt;/code&amp;gt; endpoint. The user can only withdraw if he hasn&#039;t registered for any upcoming party. Once the user withdraws the amount, he cannot register again until he deposits 1 ICP.&lt;br /&gt;
&lt;br /&gt;
== Party Flow == &lt;br /&gt;
The below flow describing a call. Say the call is scheduled to start at 10am. Then the timeline should be as follows:&lt;br /&gt;
&lt;br /&gt;
* Until 9:55am, users can enroll with the &#039;&#039;register&#039;&#039; endpoint. Since the assignment to groups has not been made, calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return what is in case 0 below.&lt;br /&gt;
* At 9:55am, the canister closes the registration phase and calling the &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; endpoint for the current party is not allowed anymore.&lt;br /&gt;
* From 9:55am to 10am, users are allowed to join. For this, there is a join endpoint that accepts a key – a blob. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 1 below. &lt;br /&gt;
* At 10am, the canister generates the random setup of all calls. From this time onward, calling the join endpoint is not allowed anymore, and clients are supposed to set up the WebRTC connections.&lt;br /&gt;
* Between 10am and 10:01am, the canister returns the call setup state as described in step 1.5 below.&lt;br /&gt;
* At 10:01am, the actual calls start.&lt;br /&gt;
* From 10:01am to 10:11am, the actual party is supposed to take place and users can submit votes. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 2 below.&lt;br /&gt;
* At 10:11am, the canister closes all calls and makes the tally. From this point onward, calling vote is not allowed anymore.&lt;br /&gt;
* From 10:11am, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 3 below.&lt;br /&gt;
&lt;br /&gt;
== Call State at Various Stages == &lt;br /&gt;
The people parties canister stores the state of each call, and updates the state during each phase of the party. The canister exposes the &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; method that returns the state of the call. &lt;br /&gt;
&lt;br /&gt;
==== Before Registration ====&lt;br /&gt;
This is returned for parties that do not exist:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_created};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
==== Joining – Before call starts ==== &lt;br /&gt;
This is returned from the point in time where the groups are assigned but before the point in time when the call is scheduled to start. The state transition from 1 to 1.5 is defined by the canister computing the random assignment.&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_started = record {    &lt;br /&gt;
     joined = true; ← so the UI can show that the user is in the waiting room&lt;br /&gt;
     starts_in_seconds = 30;&lt;br /&gt;
   }};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== Personhood Score ==&lt;br /&gt;
Each identity in the Internet Computer is assigned a personhood score. If an identity hasn’t participated in any people party, its personhood score is 0. As the identity participates in people parties and is successfully validated to be a person, its personhood score increases. &lt;br /&gt;
&lt;br /&gt;
Any canister will be able to query and obtain the personhood score of an identity. One can potentially use the personhood score to determine the voting power of an identity in an election/voting program.&lt;br /&gt;
&lt;br /&gt;
===== Requirement #1 ===== &lt;br /&gt;
An Internet Computer user is naturally inclined to increase his voting power. He is therefore motivated to create many identities and attend a people party with each identity. This gives him control of many identities with a positive personhood score, and thereby a higher voting power. We would like to avoid this. We would like to design the personhood score in such a way that an IC user is motivated to attend each people party with the same identity rather than creating a new identity for each people party. &lt;br /&gt;
&lt;br /&gt;
===== Requirement #2 ===== &lt;br /&gt;
Suppose Alice attended many parties with her identity, and Bob attended only one recent party. Alice and Bob’s personhood scores should still be close. Alice should not have a significant advantage by attending many parties. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #1 =====&lt;br /&gt;
Suppose personhood score of an identity = 1 if the identity is successfully validated in at least one party. This personhood score violates our Requirement #1. &lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #2 =====&lt;br /&gt;
Suppose personhood score of an identity = number of parties in which the identity is successfully validated. This personhood score violates our Requirement #2. &lt;br /&gt;
&lt;br /&gt;
===== Successful Attempt =====&lt;br /&gt;
After a party ends, the personhood score of an identity is composed of three components: &lt;br /&gt;
* Recent party result (RPR):   This value is 1 if the identity is accepted to be a person in the recent party. The value is 0 if the identity did not participate or is rejected in the recent party. &lt;br /&gt;
* Decay function of previous personhood score: The decay function is a monotonically non-increasing function. It is computed on the old personhood score (the score before the recent party started). The decay lets us give more weightage to the validation in the recent party over the previous parties. &lt;br /&gt;
* Bonus reward function: If the identity is accepted in the most recent party and is successfully accepted in some parties before, a bonus reward is given to the identity. This bonus component is added to incentivize IC users to participate in all the parties using the same identity rather than creating a different identity for each party. &lt;br /&gt;
&lt;br /&gt;
Suppose the personhood score of an identity is PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt; before a party starts. The trust score PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt;  of the identity after the party ends is calculated as follows. &lt;br /&gt;
&lt;br /&gt;
PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + bonus(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  decay(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where Recent Party Result (RPR) is 1 iff the identity is accepted in the party.&lt;br /&gt;
&lt;br /&gt;
Through empirical evidence, we found that &lt;br /&gt;
* bonus(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * x) and &lt;br /&gt;
* decay(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + x) &lt;br /&gt;
work pretty well. That is, &lt;br /&gt;
&lt;br /&gt;
	PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
Consider 2 scenarios. &lt;br /&gt;
* Scenario A: The user enters each party with the same identity, and the user is accepted in each of the parties. &lt;br /&gt;
* Scenario B: The user enters each party with a new identity, and the user is accepted in each of the parties. &lt;br /&gt;
&lt;br /&gt;
Let us compare the personhood scores of the user in each of the scenarios. In Scenario B, we sum up the personhood scores of all the identities controlled by the user. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of personhood scores of a user in Scenarios A &amp;amp; B&lt;br /&gt;
|-&lt;br /&gt;
!  !! Scenario A !! Scenario B&lt;br /&gt;
|-&lt;br /&gt;
| Initial Score || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| After 1st party || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| After 2nd party || 1.398 || 1.301&lt;br /&gt;
|-&lt;br /&gt;
| After 3rd party || 1.510 || 1.415&lt;br /&gt;
|-&lt;br /&gt;
| After 4th party || 1.539 || 1.462&lt;br /&gt;
|-&lt;br /&gt;
| After 5th party || 1.546 || 1.482&lt;br /&gt;
|-&lt;br /&gt;
| After 6th party || 1.548 || 1.491&lt;br /&gt;
|-&lt;br /&gt;
| After 7th party || 1.548 || 1.494&lt;br /&gt;
|-&lt;br /&gt;
| After 8th party || 1.548 || 1.496&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3951</id>
		<title>Proof of Personhood</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3951"/>
		<updated>2022-12-13T17:56:45Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Call State at Various Stages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This page is still work in progress =&lt;br /&gt;
&lt;br /&gt;
== Proof of Personhood ==&lt;br /&gt;
Decentralized protocols generally rely on voting to make decisions. Anyone can create an identity and cast their vote on a proposal. A naïve implementation of this leads to a sybil attack, where one attacker creates many identities and casts many votes in his favor.&lt;br /&gt;
&lt;br /&gt;
Proof of work and proof of stake are the most commonly implemented sybil attack resistance mechanisms. In proof of work, each identity has to invest some computational power to cast votes. The identity&#039;s voting power is proportional to its computational power. In proof of stake, each identity has to purchase some tokens and stake it in the protocol. The identity&#039;s voting power is proportional to its stake. In both cases, people with more money gets higher voting power and can alter the decisions of the decentralized protocol. &lt;br /&gt;
&lt;br /&gt;
Proof of personhood is an alternate solution to solve the sybil attack problem. The goal of the system is to make sure each real person gets voting power of (close to) only 1. Even if the person creates many identities, he cannot have a higher voting power. In this system, anyone create an identity but its voting power is 0 by default. After the identity proves that it is controlled by a real person, it is assigned a non-zero voting power. There are many well-known techniques such as CAPTCHA to verify that someone is a real person. However, a motivated person could still manually create many identities, manually prove each of them is controlled by a real person and get a high voting power. To protect against this attack, the system needs to satisfy a second requirement -- If a single person controls many identities, the sum of voting power of all the identities is still (close to) 1. Essentially, an attacker doesn&#039;t gain any advantage by creating many identities and proving each of them is controlled by a real person. The second requirement is quite difficult to satisfy. &lt;br /&gt;
&lt;br /&gt;
This article describes the &#039;&#039;people parties&#039;&#039; project currently under development at Dfinity Foundation.&lt;br /&gt;
&lt;br /&gt;
== People Parties ==&lt;br /&gt;
People parties&amp;lt;ref&amp;gt;https://medium.com/dfinity/ultimate-decentralization-using-virtual-people-parties-that-deliver-proof-of-personhood-at-de575522c80&amp;lt;/ref&amp;gt; are a mechanism for obtaining proof of personhood (also referred to as proof of humanity) built on and for the Internet Computer. &lt;br /&gt;
&lt;br /&gt;
Each people party takes place at one specific point in time. Prior to that time, each prospective participant commits to a location that they will visit for the time of the party. At the beginning of the party, participants are assigned to small, random subgroups, and meet in a real-time video call with other participants assigned to the same group. The video call, however, does not show the participants’ faces; instead, participants show their surroundings, proving that they are at the place they committed to. As locations chosen by different participants must have a certain minimum distance, and no participant can be physically present at two locations simultaneously, the proof of personhood even guarantees the uniqueness of the validated persons.&lt;br /&gt;
&lt;br /&gt;
The main purpose of people parties is democratization. Each validated participant can designate a neuron in the [[Network Nervous System]] that receives increased voting power; this improves the relative voting power of the “many” vs. the “heavy”. It also provides additional voting rewards to all validated participants, which further motivates people to participate in the parties. The validated personhood also benefits the Internet Computer ecosystem more broadly: Open Internet Systems, which are dapps that are controlled by a decentralized governance system, will be able to profit from the improved decentralization similarly to the Internet Computer itself. And any dapp will be able to use the validation information in order to, e.g., differentiate between bots and actual human users.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
The architecture of the people parties project involves 3 components. &lt;br /&gt;
* Client&lt;br /&gt;
* People party canister&lt;br /&gt;
* Signaling server&lt;br /&gt;
&lt;br /&gt;
===== Client =====&lt;br /&gt;
The client is a device that is used by the participants who want to validate their identity. The client can be a desktop, laptop or a mobile device with a web browser.&lt;br /&gt;
&lt;br /&gt;
===== People party canister =====&lt;br /&gt;
People party canister is a canister (software program) hosted on the Internet Computer. The canister maintains the information related to all the people parties and identities. This includes &lt;br /&gt;
* The longitude boundaries of the participants allowed for the party&lt;br /&gt;
* List of participants in the party&lt;br /&gt;
* The state of each call in the party&lt;br /&gt;
* Validation results of each participant&lt;br /&gt;
* Personhood score (voting power) of each identity&lt;br /&gt;
&lt;br /&gt;
The client queries people party canister to obtain the list of all the upcoming parties. The client can then register or deregister for any party by calling the people party canister. During the registration, the client specifies the latitude and longitude coordinates of the location he will be during the party. &lt;br /&gt;
&lt;br /&gt;
A few minutes before a party commences, the client calls people party canister to join the party. Throughout the party, the client repeatedly calls the people party canister to obtain the state of the call. During the call, each participant streams a video that they are in the promised location. Other participants verify this by simultaneously glancing at the google street view of the location, and send an approve/decline vote to the people party canister. After the call ends, the client queries the people party canister to know if the client was approved/declined by others. The client later calls the people party canister to withdraw 1 ICP it deposited to register for the party.&lt;br /&gt;
&lt;br /&gt;
===== Signaling server =====&lt;br /&gt;
Signaling server is used to facilitate video calls amongst the participants.&lt;br /&gt;
&lt;br /&gt;
== People Party Canister Interface == &lt;br /&gt;
We describe the interface supported by the people party canister here. &lt;br /&gt;
&lt;br /&gt;
 get_parties: () -&amp;gt; (vec record { PartyId; PartySpecification; }) query;&lt;br /&gt;
 register: (id: PartyId, place: Location) -&amp;gt; (RegistrationResponse);&lt;br /&gt;
 deregister: (id: PartyId) -&amp;gt; (DeregistrationResponse);&lt;br /&gt;
 withdraw: (destination: AccountIdentifier) -&amp;gt; (WithdrawResult);&lt;br /&gt;
 join: (id: PartyId, key: blob) -&amp;gt; (JoinResponse);&lt;br /&gt;
 vote: (id: PartyId, vote: record { Vote; ParticipantName; }) -&amp;gt; (VoteResponse);&lt;br /&gt;
 http_request: (request: HttpRequest) -&amp;gt; (HttpResponse) query;&lt;br /&gt;
 get_person_profile: () -&amp;gt; (opt PersonProfile) query;&lt;br /&gt;
 get_call_state: (id: PartyId) -&amp;gt; (PublicCallState) query;&lt;br /&gt;
 get_call_result: (id: PartyId) -&amp;gt; (CallResult) query;&lt;br /&gt;
&lt;br /&gt;
When a user enters the people party website, the frontend calls &amp;lt;code&amp;gt;get_parties&amp;lt;/code&amp;gt; endpoint to display the information of all the parties. The &amp;lt;code&amp;gt;PartySpecification&amp;lt;/code&amp;gt; for each people party is described as follows. &lt;br /&gt;
 type PartySpecification =&lt;br /&gt;
  record {&lt;br /&gt;
   registration_start: Time;&lt;br /&gt;
   registration_end: Time;&lt;br /&gt;
   call_start : Time;&lt;br /&gt;
   longitude_min : float64;&lt;br /&gt;
   longitude_max : float64;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The user can then then register or deregister for a party by calling &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;deregister&amp;lt;/code&amp;gt; endpoints. The canister responds with the status of registration. When the user registers for a party, he specifies the the Location (latitude and longitude) of where the user will be when the party starts. &lt;br /&gt;
&lt;br /&gt;
A few minutes before the party starts, the user joins the party by calling &amp;lt;code&amp;gt;join&amp;lt;/code&amp;gt; endpoint. After the user joins a call, the user sends one vote (approve/decline) for each of the other participants by calling &amp;lt;code&amp;gt;vote&amp;lt;/code&amp;gt; endpoint. &lt;br /&gt;
&lt;br /&gt;
At any point in time, one can call &amp;lt;code&amp;gt;get_person_profile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;get_call_result&amp;lt;/code&amp;gt; endpoints to obtain the information about the list of parties, a person&#039;s profile, state of a call and result of a call respectively.&lt;br /&gt;
&lt;br /&gt;
The profile of a person is described by&lt;br /&gt;
 type PersonProfile = record {&lt;br /&gt;
   upcoming_parties: vec record { PartyId; Location; };&lt;br /&gt;
   validation_score: nat64;&lt;br /&gt;
   past_parties: vec PartyId;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
When the user registers for a party, he needs to deposit 1 ICP. After the party ends, the user can withdraw this amount by calling &amp;lt;code&amp;gt;withdraw&amp;lt;/code&amp;gt; endpoint. The user can only withdraw if he hasn&#039;t registered for any upcoming party. Once the user withdraws the amount, he cannot register again until he deposits 1 ICP.&lt;br /&gt;
&lt;br /&gt;
== Party Flow == &lt;br /&gt;
The below flow describing a call. Say the call is scheduled to start at 10am. Then the timeline should be as follows:&lt;br /&gt;
&lt;br /&gt;
* Until 9:55am, users can enroll with the &#039;&#039;register&#039;&#039; endpoint. Since the assignment to groups has not been made, calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return what is in case 0 below.&lt;br /&gt;
* At 9:55am, the canister closes the registration phase and calling the &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; endpoint for the current party is not allowed anymore.&lt;br /&gt;
* From 9:55am to 10am, users are allowed to join. For this, there is a join endpoint that accepts a key – a blob. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 1 below. &lt;br /&gt;
* At 10am, the canister generates the random setup of all calls. From this time onward, calling the join endpoint is not allowed anymore, and clients are supposed to set up the WebRTC connections.&lt;br /&gt;
* Between 10am and 10:01am, the canister returns the call setup state as described in step 1.5 below.&lt;br /&gt;
* At 10:01am, the actual calls start.&lt;br /&gt;
* From 10:01am to 10:11am, the actual party is supposed to take place and users can submit votes. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 2 below.&lt;br /&gt;
* At 10:11am, the canister closes all calls and makes the tally. From this point onward, calling vote is not allowed anymore.&lt;br /&gt;
* From 10:11am, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 3 below.&lt;br /&gt;
&lt;br /&gt;
== Call State at Various Stages == &lt;br /&gt;
The people parties canister stores the state of each call, and updates the state during each phase of the party. The canister exposes the &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; method that returns the state of the call. &lt;br /&gt;
&lt;br /&gt;
==== Before Registration ====&lt;br /&gt;
This is returned for parties that do not exist:&lt;br /&gt;
 call_state = record {&lt;br /&gt;
   public_call_state = variant{not_created};&lt;br /&gt;
   my_votes = vec{};&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== Personhood Score ==&lt;br /&gt;
Each identity in the Internet Computer is assigned a personhood score. If an identity hasn’t participated in any people party, its personhood score is 0. As the identity participates in people parties and is successfully validated to be a person, its personhood score increases. &lt;br /&gt;
&lt;br /&gt;
Any canister will be able to query and obtain the personhood score of an identity. One can potentially use the personhood score to determine the voting power of an identity in an election/voting program.&lt;br /&gt;
&lt;br /&gt;
===== Requirement #1 ===== &lt;br /&gt;
An Internet Computer user is naturally inclined to increase his voting power. He is therefore motivated to create many identities and attend a people party with each identity. This gives him control of many identities with a positive personhood score, and thereby a higher voting power. We would like to avoid this. We would like to design the personhood score in such a way that an IC user is motivated to attend each people party with the same identity rather than creating a new identity for each people party. &lt;br /&gt;
&lt;br /&gt;
===== Requirement #2 ===== &lt;br /&gt;
Suppose Alice attended many parties with her identity, and Bob attended only one recent party. Alice and Bob’s personhood scores should still be close. Alice should not have a significant advantage by attending many parties. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #1 =====&lt;br /&gt;
Suppose personhood score of an identity = 1 if the identity is successfully validated in at least one party. This personhood score violates our Requirement #1. &lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #2 =====&lt;br /&gt;
Suppose personhood score of an identity = number of parties in which the identity is successfully validated. This personhood score violates our Requirement #2. &lt;br /&gt;
&lt;br /&gt;
===== Successful Attempt =====&lt;br /&gt;
After a party ends, the personhood score of an identity is composed of three components: &lt;br /&gt;
* Recent party result (RPR):   This value is 1 if the identity is accepted to be a person in the recent party. The value is 0 if the identity did not participate or is rejected in the recent party. &lt;br /&gt;
* Decay function of previous personhood score: The decay function is a monotonically non-increasing function. It is computed on the old personhood score (the score before the recent party started). The decay lets us give more weightage to the validation in the recent party over the previous parties. &lt;br /&gt;
* Bonus reward function: If the identity is accepted in the most recent party and is successfully accepted in some parties before, a bonus reward is given to the identity. This bonus component is added to incentivize IC users to participate in all the parties using the same identity rather than creating a different identity for each party. &lt;br /&gt;
&lt;br /&gt;
Suppose the personhood score of an identity is PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt; before a party starts. The trust score PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt;  of the identity after the party ends is calculated as follows. &lt;br /&gt;
&lt;br /&gt;
PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + bonus(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  decay(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where Recent Party Result (RPR) is 1 iff the identity is accepted in the party.&lt;br /&gt;
&lt;br /&gt;
Through empirical evidence, we found that &lt;br /&gt;
* bonus(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * x) and &lt;br /&gt;
* decay(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + x) &lt;br /&gt;
work pretty well. That is, &lt;br /&gt;
&lt;br /&gt;
	PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
Consider 2 scenarios. &lt;br /&gt;
* Scenario A: The user enters each party with the same identity, and the user is accepted in each of the parties. &lt;br /&gt;
* Scenario B: The user enters each party with a new identity, and the user is accepted in each of the parties. &lt;br /&gt;
&lt;br /&gt;
Let us compare the personhood scores of the user in each of the scenarios. In Scenario B, we sum up the personhood scores of all the identities controlled by the user. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of personhood scores of a user in Scenarios A &amp;amp; B&lt;br /&gt;
|-&lt;br /&gt;
!  !! Scenario A !! Scenario B&lt;br /&gt;
|-&lt;br /&gt;
| Initial Score || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| After 1st party || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| After 2nd party || 1.398 || 1.301&lt;br /&gt;
|-&lt;br /&gt;
| After 3rd party || 1.510 || 1.415&lt;br /&gt;
|-&lt;br /&gt;
| After 4th party || 1.539 || 1.462&lt;br /&gt;
|-&lt;br /&gt;
| After 5th party || 1.546 || 1.482&lt;br /&gt;
|-&lt;br /&gt;
| After 6th party || 1.548 || 1.491&lt;br /&gt;
|-&lt;br /&gt;
| After 7th party || 1.548 || 1.494&lt;br /&gt;
|-&lt;br /&gt;
| After 8th party || 1.548 || 1.496&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3950</id>
		<title>Proof of Personhood</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=Proof_of_Personhood&amp;diff=3950"/>
		<updated>2022-12-13T17:56:15Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This page is still work in progress =&lt;br /&gt;
&lt;br /&gt;
== Proof of Personhood ==&lt;br /&gt;
Decentralized protocols generally rely on voting to make decisions. Anyone can create an identity and cast their vote on a proposal. A naïve implementation of this leads to a sybil attack, where one attacker creates many identities and casts many votes in his favor.&lt;br /&gt;
&lt;br /&gt;
Proof of work and proof of stake are the most commonly implemented sybil attack resistance mechanisms. In proof of work, each identity has to invest some computational power to cast votes. The identity&#039;s voting power is proportional to its computational power. In proof of stake, each identity has to purchase some tokens and stake it in the protocol. The identity&#039;s voting power is proportional to its stake. In both cases, people with more money gets higher voting power and can alter the decisions of the decentralized protocol. &lt;br /&gt;
&lt;br /&gt;
Proof of personhood is an alternate solution to solve the sybil attack problem. The goal of the system is to make sure each real person gets voting power of (close to) only 1. Even if the person creates many identities, he cannot have a higher voting power. In this system, anyone create an identity but its voting power is 0 by default. After the identity proves that it is controlled by a real person, it is assigned a non-zero voting power. There are many well-known techniques such as CAPTCHA to verify that someone is a real person. However, a motivated person could still manually create many identities, manually prove each of them is controlled by a real person and get a high voting power. To protect against this attack, the system needs to satisfy a second requirement -- If a single person controls many identities, the sum of voting power of all the identities is still (close to) 1. Essentially, an attacker doesn&#039;t gain any advantage by creating many identities and proving each of them is controlled by a real person. The second requirement is quite difficult to satisfy. &lt;br /&gt;
&lt;br /&gt;
This article describes the &#039;&#039;people parties&#039;&#039; project currently under development at Dfinity Foundation.&lt;br /&gt;
&lt;br /&gt;
== People Parties ==&lt;br /&gt;
People parties&amp;lt;ref&amp;gt;https://medium.com/dfinity/ultimate-decentralization-using-virtual-people-parties-that-deliver-proof-of-personhood-at-de575522c80&amp;lt;/ref&amp;gt; are a mechanism for obtaining proof of personhood (also referred to as proof of humanity) built on and for the Internet Computer. &lt;br /&gt;
&lt;br /&gt;
Each people party takes place at one specific point in time. Prior to that time, each prospective participant commits to a location that they will visit for the time of the party. At the beginning of the party, participants are assigned to small, random subgroups, and meet in a real-time video call with other participants assigned to the same group. The video call, however, does not show the participants’ faces; instead, participants show their surroundings, proving that they are at the place they committed to. As locations chosen by different participants must have a certain minimum distance, and no participant can be physically present at two locations simultaneously, the proof of personhood even guarantees the uniqueness of the validated persons.&lt;br /&gt;
&lt;br /&gt;
The main purpose of people parties is democratization. Each validated participant can designate a neuron in the [[Network Nervous System]] that receives increased voting power; this improves the relative voting power of the “many” vs. the “heavy”. It also provides additional voting rewards to all validated participants, which further motivates people to participate in the parties. The validated personhood also benefits the Internet Computer ecosystem more broadly: Open Internet Systems, which are dapps that are controlled by a decentralized governance system, will be able to profit from the improved decentralization similarly to the Internet Computer itself. And any dapp will be able to use the validation information in order to, e.g., differentiate between bots and actual human users.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
The architecture of the people parties project involves 3 components. &lt;br /&gt;
* Client&lt;br /&gt;
* People party canister&lt;br /&gt;
* Signaling server&lt;br /&gt;
&lt;br /&gt;
===== Client =====&lt;br /&gt;
The client is a device that is used by the participants who want to validate their identity. The client can be a desktop, laptop or a mobile device with a web browser.&lt;br /&gt;
&lt;br /&gt;
===== People party canister =====&lt;br /&gt;
People party canister is a canister (software program) hosted on the Internet Computer. The canister maintains the information related to all the people parties and identities. This includes &lt;br /&gt;
* The longitude boundaries of the participants allowed for the party&lt;br /&gt;
* List of participants in the party&lt;br /&gt;
* The state of each call in the party&lt;br /&gt;
* Validation results of each participant&lt;br /&gt;
* Personhood score (voting power) of each identity&lt;br /&gt;
&lt;br /&gt;
The client queries people party canister to obtain the list of all the upcoming parties. The client can then register or deregister for any party by calling the people party canister. During the registration, the client specifies the latitude and longitude coordinates of the location he will be during the party. &lt;br /&gt;
&lt;br /&gt;
A few minutes before a party commences, the client calls people party canister to join the party. Throughout the party, the client repeatedly calls the people party canister to obtain the state of the call. During the call, each participant streams a video that they are in the promised location. Other participants verify this by simultaneously glancing at the google street view of the location, and send an approve/decline vote to the people party canister. After the call ends, the client queries the people party canister to know if the client was approved/declined by others. The client later calls the people party canister to withdraw 1 ICP it deposited to register for the party.&lt;br /&gt;
&lt;br /&gt;
===== Signaling server =====&lt;br /&gt;
Signaling server is used to facilitate video calls amongst the participants.&lt;br /&gt;
&lt;br /&gt;
== People Party Canister Interface == &lt;br /&gt;
We describe the interface supported by the people party canister here. &lt;br /&gt;
&lt;br /&gt;
 get_parties: () -&amp;gt; (vec record { PartyId; PartySpecification; }) query;&lt;br /&gt;
 register: (id: PartyId, place: Location) -&amp;gt; (RegistrationResponse);&lt;br /&gt;
 deregister: (id: PartyId) -&amp;gt; (DeregistrationResponse);&lt;br /&gt;
 withdraw: (destination: AccountIdentifier) -&amp;gt; (WithdrawResult);&lt;br /&gt;
 join: (id: PartyId, key: blob) -&amp;gt; (JoinResponse);&lt;br /&gt;
 vote: (id: PartyId, vote: record { Vote; ParticipantName; }) -&amp;gt; (VoteResponse);&lt;br /&gt;
 http_request: (request: HttpRequest) -&amp;gt; (HttpResponse) query;&lt;br /&gt;
 get_person_profile: () -&amp;gt; (opt PersonProfile) query;&lt;br /&gt;
 get_call_state: (id: PartyId) -&amp;gt; (PublicCallState) query;&lt;br /&gt;
 get_call_result: (id: PartyId) -&amp;gt; (CallResult) query;&lt;br /&gt;
&lt;br /&gt;
When a user enters the people party website, the frontend calls &amp;lt;code&amp;gt;get_parties&amp;lt;/code&amp;gt; endpoint to display the information of all the parties. The &amp;lt;code&amp;gt;PartySpecification&amp;lt;/code&amp;gt; for each people party is described as follows. &lt;br /&gt;
 type PartySpecification =&lt;br /&gt;
  record {&lt;br /&gt;
   registration_start: Time;&lt;br /&gt;
   registration_end: Time;&lt;br /&gt;
   call_start : Time;&lt;br /&gt;
   longitude_min : float64;&lt;br /&gt;
   longitude_max : float64;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The user can then then register or deregister for a party by calling &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;deregister&amp;lt;/code&amp;gt; endpoints. The canister responds with the status of registration. When the user registers for a party, he specifies the the Location (latitude and longitude) of where the user will be when the party starts. &lt;br /&gt;
&lt;br /&gt;
A few minutes before the party starts, the user joins the party by calling &amp;lt;code&amp;gt;join&amp;lt;/code&amp;gt; endpoint. After the user joins a call, the user sends one vote (approve/decline) for each of the other participants by calling &amp;lt;code&amp;gt;vote&amp;lt;/code&amp;gt; endpoint. &lt;br /&gt;
&lt;br /&gt;
At any point in time, one can call &amp;lt;code&amp;gt;get_person_profile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;get_call_result&amp;lt;/code&amp;gt; endpoints to obtain the information about the list of parties, a person&#039;s profile, state of a call and result of a call respectively.&lt;br /&gt;
&lt;br /&gt;
The profile of a person is described by&lt;br /&gt;
 type PersonProfile = record {&lt;br /&gt;
   upcoming_parties: vec record { PartyId; Location; };&lt;br /&gt;
   validation_score: nat64;&lt;br /&gt;
   past_parties: vec PartyId;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
When the user registers for a party, he needs to deposit 1 ICP. After the party ends, the user can withdraw this amount by calling &amp;lt;code&amp;gt;withdraw&amp;lt;/code&amp;gt; endpoint. The user can only withdraw if he hasn&#039;t registered for any upcoming party. Once the user withdraws the amount, he cannot register again until he deposits 1 ICP.&lt;br /&gt;
&lt;br /&gt;
== Party Flow == &lt;br /&gt;
The below flow describing a call. Say the call is scheduled to start at 10am. Then the timeline should be as follows:&lt;br /&gt;
&lt;br /&gt;
* Until 9:55am, users can enroll with the &#039;&#039;register&#039;&#039; endpoint. Since the assignment to groups has not been made, calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return what is in case 0 below.&lt;br /&gt;
* At 9:55am, the canister closes the registration phase and calling the &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt; endpoint for the current party is not allowed anymore.&lt;br /&gt;
* From 9:55am to 10am, users are allowed to join. For this, there is a join endpoint that accepts a key – a blob. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 1 below. &lt;br /&gt;
* At 10am, the canister generates the random setup of all calls. From this time onward, calling the join endpoint is not allowed anymore, and clients are supposed to set up the WebRTC connections.&lt;br /&gt;
* Between 10am and 10:01am, the canister returns the call setup state as described in step 1.5 below.&lt;br /&gt;
* At 10:01am, the actual calls start.&lt;br /&gt;
* From 10:01am to 10:11am, the actual party is supposed to take place and users can submit votes. Calling &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 2 below.&lt;br /&gt;
* At 10:11am, the canister closes all calls and makes the tally. From this point onward, calling vote is not allowed anymore.&lt;br /&gt;
* From 10:11am, &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; will return the result described in case 3 below.&lt;br /&gt;
&lt;br /&gt;
== Call State at Various Stages == &lt;br /&gt;
The people parties canister stores the state of each call, and updates the state during each phase of the party. The canister exposes the &amp;lt;code&amp;gt;get_call_state&amp;lt;/code&amp;gt; method that returns the state of the call. &lt;br /&gt;
&lt;br /&gt;
=== Before Registration ===&lt;br /&gt;
This is returned for parties that do not exist:&lt;br /&gt;
call_state = record {&lt;br /&gt;
  public_call_state = variant{not_created};&lt;br /&gt;
  my_votes = vec{};&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Personhood Score ==&lt;br /&gt;
Each identity in the Internet Computer is assigned a personhood score. If an identity hasn’t participated in any people party, its personhood score is 0. As the identity participates in people parties and is successfully validated to be a person, its personhood score increases. &lt;br /&gt;
&lt;br /&gt;
Any canister will be able to query and obtain the personhood score of an identity. One can potentially use the personhood score to determine the voting power of an identity in an election/voting program.&lt;br /&gt;
&lt;br /&gt;
===== Requirement #1 ===== &lt;br /&gt;
An Internet Computer user is naturally inclined to increase his voting power. He is therefore motivated to create many identities and attend a people party with each identity. This gives him control of many identities with a positive personhood score, and thereby a higher voting power. We would like to avoid this. We would like to design the personhood score in such a way that an IC user is motivated to attend each people party with the same identity rather than creating a new identity for each people party. &lt;br /&gt;
&lt;br /&gt;
===== Requirement #2 ===== &lt;br /&gt;
Suppose Alice attended many parties with her identity, and Bob attended only one recent party. Alice and Bob’s personhood scores should still be close. Alice should not have a significant advantage by attending many parties. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #1 =====&lt;br /&gt;
Suppose personhood score of an identity = 1 if the identity is successfully validated in at least one party. This personhood score violates our Requirement #1. &lt;br /&gt;
&lt;br /&gt;
===== Failed Attempt #2 =====&lt;br /&gt;
Suppose personhood score of an identity = number of parties in which the identity is successfully validated. This personhood score violates our Requirement #2. &lt;br /&gt;
&lt;br /&gt;
===== Successful Attempt =====&lt;br /&gt;
After a party ends, the personhood score of an identity is composed of three components: &lt;br /&gt;
* Recent party result (RPR):   This value is 1 if the identity is accepted to be a person in the recent party. The value is 0 if the identity did not participate or is rejected in the recent party. &lt;br /&gt;
* Decay function of previous personhood score: The decay function is a monotonically non-increasing function. It is computed on the old personhood score (the score before the recent party started). The decay lets us give more weightage to the validation in the recent party over the previous parties. &lt;br /&gt;
* Bonus reward function: If the identity is accepted in the most recent party and is successfully accepted in some parties before, a bonus reward is given to the identity. This bonus component is added to incentivize IC users to participate in all the parties using the same identity rather than creating a different identity for each party. &lt;br /&gt;
&lt;br /&gt;
Suppose the personhood score of an identity is PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt; before a party starts. The trust score PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt;  of the identity after the party ends is calculated as follows. &lt;br /&gt;
&lt;br /&gt;
PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + bonus(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  decay(PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where Recent Party Result (RPR) is 1 iff the identity is accepted in the party.&lt;br /&gt;
&lt;br /&gt;
Through empirical evidence, we found that &lt;br /&gt;
* bonus(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * x) and &lt;br /&gt;
* decay(x) = log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + x) &lt;br /&gt;
work pretty well. That is, &lt;br /&gt;
&lt;br /&gt;
	PS&amp;lt;sub&amp;gt;new&amp;lt;/sub&amp;gt; = RPR * (1 + log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + 0.25 * PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;))  +  log&amp;lt;sub&amp;gt;10&amp;lt;/sub&amp;gt;(1 + PS&amp;lt;sub&amp;gt;old&amp;lt;/sub&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===== Example =====&lt;br /&gt;
Consider 2 scenarios. &lt;br /&gt;
* Scenario A: The user enters each party with the same identity, and the user is accepted in each of the parties. &lt;br /&gt;
* Scenario B: The user enters each party with a new identity, and the user is accepted in each of the parties. &lt;br /&gt;
&lt;br /&gt;
Let us compare the personhood scores of the user in each of the scenarios. In Scenario B, we sum up the personhood scores of all the identities controlled by the user. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of personhood scores of a user in Scenarios A &amp;amp; B&lt;br /&gt;
|-&lt;br /&gt;
!  !! Scenario A !! Scenario B&lt;br /&gt;
|-&lt;br /&gt;
| Initial Score || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| After 1st party || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| After 2nd party || 1.398 || 1.301&lt;br /&gt;
|-&lt;br /&gt;
| After 3rd party || 1.510 || 1.415&lt;br /&gt;
|-&lt;br /&gt;
| After 4th party || 1.539 || 1.462&lt;br /&gt;
|-&lt;br /&gt;
| After 5th party || 1.546 || 1.482&lt;br /&gt;
|-&lt;br /&gt;
| After 6th party || 1.548 || 1.491&lt;br /&gt;
|-&lt;br /&gt;
| After 7th party || 1.548 || 1.494&lt;br /&gt;
|-&lt;br /&gt;
| After 8th party || 1.548 || 1.496&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3839</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3839"/>
		<updated>2022-11-28T23:58:16Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to subnet list. &lt;br /&gt;
*** For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** Store subnet record. &lt;br /&gt;
*** Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created subnet record, where {subnet_id} is the subnet id of the newly created subnet. &lt;br /&gt;
** Store catch-up package. &lt;br /&gt;
*** Add a key-value pair with key = &amp;lt;code&amp;gt;catch_up_package_contents_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created catch-up package. &lt;br /&gt;
** Store subnet threshold signing key. &lt;br /&gt;
*** Add a key-value pair with key = &amp;lt;code&amp;gt;crypto_threshold_signing_public_key_{subnet_id}&amp;lt;/code&amp;gt; and value = threshold BLS signing key generated above.&lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
*** Each subnet has a range of canister ids that are utilized for canisters in that subnet. The range of canister ids for each subnet is called the routing table. The routing table helps us route canister traffic to the appropriate subnet. When a new subnet is created, the next available set of &amp;lt;code&amp;gt;CANISTER_IDS_PER_SUBNET&amp;lt;/code&amp;gt; (currently set to 2^20) canister ids is assigned as the range for the subnet. This information is stored in the key &amp;lt;code&amp;gt;routing_table&amp;lt;/code&amp;gt; of the registry.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3838</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3838"/>
		<updated>2022-11-28T23:42:08Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to subnet list. &lt;br /&gt;
*** For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** Store subnet record. &lt;br /&gt;
*** Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created subnet record, where {subnet_id} is the subnet id of the newly created subnet. &lt;br /&gt;
** Store catch-up package. &lt;br /&gt;
*** Add a key-value pair with key = &amp;lt;code&amp;gt;catch_up_package_contents_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created catch-up package. &lt;br /&gt;
** Store subnet threshold signing key. &lt;br /&gt;
*** Add a key-value pair with key = &amp;lt;code&amp;gt;crypto_threshold_signing_public_key_{subnet_id}&amp;lt;/code&amp;gt; and value = threshold BLS signing key generated above.&lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3837</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3837"/>
		<updated>2022-11-28T23:41:17Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** Store subnet record. Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created subnet record, where {subnet_id} is the subnet id of the newly created subnet. &lt;br /&gt;
** Store catch-up package. Add a key-value pair with key = &amp;lt;code&amp;gt;catch_up_package_contents_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created catch-up package. &lt;br /&gt;
** Store subnet threshold signing key. Add a key-value pair with key = &amp;lt;code&amp;gt;crypto_threshold_signing_public_key_{subnet_id}&amp;lt;/code&amp;gt; and value = threshold BLS signing key generated above.&lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3836</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3836"/>
		<updated>2022-11-28T23:39:18Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** Store subnet record. Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created subnet record, where {subnet_id} is the subnet id of the newly created subnet. &lt;br /&gt;
** Store catch-up package. Add a key-value pair with key = &amp;lt;code&amp;gt; catch_up_package_contents_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created catch-up package. &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3835</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3835"/>
		<updated>2022-11-28T23:38:46Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to Subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** Store subnet record. Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created subnet record, where {subnet_id} is the subnet id of the newly created subnet. &lt;br /&gt;
** Store catch-up package. Add a key-value pair with key = &amp;lt;code&amp;gt; catch_up_package_contents_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created catch-up package. &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3834</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3834"/>
		<updated>2022-11-28T23:37:59Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to Subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** New subnet. Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created subnet record, where {subnet_id} is the subnet id of the newly created subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). Add a key-value pair with key = &amp;lt;code&amp;gt; catch_up_package_contents_{subnet_id}&amp;lt;/code&amp;gt; and value = newly created catch-up package. &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3833</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3833"/>
		<updated>2022-11-28T23:35:59Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to Subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** New subnet. Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_&amp;lt;subnet_id&amp;gt;&amp;lt;/code&amp;gt; and value = newly created subnet record, where &amp;lt;subnet_id&amp;gt; is the subnet id of the newly created subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3832</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3832"/>
		<updated>2022-11-28T23:35:24Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to Subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** New subnet. Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_&amp;lt;subnet_id&amp;gt;&amp;lt;/code&amp;gt; and value = newly created subnet record.  &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3831</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3831"/>
		<updated>2022-11-28T23:35:07Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to Subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** New subnet. Add a key-value pair with key = &amp;lt;code&amp;gt;subnet_record_\&amp;lt;subnet_id\&amp;gt;&amp;lt;/code&amp;gt; and value = newly created subnet record.  &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3830</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3830"/>
		<updated>2022-11-28T23:31:10Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. The registry is a versioned key-value storage. &lt;br /&gt;
** Append to Subnet list. For the key &amp;lt;code&amp;gt;subnet_list&amp;lt;/code&amp;gt;, the registry stores the list of all subnets. Append the new subnet to this list. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3829</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3829"/>
		<updated>2022-11-28T23:24:17Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
** Each subnet has a subnet record storing all its configuration information. The subnet record of the new subnet contains all the information present in the payload of the &#039;Create Subnet&#039; proposal. &lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3828</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3828"/>
		<updated>2022-11-28T23:20:47Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[Summary Block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3827</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3827"/>
		<updated>2022-11-28T23:19:58Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a genesis block and [[Catch-Up Package]]&lt;br /&gt;
** The registry canister creates a genesis block. This is the first block in the blockchain. Structurally, this is a [[summary block]] containing the DKG dealings computed above. &lt;br /&gt;
** The registry canister then generates a Catch-Up Package which contains the above genesis block along with other information required for the subnet to start the consensus protocol. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3826</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3826"/>
		<updated>2022-11-28T23:15:26Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Payload for &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block&lt;br /&gt;
** ecdsa_config - This field is optional. It specifies the configuration settings to be used for ECDSA signature scheme. &lt;br /&gt;
** dkg_interval_length - This is the number of rounds in an epoch. At the end of each epoch, the nodes run a distributed key generation protocol to reshare their secret key shares. &lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
** A Catch-Up Package for a subnet at a particular height contains the relevant information for a node to start consensus from that height. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3825</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3825"/>
		<updated>2022-11-28T23:11:30Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
** A Catch-Up Package for a subnet at a particular height contains the relevant information for a node to start consensus from that height. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3824</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3824"/>
		<updated>2022-11-28T22:07:11Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
** A Catch-Up Package for a subnet at a particular height contains the relevant information for a node to start consensus from that height. &lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3823</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3823"/>
		<updated>2022-11-28T22:03:20Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the [[Distributed Key Generation]] protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. A subnet also utilizes threshold BLS signature scheme for many other purposes including the generation of random beacon in the consensus layer and generation of random tape in the execution layer. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol. At the end of the protocol, all the nodes in the NNS agree on a few &amp;quot;dealings&amp;quot; for each node in the new subnet. The dealings of a node can be combined to obtain the signing key share of the node. The dealings for each node are encrypted with the encryption key registered by the node. &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3822</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3822"/>
		<updated>2022-11-28T21:55:20Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the Distributed Key Generation protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. &lt;br /&gt;
** In order to generate the above signing key share for each node in the new subnet, the nodes in the NNS engage in a distributed key generation (DKG) protocol.&lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3821</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3821"/>
		<updated>2022-11-28T20:53:04Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the Distributed Key Generation protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key (none of the nodes know the complete subnet&#039;s signing key). After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature &amp;quot;shares&amp;quot; can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. &lt;br /&gt;
** &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3820</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3820"/>
		<updated>2022-11-28T20:49:46Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the Distributed Key Generation protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. After every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. For this, the subnet utilizes a threshold BLS signature scheme. In a nutshell, each node in the subnet holds a &amp;quot;share&amp;quot; of the subnet&#039;s signing key. After every round, each of the nodes individually sign their replicated state using their signing key &amp;quot;share&amp;quot;. If at least a &amp;quot;threshold&amp;quot; number of nodes agree upon the same replicated state, their signature shares can be combined to obtain the signature of the replicated state using the subnet&#039;s signing key. &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3819</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3819"/>
		<updated>2022-11-28T20:43:21Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the Distributed Key Generation protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. In every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest [https://wiki.internetcomputer.org/wiki/Replicated_state_structure replicated state]. A subnet utilizes a threshold BLS signing key to sign &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3818</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3818"/>
		<updated>2022-11-28T20:42:29Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the Distributed Key Generation protocol. &lt;br /&gt;
** The first step is to generate the cryptographic information required for the new subnet to work properly. In every round of the Internet Computer protocol, the nodes of the subnet agree upon and sign their latest replicated state. A subnet utilizes a threshold BLS signing key to sign &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3816</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3816"/>
		<updated>2022-11-28T20:33:43Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The registry canister performs the following steps. &lt;br /&gt;
* Run the Distributed Key Generation protocol. &lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3812</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3812"/>
		<updated>2022-11-25T14:47:12Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
* Perform Distributed Key Generation protocol&lt;br /&gt;
* Create a [[Catch-Up Package]]&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3811</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3811"/>
		<updated>2022-11-25T14:44:27Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
* Perform Distributed Key Generation protocol&lt;br /&gt;
* Create a Catch-Up Package&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* Perform the following 5 mutations to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3810</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3810"/>
		<updated>2022-11-25T14:43:57Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
* Perform Distributed Key Generation protocol&lt;br /&gt;
* Create a Catch-Up Package&lt;br /&gt;
* Create a Subnet Record&lt;br /&gt;
* The following 5 mutations are made to the registry. &lt;br /&gt;
** Subnet list mutation. &lt;br /&gt;
** New subnet. &lt;br /&gt;
** New subnet Distributed Key Generation (DKG). &lt;br /&gt;
** New subnet threshold signing key. &lt;br /&gt;
** Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3809</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3809"/>
		<updated>2022-11-25T14:40:31Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage. Each mutation to the registry is stored as a new version. &lt;br /&gt;
&lt;br /&gt;
The following 5 mutations are made to the registry. &lt;br /&gt;
* Subnet list mutation. &lt;br /&gt;
* New subnet. &lt;br /&gt;
* New subnet Distributed Key Generation (DKG). &lt;br /&gt;
* New subnet threshold signing key. &lt;br /&gt;
* Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3808</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3808"/>
		<updated>2022-11-25T14:39:56Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage.&lt;br /&gt;
&lt;br /&gt;
The following 5 mutations are made to the registry. &lt;br /&gt;
* Subnet list mutation. &lt;br /&gt;
* New subnet. &lt;br /&gt;
* New subnet Distributed Key Generation (DKG). &lt;br /&gt;
* New subnet threshold signing key. &lt;br /&gt;
* Routing table mutation.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3807</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3807"/>
		<updated>2022-11-25T14:37:56Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add configuration information of the new subnet. The registry is a versioned key-value storage.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3806</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3806"/>
		<updated>2022-11-25T14:36:12Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]), which mutates the registry to add information about the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3805</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3805"/>
		<updated>2022-11-25T14:26:31Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, the proposal is executed automatically. To execute the proposal, a method in the registry canister is called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]).&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3804</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3804"/>
		<updated>2022-11-25T14:25:06Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
When the &#039;Create Subnet&#039; NNS proposal is voted and accepted by the community, a method in the registry canister is automatically called ([https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]).&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3799</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3799"/>
		<updated>2022-11-23T23:58:08Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Creating a New Subnet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process ([https://github.com/dfinity/ic/tree/master/rs/orchestrator/registry_replicator github]) which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github].&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3798</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3798"/>
		<updated>2022-11-23T23:53:18Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github].&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3797</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3797"/>
		<updated>2022-11-23T23:52:48Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Creating a New Subnet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3796</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3796"/>
		<updated>2022-11-23T23:52:28Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Creating a New Subnet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software ([[#Installing_the_Replica]]) and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3795</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3795"/>
		<updated>2022-11-23T23:51:44Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Installing the Replica */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. If a node is not assigned to any subnet, both the replica partitions are empty. If the node is actively participating in a subnet, one of the replica partitions is used to run the replica process and the other replica partition is empty. To install the new replica software, &lt;br /&gt;
* The orchestrator loads the replica image into an empty replica partition. &lt;br /&gt;
* The orchestrator then modifies the boot loader settings to use the newly loaded replica partition. &lt;br /&gt;
* The orchestrator restarts the node. &lt;br /&gt;
* When the node boots up again, the newly loaded replica partition is used as per the boot loader settings.&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3794</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3794"/>
		<updated>2022-11-23T23:32:49Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Installing the Replica */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. One of the replica partition is usually active (being used) and the other replica partition is empty. When the orchestrator&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3793</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3793"/>
		<updated>2022-11-23T23:29:07Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Executing the &amp;#039;Create Subnet&amp;#039; Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;br /&gt;
&lt;br /&gt;
== Installing the Replica ==&lt;br /&gt;
The orchestrator uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software, which works as follows. The disk is divided into 3 partitions -- 2 partitions for the replica process and 1 partition for the data. One of the replica partition is usually active/being used and the other replica partition is empty. When the orchestrator&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3792</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3792"/>
		<updated>2022-11-23T23:28:20Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Creating a New Subnet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now installs the replica software and restarts the node.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3791</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3791"/>
		<updated>2022-11-23T23:24:46Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Creating a New Subnet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below. &lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github]. &lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry. &lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration. The orchestrator now uses a [https://en.wikipedia.org/wiki/Blue-green_deployment blue/green deployment] to start the replica software.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3790</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3790"/>
		<updated>2022-11-23T23:20:07Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Creating a New Subnet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below.&lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github].&lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry.&lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a new subnet according to the registry, the orchestrator first downloads the replica software using the url in the subnet&#039;s registry configuration.&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
	<entry>
		<id>https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3789</id>
		<title>New Subnet Creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.internetcomputer.org/w/index.php?title=New_Subnet_Creation&amp;diff=3789"/>
		<updated>2022-11-23T23:18:03Z</updated>

		<summary type="html">&lt;p&gt;Satya.vusirikala: /* Creating a New Subnet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= This Page is Still Work in Progress =&lt;br /&gt;
Ever wondered about the meaning behind DFINITY? It’s Decentralized + Infinity. It’s named that way because the Internet Computer is designed to scale infinitely. It means that the Internet Computer can host an unlimited number of canisters (smart contracts), store an unlimited amount of memory, process an unlimited amount of transactions per second. In simple words, Internet Computer is designed to host even large scale social media platforms in a fully decentralized way.&lt;br /&gt;
&lt;br /&gt;
There are two types of widely-used approaches to improve the scalability of a system. (1) Vertical Scaling, and (2) Horizontal Scaling. Vertical scaling means adding more CPU, RAM and disk to a single computer. Horizontal scaling means adding more computers to the system. There is a limit to vertical scaling. But with horizontal scaling, one can achieve unlimited scalability. Internet Computer is one of the first blockchains to successfully use horizontal scaling.&lt;br /&gt;
&lt;br /&gt;
The nodes in the Internet Computer are divided into subnets, each containing a few dozen nodes. The set of nodes in a subnet together maintain one blockchain. Each subnet can host a few thousand canisters and process messages received by those canisters. Each subnet has a limited capacity in terms of the number of canisters (a few thousand), amount of storage (a few TB), and bandwidth (a few hundred transactions per second). But as more subnets are added to the Internet Computer, its overall capacity increases proportionately. There is no limit on the number of subnets that can be added, resulting in unlimited scalability.&lt;br /&gt;
&lt;br /&gt;
We need to do 2 things to create a new subnet. &lt;br /&gt;
* Add/Register new nodes. &lt;br /&gt;
* Create a new subnet with the registered nodes that were not yet assigned to any subnet. &lt;br /&gt;
&lt;br /&gt;
== Adding/Registering New Nodes ==&lt;br /&gt;
We new describe a series of steps that need to be followed to add a new node to the Internet Computer. &lt;br /&gt;
* Node provider purchases a NitroKey (a Hardware Security Module), generates a public-key/secret-key pair, and submits an NNS proposal to add his public key to the NNS registry. The community votes on the proposal. If the majority accept the proposal, then the node provider&#039;s credentials are added to the NNS registry. From now on, the NNS canisters trust the messages signed by the node provider&#039;s secret key. The entire process is specified in the [https://wiki.internetcomputer.org/wiki/Node_Provider_Onboarding node provider onboarding article].&lt;br /&gt;
* Node provider purchases node hardware with the recommended specifications and places it in a data center rack that meets the recommended specifications. &lt;br /&gt;
* The node doesn&#039;t yet have any operating system. The node provider needs to install the IC-OS operating system on the node. The detailed procedure can be found in the IC-OS installation runbook articles ([https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Supermicro Installation for SuperMicro], [https://wiki.internetcomputer.org/wiki/IC_OS_Installation_Runbook_-_Dell_Poweredge Installation for Dell Poweredge]).&lt;br /&gt;
* The node provider inserts the NitroKey usb stick into the node machine. The NitroKey contains the secret key of corresponding to the node provider&#039;s registered public key. &lt;br /&gt;
* The node provider then switches on the node to boot the IC-OS operation system, which starts a few processes including orchestrator, crypto and http adapter processes. &lt;br /&gt;
* The crypto process finds that it never generated any cryptographic key material before. The crypto process then generates new cryptographic keys. This includes node signing key, NIDKG key, ECDSA key, TLS key, etc. &lt;br /&gt;
* The cryptographic key material need to be registered with the NNS registry. For this, the crypto process sends the keys to the orchestrator, which then crafts a message containing the key material, signs the message with the node provider&#039;s signing key present in the NitroKey, and sends the message to the NNS registry canister. &lt;br /&gt;
* The NNS registry canister creates a record for the new node and stores its cryptographic key material. &lt;br /&gt;
* The node is now registered in the Internet Computer, but not yet assigned to any subnet.&lt;br /&gt;
&lt;br /&gt;
== Creating a New Subnet == &lt;br /&gt;
We now describe the process of creating a new subnet. To create a new subnet, one just needs to submit an NNS proposal. The proposal specifies a type (create subnet) and a payload ([[#Payload for &#039;Create_Subnet&#039; Proposal]]). A few sample proposals to create a new subnet can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/57048 Proposal 57048], [https://dashboard.internetcomputer.org/proposal/49018 Proposal 49018], [https://dashboard.internetcomputer.org/proposal/55730 Proposal 55730]). Anyone who staked their ICP can vote on the proposal within a deadline. After the deadline, if the majority of the voters accept the proposal, then the subnet is created as described below.&lt;br /&gt;
&lt;br /&gt;
The NNS has a canister called &amp;quot;registry&amp;quot;, which stores the configuration of the Internet Computer including the configuration of each node and subnet. When the &#039;Create subnet&#039; proposal is accepted, it automatically calls a method of the NNS Registry with input the payload included in the NNS proposal. The registry canister then creates a new subnet configuration based on the information in the payload, and stores the subnet record. The registry method executed when the &#039;Create Subnet&#039; NNS proposal is accepted can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/src/mutations/do_create_subnet.rs github].&lt;br /&gt;
&lt;br /&gt;
Each node in the Internet Computer maintains a local copy of the NNS registry. Each node runs a &amp;quot;registry replicator&amp;quot; process which is a part of the orchestrator and is responsible for regularly syncing NNS registry and maintaining the local registry copy. Once every few seconds (can be configured by setting &amp;lt;code&amp;gt;poll_delay_duration_ms&amp;lt;/code&amp;gt; variable, which has a default value of 5 seconds), the registry replicator queries the NNS registry for the changes that happened after the recent sync, and applies those changes to the local registry copy. The local registry is stored on the disk and any process running on the node can read the contents of the local registry.&lt;br /&gt;
&lt;br /&gt;
The orchestrator monitors the local registry to see what subnet the node has been assigned to. If the unassigned node has now been assigned to a subnet according to the registry, the orchestrator first downloads the&lt;br /&gt;
&lt;br /&gt;
== Payload for &#039;Create Subnet&#039; Proposal == &lt;br /&gt;
The payload for the &#039;Create Subnet&#039; NNS proposal contains the list of parameters to be used by the new subnet. Some of the fields in the payload are as follows. The structure of payloads for every type of NNS proposal can be found on [https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did github]. &lt;br /&gt;
* subnet_type - The type of the subnet to be created. Subnets of different type might exhibit different behavior, e.g. being more restrictive in what operations are allowed or privileged compared to other subnet types. There are a few types of subnets. &lt;br /&gt;
** Application subnet - A normal subnet where no restrictions are applied.&lt;br /&gt;
** System subnet - A more privileged subnet where certain restrictions are applied, like not charging for cycles or restricting who can create and install canisters on it.&lt;br /&gt;
** Verified application subnet - A subnet type that is like application subnets but can have some additional features.&lt;br /&gt;
* node_ids - List of node ids of unassigned nodes to be included in the subnet. &lt;br /&gt;
* replica_version_id - The version id of the replica software to be installed in the nodes of the subnet. &lt;br /&gt;
** A replica image has to be first uploaded to a publicly accessible server. &lt;br /&gt;
** Then one needs to create an NNS proposal of type &amp;quot;Elect new binary replica revision&amp;quot; and specify the replica image url and version id in the payload. A sample proposal can be found in the dashboard ([https://dashboard.internetcomputer.org/proposal/92338 proposal 92338]). &lt;br /&gt;
** When the proposal is accepted by the majority of voters, the replica version is stored in the NNS registry. &lt;br /&gt;
** This replica version id can now be specified in any other NNS proposals including &amp;quot;create subnet&amp;quot;. &lt;br /&gt;
* Parameters for the P2P layer - &lt;br /&gt;
**gossip_max_chunk_size - The maximum chunk size supported on this subnet. &lt;br /&gt;
**gossip_retransmission_request_ms - Period for sending retransmission request.&lt;br /&gt;
**gossip_receive_check_cache_size - History size for receive check.&lt;br /&gt;
**gossip_registry_poll_period_ms - Period for polling the registry for updates.&lt;br /&gt;
**gossip_max_duplicity - Max duplicate requests in underutilized networks.&lt;br /&gt;
**gossip_max_chunk_wait_ms - Timeout for an outstanding request.&lt;br /&gt;
**gossip_pfn_evaluation_period_ms - Period for re evaluating the priority function.&lt;br /&gt;
**gossip_max_artifact_streams_per_peer - The maximum number of outstanding request per peer MIN/DEFAULT/MAX.&lt;br /&gt;
**advert_best_effort_percentage - &lt;br /&gt;
* Parameters for the Consensus layer &lt;br /&gt;
** max_block_payload_size - The maximum combined size of the ingress and xnet messages that fit into a block.&lt;br /&gt;
** max_ingress_bytes_per_message - The maximum amount of bytes per message. This is a hard cap, which means ingress messages greater than the limit will be dropped.&lt;br /&gt;
** max_ingress_messages_per_block - The maximum number of ingress messages allowed per block.&lt;br /&gt;
** ingress_bytes_per_block_soft_cap&lt;br /&gt;
** initial_notary_delay_millis - Initial delay for notary (in milliseconds), to give time to rank-0 block propagation.&lt;br /&gt;
** unit_delay_millis - Unit delay for blockmaker (in milliseconds).&lt;br /&gt;
* Parameters for the execution layer &lt;br /&gt;
** max_instructions_per_message - The maximum number of instructions a message can execute.&lt;br /&gt;
** max_instructions_per_round - The maximum number of instructions a round can execute.&lt;br /&gt;
** max_instructions_per_install_code - The maximum number of instructions an &amp;quot;install_code&amp;quot; message can execute.&lt;br /&gt;
** max_number_of_canisters - The maximum number of canisters that may be present on the subnet at any given time. A value of 0 is equivalent to setting no limit. This also provides an easy way to maintain compatibility of different versions of replica and registry.&lt;br /&gt;
* Parameters related to cryptographic keys &lt;br /&gt;
** dkg_dealings_per_block : nat64;&lt;br /&gt;
** ecdsa_config : opt EcdsaInitialConfig;&lt;br /&gt;
** dkg_interval_length : nat64;&lt;br /&gt;
* SSH Access to Subnet&lt;br /&gt;
** ssh_readonly_access - The list of public keys whose owners have &amp;quot;readonly&amp;quot; SSH access to all replicas on this subnet, in case it is necessary to perform subnet recovery.&lt;br /&gt;
** ssh_backup_access - The list of public keys whose owners have &amp;quot;backup&amp;quot; SSH access to nodes on the NNS subnet to make sure the NNS can be backed up.&lt;br /&gt;
* Subnet Features - The list of feature flags to be used for the subnet. This indicates the features that are to be enabled/disabled in the subnet. This includes the following features.&lt;br /&gt;
** Canister sandboxing - This feature flag controls whether canister execution happens in sandboxed process or not. It is disabled by default.&lt;br /&gt;
** Http requests - This feature flag controls whether canisters of this subnet are capable of performing http(s) requests to the web2.&lt;br /&gt;
** Bitcoin testnet feature - Whether or not the subnet is capable of serving requests to the bitcoin testnet canister.&lt;br /&gt;
** Bitcoin - Controls whether the bitcoin feature is enabled and which bitcoin network is supported.&lt;br /&gt;
* is_halted - If &amp;quot;true&amp;quot;, the subnet will be halted: it will no longer create or execute blocks.&lt;br /&gt;
* start_as_nns - If set to yes, the subnet starts as a (new) NNS.&lt;br /&gt;
* subnet_id_override - This field is optional. If a principal id is specified, then that principal id will be used for the new subnet.&lt;br /&gt;
&lt;br /&gt;
== Executing the &#039;Create Subnet&#039; Proposal ==&lt;/div&gt;</summary>
		<author><name>Satya.vusirikala</name></author>
	</entry>
</feed>