Skip to content

fix(sui): caip2 resolution example uses JSON-RPC, deprecated on public fullnodes - #212

Open
okwme wants to merge 1 commit into
ChainAgnostic:mainfrom
okwme:fix-sui-deprecated-jsonrpc
Open

okwme wants to merge 1 commit into
ChainAgnostic:mainfrom
okwme:fix-sui-deprecated-jsonrpc

Conversation

@okwme

@okwme okwme commented Sep 14, 2026

Copy link
Copy Markdown

The sui CAIP-2 profile resolves the chain identifier with suix_getChainIdentifier. Sui has deprecated JSON-RPC on public fullnodes, so that example no longer runs:

$ curl -s -X POST https://fullnode.mainnet.sui.io:443 -H "Content-Type: application/json" \
    -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"suix_getChainIdentifier\",\"params\":[]}"
{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found. JSON-RPC on public
 fullnodes has been deprecated. Please migrate to gRPC or GraphQL endpoints. ..."}}

Unlike a simple method rename, no JSON-RPC method works — the transport itself is gone — so the example cannot be repaired in place.

Replaced with the GraphQL equivalent, verified on 2026-09-14:

$ curl -s -X POST https://graphql.mainnet.sui.io/graphql -H "Content-Type: application/json" \
    -d "{\"query\":\"{ chainIdentifier }\"}"
{"data":{"chainIdentifier":"4btiuiMPvEENsttpZC7CZ53DruC3MAgfznDbASZ7DR6S"}}

One substantive difference, now documented in the profile. The GraphQL field returns the full genesis checkpoint digest in base58, whereas the old JSON-RPC method returned the four-byte prefix directly. That value base58-decodes to the 32 bytes 35834a8ac17ca48fb14ac8f99c17c98747e95dd07294ae41a46b382246a4499b, whose first four bytes are 35834a8a — exactly the mainnet reference this profile already documents. The derivation is spelled out so an implementer is not left to infer it.

This also removes a trailing sentence stating that the response returns the first four bytes, which was true of the JSON-RPC reply but is not true of the GraphQL field.

Found while writing a CAIP-19 asset profile for this namespace, as part of FAR, an open cross-reference between CAIP-19, CoinGecko and ISO 24165 identifiers. The iota profile has a closely related issue (#210), since it was derived from this one.

… on public fullnodes

`suix_getChainIdentifier` returns -32601 on Sui public fullnodes:

    {"error":{"code":-32601,"message":"Method not found. JSON-RPC on public
     fullnodes has been deprecated. Please migrate to gRPC or GraphQL endpoints."}}

Unlike a simple rename, no JSON-RPC method works — the transport itself is gone,
so the worked example cannot be repaired in place.

Replaced with the GraphQL equivalent, verified against
https://graphql.mainnet.sui.io/graphql on 2026-09-14. That field returns the
FULL genesis checkpoint digest in base58 rather than the four-byte prefix the
old method returned, so the derivation is now stated explicitly: the value
base58-decodes to 32 bytes beginning 35834a8a, which is the mainnet reference
this profile already documents.

Also removes a trailing sentence that said the response returns the first four
bytes — true of the old JSON-RPC reply, not of the GraphQL field.

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.

1 participant