Java Wallet is a production-oriented Spring Boot wallet platform for centralized exchanges, payment systems, and custodial services.
It provides unified wallet management, blockchain synchronization, deposit detection, sweep automation, and admin tooling in a single deployable service.
This repository is converging to a single-service architecture to make deployment and operations simpler:
- One Spring Boot service (sources under
src/; root Gradle module) - No RabbitMQ dependency
- No xxl-job dependency
- HSM / signing invoked in-process via tokencore
com.github.galaxyscitech:tokencore:2.0.1 - Optional external HTTP signer when
wallet_chain_config.signing_backend=EXTERNAL(seewallet.external-signerinapplication.yml)
This means fewer moving parts, easier troubleshooting, and faster onboarding for developers and DevOps teams.
- Wallet lifecycle management: create, query, and manage wallet addresses
- Deposit scanning: continuously detect inbound transfers
- Chain synchronization: sync on-chain data into internal services
- Sweep automation: consolidate balances based on strategy
- Fee supply scheduling: ensure fee accounts are topped up when needed
- Admin operations: operational controls and configuration through admin APIs
Use Java Wallet as the deposit/withdrawal backend for multi-chain assets:
- Generate deposit addresses per user
- Detect incoming deposits and credit user balances
- Sweep funds from hot collection addresses to treasury/cold paths
Integrate chain deposits as payment rails:
- Assign invoice addresses
- Confirm on-chain settlement
- Trigger internal payment workflows after confirmations
Operate managed wallets for institutional users:
- Centralize key and wallet operations
- Track chain states
- Keep operational history with admin audit logs
docker compose up -d --buildServices:
app:http://localhost:8080mysql:localhost:3306
./gradlew bootRunInitialize the database from db/wallet_db.sql. If you already have wallet_chain_config, apply db/002_wallet_chain_signing_backend.sql for the signing_backend column.
| Area | Notes |
|---|---|
| JDBC | DB_URL, DB_USERNAME, DB_PASSWORD (see .env.example) |
| Keystore | KEYSTORE_DIR, WALLET_KEYSTORE_PASSWORD |
| Testnet signing | ETH_SIGN_CHAIN_ID (e.g. 11155111 for Sepolia), BTC_SIGN_CHAIN_ID (0 mainnet / 1 testnet) |
| Metrics | Actuator: /actuator/health, /actuator/prometheus |
| Gas fallback | Optional ETH_GAS_FALLBACK_URL in sys_config if the node does not expose eth_gasPrice |
- Point
ETH_RPC_URLinconfig(or env) to a Sepolia (or other testnet) HTTP endpoint. - Set
ETH_SIGN_CHAIN_ID=11155111and fund a test hot wallet. - Run
./gradlew bootRunand exercise withdraw/collect paths from Swagger or your integration client.
- Start services using Docker Compose.
- Open Swagger UI:
http://localhost:8080/swagger-ui/index.html - Check health/basic endpoints from Swagger.
- Create or query wallet resources via Wallet API.
- Observe scheduler-driven behaviors (deposit scan, sync, sweep) via logs and DB state.
If you are new to this project, using Swagger first is the fastest way to understand request/response models.
- Wallet API:
/wallet/v1 - Blockchain API:
/block_chain/v1 - Admin API:
/admin - Swagger UI:
/swagger-ui/index.html
Runtime scheduler behavior is controlled through sys_config keys:
SCHEDULER_DEPOSIT_SCAN_ENABLEDSCHEDULER_DEPOSIT_SCAN_MSSCHEDULER_CHAIN_SYNC_ENABLEDSCHEDULER_CHAIN_SYNC_MSSCHEDULER_SWEEP_ENABLEDSCHEDULER_SWEEP_MSSCHEDULER_FEE_SUPPLY_ENABLEDSCHEDULER_FEE_SUPPLY_MS
Suggestion: keep intervals conservative in production first, then tune based on chain throughput and DB load.
- Never use default passwords in production.
- Never expose keystore passwords, mnemonic phrases, or private keys in logs.
- Mask RPC credentials in admin/management outputs.
- Restrict admin endpoints with network controls and strong authentication.
- Audit table:
wallet_admin_audit_log(admin configuration change history)
To make this project even easier for users, consider adding:
- Architecture diagram (single-service + MySQL + chain nodes)
- End-to-end demo flow (create address → deposit → detect → sweep)
- API cookbook with copy-paste
curlexamples - Environment matrix (
dev/staging/prod) with recommended defaults - Troubleshooting guide (common startup, DB, RPC, and sync issues)
- FAQ for operations and security best practices
These additions reduce onboarding time and lower support burden.