jvm-libp2p

September 12, 2025 ยท View on GitHub

Gitter Build Status Discourse posts

Libp2p implementation for the JVM, written in Kotlin ๐Ÿ”ฅ

Components

List of components in the Libp2p spec and their JVM implementation status

ComponentStatus
Transporttcp:green_apple:
quic:lemon:
websocket:lemon:
webtransport
webrtc-browser-to-server
webrtc-private-to-private
Secure Communicationnoise:green_apple:
tls:lemon:
plaintext:lemon:
secio (deprecated):green_apple:
Protocol Selectmultistream:green_apple:
Stream Multiplexingyamux:lemon:
mplex:green_apple:
NAT Traversalcircuit-relay-v2:lemon:
autonat:lemon:
hole-punching
Discoverybootstrap
random-walk
mdns-discovery:lemon:
rendezvous
Peer Routingkad-dht
Publish/Subscribefloodsub:lemon:
gossipsub:green_apple:
Storagerecord
Other protocolsping:green_apple:
identify:green_apple:

Legend:

  • :green_apple: - tested in production
  • :lemon: - prototype or beta, not tested in production
  • :tomato: - in progress

Gossip simulator

Deterministic Gossip simulator which may simulate networks as large as 10000 of peers

Please check the Simulator README for more details

Android support

The library is basically being developed with Android compatibility in mind. However we are not aware of anyone using it in production.

The examples/android-chatter module contains working sample Android application. This module is ignored by the Gradle build when no Android SDK is installed. To include the Android module define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file local.properties.

Importing the project into Android Studio should work out of the box.

Adding as a dependency to your project

Hosting of artefacts is graciously provided by Cloudsmith.

Latest version of 'jvm-libp2p' @ Cloudsmith

As an alternative, artefacts are also available on JitPack.

Using Gradle

Add the required repositories to the repositories section of your Gradle file.

repositories {
  // ...
  maven { url "https://dl.cloudsmith.io/public/libp2p/jvm-libp2p/maven/" }
  maven { url "https://jitpack.io" }  
  maven { url "https://artifacts.consensys.net/public/maven/maven/" }
}

Add the library to the implementation part of your Gradle file.

dependencies {
  // ...
  implementation 'io.libp2p:jvm-libp2p:X.Y.Z-RELEASE'
}

Using Maven

Add the required repositories to the dependencyManagement section of the pom file:

<repositories>
  <repository>
    <id>libp2p-jvm-libp2p</id>
    <url>https://dl.cloudsmith.io/public/libp2p/jvm-libp2p/maven/</url>
  </repository>
  <repository>
    <id>JitPack</id>
    <url>https://jitpack.io</url>
  </repository>
  <repository>
    <id>Consensys</id>
    <url>https://artifacts.consensys.net/public/maven/maven/</url>
  </repository>
</repositories>

Add the library to the dependencies section of the pom file:

<dependency>
  <groupId>io.libp2p</groupId>
  <artifactId>jvm-libp2p</artifactId>
  <version>X.Y.Z-RELEASE</version>
</dependency>

Building the project

To build the library you will need just

  • JDK (Java Development Kit) of version 11 or higher

For building a stable release version clone the master branch:

git clone https://github.com/libp2p/jvm-libp2p -b master

For building a version with the latest updates clone the develop (default) branch:

git clone https://github.com/libp2p/jvm-libp2p

To build the library from the jvm-libp2p folder, run:

./gradlew build

After the build is complete you may find the library .jar file here: jvm-libp2p/build/libs/jvm-libp2p-X.Y.Z-RELEASE.jar

Notable users

  • Teku - Ethereum Consensus Layer client
  • Nabu - minimal Java implementation of IPFS
  • Peergos - peer-to-peer encrypted global filesystem

(Please open a pull request if you want your project to be added here)

License

Dual-licensed under MIT and ASLv2, by way of the Permissive License Stack.