From 13962d41ffc19b4fe6403c2bed5e11889575f5d5 Mon Sep 17 00:00:00 2001 From: Lemois 1337 Date: Fri, 23 Aug 2024 18:39:11 +0200 Subject: [PATCH 1/3] Align Rust 'hf_daa_score' with Golang 'HFDAAScore' --- consensus/core/src/config/params.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/core/src/config/params.rs b/consensus/core/src/config/params.rs index 48b845e..b777403 100644 --- a/consensus/core/src/config/params.rs +++ b/consensus/core/src/config/params.rs @@ -414,7 +414,7 @@ pub const TESTNET_PARAMS: Params = Params { skip_proof_of_work: false, max_block_level: 250, pruning_proof_m: 1000, - hf_daa_score: 0, + hf_daa_score: 6000000, }; pub const TESTNET11_PARAMS: Params = Params { @@ -519,7 +519,7 @@ pub const SIMNET_PARAMS: Params = Params { skip_proof_of_work: true, // For simnet only, PoW can be simulated by default max_block_level: 250, - hf_daa_score: 0, + hf_daa_score: 50, }; pub const DEVNET_PARAMS: Params = Params { From 964e53b6f48dfe79d23e8a17934e6ca83fce8a20 Mon Sep 17 00:00:00 2001 From: Lemois 1337 Date: Wed, 28 Aug 2024 23:57:29 +0200 Subject: [PATCH 2/3] Mainnet hf_daa_score set to 26962009 to switch to khashv2 --- consensus/core/src/config/genesis.rs | 8 ++++---- consensus/core/src/config/params.rs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/consensus/core/src/config/genesis.rs b/consensus/core/src/config/genesis.rs index dfad3c7..5ec5daa 100644 --- a/consensus/core/src/config/genesis.rs +++ b/consensus/core/src/config/genesis.rs @@ -196,9 +196,9 @@ pub const SIMNET_GENESIS: GenesisBlock = GenesisBlock { // Karlsen migrated pub const DEVNET_GENESIS: GenesisBlock = GenesisBlock { hash: Hash::from_bytes([ - 0x1b, 0x9b, 0xe8, 0x0e, 0xd3, 0x60, 0xb5, 0x1c, 0x95, 0xed, 0x15, 0x1d, 0x0f, 0x08, 0x03, - 0x5c, 0x8e, 0xc0, 0x1e, 0x86, 0xea, 0xb3, 0x14, 0x49, 0xe3, 0xe4, 0x96, 0xe0, 0x96, 0xb1, - 0xee, 0x43, + 0xcb, 0x1b, 0x9e, 0x97, 0x2c, 0x04, 0x3e, 0xc9, 0x98, 0xc4, 0x36, 0x13, 0x46, 0x45, 0x04, + 0xe1, 0x7d, 0xf2, 0xa4, 0x5a, 0x8a, 0x6a, 0xa1, 0x16, 0x21, 0xd9, 0x4b, 0x87, 0x6d, 0x69, + 0xe0, 0xd4, ]), version: 0, hash_merkle_root: Hash::from_bytes([ @@ -208,7 +208,7 @@ pub const DEVNET_GENESIS: GenesisBlock = GenesisBlock { ]), utxo_commitment: EMPTY_MUHASH, timestamp: 0x11e9db49828, - bits: 0x1e21bc1c, // Bits with ~testnet-like difficulty for slow devnet start + bits: 0x1f4ee5fb, nonce: 0x48e5e, daa_score: 0, #[rustfmt::skip] diff --git a/consensus/core/src/config/params.rs b/consensus/core/src/config/params.rs index b777403..5d3cea3 100644 --- a/consensus/core/src/config/params.rs +++ b/consensus/core/src/config/params.rs @@ -356,8 +356,7 @@ pub const MAINNET_PARAMS: Params = Params { skip_proof_of_work: false, max_block_level: 225, pruning_proof_m: 1000, - // todo: define the fork date DAAscore - hf_daa_score: 42000042, + hf_daa_score: 26962009, // HF DAAscore to switch to khashv2 (Fri Sep 13 01:37:00 PM UTC 2024) }; pub const TESTNET_PARAMS: Params = Params { From 8153ca51089001b33a730ac6a33c6f435fb6f5eb Mon Sep 17 00:00:00 2001 From: Lemois 1337 Date: Thu, 29 Aug 2024 11:46:34 +0200 Subject: [PATCH 3/3] Updated README.md and added khashv1 and khashv2 paragraph --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index 608fd10..ecc86be 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,50 @@ in the primary codebase will be shared back. The Karlsen Network team believes in decentralization and small-scale miners. We will ensure long-term GPU-friendly mining. +### Hashing Function + +We initially started with `kHeavyHash` and `blake3` modifications +on-top. This algorithm is called `KarlsenHashv1`. + +`KarlsenHashv1` is currently used in [mainnet](https://github.com/karlsen-network/karlsend/releases/tag/v1.1.0) +and can be mined using the following miners maintained by the Karlsen +developers: + +* Karlsen [CPU miner](https://github.com/karlsen-network/karlsend) from Golang `karlsend` +* Karlsen [GPU miner](https://github.com/karlsen-network/karlsen-miner) + as reference implementation of `kHeavyHash` with `blake3`. + +The following third-party miners are available and have added +`KarlsenHashv1`: + +* [lolMiner](https://github.com/Lolliedieb/lolMiner-releases) +* [Team Red Miner](https://github.com/todxx/teamredminer) +* [SRBMiner](https://github.com/doktor83/SRBMiner-Multi) +* [BzMiner](https://github.com/bzminer/bzminer) +* [Rigel](https://github.com/rigelminer/rigel) +* [GMiner](https://github.com/develsoftware/GMinerRelease) + +`KarlsenHashv2` will become active via hardfork at DAA score `26.962.009`. +It is based on [FishHash](https://github.com/iron-fish/fish-hash/blob/main/FishHash.pdf) +written from scratch in our Rust node implementation. It is FPGA/ASIC +resistent. It is the worlds first implementation of FishHash in Rust in +`mainnet` in a 1bps blockchain. + +`KarlsenHashv2` is currently used in [mainnet](https://github.com/karlsen-network/karlsend/releases/tag/v2.1.0) +and can be mined using the following miners maintained by the Karlsen +developers: + +* Karlsen [CPU miner](https://github.com/karlsen-network/karlsend/releases/tag/v2.1.0) from Golang `karlsend` +* Karlsen [GPU miner](https://github.com/karlsen-network/karlsen-miner/releases/tag/v2.0.0) + as bleeding edge and unoptimized reference implementation of + `KarlsenHashv2`. Please follow the steps in the [README.md](https://github.com/karlsen-network/karlsen-miner/blob/main/README.md) + to generate a DAG file. + +The following third-party miners are available and have added +`KarlsenHashv2`: + +* [SRBMiner](https://github.com/doktor83/SRBMiner-Multi) + ## Smart Contracts The Karlsen Network team is launching an R&D project to connect the