Introduction to Plus with K2 Native Delegation

Plus is an MIT open-source software designed for Ethereum consensus layer validators to communicate with external on-chain applications. K2 Native Delegation is a module that plugs into the Plus software which facilitates automatic Proposer Registry registrations (Proposer Single Sign-On) and K2 validator native delegation, allowing validators to automate their operations securely without exposing validator signing keys.

In this tutorial, we will guide you through the process of installing and running Plus with K2 Native Delegation. The primary focus will be on getting your consensus node up to speed, understanding the module’s integration, configuring it for K2 native delegation, and managing the entire workflow.

Note: MEV Plus is not a relay. It only interacts with the builder API exposed from any beacon node implementation. Node operators need to ensure that the builder API on the beacon node is connected correctly but additionally, the validator client needs to be enabled and ready for the builder API so make sure to activate any associated flags. More info below in the core README.

Assumptions and notes

The tutorial assumes that the user is using a unix-based machine such as Linux and as such the commands mentioned below are not expected to work on operating systems such as MacOS and Windows. A guide for those operating systems will come soon.

Ethereum Networks

This guide is the same for both Goerli validators as well as mainnet validators. However, please note that at the time of writing, if connecting the software to mainnet, only the native delegation pre-registration can be performed in preparation for native delegation functionality that will come later once the K2 protocol smart contracts are deployed on mainnet. This is the opportunity to get ahead of the queue for native delegation since there will be limited capacity at the start. The ceiling for native delegations will be increased bit by bit later on.

Supporting all existing configurations

Plus is friendly to all kinds of staking set ups including DVTs ♥️

If you encounter any difficulties with your specific configuration - don’t hesitate to let us know.

Prerequisites

Before you begin, ensure that you meet the following prerequisites:

  • Golang:
    • Golang should already be installed if MEV Boost is running on the node
    • Otherwise follow this link: https://go.dev/doc/install
    • You may need sudo permissions to do this
  • Full Ethereum Node: You should be running a full Ethereum node, including an Execution Layer client (e.g., Geth, Besu, Nethermind, Erigon) and a Consensus Layer client (e.g., Prysm, Lighthouse, Teku, Lodestar, Nimbus).
  • Validator Setup: Make sure you have a validator configured for your Ethereum node. Ethereum Account: Prepare an Ethereum EOA with sufficient funds to cover gas fees for on-chain transactions. - NOTE: This key is the only wallet key that would be granted permission to manage your validators on-chain. Therefore, this must be managed carefully.

Step 1: Install Plus with K2 Native Delegation using go install

If you have your GOPATH configured then go install may be your simplest option:

go install github.com/pon-network/mev-plus@latest

Step 1 Alternative: Install Plus with K2 Native Delegation (Building from Source)

Create a Service Account

The Plus service will run under a dedicated account. Create the service account named mevPlus:

sudo useradd --no-create-home --shell /bin/false mevPlus

Plus with K2 Native Delegation Module pre-packaged is made available on MEV PLUS. Download / Git Pull this version of MEV Plus from this source and build or run directly.

Build from Source Code

To build from source code, follow these instructions:

Clone the MEV Plus repository

git clone https://github.com/pon-network/mev-plus
cd mev-plus

Build MEV Plus into a binary

go build -o mevPlus mevPlus.go

Copy the binary to /usr/local/bin for easy access

sudo cp mevPlus /usr/local/bin

Step 2: Node Configuration for Builder API

Before using the K2 Native Delegation module with Plus, node runners need to configure their Ethereum node to expose a Builder API. This allows Plus to communicate with the node and receive pre-signed messages for validator registrations. A node configured with MEV Boost will already have the Builder API enabled.

Consensus client Builder API configurations

Make sure the listen-address matches the address you provide when starting MEV Plus. The default address and port for Plus is http://localhost:18551. After making these changes, restart your Ethereum node to apply the configuration. This Builder API configuration ensures that the Ethereum node exposes the necessary interface for MEV Plus to communicate with it and receive pre-signed messages for validator registration.

Step 3: Plus Along-side MEV Boost

If you have an existing validator proxy software (such as MEV Boost) for builder PBS operations and would like to maintain the use of this software while still running Plus for K2 Native Delegation and other side car applications, we need to create the Plus service file in the following way.

First, create the Plus systemd unit file

sudo vim /etc/systemd/system/mevPlus.service

Now, we will fill it with initial defaults:

[Unit]
Description=MEV Plus Service for Ethereum
Wants=network-online.target
After=network-online.target

[Service]
User=mevPlus
Group=mevPlus
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/mevPlus \
  -builderApi.listen-address <your_preferred_builderapi_address> \
  -externalValidatorProxy.address <your_existing_valdator_proxy_listening_address>

[Install]
WantedBy=multi-user.target

Replace <your_existing_validator_proxy_listening_address> with the address that the MEV boost software is running on, and set the <your_preferred_builderapi_address> builder to the address configurable on your node for builder services (Plus will hook into this). Ensure both software are running on different listening addresses. This would allow for MEV Boost software to run as normal and have native delegations working side by side.

For example:

Important note on the beacon node client:

One last thing: the beacon node client software on your node needs to be updated to point to Plus. In order to do this, the builder endpoint in your beacon node client needs to point to http://127.0.0.1:18551 if that is how Plus is configured as above. This way Plus and Boost will work side by side. Boost will continue doing what Boost does best and Plus will focus on Pre-Registrations and Native delegations.

As per the Consensus client Builder API configurations section mentioned above, here are some examples of what flag may need to be set on the beacon node client depending on which consensus implementation is installed:

  • Lighthouse: --builder http://127.0.0.1:18551
  • Teku: --validators-builder-registration-default-enabled=true --builder-endpoint=http://127.0.0.1:18551
  • Loadstar: --builder --builder.urls http://127.0.0.1:18551
  • Nimbus: --payload-builder=true --payload-builder-url=http://127.0.0.1:18551
  • Prysm: --http-mev-relay=http://127.0.0.1:18551

Where MEV Plus would have the following flag set:

-builderApi.listen-address http://127.0.0.1:18551

Please ensure that we are not mixing the use of http://0.0.0.0 versus http://127.0.0.1 - we need to be consistent on both MEV Plus and the consensus node

The MEV Boost and Validator system service files should remain unchanged during this process unless you have spotted any discrepancies.

Additional advanced configurations for proposer and K2 registration are made available here.

Step 4: Configure K2 Native Delegation

Let’s update the mevPlus.service file and pass additional flags when starting Plus:

[Unit]
Description=MEV Plus Service for Ethereum
Wants=network-online.target
After=network-online.target

[Service]
User=mevPlus
Group=mevPlus
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/mevPlus \
  -builderApi.listen-address <your_preferred_builderapi_address> \
  -externalValidatorProxy.address <your_existing_valdator_proxy_listening_address> \
  -k2.eth1-private-key <your_eth1_private_key> \
  -k2.beacon-node-url <your_beacon_node_url> \
  -k2.execution-node-url <your_execution_node_url>

[Install]
WantedBy=multi-user.target

Replace <your_eth1_private_key>, <your_beacon_node_url>, and <your_execution_node_url> with your Eth1 private key that will be your proposer representative, beacon node URL, and execution node JSON RPC HTTP URL on your node respectively. If your node is configured with different fee recipients specified for your validators, ensure you pass a comma-separated list of private keys as <your_eth1_private_key>. The number of private keys should be at least equal to the number of fee recipients configured on your node to ensure there is a representative wallet available to manage each payout to your validator’s recipients.

Example mevPlus file:

[Unit]
Description=MEV Plus Service for Ethereum
Wants=network-online.target
After=network-online.target

[Service]
User=mevPlus
Group=mevPlus
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/mevPlus \
  -builderApi.listen-address http://127.0.0.1:18551 \
  -externalValidatorProxy.address http://127.0.0.1:18550 \
  -k2.eth1-private-key <PRIV_KEY> \
  -k2.beacon-node-url http://localhost:5052 \
  -k2.execution-node-url http://localhost:8545

[Install]
WantedBy=multi-user.target

Save the system files for the beacon node client software as well as Plus and reload systemctl to pick up the new service file:

sudo systemctl daemon-reload

Step 4.a: Enable MEV Plus to start on re-boot and fire it up:

sudo systemctl enable mevPlus
sudo systemctl start mevPlus

Step 4.b: Verify Installation

Check that the service started successfully:

sudo systemctl status mevPlus

Ensure there are no errors in the logs and that Plus is running nominally. Give the system a few minutes to kick in and correctly detect the network.

Step 5: Explore MEV Plus Logs

Explore MEV Plus logs to verify its operation:

sudo journalctl -fu mevPlus

Inspect the logs to confirm that MEV Plus is running without issues. Any errors that are thrown in boot-up due to the wrong configuration can be identified and rectified by evaluating the logs. Restart the service after any modifications to the service file if required:

sudo systemctl daemon-reload

Inspect the logs to confirm that MEV Plus is running without issues.

Congratulations! You have successfully installed and configured Plus with K2 Native Delegation.

The module is now automating native delegation pre-registration on the Proposer Registry and *K2 validator native delegation registrations for your Ethereum node if the network supports native delegation (Only Goerli for now).

Ensure your wallet is funded for all on-chain executions. The module would automatically manage the registration of validator keys configured on your node through the signed validator registration calls automatically made in your consensus client software through the Builder API.

Currently, only Goerli supports native delegation at this time. However, Mainnet supports native delegation pre-registration due to the proposer registry deployments already existing on Mainnet for registrations.