Skip to content

Add SHC (Sharecoin) - #1914

Open
Share-coin wants to merge 9 commits into
GLEECBTC:masterfrom
Share-coin:add-sharecoin-shc
Open

Share-coin wants to merge 9 commits into
GLEECBTC:masterfrom
Share-coin:add-sharecoin-shc

Conversation

@Share-coin

Copy link
Copy Markdown

Adds Sharecoin (SHC), a ProgPoW/KawPow Bitcoin fork with a real live mainnet chain.

  • Electrum server: 35.252.133.249:60401 (electrs 0.11.1, verified reachable and correctly indexing real chain data)
  • Address format: bech32 (shc1...), segwit from genesis
  • Derivation path: m/84'/0' (BIP84)

Originally submitted to KomodoPlatform/coins as PR #18, resubmitting here since that repo hasn't been updated since December 2025 and this appears to be the actively maintained repo post-rebrand.

Tested end to end with a real funded wallet via kdf (checksum-verified GLEECBTC-rebranded build): HD-derived the expected bech32 address and retrieved the correct real balance through the live electrs endpoint.

@cipig

cipig commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR
the electrum server will not work though
Web DEX needs WSS port with a real SSL certificate (not self-signed)... and so it also needs a hostname/domainname.
Please also remove the icon from icons directory... those files are automatically generated from the ones in icons_original... so you only need to add it to icons_original

@cipig

cipig commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

SSL works now, but WSS seems to be the wrong port
but i could now test a swap if you send me some SHC to shc1qxemcuv7jpw4rdvcvua6gk9slrgvhgqjpftqrqn
please also add an explorer to explorers/SHC

@Share-coin

Copy link
Copy Markdown
Author

Thanks for testing! Both fixed:

  • WSS was actually a bug on our end, not a wrong port - nginx's upgrade detection was doing a case-sensitive match on the Upgrade header, so a client sending Upgrade: WebSocket (capitalized) fell through to the plain website instead of getting a proper WS handshake. Fixed and verified end-to-end with the exact header casing that was failing before.
  • Added explorers/SHC pointing at https://sharecoin.cc/explorer/

Also sent 500 SHC to shc1qxemcuv7jpw4rdvcvua6gk9slrgvhgqjpftqrqn for the swap test whenever you're ready.

@cipig

cipig commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

thanks, SSL working fine now
WSS doesn't, the script on github shows this error: https://github.com/cipig/coins/actions/runs/31060020837/job/92485733442#step:8:1040
Error parsing SHC sharecoin.cc 443 | Response: [the JSON object must be str, bytes or bytearray, not ConnectionClosedError] received 1003 (unsupported data) Unsupported: Text frames are not supported; then sent 1003 (unsupported data) Unsupported: Text frames are not supported (scan_electrums.py:693)

the bigger problem is though that the test swap failed, on taker side trying to spend makerpayment in SHC
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=SHC, from=5705, requested_count=11): UnexpectedEnd"
i saw that SHC is kind of a fork of RVN, so i also tried with this, but without success

    "protocol": {
      "type": "UTXO",
      "chain_variant": "RVN"
    },

i forwarded this to our devs
do you know how SHC differs from RVN?

@Share-coin

Copy link
Copy Markdown
Author

On the header question: SHC's block header format is identical to RVN's own KawPow header, not just similar. Just verified this directly against the live chain:

  • A raw getblockheader (hex, verbose=false) for the block at height 5705 (the exact height your test failed at) returns a 120-byte header: standard 80-byte Bitcoin header plus the same KawPow extension RVN uses (nHeight, extended 64-bit nonce, mix_hash).
  • Queried the electrs endpoint directly for blockchain.block.headers with start_height=5705, count=11 (same params as your failing request) and got back exactly 1320 bytes (11 x 120), i.e. electrs is serving correctly-sized headers, not truncating or stride-slicing at 80 bytes.

So the header data on the wire looks right on our end. Since setting "chain_variant": "RVN" in the custom coin config still didn't fix the parse error, this looks like it might be a gap on the KDF side, maybe the RVN KawPow-header parsing path is gated on something more specific than that config field (the literal coin ticker, a separate flag, etc.) rather than being generically triggered for any UTXO coin configured as an RVN variant. Happy to dig further with your devs if a repro or more detail would help.

Still looking into the WSS text-frame error separately, will follow up once we have something concrete there too.

@Share-coin

Copy link
Copy Markdown
Author

WSS issue: bugfixed our end. Just tested a text-frame Electrum request against wss://sharecoin.cc/ end to end and it now returns correctly - should work for your scan too.

@Share-coin

Copy link
Copy Markdown
Author

Update on the header parsing issue: submitted a fix upstream to komodo-defi-framework, pending your team's review: GLEECBTC/komodo-defi-framework#2730. Adds a ChainVariant::SHC that parses the KawPow-extended header layout without needing SHC's version field to match RVN's, verified against a real header from our live chain plus the full existing test suite (55/55, no regressions).

@Share-coin

Share-coin commented Sep 26, 2026 •

Copy link
Copy Markdown
Author

Quick update: I merged the latest master into this branch and resolved the conflict in coins, so the PR is mergeable again. The diff is the same four files.

The earlier points are all done: SSL and WSS work on sharecoin.cc (WSS bug fixed on our side), the icon is removed from icons, and explorers/SHC is added. The header parsing fix is in GLEECBTC/komodo-defi-framework#2730 and needs review too.

@cipig, could you take another look when you have time? The 500 SHC for the test swap is already at the address you gave, so you're good to go whenever you're ready.

This branch has not been deployed

No deployments
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