Convert a Subnet to an L1

Learn how to convert a Subnet to an L1 on the P-Chain by issuing a ConvertSubnetToL1Tx transaction using the Builder Tooling.

The node you have just launched is tracking the Subnet but is not yet a validator. In fact, since the Subnet does not have any validators yet it cannot process any transactions. In this step we will do two things at once:

  1. Convert the Subnet to an L1
  2. Add your node as a validator

Converting a Subnet to an L1 requires the Subnet owner issuing a ConvertSubnetToL1Tx transaction on the P-Chain. This transaction establishes a new validator set for your blockchain and transforms it from a Subnet into a sovereign L1 chain. The ConvertSubnetToL1Tx transaction is a one-time transaction that can only be executed once by the Subnet owner(s).

After the conversion the subnet owner looses all privileges and the L1 is controlled by a validator manager contract, that manages the validator set. You will learn more about this in the next chapter.

The ConvertSubnetToL1Tx has the following parameters:

  • Subnet ID - The unique identifier of your Subnet
  • Validator Manager Blockchain ID - The ID of the blockchain where the Validator Manager contract will be deployed. This blockchain can belong to the L1, be the C-Chain or belong to any other L1 in the Avalanche network
  • Validator Manager Address - The address of the contract on that blockchain
  • Validators - The initial set of validators for the L1

The Validator Manager Address is initially set to an OpenZeppelin TransparentUpgradeableProxy contract pre-deployed in the genesis.json. After conversion, you'll deploy the actual ValidatorManager implementation contract and update the proxy to point to it.

Conversion Tool

Use the following tool to convert your Subnet to an L1:

Logo

Convert Subnet to L1

This will convert your subnet to an L1 chain.

Validator Manager

With the conversion of the Subnet to an L1, the validator set of the L1 will be managed by a validator manager contract. This contract can implement Proof-of-Authority, Proof-of-Stake or any custom logic to determine the validator set. The contract can be deployed on a blockchain of the L1, the C-Chain or any other blockchain in the Avalanche network.

The ID of the blockchain where the validator manager contract is deployed. This can be a chain of the L1 itself, the C-Chain or any other blockchain in the Avalanche network.

Suggestions:
C-Chain (2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5)
The C-Chain of the Mainnet is the EVM chain of the Primary Network.

The address of the validator manager contract (or a proxy pointing for it) on the blockchain. This contract will manage the validator set of the L1. A chain created with the Toolbox will have a pre-deployed proxy contract at the address 0xfacade0000000000000000000000000000000000. After the conversion you can point this proxy to a reference implementation of the validator manager contract or a custom version of it.

An OpenZeppelin TransparentUpgradeableProxy contract is pre-deployed at the address 0xfacade.... This proxy can be pointed to a reference implementation or customized version of the validator manager contract. Tools for the deployment of the reference implementations of validator manager contracts are available in the L1 Toolbox for after the conversion.

Initial Validators

Specify the initial validator set for the L1 below. You need to add at least one validator. If converting a pre-existing Subnet with validators, you must establish a completely new validator set for the L1 conversion. The existing Subnet validators cannot be transferred. For each new validator, you need to specify NodeID, the consensus weight, the initial balance and an address or a multi-sig that can deactivate the validator and that receives its remaining balance. The sum of the initial balances of the validators needs to be paid when issuing this transaction.

Add Validator

Click the copy button to copy the command and run it in your node's terminal to get the node credentials.

curl -X POST --data '{"jsonrpc":"2.0","id":1,"method":"info.getNodeID"}' -H "content-type:application/json;" 127.0.0.1:9650/ext/info

Paste the JSON response below:

Is this guide helpful?

On this page