Polkadot staking: Practical part

--

Welcome to the continuation of our series on staking. In the first part we have looked at some theoretical concepts that are worth knowing about Polkadot and now we will finally focus on application of these concepts.

We’ll show you how to work with the account types that Polkadot offers, secure your finances with a Ledger or a cold wallet, and look at some of the criteria you should consider when choosing a validator. Finally, as a bonus, we’ll show you some tools that which can help increase your staking earnings.

Types of accounts

Polkadot offers two types of accounts for increased security — Stash and Controller. This partition is based on the principle of hot and cold wallets — hot has access to the Internet and is used to manipulate your tokens, cold, on the other hand, should never connect to the internet and serve as a secure storage for your tokens.

Stash

Stash is used to store the tokens you want to nominate. The Stash account has full access rights to your account, in case of loss or theft of your seed you lose your funds without any chance for recovery. That is why Polkadot comes up with the concept of two separate accounts where one serves as a cold storage and the other has only limited access rights for changing your nomination (and therefore you do not lose your funds by compromising it).

Controller

The controller complements your stash account by delegating only limited access rights from the stash to the controller. In practice, stash can easily be just a paper wallet without an internet access and the controller connected to your stash takes care of managing your nomination. If your controller account is compromised, due to limited rights, the attacker can cancel or change your nominations but he will no longer be able to transfer your funds to another address.

Proxies

The way Polkadot allows you to link accounts and delegate access rights is called a proxy. We even have several kinds of them

• staking — brings the concept of account controller

• governance — has access only to governance (for example, voting in referendums)

• non-transfer — the account can perform any operations, except for the transfer of funds

We acknowledge that the average user is unlikely to make much use of this functionality but we also believe that it is good to know about the existence of proxy accounts because they increase security and make managing accounts easier in large organizations (for example, imagine a company with a large number of tokens — that is a perfect use for governance proxies which ensures that no one with voting rights can also steal the funds).

Wallets

We will show you several possible combinations which, in our opinion, can best secure your funds.

• Polkadot JS + Ledger

• Polkadot JS + Parity signer

• Polkadot JS + Web Extension

• Subkey

Parity signer

A Parity signer is a smartphone application that can turn your phone into a cold wallet. The principle is very simple, you take your old phone, remove the SIM card, reset the phone to factory settings, install the Parity signer and make sure that the phone is not connected to any network (Bluetooth, WiFi, etc.). Because all the communication means are disallowed, you’ll get very secure storagewhich makes transaction signing very easy by scanning the QR code.

After installing the application, all you have to do is create an account on one of the supported networks (Polkadot, Kusama, Ethereum), enter your PIN and, of course, back up your seed. You can import your account into Polkadot JS wallet via Accounts -> Add via QR.

For example, if you want to send a transaction, just click on Send, enter the number of tokens to transfer, and then click on Sign via QR.

Then a QR code will appear, which you just need to scan and sign in the Parity signer application — this step will again result in a QR code which you will scan from your computer. Voila, transaction is sent!

Parity signer

Staking

And that finally brings us to the staking itself. As you might have guessed, the account in Parity signer will serve as a Stash account. Our Controller will be a new account which we are going to to create in Polkadot JS extension — as we showed in our introductory article on wallets.

So, after creating both, your account should look like this — as you can see, the Controller is an injected account (added from a web extension) and Stash is external, that is, created in a Parity signer or possibly another tool.

Now there is nothing easier than nominating your tokens and choosing Stash and Controller account in the first step. As a result, your Stash remains as secure as a cold storage, and you can now change the amount of your nomination or nominate/remove other validators using the controller account. For a detailed guide to the nomination process, see our first wallet article or official documentation.

Ledger

Ledger is a hardware wallet that our readers probably know in detail and many of them use it. Its security lies in the fact that it uses a special computer chip to store private keys and it is therefore almost impossible for an attacker to access your private keys.

At first, you need to install Polkadot from the list of applications offered in Ledger.

Then you can go to Polkadot JS wallet and enable the search for hardware wallets in the settings — Settings -> General — manage hardware connections and select Attach Ledger via WebUSB. Then we will move to Accounts and here just press the Add Ledger to add your Ledger to the Polkadot JS.

Now it’s up to you whether you want to have a separate Stash and Controller accounts or set up both as an account from your Ledger. My view is that the separation of accounts has the following advantages

  • it will increase security a bit because you will never manipulate your stake with a fully authorized account (and even Ledger already had its security problems)
  • you do not need to have a Ledger with you to change your nomination, Controller account can be easily imported into a mobile wallet where you can conveniently change anything you want

But on the other hand, Ledger itself is such a safe option that the scenario when you set up both Stash and Controller as a Ledger account is perfectly fine.

Browser extension

We will mention it only briefly because we wrote a detailed description in our article about wallets. This is a variant where we create Stash and Controller accounts using browser extensions. From a security point of view such a partition no longer makes sense because if someone compromises your computer, he will still have access to both accounts. Therefore, we definitely do not recommend this variant — or only for staking a small number of tokens.

Subkey

We are adding this option for “nerds” and for others who are interested in how Polkadot/Substrate works in detail. Substrate is a tool for creating and developing blockchains which then can run on Polkadot (the code of Polkadot itself consists from 85% of the Substrate code which anyone can use to build their own chain). Well, Substrate is not one huge piece of code but it is divided into so-called libraries or tools. One of them is the Subkey which is used to create and manipulate Polkadot/Kusama (or more generally Substrate) addresses and accounts. So, let’s see how can we simply create an address via the command line and sign a transaction using it.

$ subkey generate

Secret phrase `spend report solution aspect tilt omit market cancel what type cave author` is account:
Secret seed: 0x554b6fc625fbea8f56eb56262d92ccb083fd6eaaf5ee9a966eaab4db2062f4d0
Public key (hex): 0x143fa4ecea108937a2324d36ee4cbce3c6f3a08b0499b276cd7adb7a7631a559
Account ID: 0x143fa4ecea108937a2324d36ee4cbce3c6f3a08b0499b276cd7adb7a7631a559
SS58 Address: 5CXFinBHRrArHzmC6iYVHSSgY1wMQEdL2AiL6RmSEsFvWezd

Here you can see your seed in the Secret phrase section which you would promptly backup on paper. Then we can easily sign any message — how about creating a staking proxy on another account (which will be in the message)? And this account (or Controller) can easily be ready for nomination in your Polkadot JS.

$ echo "whatever message or transaction to sign" | subkey sign "your seed or private key"

At first sight this may seem extremely complicated but let’s realize a few things:

• This is exactly the code that wallets usually call, making it easy to create keys, generate seeds, sign transactions, and so on,

• Imagine that you want to sign thousands of transactions with hundreds of accounts every day —in this case automation pays off and you need to be able to work with accounts directly in code and not just in the user interface,

• There will always be scenarios where people store a huge number of tokens and then it makes sense to take the path of maximum security, and that is to have keys in the air-gapped devices — ones that never connect to any network and therefore cannot be compromised (which is something you cannot say even with Ledger).

We will deal with the Substrate itself later, it is one of the things that is absolutely revolutionary in Polkadot and I even dare to say that it’s the best development framework within the cryptocurrency space 😊 Anyway, please forgive us this “nerdy” part and now we are going to continue with what you are probably most interested in and that is how to choose your validators.

How to choose the validator

There are several criteria (or metrics) you should pay attention to when selecting a validator. We will start with the basic ones which everyone should take into account and then we’ll talk about others which are a bit more advanced.

Basic criteria

First, let’s look at the picture with an overview of staking screen in a Polkadot JS wallet. We will analyze the individual fields here and talk about how their values ​​affect your nomination.

Identity

For a fee, Polkadot allows you to bind address to an identity using so-called registrars. They provide the network with a service to verify your identity — this means that you can add a link to your website or profile on a social network to your account and the registrar then off-chain verifies that it is really you. In the context of staking, this affects us in such a way that validators with verified identity are, in our opinion, more trustworthy (“not afraid to go to market with their skin”) than those who remain anonymous. Therefore, when searching for a validator, check only with identity (red circle).

Oversubscribed validators

As we mentioned in our article about the theory, the reward is paid only to the first 256 nominators per validator — a validator supported by more nominators is called oversubscribed. Therefore, select only those who do not have any of the brown icons next to their name (green circle, we will explain the meaning of slashing below).

Commission

The Commission is a fee associated with the operational costs of the validator which is determined as a percentage of the total staking reward. In general, the lower the fee, the better for you. But on the other hand, it also depends on how much risk you are willing to accept — there may be a group of validators with a great rating, verified identity, and enough stake which guarantees a stable reward with little opportunity for slashing. However, it charge higher commission than validators with worse parameters. So, it’s up to everyone whether they can accept higher level of risk or rather to pay a slightly higher fee. Of course, this may not always be the case, it is more of an illustration that a higher commission does not necessarily hurt.

Just one more note, many of you have probably wondered why some validators have a commission set to 100% — it’s because the entire nomination is covered by their own stake and 100% commission is a way to ensure that they will always receive a full reward.

Slashing

Slashing is a punishment for validator which is misbehaving or has outright malicious intents in the network. As we mentioned in our first part of this series, punishment rate is determined by the severity of its misconduct. However, the more important fact is that the penalty is paid from the whole stake — which means it will be partially paid even from the stake you have nominated to this validator!

That’s why encourage everyone to avoid validators which have been slashed in the past. You can find “slashing sign” (brown one) in the green circle of our screenshot.

Amount of the stake

One of the other criteria for selecting a validator is the amount of his own stake because it determines how much confidence he has in himself and how much he actually risks (see slashing). Therefore, the larger the validators’ own stake, the greater the motivation to take care of the operation of his validator carefully because any slashing would do a financial damage to him as well.

Advanced criteria

Now let’s move on to the Target page within the Staking section.

In addition, we have two things here — the profit/era column which calculates the earnings of your stake for each era, and at the same time, there is an option to directly select and nominate a validator.

Statistics

Polkadot JS offers another way to find out more about the validator. There is a small button with a graph on the right side of the table with validators (highlighted in blue in our screenshot) — this will take you to the Validator stats screen. Here you ideally want to see zero slashing and a consistent curve for the other graphs (rewards and era points should not constantly jump up and down, we want to see a nice linear line).

Era points

As we explained in the first article, the validators’ reward is calculated using a scoring system. Therefore, these two graphs are closely related and the reward graph should look very similar to the graph of points earned per era.

Tools

Let’s briefly jump into the last section (it’s an awfully long article already :-). We will introduce two tools that can help you choosing the validator and manage your nomination.

Telegram BOT

The first one is the BOT for the Telegram which can monitor your address and send notifications based on various changes:

  • transfer of funds,
  • crediting of reward,
  • the occurrence of slashing,
  • one of your nominated validators has changed the commission,
  • and other governance and treasury functions.

BOT is still under development, so we expect more features to be added soon to make notifications even better.

Polkastats

Polkastats.io is a website that monitors events in the Polkadot network and derives various statistics and predictions from it. We are especially interested in the Staking section, where we can browse the nominator or a Targets section for a list of validators and the estimated reward.

From a staking point of view we find the most interesting section Staking -> Election prediction which tries to predict the result of the choice of validators for future eras — which can be especially useful if you want to estimate whether your validator will be chosen in the next era or not.

Conclusion

Ugh, so we’re done 😊 If you’ve read this far, you have our admiration. We hope that this guide has helped you to understand staking in Polkadot and especially to maximize your earnings. Happy staking 😊

Stay tuned for further information about the Polkadot ecosystem projects here on Medium, in our Twitter channel Polkadotters as well as in our Facebook Group Polkadot unofficial!

--

--

Polkadotters | Kusama & Polkadot validators
Polkadotters | Kusama & Polkadot validators

Written by Polkadotters | Kusama & Polkadot validators

Czech bloggers & community builders. We are validators of Polkadot, Kusama, Darwinia, Crab, Bifrost, HydraDX, StaFi, Centrifuge under the name: POLKADOTTERS

No responses yet