Cryptocurrency adoption is accelerating across e-commerce, financial services, and digital marketplaces. For developers building on centralized platforms, integrating secure and scalable crypto payment functionality has become a critical requirement. Tues Pay emerges as a powerful, open-source Java SDK designed specifically to streamline cryptocurrency integration into centralized systems.
Built with modularity and scalability in mind, Tues Pay currently supports Bitcoin (BTC), Ethereum (ETH), and ERC20 token payments—enabling businesses to accept crypto deposits, process withdrawals, and facilitate digital product purchases with minimal development overhead.
Whether you're building a fintech platform, an online store, or a blockchain-powered service, Tues Pay offers a robust foundation for adding crypto capabilities using familiar Java-based tooling.
👉 Discover how seamless crypto integration can transform your platform
Modular Architecture for Scalable Crypto Integration
Tues Pay follows a clean, component-based architecture that separates concerns and promotes maintainability. Each module serves a distinct purpose, allowing developers to integrate only what they need while retaining the ability to scale.
tues-pay
├── tues-bitcoin -- Bitcoin service implementation
├── tues-core -- Core cryptographic and service utilities
├── tues-erc20 -- ERC20 token handling module
├── tues-eth -- Ethereum payment processing
└── tues-ethereum-core -- Shared Ethereum infrastructure
docs -- Setup and configuration guides
sql -- Database schema scriptsThis modular design ensures that teams can easily extend support to new cryptocurrencies by following existing patterns. The separation of core logic from blockchain-specific implementations enhances testability and reduces coupling.
At the heart of the system lies tues-core, which provides essential utilities such as encrypted configuration management, wallet address generation, transaction parsing, and database interaction layers. This central dependency ensures consistent behavior across all supported currencies.
How Tues Pay Works: From Deposit to Confirmation
Understanding the workflow behind crypto transactions is crucial for ensuring reliability and security in production environments. Tues Pay employs a two-phase verification mechanism powered by scheduled background tasks that continuously monitor blockchain activity.
Step 1: Generate a Recharge Order
When a user initiates a deposit, your application calls the appropriate API endpoint:
/{currencyName}/createRecharge/{orderId}/{amount}Replace currencyName with bitcoin, eth, or an ERC20 token symbol. The system generates a unique wallet address tied to the provided orderId and amount. This mapping is securely stored in the database.
For example:
/bitcoin/createRecharge/order_12345/0.05This creates a BTC recharge order requiring exactly 0.05 BTC sent to a newly generated address.
Step 2: Blockchain Monitoring via Node Scanning
Tues Pay connects directly to self-hosted blockchain nodes (Bitcoin Core, Geth, etc.) set up according to the documentation in the docs directory.
A scheduled task scans the blockchain starting from block height 0 up to the latest block. It parses every transaction within each block, checking for incoming transfers that match:
- A known recharge address in the system
- The exact expected amount (or within acceptable tolerance if configured)
Once a match is found, the corresponding recharge record is marked as "confirmed" in the database.
Step 3: Transaction Finality Verification
To prevent double-spending and ensure transaction immutability, a second background job monitors confirmed transactions. It checks how many block confirmations exist for each matched transaction.
When the number of confirmations meets the threshold defined in the system configuration (e.g., 6 confirmations for Bitcoin), the deposit is finalized and marked as successful. At this point, your application can credit the user's account or fulfill their purchase.
This dual-layer verification process ensures both accuracy and security—critical for financial applications processing real-world value.
Deployment Guide: Setting Up Tues Pay
Deploying Tues Pay requires careful attention to infrastructure setup and security practices. Follow these steps to ensure a smooth and secure integration.
1. Set Up Your Blockchain Nodes
Refer to the detailed guides in the docs folder to deploy full nodes for:
- Bitcoin Core (for BTC support)
- Geth or OpenEthereum (for ETH and ERC20 tokens)
Running your own nodes eliminates reliance on third-party APIs and enhances privacy and control over transaction data.
2. Secure Sensitive Configuration Data
Never expose credentials in plaintext. Tues Pay includes the EncryptPropertiesUtils utility class within the tues-core module to encrypt sensitive information such as:
- Node RPC usernames and passwords
- Database connection strings
- Wallet encryption keys
Use this tool to encode secrets before placing them in configuration files like application.yml or application.properties.
Example usage:
String encrypted = EncryptPropertiesUtils.encrypt("my-secret-password");Store only the encrypted values in config files, and let the SDK handle decryption at runtime.
3. Initialize the Database
Run the SQL script located at sql/wallet.sql to create the required tables for storing:
- Recharge orders
- Wallet addresses
- Transaction hashes
- Confirmation statuses
Ensure your MySQL instance is properly secured and accessible only from trusted services.
Again, encrypt your database credentials using EncryptPropertiesUtils before configuring the connection.
4. Build and Run
Package the project using Maven:
mvn clean packageThen launch the service:
java -jar tues-pay.jarYou can deploy this JAR file on any server environment supporting Java 8+—ideal for cloud instances, containerized deployments (Docker/Kubernetes), or on-premise servers.
👉 See how leading platforms simplify crypto onboarding
Why Use Tues Pay? Key Advantages
- ✅ Open-source transparency: Full visibility into code logic and security mechanisms.
- ✅ Self-hosted infrastructure: No dependency on external APIs; full control over data.
- ✅ Java-native development: Leverages JVM ecosystem tools familiar to enterprise developers.
- ✅ Support for major cryptocurrencies: Immediate support for BTC, ETH, and any ERC20 token.
- ✅ Secure by design: Built-in encryption for configurations and modular isolation of critical components.
These features make Tues Pay particularly suitable for regulated industries where compliance, auditability, and data sovereignty are paramount.
Frequently Asked Questions (FAQ)
Q: Can I use Tues Pay without running my own blockchain node?
A: While technically possible using remote node services, running your own node is strongly recommended. It ensures data integrity, improves privacy, and avoids rate limits or downtime from third-party providers.
Q: Does Tues Pay support withdrawal functionality?
A: Yes. Although the documentation focuses on recharge workflows, the underlying modules provide tools for constructing and broadcasting outbound transactions. You can extend the SDK to support withdrawals by implementing payout logic securely.
Q: How does it handle partial or overpayments?
A: By default, Tues Pay matches exact amounts. However, you can customize tolerance thresholds in configuration files to accept slight overpayments (e.g., due to network fees). Underpayments are typically ignored unless custom logic is added.
Q: Is there support for other blockchains like Solana or Binance Smart Chain?
A: Currently, only Bitcoin and Ethereum-based assets are supported. However, the modular architecture makes it feasible to add support for EVM-compatible chains like BSC with minimal changes.
Q: What happens if the scanner misses a transaction during initial sync?
A: The scanner starts from block 0 and runs continuously. Even if a transaction was missed temporarily (e.g., due to downtime), restarting the service will resume scanning from the last processed block, ensuring eventual consistency.
Q: How often are blocks scanned?
A: Scanning frequency is configurable via Spring Scheduler settings. Default intervals range from 30 seconds to 5 minutes depending on network load and performance requirements.
Final Thoughts: Building the Future of Crypto Payments
As digital currencies gain mainstream traction, businesses must adapt quickly to offer seamless crypto experiences. Tues Pay lowers the technical barrier for Java-based enterprises looking to integrate Bitcoin, Ethereum, and tokenized assets securely.
With its clear structure, secure defaults, and transparent operation model, Tues Pay stands out as a reliable choice for developers who value control, auditability, and long-term maintainability.