Wire Protocol
Reference for the identifiers and JSON-RPC message shapes used by D9 Wallet across both the injected provider and WalletConnect v2. Use this when implementing custom transport handling or server-side verification.
Identifiers
Section titled “Identifiers”| Surface | Value |
|---|---|
| Injected provider | window.injectedWeb3['d9-wallet'] |
| WalletConnect namespace | d9net (custom CAIP namespace) |
| Protocol chain ID | d9net:000000000000000000000000000000d9 |
| Account (CAIP-10) | d9net:000000000000000000000000000000d9:<address> |
Auth issuer iss (DID PKH) |
did:pkh:d9net:000000000000000000000000000000d9:<address> |
d9_signMessage
Section titled “d9_signMessage”Request an off-chain signature over arbitrary bytes:
type SignMessageRequest = { account: `d9net:${string}:${string}`; message: `0x${string}`; // 0x-prefixed hex-encoded bytes};
type SignMessageResponse = { account: `d9net:${string}:${string}`; chainId: string; signature: `0x${string}`; // Hex-encoded cryptographic signature};d9_signTransaction
Section titled “d9_signTransaction”Request a signature over a Substrate transaction signer payload:
type SignTransactionRequest = { version: 1; // D9 envelope version account: `d9net:${string}:${string}`; transaction: { address: string; // SS58 address blockHash: `0x${string}`; blockNumber: `0x${string}`; era: `0x${string}`; genesisHash: `0x${string}`; // Real 32-byte chain genesis hash method: `0x${string}`; // SCALE-encoded Call bytes nonce: `0x${string}`; specVersion: `0x${string}`; transactionVersion: `0x${string}`; signedExtensions: string[]; tip: `0x${string}`; version: 4; // Substrate extrinsic version };};
type SignTransactionResponse = { version: 1; account: `d9net:${string}:${string}`; chainId: string; signature: `0x${string}`; // SCALE-encoded MultiSignature bytes signedTransaction?: `0x${string}`; // Optional complete extrinsic bytes ready for broadcast};d9_authenticate (CACAO / SIWX)
Section titled “d9_authenticate (CACAO / SIWX)”Request a CAIP-122 sign-in proof. The wallet displays statement to the user and signs the canonical SIWX message. Verify the returned CACAO proof on your backend as described in Sign-In (SIWX).
type D9Cacao = { h: { t: "caip122"; }; p: { domain: string; aud: string; chain_id: "d9net:000000000000000000000000000000d9"; nonce: string; request_id: string; iss: `did:pkh:d9net:${string}:${string}`; version: "1"; iat: string; // ISO 8601 UTC exp: string; // ISO 8601 UTC nbf?: string; statement?: string; resources?: string[]; }; s: { t: "sr25519" | "ed25519" | "ecdsa"; s: `0x${string}`; // Hex-encoded signature public_key?: `0x${string}`; };};