There’s some community demand for the substrate RPC java tooling and sdk Posts containing 'java' - Substrate and Polkadot Stack Exchange
and discord.gg/polkadot
Java is still one of the most professionally used languages, mostly by enterprises Stack Overflow Developer Survey 2023.
I have worked at a few major fintechs in India, where Java is hugely prevalant.
Previous attempts but with no longer support and maintenance
I have forked GitHub - splix/polkaj: Library to access and build for Polkadot using Java and started working on a new java substrate API client with ease of use like polkadot-js and aws-java-sdk. It’s a mammoth task getting near to the levels of polkadot-js, but I believe something like this is a must have for the community to support full integration of the APIs compatible with all languages(Go, Rust, Python, Js are well maintained).
I created the Substrate .NET API, and the according toolchain to build an extension from the nodes metadata. It should be quite easy to build the Java API, following the model-driven paradigm, if you want I can support or help with doing it. Let me know. Telegram @darkfriend77
do you already have something that people can use?
polkaj works to some extent for basic functionalities, I had forked and made some minor changes to run the examples with Java 13.
I am working on a new version, will update here.
thanks! Did you have a chance to update MetadataReader to support v14? I’m stuck on that
apart from Java, what other languages do you think there should be extensive API support for?
not sure. Current languages which are supported
- rust(subxt)
- go(centrifuge)
- python
- dart
- js/ts(polkadot js APi)
work in progress.
Plan to release the upgraded library version by July end.
Thanks for this initiative, the more diverse implementations we have around this, the better.
My suggestion is to focus the new work around the new JSON RCP interface since the ecosystem is still lacking of implementations using it (at the moment only Polkadot-API, TS based, aims to fill this gap.
Hi,
I have good news!
My project, Substrate4j, is in the final stages. I’ve been working on it for the last two years and have implemented a lot. I believe it will be a very useful tool.
The repo isn’t public yet, but I’m planning to release the first version in a few weeks. Here’s a quick summary of what it includes:
-
A complete Java client, well‑tested and developer‑friendly
-
Pure native Java (no JNI)
-
Feature‑complete and comparable to polkadot.js or polkadot‑api
-
Type‑safe, statically generated types from runtime metadata
I’m really proud of it. You’ll hear more soon.
here is a demo:
import org.substrate4j.crypto.keys.sr25519.SR25519Pair;
import org.substrate4j.polkadot.PolkadotAPI;
import org.substrate4j.polkadot.core.Context;
import org.substrate4j.polkadot.types.sp.core.crypto.AccountId32;
public class Demo {
public static void main(String[] args) throws Exception {
// send an extrinsic using Substrate!
PolkadotAPI api = new PolkadotAPI(new Context("https://rpc.polkadot.io"));
SR25519Pair pair = SR25519Pair.factory().fromPhrase(MySecret.getSecret(), null).f0();
AccountId32 accountId32 = new AccountId32(pair.publicKey().bytesRef());
String txHash = api.system.call.remark("""
I am Mehrdad Salehi, author of Substrate4j. the last commit of main branch is
e6d393a3cf1b0bbc74795a08897ab018333e3fa0.
I am using this library to send this extrinsic!
""".getBytes())
.autoConfig(accountId32.toSs58())
.sign(pair)
.send().get();
System.out.println("tx hash : " + txHash);
// success!!!
// 0x9fd632f6133df0942cc5f4e7fb322549080570c9f1148e477dbad8b86126d4aa
// thank you!,
}
}
Good to see many Java API clients being shipped.
I started off similarly but then later realised
- low adaptation/need of a Java client compared to Js/Ts clients like Papi
- long term maintenance required as the specs keep evolving
IMO the current agentic/LLM state makes it more viable to ship and maintain.
I dont agree with the idea that the need is low. Java is one of the most popular programming languages in the world, and anything that aims to be successful should support it. In fact, I’ve personally seen how the lack of Java tooling for Polkadot has slowed down its adoption.
In my previous job at a crypto exchange, our entire backend stack was Java—just like many other exchanges and enterprise systems. Java is the number‑one choice for high‑reliability platforms like exchanges. Because Polkadot didn’t have strong Java support, integrating it took significantly longer than other networks that already had mature Java tooling(we had to use JS!). That delay translated directly into slower adoption.
In the highly unpredictable crypto market, small technical gaps can trigger outsized effects on adoption and user behavior, I hvae seen this with my eyes!
There is also a fully supported Java SDK for Polkadot/Substrate called Jot, available at GitHub - methodfive/jot: A Modern Java SDK for Polkadot · GitHub