Agent skill

Devp2p Peer Connect

by Nethereum in Nethereum/Nethereum

Help users connect to an Ethereum peer over devp2p, dial a node by its enode:// URL, accept inbound RLPx connections, or understand devp2p handshake and capability negotiation with Nethereum (.NET).

MITAuto-check passedBackend & APIs

Install Devp2p Peer Connect

skills CLI
$ npx skills add Nethereum/Nethereum --skill devp2p-peer-connect -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Nethereum/Nethereum devp2p-peer-connect --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Nethereum/Nethereum.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/nethereum-skills/skills/devp2p-peer-connect .claude/skills/devp2p-peer-connect && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
devp2p-peer-connect
GitHub stars
2.3k
Token cost
~2.8k tokens
SKILL.md length
977 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Help users connect to an Ethereum peer over devp2p, dial a node by its enode:// URL, accept inbound RLPx connections, or understand devp2p handshake and capability negotiation with Nethereum (.NET).

  • Works in 2 steps: RLPx handshake — an ECIES key exchange… → Capability negotiation — the two Hello…
  • The user mentions connecting to an Ethereum peer
  • SKILL.md covers Package, Mental model: RLPx, then…, Generate a node identity and… and Dial a peer you already have…, plus 6 more sections
  • Calls dotnet

What it does

Devp2p Peer Connect is an agent skill from Nethereum/Nethereum. Help users connect to an Ethereum peer over devp2p, dial a node by its enode:// URL, accept inbound RLPx connections, or understand devp2p handshake and capability negotiation with Nethereum (.NET). Use this skill whenever the user mentions connecting to an Ethereum peer, RLPx handshake, enode URL, StaticPeerConnector, RlpxListener, ECIES key exchange, capability negotiation (Hello message, eth/snap sub-protocols), or fork-ID compatibility when peering with go-ethereum/geth or another client.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs. It works with Ethereum and .NET. The repository describes itself as: Ethereum .Net cross platform integration library. The licence is MIT.

When your agent uses it

  • The user mentions connecting to an Ethereum peer
  • StaticPeerConnector
  • ECIES key exchange
  • Capability negotiation (Hello message

Example prompts

  • “/devp2p-peer-connect”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. RLPx handshake — an ECIES key exchange establishes a shared secret, then the connection switches to AES-CTR + Keccak-MAC framing. Both…
  2. Capability negotiation — the two Hello capability lists are intersected. Only protocols both sides advertise survive, and each surviving…

What it can do on your machine

Read from SKILL.md and the folder at commit 229f278. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.nethereum.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Devp2p Peer Connect loads about 2.8k tokens when it runs. Until then it costs about 129 tokens; SKILL.md has 977 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~129
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Nethereum/Nethereum at commit 229f278, republished under its MIT licence (© Nethereum). 977 words, ~2,760 tokens.

Download SKILL.mdSave it as .claude/skills/devp2p-peer-connect/SKILL.md (or your agent's skills folder).
name
devp2p-peer-connect
description
Help users connect to an Ethereum peer over devp2p, dial a node by its enode:// URL, accept inbound RLPx connections, or understand devp2p handshake and capability negotiation with Nethereum (.NET). Use this skill whenever the user mentions connecting to an Ethereum peer, RLPx handshake, enode URL, StaticPeerConnector, RlpxListener, ECIES key exchange, capability negotiation (Hello message, eth/snap sub-protocols), or fork-ID compatibility when peering with go-ethereum/geth or another client.
user-invocable
true

Connect to a Peer — Nethereum.DevP2P

Before a Nethereum node can sync blocks, serve state, or discover the rest of the network, it needs to open at least one encrypted connection to another Ethereum node. This skill covers the two ways a connection starts — dialing a peer whose enode:// address you already have, and accepting inbound connections from peers who dial you — plus what happens right after the socket opens: capability negotiation, which decides which sub-protocols (eth, snap) the two nodes will actually speak to each other.

Use this skill for the transport layer only. For finding enode:// addresses when you don't have one, use the devp2p-peer-discovery skill. For wiring connecting + serving + syncing together into one node object, use devp2p-run-a-node.

Package

bash
dotnet add package Nethereum.DevP2P

Mental model: RLPx, then capabilities

Every devp2p connection is a two-layer negotiation:

  1. RLPx handshake — an ECIES key exchange establishes a shared secret, then the connection switches to AES-CTR + Keccak-MAC framing. Both sides then exchange a Hello message listing the sub-protocols (eth/68, eth/69, snap/1, and so on) each one supports.
  2. Capability negotiation — the two Hello capability lists are intersected. Only protocols both sides advertise survive, and each surviving protocol is assigned a block of message IDs on the shared socket (multiple sub-protocols share one TCP connection).

Nethereum.DevP2P handles both layers and hands you back a connection with SharedCapabilities already resolved. It does not run the eth Status exchange or the snap protocol loop — those live one layer up, in Nethereum.DevP2P.Sync (SyncPeerSession, PeerListener), covered by the devp2p-run-a-node skill.

Generate a node identity and config

Every example below needs a key and a DevP2PConfig. DevP2PConfig.ForDevChain collapses the common dev-chain defaults into one call:

csharp
using Nethereum.DevP2P;
using Nethereum.Signer;

// Node identity: generate a fresh key, or load your persisted node key.
var localKey = EthECKey.GenerateKey();

// Config quickstart — DevP2PConfig.ForDevChain(byte[] genesisHash, ulong networkId = 1337)
// collapses the sensible dev-chain knobs into one factory call.
var genesisHash = new byte[32];                       // your dev-chain genesis block hash
var config = DevP2PConfig.ForDevChain(genesisHash, networkId: 1337);

A key generated with EthECKey.GenerateKey() is fine for scripts and tests, but a real node loses its identity — and any peer that trusted it by node-id — on every restart if you don't persist it. For a long-running node, use NodeKeyStore.LoadOrCreate (see devp2p-peer-discovery).

Dial a peer you already have the address for

If you already have a peer's enode:// URL — from a config file, a static-peers list, or a discovery result — StaticPeerConnector.ConnectAsync parses it and completes the RLPx handshake and Hello exchange in one call:

csharp
using System.Threading;
using Nethereum.DevP2P;
using Nethereum.DevP2P.Rlpx;
using Nethereum.Signer;

var localKey = EthECKey.GenerateKey();
var connector = new StaticPeerConnector(localKey);           // config optional; defaults are fine
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));

// ConnectAsync(string enode, CancellationToken ct = default)
RlpxConnection conn = await connector.ConnectAsync(
    "enode://<64-byte-hex-pubkey>@127.0.0.1:30303",
    cts.Token);

// conn.SharedCapabilities now lists the negotiated protocols (eth >= 68).

The <64-byte-hex-pubkey> is the peer's uncompressed secp256k1 public key without the 0x04 prefix, hex-encoded — the same identity that shows up as PeerId if you parse the URL with EnodeUrl.Parse. Once ConnectAsync returns, conn.SharedCapabilities tells you what you can actually do with this peer: if eth isn't in the list, this peer won't answer block/header requests; if snap isn't there, it won't serve state ranges.

Accept inbound connections

To let peers dial you, start an RlpxListener. It performs admission control, the RLPx handshake, and the Hello exchange, then raises PeerAccepted once a peer is fully connected:

csharp
using System.Net;
using Nethereum.DevP2P;
using Nethereum.DevP2P.Rlpx;
using Nethereum.Signer;

var serverKey = EthECKey.GenerateKey();
var genesisHash = new byte[32];                              // your dev-chain genesis block hash
var config = DevP2PConfig.ForDevChain(genesisHash);

var listener = new RlpxListener(serverKey, config);
listener.PeerAccepted += (_, conn) =>
{
    // conn.SharedCapabilities is already negotiated. Run the eth Status
    // exchange and the protocol loop here — see Nethereum.DevP2P.Sync.
};

// Start(int port = 0, IPAddress bindAddress = null) — port 0 binds an ephemeral port.
listener.Start(port: 30303, bindAddress: IPAddress.Any);

// ... on shutdown:
await listener.StopAsync();                                 // StopAsync() drains in-flight handshakes

RlpxListener deliberately stops at "you have a negotiated connection." It does not know about eth Status messages or snap requests — that dispatch loop is devp2p-run-a-node's PeerListener, built on top of this same event.

See it end-to-end: a two-node handshake

Both sides run in the same process — a listener and a client, both on loopback:

csharp
var serverKey = EthECKey.GenerateKey();
var clientKey = EthECKey.GenerateKey();
var config = new DevP2PConfig
{
    ClientId = "Nethereum/test",
    ConnectTimeoutMs = 5000,
    HandshakeTimeoutMs = 5000
};

var listener = new RlpxListener(serverKey, config);
RlpxConnection acceptedConnection = null;
var acceptedTcs = new TaskCompletionSource<RlpxConnection>();
listener.PeerAccepted += (_, conn) =>
{
    acceptedConnection = conn;
    acceptedTcs.TrySetResult(conn);
};

listener.Start(port: 0, bindAddress: IPAddress.Loopback);
var listenerPort = listener.Port;

var clientConn = new RlpxConnection(clientKey, config);
await clientConn.ConnectAsync("127.0.0.1", listenerPort, serverKey.GetPubKeyNoPrefix());
var server = await acceptedTcs.Task.WaitAsync(TimeSpan.FromSeconds(5));

// Both sides are connected and see each other's Hello:
Console.WriteLine($"Client sees: {clientConn.RemoteHello.ClientId}, caps={string.Join(",", clientConn.SharedCapabilities.ConvertAll(c => $"{c.Name}/{c.Version}"))}");
Console.WriteLine($"Server sees: {server.RemoteHello.ClientId}, caps={string.Join(",", server.SharedCapabilities.ConvertAll(c => $"{c.Name}/{c.Version}"))}");

await clientConn.DisconnectAsync();
await listener.StopAsync();

The outbound ConnectAsync overload here takes (host, port, remotePubNoPrefix) — the raw connection form, distinct from StaticPeerConnector's single enode:// string — and clientConn.SharedCapabilities will contain eth at version 68 or higher, because that's the floor this package advertises. Port 0 in Start binds an OS-assigned ephemeral port, which is why the test reads listener.Port back before dialing it.

Show full SKILL.md (416 more words)Show less

Capability negotiation, in detail

CapabilityNegotiator.Negotiate is what computes SharedCapabilities from the two Hello messages. You don't normally call it directly — RlpxConnection/RlpxListener do it for you — but understanding it explains a real failure mode:

csharp
List<P2PCapability> Negotiate(List<P2PCapability> local, List<P2PCapability> remote)

Each protocol gets a block of message IDs starting at 0x10, sized by version: eth gets 17 slots at v68, 18 at v69–70, 20 at v71; snap gets 8 slots at v1, 10 at v2. If the eth version negotiated is wrong, snap's message-id block shifts and the peer's dispatcher misroutes every snap message it receives — which is why this computation is centralized rather than inlined at each call site.

RlpxConnection advertises eth/68, eth/69, eth/70, eth/71, and snap/1 in its own Hello — snap/2 only appears when DevP2PConfig.AdvertiseSnap2 is set, which matters for the snap-v2 BAL heal path (see devp2p-bal-sync).

Why a peer might reject you: fork compatibility

Capability negotiation only checks which protocols two peers share — it says nothing about whether they're on the same chain. That check happens one layer up, in the eth Status message that Nethereum.DevP2P.Sync's SyncPeerSession sends immediately after the handshake: Status carries an EIP-2124 fork-ID, and Eip2124ForkIdCalculator/Eip2124ValidationResult decide whether the two nodes are running compatible or stale fork schedules. A connection can complete everything in this skill successfully and still be useless for syncing if the fork-ID check fails afterward — see devp2p-run-a-node.

Common mistakes

SymptomCauseFix
ConnectAsync throws RlpxPeerRejectedExceptionThe remote peer rejected the handshake (full, banned you, or a capability mismatch)Inspect the exception's DisconnectReason; not always retryable
ConnectAsync throws RlpxNetRestrictedExceptionNone of the target's resolved IPs match your configured NetRestrict allow-listWiden NetRestrict, or confirm you dialed the address you intended
SharedCapabilities is empty or missing ethPassed the wrong pubkey form, or the peer only advertises protocols you don't supportConfirm you passed remotePubNoPrefix (64-byte uncompressed key, no 0x04) to the raw ConnectAsync(host, port, pubkey) overload — StaticPeerConnector handles this for you from an enode:// string
Connects, but never receives blocksHandshake succeeded but the fork-ID Status check (in Nethereum.DevP2P.Sync) rejected the peer, or no eth/snap dispatch loop is wired to PeerAcceptedUse devp2p-run-a-node — RlpxListener alone does not run the protocol loop

Decision guidance

I want to…Use
Connect to one specific peer I already have an enode:// forStaticPeerConnector.ConnectAsync
Accept connections from peers dialing meRlpxListener + PeerAccepted
Both sides in the same process (tests, local dev networks)RlpxListener + RlpxConnection.ConnectAsync(host, port, pubkey), as in the two-node example above
I don't have any peer addresses yetUse the devp2p-peer-discovery skill first

For full documentation, see: https://docs.nethereum.com/docs/devp2p/guide-connect-to-a-peer

© Nethereum, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/nethereum-skills/skills/devp2p-peer-connect of Nethereum/Nethereum.

Open the folder on GitHubat commit 229f278

Compare with similar skills

Devp2p Peer Connect next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Devp2p Peer Connect compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Devp2p Peer Connect this skillNethereum/Nethereum2.3k—~2.8kAutomated safety check: PassMIT
FoundatioFoundatioFx/Foundatio2.1k—~3.9kAutomated safety check: PassApache-2.0
NEAR Intents Swap Integrationinternet-court/internet-court-skill6.4k2 repos~939Automated safety check: PassCustom licence
Aspnet Corefanslead/ReverseProxy.Store1632 repos~1.4kAutomated safety check: PassApache-2.0
.NET API Compatibility DesignAaronontheweb/dotnet-skills1.2k2 repos~2.7kAutomated safety check: PassMIT
Msal Auth Code FlowAzureAD/microsoft-authentication-library-for-dotnet1.5k—~917Automated safety check: PassMIT

Similar skills

  • Foundatio

    FoundatioFx/Foundatio

    A skill your agent uses when working with Foundatio infrastructure abstractions for .NET -- caching, queuing, messaging, file storage, distributed locking, or background jobs.

    2.1k GitHub stars~3.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • NEAR Intents Swap Integration

    internet-court/internet-court-skill

    Builds cross-chain token swaps and bridge flows with the NEAR Intents 1Click API: quotes, deposit addresses, per-chain deposits and status polling.

    6.4k GitHub starsUsed in 2 repos~939 tokens
    Backend & APIsAuto-check passed
  • Aspnet Core

    fanslead/ReverseProxy.Store

    Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development.

    163 GitHub starsUsed in 2 repos~1.4k tokens
    Backend & APIsAuto-check passed
  • .NET API Compatibility Design

    Aaronontheweb/dotnet-skills

    Applies extend-only design rules to NuGet packages and distributed systems, covering source, binary and wire compatibility and how to deprecate members safely.

    1.2k GitHub starsUsed in 2 repos~2.7k tokens
    Backend & APIsAuto-check passed
  • Msal Auth Code Flow

    AzureAD/microsoft-authentication-library-for-dotnet

    Authorization Code Flow for web applications using MSAL.NET confidential client to sign in users and access APIs on their behalf

    1.5k GitHub stars~917 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Tsp Csharp

    querylenshq/ef-querylens

    Comprehensive C and .NET development skill for TSP projects.

    225 GitHub stars~1.3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed

More from Nethereum/Nethereum

All 71 skills in this repo
  • Aa Batching Paymasters

    Nethereum/Nethereum

    Help users batch multiple calls into a single UserOperation and sponsor gas with paymasters using Nethereum Account Abstraction.

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Aa Bundler

    Nethereum/Nethereum

    Help users run an ERC-4337 bundler using Nethereum — set up in-process or standalone bundlers with mempool, validation, reputation, and JSON-RPC server.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Encoding

    Nethereum/Nethereum

    Encode and decode Ethereum ABI data with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Retrieval

    Nethereum/Nethereum

    Fetch contract ABIs from Sourcify, Etherscan, and 4Byte Directory using the composite ABIInfoStorage pattern (.NET/C).

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Account Abstraction

    Nethereum/Nethereum

    Help users implement ERC-4337 Account Abstraction with Nethereum — send UserOperations, use smart accounts, route contract calls through a bundler, enable gasless transactions, or work with AA in…

    2.3k GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Address Utils

    Nethereum/Nethereum

    Validate and format Ethereum addresses with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Devp2p Peer Connect

What does Devp2p Peer Connect do?

Help users connect to an Ethereum peer over devp2p, dial a node by its enode:// URL, accept inbound RLPx connections, or understand devp2p handshake and capability negotiation with Nethereum (.NET). Devp2p Peer Connect is an agent skill from Nethereum/Nethereum.NET).

When should I use Devp2p Peer Connect?

Devp2p Peer Connect fits situations like: the user mentions connecting to an Ethereum peer; staticPeerConnector; ECIES key exchange; capability negotiation (Hello message.

How do I install Devp2p Peer Connect in Claude Code?

Run `npx skills add Nethereum/Nethereum --skill devp2p-peer-connect -a claude-code`. Or copy the skill folder (plugins/nethereum-skills/skills/devp2p-peer-connect in Nethereum/Nethereum) into .claude/skills/devp2p-peer-connect in your project. Claude Code loads it when a task matches its description.

How do I install Devp2p Peer Connect in Codex?

Run `npx skills add Nethereum/Nethereum --skill devp2p-peer-connect -a codex`. Or copy the skill folder (plugins/nethereum-skills/skills/devp2p-peer-connect in Nethereum/Nethereum) into .agents/skills/devp2p-peer-connect in your project. Codex loads it when a task matches its description.

Can I use Devp2p Peer Connect in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Nethereum/Nethereum --skill devp2p-peer-connect -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/devp2p-peer-connect, .gemini/skills/devp2p-peer-connect, .github/skills/devp2p-peer-connect and .opencode/skills/devp2p-peer-connect in your project.

What does Devp2p Peer Connect need to run?

Going by SKILL.md and its folder, Devp2p Peer Connect needs the command-line tools its instructions call (dotnet).

Does Devp2p Peer Connect access the network?

SKILL.md names 1 domain. As links in the text: docs.nethereum.com. This is read from the text; nothing was executed.

Is Devp2p Peer Connect safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Devp2p Peer Connect use?

Devp2p Peer Connect is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Devp2p Peer Connect use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Devp2p Peer Connect?

Skills that share tags, products or a category with Devp2p Peer Connect: Foundatio (FoundatioFx/Foundatio, 2.1k stars), NEAR Intents Swap Integration (internet-court/internet-court-skill, 6.4k stars), Aspnet Core (fanslead/ReverseProxy.Store, 163 stars) and .NET API Compatibility Design (Aaronontheweb/dotnet-skills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Devp2p Peer Connect?

Nethereum (a GitHub organization) maintains it in Nethereum/Nethereum, which has 2,260 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on October 5, 2026.

Source: Nethereum/Nethereum on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.