ICP staking with seed phrase and air-gapped computer

From Internet Computer Wiki
Jump to: navigation, search

Requirements

You can only stake with seed phrase and air-gapped computer if you are already doing ICP custody with seed phrase and air-gapped machine. This page assumes you are successfully doing self-custody of ICP as in that page.

This section assumes you successfully installed the QR tools on your air-gapped computer from ICP custody with seed phrase and air-gapped machine.

In this section, we need to “bridge the air gap.” This means that we will continue to perform the sensitive operations within the air-gapped computer, but we will use a networked smartphone’s QR code scanner to send the messages from the air-gapped computer to the Internet Computer.

bridging air gap

Terminology

To “stake ICP” and to “create a neuron” are the same activity so they are used interchangeably.

Basic steps

Summary of steps

  1. Send ICP to your ledger account number
  2. Create a neuron
  3. Set dissolve delay of neuron

Step 1: Send ICP to your ledger account number

This account number lives in the Ledger canister that maintains the ICP addresses for the entire network. This account number is analogous to “addresses” in other blockchains. You need to send the ICP you want to stake to the ledger account number. In the example case, the ledger account 77b5eb9a465f4ce6f4da494ee2bfedeefe0b52d106e0272556c1ad991f99e3da so that is the address we will use.

To create a neuron, you need to stake a minimum of 1 ICP. Anything less will not create a neuron.

If you cannot send ICP to your ledger account number, do not continue. Try again, check out support, or submit a question to support.

Step 2: Create a neuron

Step 2a: Generate a signed message to “create a neuron” using quill

On the air-gapped computer:

/ This is just the structure, copy/pasting WILL NOT work. See below for working example of a command
$ target/release/quill --pem-file private.pem neuron-stake --name $NAME --amount $AMOUNT

For this command, the $NAME is an arbitrary string, up to 8 characters, that you can use to identify your neuron for the purposes of topping up later with quill. For example, if you intend to have only one eight-year neuron, you could use the name 8yneuron. This string has no meaning otherwise, and will not be visible anywhere else. You can store the string on your air-gapped computer. It can in theory be recovered if lost but there is currently no tooling for recovery, so we recommend you also write the string down.

The $AMOUNT should not include the transaction fee, but remember that it will still be deducted from your account, so if you wish to stake everything you’ve got, stake your balance minus the 0.0001 ICP fee.

Here is the same command with the fields $NAME (“neuron3”) and $AMOUNT (1.01) filled out, but you should choose your own fields.

On the air-gapped computer:

// Create the message that tells IC "create the neuron" and save it in  "message.json"
$ target/release/quill --pem-file private.pem neuron-stake --name neuron3 --amount 1.01 > message.json

Step 2b: Bridge the air gap: Send the "create neuron" message to the Internet Computer using a QR code

Since your air-gapped computer is not connected to the internet, we will use a QR app to send the message generated above to the Internet Computer. We will use IC Transaction Scanner which lives in a canister (and whose code is visible here: https://github.com/ninegua/ic-qr-scanner).

See Bridging the air gap with quill and QR codes

On your air-gapped computer terminal, press ENTER to get the next QR code to scan, repeat scanning and sending messages until there are no more.

When you do this, the browser on your smartphone will get a response with the id of the new neuron created.

After sending the message from IC Transaction scanner, do not close your browser window. Wait to get a response on IC Transaction Scanner that confirms the neuron was successfully created. A neuron id will come back to you as a response on the browser that looks like this:

(
  record {
    result = opt variant {
      NeuronId = record { id = 5_241_875_388_871_980_017 }
    };
  },
)

In the example above, the neuron id is 5241875388871980017.

You can view your neuron on community dashboards like ic.rocks by going to URL: https://ic.rocks/neuron/

For example, neuron 5241875388871980017, https://ic.rocks/neuron/5241875388871980017

Step 3: Set dissolve delay of neuron

Related topics