{"id":19190195,"url":"https://github.com/xrplf/xrpl4j","last_synced_at":"2026-01-17T00:43:18.594Z","repository":{"id":37536102,"uuid":"318196001","full_name":"XRPLF/xrpl4j","owner":"XRPLF","description":"A 100% Java implementation to interact with the XRP Ledger.","archived":false,"fork":false,"pushed_at":"2025-03-29T00:19:57.000Z","size":6418,"stargazers_count":107,"open_issues_count":93,"forks_count":61,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-12T06:16:42.317Z","etag":null,"topics":["java","xrp","xrp-ledger","xrpl"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XRPLF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-03T13:05:26.000Z","updated_at":"2025-03-29T00:17:50.000Z","dependencies_parsed_at":"2024-05-20T23:49:10.423Z","dependency_job_id":"f1cabce6-3074-4c58-96a9-5693b18c94a5","html_url":"https://github.com/XRPLF/xrpl4j","commit_stats":{"total_commits":434,"total_committers":19,"mean_commits":"22.842105263157894","dds":0.4769585253456221,"last_synced_commit":"9cc99a3ed0fe4cd1b6106a9a7d8987f9c0fce72c"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLF%2Fxrpl4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLF%2Fxrpl4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLF%2Fxrpl4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLF%2Fxrpl4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XRPLF","download_url":"https://codeload.github.com/XRPLF/xrpl4j/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525141,"owners_count":21118620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","xrp","xrp-ledger","xrpl"],"created_at":"2024-11-09T11:33:17.073Z","updated_at":"2026-01-17T00:43:18.557Z","avatar_url":"https://github.com/XRPLF.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xrpl4j: A 100% Java SDK for the XRP Ledger\n\n[![codecov][codecov-image]][codecov-url]\n[![issues][github-issues-image]][github-issues-url]\n[![javadoc](https://javadoc.io/badge2/org.xrpl/xrpl4j-parent/javadoc.svg?color=blue)](https://javadoc.io/doc/org.xrpl/xrpl4j-parent)\n\nThis project is a pure Java implementation of an SDK that works with the XRP Ledger. This library supports XRPL key \nand address generation, transaction serialization and signing, provides useful Java bindings for XRP Ledger objects and \n`rippled` request/response objects, and also provides a JSON-RPC client for interacting with XRPL nodes.\n\n## Documentation\n\n- [Get Started Using Java](https://xrpl.org/get-started-using-java.html): a tutorial for building a very simple XRP\n  Ledger-connected app.\n- Example usage can be found in the `xrpl4j-integration-tests`\n  module [here](https://github.com/XRPLF/xrpl4j/tree/main/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests).\n\n## Usage \n\n### Requirements\n\n- JDK 1.8 or higher\n- A Java project manager such as Maven or Gradle\n\n### Maven Installation\n\nYou can use one or more xrpl4j modules in your Maven project by using the\ncurrent [BOM](https://howtodoinjava.com/maven/maven-bom-bill-of-materials-dependency/) like this:\n\n```\n\u003cdependencyManagement\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.xrpl\u003c/groupId\u003e\n            \u003cartifactId\u003exrpl4j-bom\u003c/artifactId\u003e\n            \u003cversion\u003e5.0.0\u003c/version\u003e\n            \u003ctype\u003epom\u003c/type\u003e\n            \u003cscope\u003eimport\u003c/scope\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/dependencyManagement\u003e\n```\n\nThen you can add one or both of the `xrpl4j-core` and `xrpl4j-client` modules\nfound in the BOM to your `pom.xml`. For example:\n\n```\n\u003cdependencies\u003e  \n  ...\n  \u003cdependency\u003e\n    \u003cgroupId\u003eorg.xrpl\u003c/groupId\u003e\n    \u003cartifactId\u003exrpl4j-core\u003c/artifactId\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eorg.xrpl\u003c/groupId\u003e\n    \u003cartifactId\u003exrpl4j-client\u003c/artifactId\u003e\n  \u003c/dependency\u003e\n  ...\n\u003c/dependencies\u003e\n```\n\n### Core Objects\n\nThis library provides Java objects modeling [XRP Ledger Objects](https://xrpl.org/ledger-data-formats.html),\n[Transactions](https://xrpl.org/transaction-formats.html),\nand [request parameters](https://xrpl.org/request-formatting.html)/[response results](https://xrpl.org/response-formatting.html)\nfor the [rippled API](https://xrpl.org/public-rippled-methods.html).\n\nThe objects in this module are annotated with `@Value.Immutable` from\nthe [immutables library](https://immutables.github.io/), which generates immutable implementations with builders, copy\nconstructors, and other useful boilerplate code.\n\nFor example, the following code constructs an `EscrowCreate` object, which represents\nan [EscrowCreate](https://xrpl.org/escrowcreate.html) Transaction:\n\n```java\nEscrowCreate escrowCreate = EscrowCreate.builder()\n  .account(Address.of(\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\"))\n  .fee(XrpCurrencyAmount.ofDrops(12))\n  .sequence(UnsignedInteger.ONE)\n  .amount(XrpCurrencyAmount.ofDrops(10000))\n  .destination(Address.of(\"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\"))\n  .destinationTag(UnsignedInteger.valueOf(23480))\n  .cancelAfter(UnsignedLong.valueOf(533257958))\n  .finishAfter(UnsignedLong.valueOf(533171558))\n  .condition(CryptoConditionReader.readCondition(\n  BaseEncoding.base16()\n    .decode(\"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\"))\n  )\n  .sourceTag(UnsignedInteger.valueOf(11747))\n  .build();\n```\n\nThese objects can be serialized to, and deserialized from, `rippled` JSON representations using the provided\nJackson `ObjectMapper`, which can be instantiated\nusing [`ObjectMapperFactory`](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/ObjectMapperFactory.java).\n\nUsing the `EscrowCreate` object created above, it is then possible to use the supplied `ObjectMapper` to serialize to\nJSON like this:\n\n```java\n  ObjectMapper objectMapper = ObjectMapperFactory.create();\n  String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(escrowCreate);\n  System.out.println(json);\n```\n\nWhich produces the following output:\n\n```\n{\n  \"Account\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n  \"Fee\" : \"12\",\n  \"Sequence\" : 1,\n  \"SourceTag\" : 11747,\n  \"Flags\" : 2147483648,\n  \"Amount\" : \"10000\",\n  \"Destination\" : \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n  \"DestinationTag\" : 23480,\n  \"CancelAfter\" : 533257958,\n  \"FinishAfter\" : 533171558,\n  \"Condition\" : \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n  \"TransactionType\" : \"EscrowCreate\"\n}\n```\n\n### Public/Private Key Material\n\nMost operations using this library require some sort of private key material. Broadly speaking, the library supports\ntwo mechanisms: (1) in-memory private keys, and (2) in-memory _references_ to private keys where the actual private key \nmaterial lives in an external system (e.g., keys in a Hardware Security Module, or HSM). In Java, this is modeled \nusing the [`PrivateKeyable`](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/crypto/keys/PrivateKeyable.java) interface,\nwhich has two subclasses: [`PrivateKey`](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/crypto/keys/PrivateKey.java)\nand [`PrivateKeyReference`](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/crypto/keys/PrivateKeyReference.java).\n\n#### In-Memory Private Keys (`PrivateKey`)\n\n`PrivateKey` represents a private key held in memory, existing in the same JVM that is executing xrpl4j code. This key \nvariant can be useful in the context of an android or native application, but is likely not suitable for server-side \napplication because private key material is held in-memory (for these scenarios, consider using a remote service like \nan HSM).\n\nFor use-cases that require private keys to exist inside the running JVM, the following examples shows how to\ngenerate a keypair, and also how to derive an XRPL address from there:\n\n```java\nimport org.xrpl.xrpl4j.crypto.keys.KeyPair;\nimport org.xrpl.xrpl4j.crypto.keys.PrivateKey;\nimport org.xrpl.xrpl4j.crypto.keys.PublicKey;\nimport org.xrpl.xrpl4j.crypto.keys.Seed;\nimport org.xrpl.xrpl4j.model.transactions.Address;\n\nSeed seed = Seed.ed25519Seed(); // \u003c-- Generates a random seed.\nKeyPair keyPair = seed.deriveKeyPair(); // \u003c-- Derive a KeyPair from the seed.\nPrivateKey privateKey = keyPair.privateKey(); // \u003c-- Derive a privateKey from the KeyPair.\nPublicKey publicKey = keyPair.publicKey(); // \u003c-- Derive a publicKey from the KeyPair.\nAddress address = publicKey.deriveAddress(); // \u003c-- Derive an address from the publicKey\n```\n\n#### Private Key References (`PrivateKeyReference`)\n\nFor applications with higher-security requirements, private-key material can be stored outside the JVM \nusing an external system that can simultaneously manage the key material and also perform critical signing operations \nwithout exposing key material to the outside world (e.g., an HSM or cloud service provider). For these scenarios, \n`PrivateKeyReference` can be used.\n\nThis library does not provide an implementation that interacts with any particular external signing service or HSM.\nHowever, developers wishing to support such interactions should extend `PrivateKeyReference` for the particular external service, and implement\n[SignatureService](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/crypto/signing/SignatureService.java) for their `PrivateKeyReference` type.\ninterface. In\naddition, [FauxGcpKmsSignatureServiceTest](./xrpl4j-core/src/test/java/org/xrpl/xrpl4j/crypto/signing/faux/FauxGcpKmsSignatureServiceTest.java)\nand [FauxAwsKmsSignatureServiceTest](./xrpl4j-core/src/test/java/org/xrpl/xrpl4j/crypto/signing/faux/FauxAwsKmsSignatureServiceTest.java)\nillustrate faux variants of a simulated external key provider that can also be used for further guidance.\n\n### Signing and Verifying Transactions\n\nThe main interface used to sign and verify transactions\nis [SignatureService](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/crypto/signing/SignatureService.java), which has two concrete\nimplementations: [`BcSignatureService`](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/crypto/signing/bc/BcSignatureService.java) and\n[`BcDerivedKeySignatureService`](./xrpl4j-core/src/main/java/org/xrpl/xrpl4j/crypto/signing/bc/BcDerivedKeySignatureService.java).\nThe first uses in-memory private key material to perform signing and validation operations, while the latter can be used to derive\nmultiple private keys using a single entropy source combined with differing unique key identifiers (e.g., User Ids).\n\n#### Construct and Sign an XRP Payment:\n\nThe following example illustrates how to construct a payment transaction, sign it using an in-memory private key, and\nthen submit that transaction to the XRP Ledger for processing and validation:\n\n```java\nimport org.xrpl.xrpl4j.client.XrplClient;\nimport org.xrpl.xrpl4j.crypto.keys.PrivateKey;\nimport org.xrpl.xrpl4j.crypto.keys.Seed;\nimport org.xrpl.xrpl4j.crypto.signing.SignatureService;\nimport org.xrpl.xrpl4j.crypto.signing.SingleSignedTransaction;\nimport org.xrpl.xrpl4j.model.client.transactions.SubmitResult;\nimport org.xrpl.xrpl4j.model.transactions.Address;\n\nimport org.xrpl.xrpl4j.crypto.signing.bc.BcSignatureService;\nimport org.xrpl.xrpl4j.model.transactions.Payment;\n\n// Construct a SignatureService that uses in-memory Keys (see SignatureService.java for alternatives).\nSignatureService signatureService = new BcSignatureService();\n\n// Sender (using ed25519 key)\nSeed seed = Seed.ed25519Seed(); // \u003c-- Generates a random seed.\nPrivateKey senderPrivateKey = seed.deriveKeyPair().privateKey();\n  \n// Receiver (using secp256k1 key)\nAddress receiverAddress = Address.of(\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\");\n\n// Construct a Payment\nPayment payment = ...; // See V3 ITs for examples.\n\nSingleSignedTransaction\u003cPayment\u003e signedTransaction = signatureService.sign(sourcePrivateKey,payment);\nSubmitResult\u003cPayment\u003e result = xrplClient.submit(signedTransaction);\nassert result.engineResult().equals(\"tesSUCCESS\");\n```\n\n### Codecs\nThis library relies upon two important sub-modules called Codecs (One for the XRPL binary encoding, and one for XRPL \ncanonical JSON encoding). Read more about each here:\n\n- [Binary Codec](https://github.com/XRPLF/xrpl4j/tree/main/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/codec/binary/README.md)\n- [Address Codec](https://github.com/XRPLF/xrpl4j/tree/main/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/codec/addresses/README.md)\n\n## Development\n\n### Project Structure\n\nXrpl4j is structured as a Maven multi-module project, with the following modules:\n\n- **xrpl4j-core**: [![javadoc](https://javadoc.io/badge2/org.xrpl/xrpl4j-core/javadoc.svg?color=blue)](https://javadoc.io/doc/org.xrpl/xrpl4j-core)\n    - Provides core primitives like seeds, public/private keys definitions (supports secp256k1 and ed25519 key types \n      and signing algorithms), signature interfaces, address and binary codecs etc. Also provides Java objects which model XRP Ledger objects, \n      as well as request parameters and response results for the `rippled` websocket and JSON RPC APIs.\n    - Provides a Jackson `ObjectMapper` with JSON bindings that serialize and deserialize to and from the JSON\n      representation of XRPL Transactions; this is used to move to and from the canonical binary format of the XRP\n      Ledger.\n- **xrpl4j-client**: [![javadoc](https://javadoc.io/badge2/org.xrpl/xrpl4j-client/javadoc.svg?color=blue)](https://javadoc.io/doc/org.xrpl/xrpl4j-client)\n    - Provides an example `rippled` JSON RPC client which can be used to communicate with a `rippled` node\n- **xrpl4j-integration-tests**:\n    - Contains the project's integration tests, which also serve as valuable xrpl4j usage examples for common XRPL\n      flows.\n\nYou can build and test the entire project locally using maven from the command line:\n\n```\nmvn clean install\n```\n\nTo build the project while skipping Integration tests, use the following command:\n\n```\nmvn clean install -DskipITs\n```\n\nTo build the project while skipping Unit and Integration tests, use the following command:\n\n```\nmvn clean install -DskipITs -DskipTests\n```\n\n[codecov-image]: https://codecov.io/gh/XRPLF/xrpl4j/branch/main/graph/badge.svg\n\n[codecov-url]: https://codecov.io/gh/XRPLF/xrpl4j\n\n[github-issues-image]: https://img.shields.io/github/issues/XRPLF/xrpl4j.svg\n\n[github-issues-url]: https://github.com/XRPLF/xrpl4j/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplf%2Fxrpl4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxrplf%2Fxrpl4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplf%2Fxrpl4j/lists"}