Staking Delegation Testnet Guide — Pool Management

Cartesi Foundation
Cartesi
Published in
8 min readJun 30, 2021

In December 2020 Cartesi launched its Proof of Stake (PoS) system to bootstrap Noether’s validator network. Noether is a high-performance side chain tailored for temporary data availability, and you can read more about it in this Medium article.

Today we are launching Noether’s staking delegation system on testnet.

This article provides more details for individuals or organizations who intend to provide staking services for users by creating Staking Pools and managing Noether nodes. For details on how staking delegation works and the requirements, refer to the Staking Delegation Guide — User Delegation and Overview.

Creating a Staking Pool

Any organization or individual is free to create and manage staking pools. The creation of pools can be made using the Cartesi Explorer by navigating to https://preview.explorer.cartesi.io/pools/create. When the pool is created, the account connected to metamask is assigned as the pool owner and management operations can be done using that same account.

The first decision the pool owner has to make when creating a pool is choosing the commission model. There are two models available: flat rate and gas-based commission. For a detailed explanation about the math involved in both models please refer to the Staking Delegation Guide — User Delegation and Overview article, section Commission.

Pool creation screen. Here you can select the commission model and fee for your pool.

The flat rate model is easier to calculate and to explain to your users. The gas tax model is more elaborate and harder to explain, but can accommodate varying layer 1 costs and reward token prices.

Once created and configured, the pool manager cannot change the selected commission model. The value of the commission cannot be increased, but can be decreased at any time. This allows for fine adjustments of the economics of the pool, while preserving the public commitment not to increase the commission value.

Noether is a layer-2 solution. It rewards block producers with CTSI, and requires ETH to pay for layer 1 transaction costs. The fees for block production are paid by the pool manager. Users pay ETH fees to initiate staking, unstaking and withdrawal requests, but the pool also needs to pay ETH fees to fulfill those requests (as the users interface with the pool smart contract and the pool then has to fulfill the requests on the PoS smart contracts).

The ETH to fund these transactions must be deposited in the wallet managed by the Noether node, created and managed by the pool manager (this topic will be revisited in a while, on the section “running a node”). As a pool manager, one must keep track of the node’s wallet balance and replenish it as needed to make sure the node always has enough funds to operate correctly.

Pool Management

After the transaction for creating a pool is processed the pool will immediately be listed at the pools page and available for staking. The list shows basic information about each pool, and a button “Stake” to navigate to the pool page. If the current metamask user is also the pool owner there will also be an “Edit” button to navigate to the pool management page.

The pool management page allows the pool owner to do the following operations:

  • Hire a node to represent the pool
  • Set an ENS name for the pool
  • Change the commission value
  • Pause the pool

Each operation is described in detail in the following sections.

Running a Node

Pool managers are responsible for running a Noether node and making sure it works properly 24x7, with a reliable internet connection, well funded and using a reliable Ethereum provider.

We recommend running the pool node on a VPS server, with appropriate monitoring tools and using a professionally managed Ethereum provider, like Infura or Alchemy. However, any Linux, Mac OS or Windows box with Docker support, and any Ethereum provider might work.

The steps to run a node are very similar to the ones to run a node for a direct staker. You can refer to steps 1 and 2 of the “How to Run a Node” article for detailed instructions. There are 2 differences that should be applied to the default instructions:

  1. Instead of using the stable docker image of Noether, you should use the Noether 2.0 alpha image (cartesi/noether:2.0.0-alpha.0).
  2. Instead of using Infura, Alchemy or another Ethereum Gateway pointing to Ethereum Mainnet, you should use one pointing to Ethereum Ropsten testnet.

After the node is running you need to hire it for the pool. You can navigate to the pool management page, paste the address of the node and click the “Hire” button.

After the transaction is processed the node should accept the job and print messages like the ones below to its log:

accepting job from <pool_address>…

worker hired by pool <pool_address>

From this point forward the node will keep polling the blockchain and try to produce blocks whenever possible. It will also eventually send transactions to fulfil staking, unstaking and withdrawal requests from pool stakeholders.

Pool operators should monitor their nodes and maintain a reasonable amount of ETH to submit transactions. Metamask can be used to send ETH to the node address from the pool owner address directly.

Naming the Pool

Users usually choose a pool to stake based on a number of criteria: i.e. current stake, total rewards, number of users or charged commission. Additionally, trust also plays an important role, as users feel more comfortable about staking through a pool managed by a trusted party that manages their node well.

Pool owners can name their pool addresses to provide additional trust (or just make it easier to identify their pool). The system relies on authority information provided by ENS domains. The process to name a pool is twofold: the first step is done using the ENS application and the second step is performed on the Cartesi Explorer pool management page.

The pool owner must register a domain or subdomain to use as the pool name. That can be done at the ENS application hosted at https://app.ens.domains/ which integrates with Metamask.

For the purpose of this tutorial we will use a Ropsten subdomain under the `cartesi.eth` domain called `pool1.cartesi.eth`. Ropsten (and other testnet) domains can be registered for free but mainnet domains have costs involved. For a step-by-step guide on how to register an ENS domain, please refer to this article.

Example domain details page at ENS.

The subdomain page starts as shown in the picture above. Click on the “Add/Edit Record” button on the top-right of the “Records” table. Then, fill the ETH address with the pool address (you can retrieve it on the Cartesi Explorer, be sure to double-check it) and click the “Confirm” button in the bottom right. You can also fill the “avatar” field with an URL of an image to be used as the icon for the pool. Once you click “Confirm”, you will be presented with a confirmation dialog like the one below.

Confirmation dialog on ENS for adding/editing records.

This first step configures the name to resolve to the pool address. Now it’s time for the second step, which consists of configuring a reverse lookup from the pool address to the name. This step is performed using the Cartesi Explorer, on the pool management page.

Fill out the fully qualified pool domain name in the “Pool Name” field, click the “Set Name” button and confirm the transaction on Metamask to issue an Ethereum transaction that does that.

After the transaction is processed, you can go back to the pools page and you should see the name (and optionally icon) you set instead of the pool address.

Pool table with icon and name after performing the procedure to name and set an icon to the pool.

Costs and Economics Considerations

The associated costs of the operations performed by the pool are of essence to determine if a pool manager fees are enough to cover the costs of keeping the pool node running or not.

During the testnet release period these might vary as optimizations might be released both to reduce the gas costs of certain tasks and also fine-tune the frequency at which certain maintenance transactions are performed.

A pool can have multiple users staking/unstaking at a given time without producing many blocks, or can have few users staking/unstaking while producing many blocks, or anything in between.

As it is very hard to predict the ratio between these maintenance transactions to the block production ratio, we initially established a policy that allows a pool to be created with a rather high fee and allow the pool manager to decrease it over time, up to a point where it’s competitive and still has some margin to absorb costs variation and provide profit. Pool managers should perform this commission tuning with care as once the fee is set to a lower value it cannot be raised.

As always, we’re ready for any questions or support in our development community on Discord, see you there!

About Cartesi

Cartesi is a multi-chain layer-2 infrastructure that allows any software developer to create smart contracts with mainstream software tools and languages they are used to while achieving massive scalability and low costs. Cartesi combines a groundbreaking virtual machine, optimistic rollups, and side-chains to revolutionize the way developers create blockchain applications.

--

--