# @nethermindeth/discv5

> Discovery V5

Latest version **9.0.0-backport-306-v4** (published 2025-10-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @nethermindeth/discv5
pnpm add @nethermindeth/discv5
yarn add @nethermindeth/discv5
bun add @nethermindeth/discv5
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.0.0-backport-306-v4 |
| Published | 2025-10-18 |
| First published | 2025-10-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 9 |
| Unpacked size | 428.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ChainSafe Systems |
| Maintainers | nethermind, mralj |
| Keywords | discovery, discv5, ethereum, p2p |

## Links

- npm: https://www.npmjs.com/package/@nethermindeth/discv5
- Repository: https://github.com/nethermindeth/discv5
- Homepage: https://github.com/ChainSafe/discv5#readme
- Issues: https://github.com/ChainSafe/discv5/issues
- npm.io page: https://npm.io/package/@nethermindeth/discv5

## Dependencies (9)

- [rlp](https://npm.io/package/rlp.md) ^2.2.6
- [debug](https://npm.io/package/debug.md) ^4.3.1
- [bcrypto](https://npm.io/package/bcrypto.md) ^5.4.0
- [lru-cache](https://npm.io/package/lru-cache.md) ^10.1.0
- [@libp2p/crypto](https://npm.io/package/@libp2p/crypto.md) ^4.0.1
- [@libp2p/interface](https://npm.io/package/@libp2p/interface.md) ^1.1.1
- [@nethermindeth/enr](https://npm.io/package/@nethermindeth/enr.md) ^3.0.0-backport-306-v4
- [@multiformats/multiaddr](https://npm.io/package/@multiformats/multiaddr.md) ^12.1.10
- [strict-event-emitter-types](https://npm.io/package/strict-event-emitter-types.md) ^2.0.0

## Recent versions

- 9.0.0-backport-306-v4 (latest) — 2025-10-18
- 9.0.0-backport-306-v3 — 2025-10-14
- 9.0.0-backport-306-v2 — 2025-10-13
- 9.0.0-backport-306 — 2025-10-13

## README

# discv5

![ES Version](https://img.shields.io/badge/ES-2020-yellow)
![Node Version](https://img.shields.io/badge/node-18.x-green)

A TypeScript implementation of the [DiscV5](https://github.com/ethereum/devp2p/blob/master/discv5/discv5.md) protocol

## Libp2p compatibility

![Peer Discovery Compatible](https://github.com/libp2p/js-libp2p-interfaces/raw/master/src/peer-discovery/img/badge.png)

Included is a libp2p peer-discovery compatibility module.

#### Example

```typescript
import { Discv5Discovery, ENR } from "@chainsafe/discv5";
import Libp2p from "libp2p";
import PeerId from "peer-id";

const myPeerId: PeerId = ...;

const bootstrapEnrs: ENR[] = [...];

const libp2p = new Libp2p({
  peerId: myPeerId,
  modules: {
    peerDiscovery: [Discv5Discovery],
  },
  config: {
    discv5: {
      enr: ENR.createFromPeerId(myPeerInfo.id),
      bindAddr: "/ip4/0.0.0.0/udp/9000",
      bootstrapEnrs: bootstrapEnrs,
      searchInterval: 30000, // wait 30s between searches
    },
  },
});

```

## Additional features

By default, importing this library will, as a side-effect, change the enr crypto implementation to use `bcrypto`.
If you'd like to remain using `@chainsafe/enr`'s default crypto you can add this after importing `@chainsafe/discv5`:
```ts
import {setV4Crypto, defaultCrypto} from "@chainsafe/enr";

setV4Crypto(defaultCrypto)
```

## License

Apache-2.0

---
_Source: https://npm.io/package/@nethermindeth/discv5 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
