{"id":15146781,"url":"https://github.com/woodser/monero-java","last_synced_at":"2026-01-11T17:38:47.017Z","repository":{"id":47771358,"uuid":"87889947","full_name":"woodser/monero-java","owner":"woodser","description":"Java library for using Monero","archived":false,"fork":false,"pushed_at":"2025-02-13T12:49:52.000Z","size":173358,"stargazers_count":106,"open_issues_count":10,"forks_count":42,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-29T00:12:03.933Z","etag":null,"topics":["java","jni","monero","rpc"],"latest_commit_sha":null,"homepage":"https://woodser.github.io/monero-java/javadocs/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/woodser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T04:55:17.000Z","updated_at":"2025-03-19T07:38:02.000Z","dependencies_parsed_at":"2023-11-11T16:25:46.478Z","dependency_job_id":"0ca0e843-1fa5-49a3-9675-49a1a23fad10","html_url":"https://github.com/woodser/monero-java","commit_stats":{"total_commits":2830,"total_committers":9,"mean_commits":"314.44444444444446","dds":0.00883392226148405,"last_synced_commit":"1d14120ac3faa9cd2973f613843af9c27821c32a"},"previous_names":["woodser/monero-java","monero-ecosystem/monero-java"],"tags_count":85,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodser%2Fmonero-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodser%2Fmonero-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodser%2Fmonero-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodser%2Fmonero-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woodser","download_url":"https://codeload.github.com/woodser/monero-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271532,"owners_count":20911587,"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","jni","monero","rpc"],"created_at":"2024-09-26T12:04:53.430Z","updated_at":"2026-01-11T17:38:47.012Z","avatar_url":"https://github.com/woodser.png","language":"Java","readme":"# Monero Java Library\n\nA Java library for creating Monero applications using RPC and JNI bindings to [monero v0.18.4.4 'Fluorine Fermi'](https://github.com/monero-project/monero/tree/v0.18.4.4).\n\n* Supports wallet and daemon RPC clients.\n* Supports client-side wallets using JNI bindings.\n* Supports multisig, view-only, and offline wallets.\n* Wallet types are interchangeable by conforming to a [common interface](https://woodser.github.io/monero-java/javadocs/monero/wallet/MoneroWallet.html).\n* Uses a clearly defined [data model and API specification](https://woodser.github.io/monero-java/monero-spec.pdf) intended to be intuitive and robust.\n* Query wallet transactions, transfers, and outputs by their properties.\n* Fetch and process binary data from the daemon (e.g. raw blocks).\n* Receive notifications when blocks are added to the chain or when wallets sync, send, or receive.\n* Over 300 passing JUnit tests.\n\n## Architecture\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg width=\"85%\" height=\"auto\" src=\"docs/architecture.png\"/\u003e\u003cbr\u003e\n\t\u003ci\u003eBuild Java applications using RPC or JNI bindings to \u003ca href=\"https://github.com/monero-project/monero\"\u003emonero-project/monero\u003c/a\u003e.  Wallet implementations are interchangeable by conforming to a common interface, \u003ca href=\"https://woodser.github.io/monero-java/javadocs/monero/wallet/MoneroWallet.html\"\u003eMoneroWallet.java\u003c/a\u003e.\u003c/i\u003e\n\u003c/p\u003e\n\n## Sample code\n\n```java\n// connect to daemon\nMoneroDaemon daemon = new MoneroDaemonRpc(\"http://localhost:38081\", \"superuser\", \"abctesting123\");\nlong height = daemon.getHeight();                       // 1523651\nList\u003cMoneroTx\u003e txsInPool = daemon.getTxPool();          // get transactions in the pool\n\n// create wallet from mnemonic phrase using JNI bindings to monero-project\nMoneroWalletFull walletFull = MoneroWalletFull.createWallet(new MoneroWalletConfig()\n        .setPath(\"sample_wallet_full\")\n        .setPassword(\"supersecretpassword123\")\n        .setNetworkType(MoneroNetworkType.STAGENET)\n        .setServerUri(\"http://localhost:38081\")\n        .setServerUsername(\"superuser\")\n        .setServerPassword(\"abctesting123\")\n        .setSeed(\"hefty value scenic...\")\n        .setRestoreHeight(573936l));\n\n// synchronize the wallet and receive progress notifications\nwalletFull.sync(new MoneroWalletListener() {\n  @Override\n  public void onSyncProgress(long height, long startHeight, long endHeight, double percentDone, String message) {\n    // feed a progress bar?\n  }\n});\n\n// synchronize in the background every 5 seconds\nwalletFull.startSyncing(5000l);\n\n// receive notifications when funds are received, confirmed, and unlocked\nwalletFull.addListener(new MoneroWalletListener() {\n  @Override\n  public void onOutputReceived(MoneroOutputWallet output) {\n    BigInteger amount = output.getAmount();\n    String txHash = output.getTx().getHash();\n    Boolean isConfirmed = output.getTx().isConfirmed();\n    Boolean isLocked = output.getTx().isLocked();\n    FUNDS_RECEIVED = true;\n  }\n});\n\n// connect to wallet RPC and open wallet\nMoneroWalletRpc walletRpc = new MoneroWalletRpc(\"http://localhost:38083\", \"rpc_user\", \"abc123\");\nwalletRpc.openWallet(\"sample_wallet_rpc\", \"supersecretpassword123\");\nString primaryAddress = walletRpc.getPrimaryAddress();  // 555zgduFhmKd2o8rPUz...\nBigInteger balance = walletRpc.getBalance();            // 533648366742\nList\u003cMoneroTxWallet\u003e txs = walletRpc.getTxs();          // get transactions containing transfers to/from the wallet\n\n// send funds from RPC wallet to full wallet\nMoneroTxWallet createdTx = walletRpc.createTx(new MoneroTxConfig()\n        .setAccountIndex(0)\n        .setAddress(walletFull.getAddress(1, 0))\n        .setAmount(\"250000000000\") // send 0.25 XMR (denominated in atomic units)\n        .setRelay(false)); // create transaction and relay to the network if true\nBigInteger fee = createdTx.getFee(); // \"Are you sure you want to send... ?\"\nwalletRpc.relayTx(createdTx); // relay the transaction\n\n// recipient receives unconfirmed funds within 5 seconds\nTimeUnit.SECONDS.sleep(5);\nassertTrue(FUNDS_RECEIVED);\n\n// save and close wallet\nwalletFull.close(true);\n```\n\n## Documentation\n\n* [Javadoc](https://woodser.github.io/monero-java/javadocs/index.html)\n* [API and model overview with visual diagrams](https://woodser.github.io/monero-java/monero-spec.pdf)\n* [JUnit tests](src/test/java)\n* [Using TOR](docs/tor.md)\n* [monero-ts documentation](https://github.com/woodser/monero-ts#documentation) provides additional documentation which translates to monero-java\n\n## Using monero-java in your project\n\n#### For Gradle, add to build.gradle:\n\n`compile 'io.github.woodser:monero-java:0.8.41'`\n\n#### For Maven, add to pom.xml:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.woodser\u003c/groupId\u003e\n  \u003cartifactId\u003emonero-java\u003c/artifactId\u003e\n  \u003cversion\u003e0.8.41\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### If using RPC servers:\n\n1. Download and install [Monero CLI](https://web.getmonero.org/downloads/).\n2. Start monerod, e.g.: `./monerod --stagenet` (or use a remote daemon).\n3. Start monero-wallet-rpc, e.g.: `./monero-wallet-rpc --daemon-address http://localhost:38081 --stagenet --rpc-bind-port 38083 --rpc-login rpc_user:abc123 --wallet-dir ./`\n\n\u003e [!NOTE]\n\u003e On Windows, if you want to use native wallets instead of monero-wallet-rpc, or if you want to process binary data, first install MSYS2:\n\u003e 1. Install [MSYS2](https://www.msys2.org/).\n\u003e 2. Environment variables \u003e System variables \u003e Path \u003e Edit \u003e New \u003e C:\\msys64\\mingw64\\bin\n\n## Building native libraries from source\n\nIf you want to use native wallets instead of monero-wallet-rpc, or if you want to process binary data, native libraries must be used for your specific platform.\n\nFor convenience, native libraries for Linux, macOS, and Windows are distributed with monero-java, but they can be built independently from source:\n\n### Linux and macOS\n\n1. Install [maven](https://maven.apache.org/download.cgi) for your system.\n2. Install a Java JDK for your system, for example:\u003cbr\u003e\n    ```\n    curl -s \"https://get.sdkman.io\" | bash\n    sdk install java 21.0.2.fx-librca\n    ```\n3. Clone the project repository: `git clone --recurse-submodules https://github.com/woodser/monero-java.git`\n4. `cd ./monero-java`\n5. Install Maven dependencies: `mvn install`\n6. Build the monero-cpp submodule (located at ./external/monero-cpp) as a native library by following [instructions](https://github.com/woodser/monero-cpp#using-monero-cpp-in-your-project) for your system.\n7. Build native libraries to ./build/: `./bin/build_libmonero_java.sh`\n\n### Windows\n\n1. Install [MSYS2](https://www.msys2.org/).\n2. Install Maven:\n\n    a. Download binary zip archive from https://maven.apache.org/download.cgi\u003cbr\u003e\n    b. Unpack to C:\\msys64\\usr\\local\n3. Environment variables \u003e System variables \u003e Path \u003e Edit \u003e New \u003e C:\\msys64\\mingw64\\bin\n4. Start MSYS2 MINGW64 or MSYS MINGW32 depending on your system and use for the following steps.\n5. Update packages: `pacman -Syu` and confirm at the prompts.\n6. Install dependencies. During installation, use default=all by leaving the input blank and pressing enter.\n\n    64-bit: `pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake git mingw-w64-x86_64-icu zip unzip`\n\n    32-bit: `pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake git mingw-w64-i686-icu`\n7. Install Java JDK:\n    ```\n    curl -s \"https://get.sdkman.io\" | bash\n    sdk install java 21.0.2.fx-librca\n    ```\n8. Set environment variables (replace with your paths):\n    ```\n    export MAVEN_HOME=/usr/local/apache-maven-3.x.x/\n    export PATH=$PATH:$JAVA_HOME/bin/:$MAVEN_HOME/bin/\n    ```\n9. Clone the project repository: `git clone --recurse-submodules https://github.com/woodser/monero-java.git`\n10. `cd ./monero-java`\n11. Install Maven dependencies: `mvn install`\n12. Build the monero-cpp submodule (located at ./external/monero-cpp) as a native library by following [instructions](https://github.com/woodser/monero-cpp#windows) for Windows.\n13. Build native libraries to ./build/: `./bin/build_libmonero_java.sh`\n\n### Loading native libraries\n\nAfter building the native libraries to the ./build folder, add them to `PATH`, your application's classpath, or explictly load them in Java by calling:\n\n```\nSystem.load(/absolute/path/to/libmonero-cpp.dll);\nSystem.load(/absolute/path/to/libmonero-java.dll);\n```\n\nAlternatively, you can bundle the libraries into monero-java's JAR:\n\n1. Copy the libraries to their respective folder in ./lib.\n2. `mvn install`\n3. Force update Maven snapshots: `mvn clean install -U`\n\nYou can verify the native libraries are working by running TestMoneroUtils.java.\n\n## Memory Growth\n\nIf you see unrestricted memory growth using native bindings, consider applying [jemalloc](https://jemalloc.net/) to improve memory management with `malloc`. In many cases, this can completely resolve the memory growth.\n\nFor example: `export LD_PRELOAD=/path/to/libjemalloc.a` then run your app.\n\n## Running JUnit tests\n\n1. Clone the project repository: `git clone --recurse-submodules https://github.com/woodser/monero-java.git`\n2. `cd monero-java`\n3. Start RPC servers:\n\t1. Download and install [Monero CLI](https://web.getmonero.org/downloads/).\n\t2. Start monerod, e.g.: `./monerod --stagenet` (or use a remote daemon).\n\t3. Start monero-wallet-rpc, e.g.: `./monero-wallet-rpc --daemon-address http://localhost:38081 --stagenet --rpc-bind-port 38083 --rpc-login rpc_user:abc123 --wallet-dir ./`\n4. Configure the appropriate RPC endpoints, authentication, and other settings in [TestUtils.java](src/test/java/utils/TestUtils.java).\n5. Run all *.java files in src/test/java as JUnits.\n\n## Related projects\n\n* [monero-ts](https://github.com/woodser/monero-ts)\n* [monero-cpp](https://github.com/woodser/monero-cpp)\n* [Haveno](https://github.com/haveno-dex/haveno)\n\n## License\n\nThis project is licensed under MIT.\n\n## Donations\n\nIf this library has been valuable to you, please consider donating to support its continued development.\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"donate.png\" width=\"115\" height=\"115\"/\u003e\u003cbr\u003e\n\t\u003ccode\u003e46FR1GKVqFNQnDiFkH7AuzbUBrGQwz2VdaXTDD4jcjRE8YkkoTYTmZ2Vohsz9gLSqkj5EM6ai9Q7sBoX4FPPYJdGKQQXPVz\u003c/code\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Other Wallets"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodser%2Fmonero-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoodser%2Fmonero-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodser%2Fmonero-java/lists"}