Repository navigation
Support genesis-hash network identifiers in DIDs and chain IDs - #711
Open
andynelson wants to merge 1 commit into
Open
andynelson wants to merge 1 commit into
andynelson wants to merge 1 commit into
Conversation
andynelson
force-pushed
the
feature/did-genesis-network
branch
from
November 12, 2026 14:18
c233494 to
324c972
Compare
andynelson
marked this pull request as draft
November 12, 2026 14:25
andynelson
force-pushed
the
feature/did-genesis-network
branch
5 times, most recently
from
November 12, 2026 16:25
476c536 to
cb10333
Compare
andynelson
marked this pull request as ready for review
November 12, 2026 16:29
Bump concordium-base to main (Concordium/concordium-base#986), which accepts did:ccd:<genesis hash prefix>:..., and adopt it across the SDK packages. Existing DIDs, chain IDs and stored settings are unchanged; the genesis form is opt-in. - sdk: widen Network to 'Testnet' | 'Mainnet' | GenesisHashPrefix.Type; add the GenesisHashPrefix module and network helpers (chain IDs, chain equality, key derivation: mainnet derives as Mainnet, every other network as Testnet); add a ConcordiumDID class covering every Concordium DID type and route the DID classes, create*DID helpers and credential metadata parsing through it; compare networks by chain when verifying. - wallet-connectors: opt-in chainIdFormat: 'genesis' / withGenesisChainId for ccd:<genesis hash prefix> chain IDs. - verification-web-ui: accept a custom network ({ chainId, walletDeepLinks }), resolve the network in one place, and fix the CryptoX deep-link schemes (mainnet, and Android testnet).
andynelson
force-pushed
the
feature/did-genesis-network
branch
from
November 12, 2026 16:33
cb10333 to
d6101ef
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Chain IDs can already name a network either by name (
ccd:testnet) or by genesis hash prefix (ccd:4221332d34e1694168c2a0c0b3fd0f27), but DIDs only accepted the named form (did:ccd:testnet:…). This brings DIDs in line, so any network, including a custom one, can be addressed asdid:ccd:<32-hex genesis prefix>:….Builds on Concordium/concordium-base#986 (merged);
deps/concordium-basenow points at that commit onmain.Compatibility
testnet/mainnet, and parsingdid:ccd:testnet:…still givesnetwork === 'Testnet'.DIDNetwork.sameChain, matching the Rust equality in base).did:ccd:<prefix>:…, so adopt per integration.Changes
sdk
Network(intypes.ts) is now'Testnet' | 'Mainnet' | GenesisHashPrefix.Type.GenesisHashPrefixmodule insrc/types/(Type,TESTNET,MAINNET,instanceOf,fromHexString,fromGenesisHash,toHexString), following theBlockHash-style modules.networkHelpers.ts:networkToString,networkFromString,isSameNetwork,getNetworkGenesisHashPrefix,networkFromChainId,networkToChainId,getKeyDerivationNetwork.getKeyDerivationNetworkmaps mainnet (by name or genesis prefix) toMainnet(coin type 919) and every other network toTestnet(coin type 1). Applied inConcordiumHdWalletandgetIdProof, the only places the network reaches WASM key derivation.ConcordiumDIDclass inweb3-id/types.ts, next toDIDString,IdentityProviderDIDandContractInstanceDID:fromJSON,toJSONandidentifierOf, with aDIDIdentifierunion for every DID type (acc,cred,sci,pkc,idp,encidcred). It is now the only code that builds or parsesdid:ccd:strings.IdentityProviderDID,ContractInstanceDID, thecreate*DIDhelpers and credential metadata parsing use it. NewIdentityProviderDID.fromChainId,createAccountAddressDID,createPublicKeyDID.isSameNetwork) instead of by regex.Effect on code that checks
NetworkexhaustivelyExisting calls compile and behave as before. The only TypeScript that stops compiling is code assuming
Networkhas exactly two values, e.g.or passing a
Networkinto something typed'Testnet' | 'Mainnet'. As with#[non_exhaustive]in Concordium/concordium-base#986, I don't expect this in practice, so the CHANGELOG lists it under Changed rather than as a breaking change.wallet-connectors (peer dependency on
@concordium/web-sdkunchanged,>= 12.0.2)chainIdFormat: 'genesis'onNetworkand awithGenesisChainId(network)helper, producingccd:<genesis prefix>. The default staysccd:<name>(soSTAGENETremainsccd:stagenet).getChainIdis exported.verification-web-ui
networkconfig accepts a custom network:{ chainId: 'ccd:<prefix>', walletDeepLinks?: { ios?, android? } }.utils/network.ts) instead of four inconsistent sources; legacy'testnet'/'mainnet'values in localStorage still resolve.cryptox-iosInfo.plists /AppDelegate.swiftand thecryptox-androidmanifest): mainnetcryptoxmainnet:///cryptox-wc-mainnet://→cryptox:///cryptox-wc://, and Android testnetcryptox-wc-testnet://→cryptox-wc://(both Android builds register onlycryptox-wc).testscript (node:test via tsx).Testing
test/cipasses (695 tests), including newdid.test.ts(parse/format round trips for every DID type and network form, compatibility snapshots for named networks, and key derivation for genesis-prefix networks) and an end-to-endVerifiablePresentationV1prove → verify with the testnet genesis prefix and a custom prefix through WASM.build:libOK.