Monaco Protocol SDK v0.8.8
Breaking: authentication moves to ed25519 session-key signing
Authentication no longer uses JWT access/refresh tokens. The wallet now signs once to authorize a locally-generated ed25519 session key, and every request is signed with that key. All existing sessions are invalidated on deploy — every user must reconnect their wallet and sign once. Backend and frontend must deploy v0.8.8 together; there is no window where both auth schemes work. What changes for SDK users:AuthStateno longer hasaccessToken/refreshToken. It now carriessessionPublicKey,sessionPrivateKey,expiresAt, anduser. The session private key is the credential — persist it (not a token) to restore a session without re-prompting the wallet.sdk.login(clientId)is unchanged as the entry point and still returnsAuthState. Request signing is automatic after login (and aftersdk.setAuthState(...)); there is no token to attach.- The manual token methods
sdk.auth.refreshToken(...)andsdk.auth.revokeToken()are gone. Usesdk.refreshAuth()(orsdk.auth.refreshSession()) to extend a session andsdk.logout()(orsdk.auth.revokeSession()) to revoke it. - React:
useAuthexposesrefreshSession/revokeSession(the oldrefreshToken/revokeTokenare removed). TheuseTokenLifecyclehook and the providertokenLifecycleprop now persist and refresh the session (keypair + expiry); their names and config are unchanged.
POST /api/v1/auth/challengeandPOST /api/v1/auth/verifynow require asession_public_key(64-char lowercase-hex ed25519 public key).verifyno longer returns any tokens — onlyexpires_atanduser.- Every authenticated request must be signed with three headers:
X-Monaco-PublicKey,X-Monaco-Timestamp(Unix milliseconds, within 30 seconds of server time), andX-Monaco-Signature. The signature coversMETHOD\npath?query\ntimestamp_ms\nSHA256_hex(body). POST /api/v1/auth/refreshandPOST /api/v1/auth/revokenow take an empty body and are authenticated with those signing headers.- Backend services authenticate by sending their
sk_secret key in thex-server-keyheader on every request — there is no token exchange.
Added: custom API and WebSocket URLs
SDKConfig gains optional apiUrl and wsUrl overrides. When set, the core SDK (createMonacoSDK / new MonacoSDK) connects to the given URLs instead of the network preset’s defaults — useful for self-hosted deployments or CI/e2e stacks reachable only by a custom host (e.g. http://api-gateway:8080, ws://ws-api:8080/ws). network still selects the chain. Both must be valid absolute URLs or the constructor throws InvalidConfigError.

