diff --git a/src/Miningcore/Blockchain/Kaspa/KaspaConstants.cs b/src/Miningcore/Blockchain/Kaspa/KaspaConstants.cs index 13d7b8ebc..654169644 100644 --- a/src/Miningcore/Blockchain/Kaspa/KaspaConstants.cs +++ b/src/Miningcore/Blockchain/Kaspa/KaspaConstants.cs @@ -24,6 +24,15 @@ public static class HoosatConstants public const string ChainPrefixMainnet = "hoosat"; } +public static class KobradagConstants +{ + // List of Kobra prefixes: + public const string ChainPrefixDevnet = "kobradev"; + public const string ChainPrefixSimnet = "kobrasim"; + public const string ChainPrefixTestnet = "kobratest"; + public const string ChainPrefixMainnet = "kobra"; +} + public static class KaspaConstants { public const string WalletDaemonCategory = "wallet"; diff --git a/src/Miningcore/Blockchain/Kaspa/KaspaJobManager.cs b/src/Miningcore/Blockchain/Kaspa/KaspaJobManager.cs index 65602ccc8..3fdfa7f78 100644 --- a/src/Miningcore/Blockchain/Kaspa/KaspaJobManager.cs +++ b/src/Miningcore/Blockchain/Kaspa/KaspaJobManager.cs @@ -224,6 +224,21 @@ private KaspaJob CreateJob(long blockHeight) customBlockHeaderHasher = new Blake3(hashBytes); } + if(customCoinbaseHasher is not Blake3) + customCoinbaseHasher = new Blake3(); + + if(customShareHasher is not Blake3) + customShareHasher = new Blake3(); + + return new PyrinJob(customBlockHeaderHasher, customCoinbaseHasher, customShareHasher); + case "KODA": + if(customBlockHeaderHasher is not Blake3) + { + string coinbaseBlockHash = KaspaConstants.CoinbaseBlockHash; + byte[] hashBytes = Encoding.UTF8.GetBytes(coinbaseBlockHash.PadRight(32, '\0')).Take(32).ToArray(); + customBlockHeaderHasher = new Blake3(hashBytes); + } + if(customCoinbaseHasher is not Blake3) customCoinbaseHasher = new Blake3(); diff --git a/src/Miningcore/Blockchain/Kaspa/KaspaUtils.cs b/src/Miningcore/Blockchain/Kaspa/KaspaUtils.cs index b32b92a8f..43e3f1200 100644 --- a/src/Miningcore/Blockchain/Kaspa/KaspaUtils.cs +++ b/src/Miningcore/Blockchain/Kaspa/KaspaUtils.cs @@ -383,6 +383,16 @@ public KaspaAddressUtility(string coinSymbol = "KAS") { HoosatConstants.ChainPrefixSimnet, KaspaBech32Prefix.KaspaSim }, }; + break; + case "KODA": + this.stringsToBech32Prefixes = new Dictionary + { + { KobradagConstants.ChainPrefixMainnet, KaspaBech32Prefix.KaspaMain }, + { KobradagConstants.ChainPrefixDevnet, KaspaBech32Prefix.KaspaDev }, + { KobradagConstants.ChainPrefixTestnet, KaspaBech32Prefix.KaspaTest }, + { KobradagConstants.ChainPrefixSimnet, KaspaBech32Prefix.KaspaSim }, + }; + break; case "KLS": this.stringsToBech32Prefixes = new Dictionary diff --git a/src/Miningcore/Configuration/ClusterConfigExtensions.cs b/src/Miningcore/Configuration/ClusterConfigExtensions.cs index 519466ffc..a6a5fb721 100644 --- a/src/Miningcore/Configuration/ClusterConfigExtensions.cs +++ b/src/Miningcore/Configuration/ClusterConfigExtensions.cs @@ -264,6 +264,7 @@ public override string GetAlgorithmName() return "Karlsenhash"; case "CAS": case "HTN": + case "KODA": case "PYI": return "Pyrinhash"; default: diff --git a/src/Miningcore/coins.json b/src/Miningcore/coins.json index c48af22d6..4144390f6 100644 --- a/src/Miningcore/coins.json +++ b/src/Miningcore/coins.json @@ -5155,5 +5155,19 @@ "explorerBlockLink": "https://explorer.sedracoin.com/blocks/$hash$", "explorerTxLink": "https://explorer.sedracoin.com/txs/{0}", "explorerAccountLink": "https://explorer.sedracoin.com/addresses/{0}" + }, + "kobradag": { + "name": "Kobradag", + "canonicalName": "Kobradag", + "symbol": "KODA", + "family": "kaspa", + "website": "https://k0bradag.com/", + "market": "", + "twitter": "https://twitter.com/k0bradag", + "telegram": "https://t.me/k0bradag", + "discord": "https://discord.com/invite/ahnm5zENqg", + "explorerBlockLink": "https://explorer.kobradag.online/blocks/$hash$", + "explorerTxLink": "https://explorer.kobradag.online/txs/{0}", + "explorerAccountLink": "https://explorer.kobradag.online/addresses/{0}" } }