Skip to content

Commit

Permalink
Merge pull request #11 from lemois-1337/mainnet_karlsenhashv2
Browse files Browse the repository at this point in the history
Mainnet hf_daa_score set to 26962009 to switch to khashv2
  • Loading branch information
lemois-1337 authored Aug 29, 2024
2 parents bc172c5 + 8153ca5 commit 565ac13
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions consensus/core/src/config/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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]
Expand Down
7 changes: 3 additions & 4 deletions consensus/core/src/config/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -414,7 +413,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 {
Expand Down Expand Up @@ -519,7 +518,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 {
Expand Down

0 comments on commit 565ac13

Please sign in to comment.