Overview
API for Auth server with HTTP endpoints and Socket.IO WebSocket protocol.
This server facilitates communication between the Decentraland clients and the auth dapp on the browser. It allows the desktop client to execute wallet methods (eth_sendTransaction, personal_sign, etc.) using the wallet the user has on their browser.
Request Lifecycle
A request is created with a method and parameters
The server returns a request ID, expiration time, and verification code
The auth dapp recovers the request using the request ID
The request is executed on the auth dapp with the user's wallet
The outcome (result or error) is submitted back to the server
The original client receives the outcome via WebSocket or polling
Request Characteristics
Only one request can exist at a time per connected socket. A new request will invalidate a previous one if it existed.
Requests have an expiration (default: 5 minutes), and cannot be consumed after it.
If the socket disconnects, any request made by that socket will be deleted.
Authentication
An
authChainis required on every request and will be validated.Signature validation is performed using
@dcl/cryptoAuthenticator.
What cannot be requested
The
dcl_personal_signmethod, in any casing.Signing a Decentraland ephemeral message under any other method: a request is refused when any of its string params parses as one (
Ephemeral address:/Expiration:lines), plain text or hex-encoded. That payload is what mints an auth identity, so blocking only the method name would leave the removed sign-in flow reproducible viapersonal_signoreth_sign.Ordinary signing is unaffected:
personal_sign,eth_signandeth_signTypedData*are accepted for messages that are not ephemeral messages.
Last updated