Skip to content

list Kerrigan (KRGN)#1791

Open
JSKitty wants to merge 1 commit into
GLEECBTC:masterfrom
JSKitty:add-kerrigan
Open

list Kerrigan (KRGN)#1791
JSKitty wants to merge 1 commit into
GLEECBTC:masterfrom
JSKitty:add-kerrigan

Conversation

@JSKitty

@JSKitty JSKitty commented Apr 12, 2026

Copy link
Copy Markdown

Kerrigan Network (KRGN)

Privacy-first Layer 1 blockchain with optional Sapling shielded transactions.

Coin details

  • Ticker: KRGN
  • Full name: Kerrigan
  • Protocol: UTXO (Dash fork, multi-algo PoW)
  • PoW algorithms: X11, KawPoW, Equihash(192,7), Equihash(200,9)
  • Block time: 120 seconds (combined)
  • RPC port: 7121
  • pubtype: 45 (addresses start with K)
  • p2shtype: 16
  • wiftype: 204
  • txfee: 1000
  • dust: 546
  • Source: https://github.com/kerrigan-network/kerrigan
  • Homepage: https://kerrigan.network

ElectrumX servers

Host SSL TCP
electrum-kerrigan.jskitty.cat 50002 50001

Contact: notjskitty (Discord)

Explorers

Testing

Verified end-to-end with Komodo DeFi Framework v3.0.0-beta:

  • Coin activation via ElectrumX (SSL + TCP)
  • Balance queries
  • Deposit (confirmed on-chain, balance updated)
  • Withdrawal (tx built, signed, broadcast, confirmed)

Files changed

  • coins — KRGN entry
  • electrums/KRGN — ElectrumX server config (SSL + TCP)
  • explorers/KRGN — Block explorer URL
  • icons_original/krgn.png — 128x128 RGBA coin icon

@cipig

cipig commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

thanks for the PR

i activated KRGN on one of my makers and made a Desktop build, so it can be tested: https://github.com/cipig/komodo-wallet-desktop/actions/runs/24337624835
can you please send me some to KR5K3jWay8aaFdWFyRmjuun4LTwX6ywPAo, so i can test a swap?

i found a problem related to the IPv6 address in DNS... if DEX uses that, it gets a connection failure
does IPv6 work? is it needed? if not, it would be better to remove IPv6 from DNS entry of electrum-kerrigan.jskitty.cat

btw, the Web version of the DEX can only handle WSS... TCP/SSL is for Mobile and Desktop
since you already have SSL with a valid certificate it's easy to add WSS... just add the port to config: SERVICES = tcp://:50001,rpc://:8001,ssl://:50002,wss://:50003

@JSKitty

JSKitty commented Apr 13, 2026

Copy link
Copy Markdown
Author

Sent! https://explorer.kerrigan.network/#/tx/3afd054c5a1f5e3f72b6b1f7e369d837be2e7fc909ebd3867d6061acbcc685b5

Enabled the IPv6 Electrum interface and WSS as well, thanks for catching that. 🙏

@cipig

cipig commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

I tried a swap, but it failed. Maker could send makerpayment, but taker couldn't spend it. Backend shows me this error then: taker_swap:2010] mm2src/coins/utxo/utxo_common.rs:2034] "utxo_common:1025] utxo_common:977] client:1132] blockchain.block.headers: failed to parse list of 11 headers (coin=KRGN, from=22313, requested_count=11): MalformedData"
This indicates that headers are different on KRGN. I forwarded this to the devs, so they can take a look at it.
Question: Was KRGN wallet forked from some other coin or is similar to some other coin, like eg RVN?
I could then try some settings, like "chain_variant": "RVN", but first i need to know what to try.

komodoce pushed a commit to komodoce/coins-ce that referenced this pull request Apr 17, 2026
JSKitty added a commit to JSKitty/komodo-defi-framework that referenced this pull request Apr 18, 2026
Kerrigan (KRGN) is a Dash fork with PIVX-style Sapling that mines four
PoW algorithms concurrently (X11, KawPoW, Equihash(200,9),
Equihash(192,7)). The mined algorithm is encoded at `(version >> 9) & 0x7`
and selects a different header tail per block, so header size varies
within a single batch (80, 124, 543, or 1487 bytes on mainnet).

On `ChainVariant::Standard` this produces a `blockchain.block.headers`
parse failure as soon as the batch crosses a non-X11 block — see the
listing PR at GLEECBTC/coins#1791, failing at height 22313:
`failed to parse list of 11 headers ... MalformedData`.

The fix dispatches the per-algo tail inside `BlockHeader::deserialize`
when `ChainVariant::KRGN` is set:

- algo 0 (X11) — plain 80-byte path (already the default behaviour)
- algo 1 (KawPoW) — reuses the existing RVN ProgPow tail reader
  (n_height u32, n_nonce_64 u64, mix_hash H256); one detail to note is
  that Kerrigan keeps the 80-byte prefix u32 nonce on-wire (zeroed),
  unlike RVN which omits it, so the u32 read path stays active for KRGN
- algo 2 or 3 (Equihash) — Zcash-style layout: hash_final_sapling_root
  before time, U32 bits, H256 nonce, then the variable-length solution
  list. No new struct fields needed; the existing zcash-style branch
  handles the whole tail once `is_zcash_style` is extended.

All four algos share the canonical 80-byte Bitcoin-shaped prefix for
identity hashing (X11 over those 80 bytes), so Serializable round-trips
without changes.

### Tests

Six new tests in `mm2src/mm2_bitcoin/chain/src/block_header.rs`, all
using real mainnet block headers fetched from
`electrum-kerrigan.jskitty.cat` around the original failure range:

- `test_krgn_chain_variant_try_from` — "KRGN" string parses to
  `ChainVariant::KRGN`
- `test_krgn_x11_header_round_trip` — algo 0, height 22312 (80 bytes)
- `test_krgn_kawpow_header_round_trip` — algo 1, height 22316 (124 bytes);
  asserts n_height/n_nonce_64/mix_hash are populated with the right
  on-chain values
- `test_krgn_equihash_200_header_round_trip` — algo 2, height 22314
  (1487 bytes); asserts sapling root + 1344-byte solution + H256 nonce
- `test_krgn_equihash_192_header_round_trip` — algo 3, height 22313
  (543 bytes); asserts 400-byte solution
- `test_krgn_mixed_algo_header_batch` — concatenates one header of each
  of the four algos and walks the buffer with a single Reader. This
  reproduces the exact on-wire shape of a `blockchain.block.headers`
  response and is the strongest regression guard for the swap failure
  reported on coins#1791.

Every fixture is round-tripped byte-for-byte (parse → serialize ==
original), so the dispatch provably preserves all bytes of the header.

All 32 tests pass in `chain::block_header::tests` (6 new, 26 existing);
`cargo fmt` and `cargo clippy -- -D warnings` are clean for the two
touched crates (`chain`, `serialization`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants