docs: add Stellar chain support RPC methods - #154
Conversation
Add Stellar JSON-RPC method reference to Wallet SDK chain support, based on the Stellar Specs — WalletConnect Network proposal. Covers stellar_signXDR, stellar_signAndSubmitXDR, stellar_signMessage, and stellar_signAuthEntry (Soroban), plus CAIP identifiers, account/XDR conventions, events, and signing semantics. Registers the page in docs.json navigation and the chain-support overview. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
| | CAIP-10 | `stellar:pubnet:G…` — base32 StrKey account ID (56 chars, version byte `0x30`) | | ||
| | CAIP-19 | `stellar:pubnet/slip44:148` (XLM) or `stellar:pubnet/asset:{code}-{issuer}` (issued assets) | | ||
|
|
||
| The CAIP-2 reference `pubnet` matches the [Stellar CAIP-2 namespace draft](https://github.com/ChainAgnostic/namespaces/blob/main/stellar/caip2.md). The network passphrase (`"Public Global Stellar Network ; September 2015"` for mainnet, `"Test SDF Network ; September 2015"` for testnet) is **not** the CAIP-2 reference — it is a separate signing-domain constant that wallets MUST bind into every signature (see [Signing semantics](#signing-semantics)). |
There was a problem hiding this comment.
what's this note? is this useful?
There was a problem hiding this comment.
Trimmed. Kept just the CAIP-2-reference-vs-network-passphrase distinction — it's a real implementer footgun (the signature binds the passphrase, derived from the chain, not the CAIP-2 reference) — and left the full detail to the Signing semantics section.
| - The envelope's discriminant determines tx version: `ENVELOPE_TYPE_TX_V0`, `ENVELOPE_TYPE_TX`, or `ENVELOPE_TYPE_TX_FEE_BUMP`. | ||
| - Wallets MUST accept all three; wallets MAY emit signatures only on V1 and fee-bump envelopes (V0 is deprecated). | ||
|
|
||
| ## Session Properties |
There was a problem hiding this comment.
why is this section called Session Properties? it only shows the session proposal, i dont see properties here
There was a problem hiding this comment.
Good catch — renamed to Session Proposal. It shows the proposal (optionalNamespaces), not sessionProperties.
|
|
||
| ### stellar_signXDR | ||
|
|
||
| Asks the wallet to attach a signature to a Stellar `TransactionEnvelope` and return the resulting envelope **without broadcasting it**. The dApp (or a relayer it trusts — e.g. pay-core's fee-payer) is responsible for submission. |
There was a problem hiding this comment.
| Asks the wallet to attach a signature to a Stellar `TransactionEnvelope` and return the resulting envelope **without broadcasting it**. The dApp (or a relayer it trusts — e.g. pay-core's fee-payer) is responsible for submission. | |
| Asks the wallet to attach a signature to a Stellar `TransactionEnvelope` and return the resulting envelope **without broadcasting it**. The dApp (or a relayer it trusts) is responsible for submission. |
| sign(Ed25519, sha256("StellarMessage" || 0x00 || message)) | ||
| ``` | ||
|
|
||
| The literal byte string `"StellarMessage"` (14 bytes) followed by a `0x00` separator MUST be hashed alongside the message bytes. This matches the SEP-53 (in-draft) convention and ensures cross-context replay is impossible — a SEP-10 challenge transaction would never collide with a `stellar_signMessage` payload. |
There was a problem hiding this comment.
| The literal byte string `"StellarMessage"` (14 bytes) followed by a `0x00` separator MUST be hashed alongside the message bytes. This matches the SEP-53 (in-draft) convention and ensures cross-context replay is impossible — a SEP-10 challenge transaction would never collide with a `stellar_signMessage` payload. | |
| The literal byte string `"StellarMessage"` (14 bytes) followed by a `0x00` separator MUST be hashed alongside the message bytes. This matches the [SEP-53](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0053.md) convention and ensures cross-context replay is impossible — a SEP-10 challenge transaction would never collide with a `stellar_signMessage` payload. |
There was a problem hiding this comment.
Applied the finalized SEP-53 algorithm here instead of the inline suggestion (per your general comment, which supersedes it): prefix is "Stellar Signed Message:\n" concatenated directly, no 0x00 separator and no length prefix.
| | Event | Payload | Notes | | ||
| | ----------------- | ------------------------------------ | -------------------------------------------------------------------------------------------- | | ||
| | `accountsChanged` | `{ accounts: string[] }` (CAIP-10) | Emitted when the user changes the active account in their wallet, or revokes access for an account. | | ||
| | `chainChanged` | `{ chainId: string }` (CAIP-2) | Reserved for future testnet support. Today, only `stellar:pubnet` is emitted. | |
There was a problem hiding this comment.
what does "Reserved for future testnet support" mean?
There was a problem hiding this comment.
Reworded. Both networks are supported (stellar:pubnet and stellar:testnet), so chainChanged now describes switching the active network rather than "reserved for future testnet support".
There was a problem hiding this comment.
Reworded. Both networks are supported (stellar:pubnet and stellar:testnet), so chainChanged now describes switching the active network rather than "reserved for future testnet support".
|
|
||
| ## Additional Resources | ||
|
|
||
| - [WalletConnect Wallet SDK — Ethereum chain support](/wallet-sdk/chain-support/evm) — structural template for this document. |
There was a problem hiding this comment.
Removed — it was an authoring-meta note ("structural template for this document"), not a reader resource.
| ## Additional Resources | ||
|
|
||
| - [WalletConnect Wallet SDK — Ethereum chain support](/wallet-sdk/chain-support/evm) — structural template for this document. | ||
| - [WalletConnect Wallet SDK — Solana chain support](/wallet-sdk/chain-support/solana) — closest precedent for an Ed25519-based chain. |
There was a problem hiding this comment.
Removed for the same reason (the chain-support overview page already links all chains).
| - [WalletConnect Wallet SDK — Solana chain support](/wallet-sdk/chain-support/solana) — closest precedent for an Ed25519-based chain. | ||
| - [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) and [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) — chain and account identifiers. | ||
| - [Stellar CAIP-2 namespace draft](https://github.com/ChainAgnostic/namespaces/blob/main/stellar/caip2.md). | ||
| - [Stellar SEP-7](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md), [SEP-10](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md). |
There was a problem hiding this comment.
Added SEP-53 to the references.
| - [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) and [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) — chain and account identifiers. | ||
| - [Stellar CAIP-2 namespace draft](https://github.com/ChainAgnostic/namespaces/blob/main/stellar/caip2.md). | ||
| - [Stellar SEP-7](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md), [SEP-10](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md). | ||
| - [Freighter API reference](https://docs.freighter.app/docs/guide/usingFreighterWebApp). |
There was a problem hiding this comment.
what's this?
should we point here?
There was a problem hiding this comment.
Repointed to the Freighter WalletConnect mobile docs you linked, and dropped the generic web-app API reference.
|
The fixed UTF-8 string Verifiable against SEP-53's official vectors (seed
The |
- stellar_signMessage: use finalized SEP-53 preimage
sha256("Stellar Signed Message:\n" || message) — corrected prefix,
no 0x00 separator, no length prefix; link SEP-53
- rename "Session Properties" -> "Session Proposal" (it shows the proposal)
- signXDR: drop pay-core-specific relayer mention from the public spec
- chainChanged: describe network switching (pubnet <-> testnet) instead of
"reserved for future testnet support" (both networks are supported)
- tighten the CAIP-2 reference vs network-passphrase note
- Additional Resources: drop the EVM/Solana authoring-meta links, add SEP-53,
point Freighter link at its WalletConnect mobile docs
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Fixed in e0b0d38 — thanks, this was spot on.
Corrected prefix, no For what it's worth, the reference implementation in web-examples (react-wallet-v2 |
Summary
Adds a Stellar chain-support page to the Wallet SDK docs, documenting the JSON-RPC methods wallets should implement to transact over the WalletConnect network on Stellar. Content is based on the Stellar Specs — WalletConnect Network (Proposal) and follows the same format as the existing chain-support pages (EVM, Solana, Canton, Tron, etc.).
Methods documented
stellar_signXDR— sign aTransactionEnvelopewithout broadcasting (primary method for fee-abstracted / fee-bump flows)stellar_signAndSubmitXDR— sign and submit in one stepstellar_signMessage— domain-separated Ed25519 message signing (SEP-10 style sign-in)stellar_signAuthEntry— SorobanSorobanAuthorizationEntrysigningAlso included
events(accountsChanged,chainChanged)docs.jsonnavigation and the chain-support overview🤖 Generated with Claude Code