nostr-java is a Java SDK for the Nostr protocol. It provides utilities for creating, signing and publishing Nostr events to relays.
- Maven
- Java 21+
Clone the repository and build the modules. Installing them locally allows you to add the artifacts as dependencies in your own projects:
$ git clone https://github.com/tcheeric/nostr-java.git
$ cd nostr-java
$ ./mvnw clean installYou can also consume published artifacts from our Maven repository instead of building from source.
<repositories>
<repository>
<id>nostr-java</id>
<url>https://maven.398ja.xyz/releases</url>
</repository>
</repositories>
<dependency>
<groupId>xyz.tcheeric</groupId>
<artifactId>nostr-java-api</artifactId>
<version>[VERSION]</version>
</dependency>Snapshot builds are available at https://maven.398ja.xyz/snapshots.
repositories {
maven { url 'https://maven.398ja.xyz/releases' }
}
dependencies {
implementation 'xyz.tcheeric:nostr-java-api:[VERSION]'
}Replace [VERSION] with the latest release number from the releases page.
See docs/CODEBASE_OVERVIEW.md for details about running tests and contributing.
Example usages are located in the nostr-java-examples module. Additional demonstrations can be found in nostr-client and SuperConductor.
The API currently implements the following NIPs: