DogecoinJ is a Java library that implements the Dogecoin protocol, allowing you to maintain a wallet and send/receive transactions without needing a local copy of Dogecoin Core. It's a fork of the excellent bitcoinj library, specifically adapted for the Dogecoin blockchain.
Current Version: 0.18-doge (based on bitcoinj 0.18-SNAPSHOT)
This project was originally adapted by langerhans and has been updated to the latest bitcoinj release by Paulo Vidal (@inevitable360) to bring you the most current features and security updates while maintaining full Dogecoin compatibility.
- Full Dogecoin Support: Complete implementation of the Dogecoin protocol
- SPV (Simplified Payment Verification): Lightweight wallet without downloading the entire blockchain
- Modern Java: Built with Java 17+ and modern build tools
- Dogecoin-Specific Parameters: Optimized for Dogecoin's unique characteristics
- Much Lower Fees: Implements current Dogecoin fee structure (0.01 DOGE per kB)
- Community Driven: Maintained by the Dogecoin community for the Dogecoin community
This fork includes several Dogecoin-specific optimizations:
- Transaction Fees: 0.01 DOGE per kilobyte (much lower than Bitcoin)
- Dust Limit: 1 DOGE per output
- Fee Calculation: Based on exact transaction size for precision
- Smallest Unit: Koinu (0.00000001 DOGE) - Dogecoin's equivalent to Bitcoin's Satoshi
- 1 DOGE = 100,000,000 Koinu (like Bitcoin's 100,000,000 Satoshis)
- Koinu = 0.00000001 DOGE (smallest possible unit)
- Fee per kB = 1,000,000 Koinu (0.01 DOGE)
- Dust limit = 100,000,000 Koinu (1 DOGE)
- Coins Supply: 10,000 DOGE per block (vs 21 Million Bitcoin limitation )
- Block Time: ~1 minute (vs Bitcoin's 10 minutes)
- Difficulty Adjustment: Every block (vs Bitcoin's 2016 blocks)
- Network Stability: Enhanced stall handling for Dogecoin's faster block times
- Package Structure: Uses
org.dogecoinj
packages for clear Dogecoin focus
DogecoinJ maintains full compatibility with the original bitcoinj API while adding Dogecoin-specific optimizations:
Feature | bitcoinj | DogecoinJ |
---|---|---|
Target Network | Bitcoin | Dogecoin |
Package Names | org.bitcoinj.* |
org.dogecoinj.* |
Transaction Fees | Bitcoin fee structure | 0.01 DOGE per kB |
Max Coins | Limitation of 21 million BTC | Fixed Supply 10 k DOGE per Block |
Block Time | 10 minutes | ~1 minute |
Network Stability | Standard | Enhanced for faster blocks |
Fee Calculation | Complex | Simplified Dogecoin logic |
API Compatibility: All bitcoinj APIs work the same way - just import from org.dogecoinj
instead of org.bitcoinj
!
- Java 17+ (required)
- Gradle 7.3+ (for building)
git clone https://github.com/qlpqlp/dogecoinj.git
cd dogecoinj
git checkout master # Use the updated branch
gradle clean build
Add DogecoinJ to your project dependencies:
Gradle:
dependencies {
implementation 'org.dogecoinj:dogecoinj-core:0.18-doge'
implementation 'org.dogecoinj:dogecoinj-base:0.18-doge'
}
Maven:
<dependency>
<groupId>org.dogecoinj</groupId>
<artifactId>dogecoinj-core</artifactId>
<version>0.18-doge</version>
</dependency>
<dependency>
<groupId>org.dogecoinj</groupId>
<artifactId>dogecoinj-base</artifactId>
<version>0.18-doge</version>
</dependency>
import org.dogecoinj.core.*;
import org.dogecoinj.crypto.*;
import org.dogecoinj.params.MainNetParams;
public class DogecoinAddressExample {
public static void main(String[] args) {
// Use Dogecoin mainnet parameters
NetworkParameters params = MainNetParams.get();
// Generate a new key pair
ECKey key = new ECKey();
// Create a Dogecoin address
Address address = LegacyAddress.fromKey(params, key);
System.out.println("Dogecoin Address: " + address.toString());
System.out.println("Private Key: " + key.getPrivateKeyAsHex());
System.out.println("Amount in Koinu: " + amount.toSat() + " Koinu");
}
}
import org.dogecoinj.core.*;
import org.dogecoinj.kits.WalletAppKit;
import org.dogecoinj.params.MainNetParams;
public class DogecoinTransactionExample {
public static void main(String[] args) throws Exception {
NetworkParameters params = MainNetParams.get();
// Create wallet kit
WalletAppKit kit = new WalletAppKit(params, new File("."), "dogecoin-wallet");
kit.startAsync();
kit.awaitRunning();
// Wait for wallet to sync
kit.wallet().allowSpendingUnconfirmedTransactions();
// Create transaction
Address recipient = LegacyAddress.fromBase58(params, "DTqAFgNNUgiPEfGmc4HZUkqJ4sz5vADd1n");
Coin amount = Coin.valueOf(100000000); // 1 DOGE = 100,000,000 Koinu
SendRequest sendRequest = SendRequest.to(recipient, amount);
sendRequest.feePerKb = Transaction.DEFAULT_TX_FEE; // 0.01 DOGE per kB
// Send transaction
Wallet.SendResult result = kit.wallet().sendCoins(kit.peerGroup(), sendRequest);
result.broadcastComplete.get(); // Wait for confirmation
System.out.println("Transaction sent! Hash: " + result.tx.getTxId());
}
}
import org.dogecoinj.core.*;
import org.dogecoinj.kits.WalletAppKit;
import org.dogecoinj.params.MainNetParams;
public class DogecoinSPVNode {
public static void main(String[] args) throws Exception {
NetworkParameters params = MainNetParams.get();
// Create SPV node
WalletAppKit kit = new WalletAppKit(params, new File("."), "dogecoin-spv") {
@Override
protected void onSetupCompleted() {
// Add wallet listener
wallet().addCoinsReceivedEventListener((wallet, tx, prevBalance, newBalance) -> {
System.out.println("Received: " + tx.getValueSentToMe(wallet()) + " DOGE");
});
}
};
// Start the node
kit.startAsync();
kit.awaitRunning();
System.out.println("Dogecoin SPV node is running!");
System.out.println("Wallet balance: " + kit.wallet().getBalance() + " DOGE");
// Keep running
Thread.sleep(Long.MAX_VALUE);
}
}
dogecoinj/
βββ base/ # Core Dogecoin types (Coin, Address, etc.)
βββ core/ # Main Dogecoin protocol implementation
βββ examples/ # Example applications
βββ tools/ # Command-line tools
βββ wallettemplate/ # JavaFX wallet template
βββ wallettool/ # Wallet management tool
- β Updated to bitcoinj 0.18-SNAPSHOT: Latest features and security updates
- β Modernized build system: Gradle 7.3+ and Java 17+ support
- β Updated fee structure: Now uses official Dogecoin Core recommendations (0.01 DOGE per kB)
- β Enhanced network stability: Better handling of Dogecoin's faster block times
- β Complete examples: Ready-to-run code for common Dogecoin operations
- β Proper attribution: Full credit to all contributors and original work
- β Community focus: Built by and for the Dogecoin community
- Current Branch:
master
(contains all latest updates) - Stable: Ready for production use
- Maintained: Actively updated and maintained
- Community: Open to contributions and feedback
We welcome contributions from the Dogecoin community! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the COPYING file for details.
- Original bitcoinj: This project is based on the excellent bitcoinj library by the BitcoinJ team
- Initial Dogecoin adaptation: langerhans for the original Dogecoin fork
- Current maintainer: Paulo Vidal (@inevitable360) for updating and maintaining this fork
- Dogecoin Community: For the continued support and feedback
- Repository: https://github.com/qlpqlp/dogecoinj
- Original bitcoinj: https://github.com/bitcoinj/bitcoinj
- Dogecoin Core: https://github.com/dogecoin/dogecoin
- Dogecoin Website: https://dogecoin.com
DogecoinJ brings the power of the Dogecoin blockchain to Java developers everywhere. Whether you're building a wallet, a payment processor, or just want to experiment with Dogecoin, DogecoinJ has you covered!
To the moon! π
Made with β€οΈ by the Dogecoin Community
Such code, much wow!