Skip to content

Retire deprecated sei_* association methods, document addr precompile#11

Open
alexander-sei wants to merge 2 commits into
mainfrom
docs/clarify-association-method-availability
Open

Retire deprecated sei_* association methods, document addr precompile#11
alexander-sei wants to merge 2 commits into
mainfrom
docs/clarify-association-method-availability

Conversation

@alexander-sei
Copy link
Copy Markdown
Collaborator

Summary

Replaces learn/accounts and the address-resolution part of the EVM reference with the on-chain addr precompile path (0x0000000000000000000000000000000000001004), and retires the deprecated sei_* JSON-RPC methods that the old copy pointed users at.

Why

The sei_* JSON-RPC namespace is deprecated and gated by enabled_legacy_sei_apis in app.toml (see evmrpc/sei_legacy.go):

  • sei_associate is not in the default allowlist. On every public Sei RPC (evm-rpc.sei-apis.com, third-party providers, etc.) it returns legacy_sei_deprecated. The docs were telling readers to build a flow that fails for the vast majority of them.
  • sei_getSeiAddress / sei_getEVMAddress are enabled by default today but belong to the same deprecated namespace and may be removed in a future release. They duplicate getSeiAddr / getEvmAddr on the addr precompile, which is a normal EVM call available on every RPC and never deprecated.

The on-chain addr precompile already covers all three operations (associate, getSeiAddr, getEvmAddr) and is what first-party Sei integrations now use end-to-end. The first-party dashboard's recent switch to the precompile path is tracked in sei-dashboard#8.

What changed

learn/accounts.mdx

  • Drop Method 5: Gasless Association via Signed Message (the sei_associate flow) — its row in the table, its ~35-line code snippet, and the surrounding callouts. Method 3 covers the same wallet-signed-message UX without depending on a gated endpoint.
  • Drop the Manual Association From the CLI subsection (the seid tx evm associate-address snippet).
  • Replace the two sei_get*Address curl examples under Query Linked Addresses with eth_call against the precompile, plus a viem TypeScript example that covers both getSeiAddr and getEvmAddr directions. Selector 0x0c3c20ed verified against viem.toFunctionSelector('function getSeiAddr(address) view returns (string)').
  • Update the methods-table footnote and the Recap bullet to match the trimmed surface.
  • Add a <Note> for readers arriving from old links, pointing operators who want the legacy method back to /node/node-operators (where the chain's default app.toml is mirrored).
  • Replace the stale pinned commit link to sei-chain/precompiles (was 44fd60cec6…) with /tree/main/precompiles/addr.

evm/reference.mdx

  • Drop the rows for sei_associate, sei_getSeiAddress, and sei_getEVMAddress from the legacy methods accordion table.
  • Drop their dedicated subsections (parameters / object schema / result tables / example requests) from "Address & Cross-VM Helpers".
  • Split that section into two:
    • Address Resolution — full precompile docs (curl + viem) for both directions, with a <Note> explaining the historical helpers.
    • Cross-VM Transaction Lookup — keeps #### sei_getCosmosTx (no precompile equivalent yet).
  • Leave the default enabled_legacy_sei_apis code block intact — it mirrors what seid init actually writes to app.toml. Omitting the two sei_get*Address entries there would make the docs disagree with the chain default.

Not touched

  • node/node-operators.mdx — the commented # "sei_associate", line and the two enabled get-helpers in the default allowlist are accurate operator reference for what the chain ships. Removing them would diverge from chain reality.

Reviewer notes

  • The <Note> blocks on both pages are load-bearing for SEO / external-link continuity: they explain to anyone arriving here from a stale Google result, a third-party tutorial, or an old bookmark why the section they remembered no longer exists.
  • I spotted a separate bug in learn/accounts.mdx: the "Sei Address Derivation" snippet near the bottom (under "Deriving Addresses from the Public Key") says to keccak256-hash the public key and take the first 20 bytes for the bech32 — but Cosmos sei derivation is SHA256→RIPEMD160, as the Python/TypeScript snippets later in the same doc correctly show. Not fixed in this PR to keep the scope focused on association method availability; happy to do it in a follow-up.

🤖 Generated with Claude Code

The sei_* JSON-RPC namespace is deprecated and gated by enabled_legacy_sei_apis
in app.toml. Of the three address-related legacy methods:

- sei_associate is not in the default allowlist and returns
  legacy_sei_deprecated on every public RPC unless the node operator has
  opted in. It is functionally a relay-only path that no public Sei node
  currently accepts.
- sei_getSeiAddress and sei_getEVMAddress are enabled by default today,
  but belong to the same deprecated namespace and may be removed in a
  future release.

All three are duplicated by the on-chain addr precompile at 0x...1004:
associate(v, r, s, customMessage) / associatePubKey(pubKeyHex) for writes,
getSeiAddr(address) / getEvmAddr(string) for reads. The precompile is a
normal EVM call available on every public RPC, never deprecated, and is
what the dashboard and other first-party integrations now use.

learn/accounts.mdx:
- Drop the entire "Method 5: Gasless Association via Signed Message"
  section (sei_associate-based) and its row in the methods table.
- Drop the "Manual Association From the CLI" subsection — its only
  consumer was an embedded seid command for a flow we no longer document
  here.
- Replace the legacy curl examples under "Query Linked Addresses" with
  precompile-based eth_call examples (curl + viem TS) covering both
  resolution directions.
- Add an explanatory <Note> on the methods table and recap pointing
  operators who genuinely want sei_associate to the node-operators page.

evm/reference.mdx:
- Drop the sei_associate, sei_getSeiAddress, sei_getEVMAddress rows from
  the legacy methods accordion and their dedicated subsections in
  "Address & Cross-VM Helpers".
- Split that section into an "Address Resolution" subsection (precompile
  + curl + viem examples, plus a <Note> on the historical methods) and a
  "Cross-VM Transaction Lookup" subsection that keeps sei_getCosmosTx
  (no precompile equivalent yet).
- Leave the default enabled_legacy_sei_apis code block intact — it
  documents what `seid init` actually emits, and the chain still ships
  with the two get-helpers enabled by default.

node/node-operators.mdx is intentionally untouched: it mirrors the
chain's default app.toml, so the commented sei_associate line and the
two enabled get-helpers stay there as accurate operator reference.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 25, 2026

PR Summary

Low Risk
Markdown-only changes to developer docs; no runtime, auth, or application code paths are modified.

Overview
Documentation now steers developers away from deprecated sei_* association and lookup RPCs toward the on-chain addr precompile at 0x0000000000000000000000000000000000001004 via standard eth_call / viem readContract.

On learn/accounts, the gasless sei_associate flow (Method 5), CLI seid tx evm associate-address, and sei_get*Address curl examples are removed; lookup uses getSeiAddr / getEvmAddr, with notes that public RPCs return legacy_sei_deprecated for sei_associate. The public-key derivation section is corrected to SHA256→RIPEMD160 (compressed) for bech32 and keccak256 (uncompressed, no 0x04) for EVM.

On evm/reference, sei_associate and the two get-address methods drop out of the legacy accordion and long-form sections; Address Resolution documents the precompile, while sei_getCosmosTx stays under Cross-VM Transaction Lookup. The default enabled_legacy_sei_apis example in docs is unchanged so it still matches chain defaults.

Reviewed by Cursor Bugbot for commit c2b92f1. Bugbot is set up for automated code reviews on this repo. Configure here.

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 25, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
sei-docs 🟢 Ready View Preview May 25, 2026, 10:01 AM

…ak256)

The "Sei Address Derivation" snippet was applying the Ethereum derivation
algorithm to the Cosmos side: keccak256 the pubkey, then take the first
20 bytes. That doesn't match what the chain actually does — see
`PubkeyBytesToSeiPubKey` and the standard cosmos secp256k1
`PubKey.Address()` in sei-chain/utils/helpers/address.go, which is
SHA256 -> RIPEMD160 of the compressed pubkey (the canonical Cosmos
derivation). The Python and TypeScript "Generating Wallets" snippets
later in the same doc already implement this correctly, so the bug was
just in the standalone "Sei Address Derivation" section near the top.

Also tightened the paired EVM derivation snippet:
- Made the input type explicit (uncompressed pubkey, 65 bytes, leading 0x04).
- Slice off the 0x04 prefix byte before hashing, matching the Python
  snippet ("Exclude the first byte") and the actual EVM derivation in
  sei-chain/utils/helpers/address.go:PubkeyToEVMAddress.

Updated the Summary block and the "Why It Works" paragraph to reflect
that the two derivations use different algorithms, and switched both
example imports from ethereumjs-util to @noble/hashes for consistency
with the canonical snippets later in the file.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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