# @chainsafe/discv5

> Discovery V5

Latest version **12.0.2** (published 2026-08-11) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 12.0.2 |
| Published | 2026-08-11 |
| First published | 2020-04-06 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 12 |
| Unpacked size | 625.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 31 |
| Author | ChainSafe Systems |
| Maintainers | wemeetagain, matthewkeil |
| Keywords | discovery, discv5, ethereum, p2p |

## Links

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

## Dependencies (12)

- [weald](https://npm.io/package/weald.md) ^1.1.1
- [lru-cache](https://npm.io/package/lru-cache.md) ^11.2.5
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^2.0.1
- [@chainsafe/enr](https://npm.io/package/@chainsafe/enr.md) ^6.0.2
- [@libp2p/crypto](https://npm.io/package/@libp2p/crypto.md) ^5.0.1
- [@ethereumjs/rlp](https://npm.io/package/@ethereumjs/rlp.md) ^10.1.1
- [@libp2p/peer-id](https://npm.io/package/@libp2p/peer-id.md) ^6.0.4
- [@noble/secp256k1](https://npm.io/package/@noble/secp256k1.md) ^3.0.0
- [@libp2p/interface](https://npm.io/package/@libp2p/interface.md) ^3.1.0
- [ethereum-cryptography](https://npm.io/package/ethereum-cryptography.md) ^3.2.0
- [@multiformats/multiaddr](https://npm.io/package/@multiformats/multiaddr.md) ^13.0.1
- [strict-event-emitter-types](https://npm.io/package/strict-event-emitter-types.md) ^2.0.0

## Recent versions

- 12.0.2 (latest) — 2026-08-11
- 0.6.7 (beta) — 2022-01-20
- 12.0.1 — 2026-03-16
- 12.0.0 — 2026-02-10
- 11.0.4 — 2025-09-10
- 11.0.3 — 2025-08-12
- 11.0.2 — 2025-04-23
- 11.0.1 — 2025-04-22
- 11.0.0 — 2025-01-28
- 10.0.1 — 2024-09-12
- 10.0.0 — 2024-09-11
- 9.0.1 — 2024-09-04
- 9.0.0 — 2024-01-30
- 7.1.0 — 2024-01-11
- 7.0.1 — 2023-11-29
- … 53 more at https://npm.io/package/@chainsafe/discv5/versions

## 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} from "@chainsafe/discv5";
import {ENR, SignableENR} from "@chainsafe/enr";
import {createLibp2p} from "libp2p";
import PeerId from "peer-id";

const myPeerId: PeerId = ...;

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

const libp2p = createLibp2p({
  peerId: myPeerId,
  peerDiscovery: [() => new Discv5Discovery({
    enabled: true,
    enr: SignableENR.createFromPeerId(myPeerId),
    peerId: myPeerId,
    bindAddrs: {ip4: "/ip4/0.0.0.0/udp/9000"},
    bootEnrs,
    searchInterval: 30000, // wait 30s between searches
  })]
});
```

## License

Apache-2.0

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