{
  "schemaVersion": "1.0.0",
  "id": "article.v3-77708d18-2be1-4695-a991-268e6b6971cd",
  "contentType": "evergreen_guide",
  "title": "Sign‑In with Ethereum: What to Check Before Signing a Login Message",
  "slug": "sign-in-with-ethereum-login-message-checks",
  "category": "wallet_security",
  "intent": "What does a Sign-In with Ethereum message authenticate, and which checks reduce wrong-site and replay risks before a login signature is accepted?",
  "directAnswer": "Sign-In with Ethereum (SIWE) lets a service authenticate an Ethereum address using a signed message. Before signing, check which site is requesting the login and which account it names. For the service accepting the signature, recovering an address is only part of verification.",
  "sections": [
    {
      "heading": "What the login message contains",
      "paragraphs": [
        "[ERC-4361's Message Fields section](https://ercs.ethereum.org/ERCS/erc-4361#message-fields) distinguishes the required fields from optional additions:",
        "| Required field | What it identifies |\n| --- | --- |\n| `domain` | The requesting domain, including its authority and any specified port. |\n| `address` | The account being authenticated. |\n| `uri` | The resource that is the subject of the signed message. |\n| `version` | The message-format version; this specification uses `1`. |\n| `chain-id` | The session's chain context and the network used to resolve contract accounts. |\n| `nonce` | A challenge value used for replay protection. |\n| `issued-at` | When the message was generated. |",
        "The scheme, statement, expiration time, not-before time, request ID and resources list are optional fields. The required `uri` is not the optional `resources` list. Leaving URI out is not a valid way to simplify a conforming SIWE message."
      ]
    },
    {
      "heading": "Illustrative login message and rejection checks",
      "paragraphs": [
        "Illustrative example only. This unsigned message uses a placeholder account, a fixed sample nonce and historical sample times; it is not an active login challenge. Its line breaks are part of the message format.",
        "```text\nexample.com wants you to sign in with your Ethereum account:\n0x0000000000000000000000000000000000000001\n\nSign in to the example reading account.\n\nURI: https://example.com/login\nVersion: 1\nChain ID: 1\nNonce: q8M2v7R4s9T6u3W5\nIssued At: 2026-11-10T08:00:00Z\nExpiration Time: 2026-11-10T08:10:00Z\n```",
        "| Check | Expected handling in this example |\n| --- | --- |\n| Origin and fields | Compare with trusted origin `https://example.com`, expected URI, account, version and chain; reject a different domain. |\n| Challenge | Match the server-issued pending-login nonce and prevent a second successful use. Never issue this printed sample nonce. |\n| Time | Reject after the supplied expiration; ten minutes is this example’s choice, not a universal SIWE rule. |\n| Signature and session | Validate the exact message using ERC-191 for an EOA or the declared-chain ERC-1271 contract method, then bind the session to the verified address. |",
        "The format and account-verification rules come from [ERC-4361](https://ercs.ethereum.org/ERCS/erc-4361#specification); nonce consumption is an implementation recommendation. This is a documentation walkthrough, not an executed signature or application test."
      ]
    },
    {
      "heading": "Match the request to its origin",
      "paragraphs": [
        "The [origin requirements](https://ercs.ethereum.org/ERCS/erc-4361#specifying-the-request-origin) bind the message's domain and supplied scheme to the origin making the request. An embedded cross-origin frame has its own origin; it cannot simply claim its parent page's identity.",
        "For a reader, an unexpected domain or account is a reason to stop and inspect the request. For an implementation, displaying a familiar domain string is insufficient: the wallet must compare the claimed origin with trusted request-origin information, and the service must validate the parsed fields against its expected values."
      ]
    },
    {
      "heading": "Validate the challenge as well as the signature",
      "paragraphs": [
        "[ERC-4361's verification requirements](https://ercs.ethereum.org/ERCS/erc-4361#verifying-a-signed-message) cover message grammar, expected values and signature validity. Check the intended domain, URI, chain, version and challenge rather than accepting whichever values arrived in the submitted message.",
        "The standard recommends a nonce with enough unpredictability for each session initiation. An implementation recommendation is to bind the issued challenge to the pending login and prevent it being accepted again after use. The precise nonce-generation mechanism is outside the standard's scope; the presence of a field named `nonce` does not prove replay protection is implemented.",
        "Check any supplied expiration and not-before bounds. Apply a deliberate freshness policy to issued-at rather than inventing a universal few-minute validity window. The optional expiration field is not automatically present in every conforming message."
      ]
    },
    {
      "heading": "Recovering an EOA signer is only one check",
      "paragraphs": [
        "For an externally owned account, [ERC-191](https://ercs.ethereum.org/ERCS/erc-191) defines the personal-message framing used by SIWE. That framing separates these signed bytes from an ordinary Ethereum transaction.",
        "In ethers v6, [hashMessage and verifyMessage](https://docs.ethers.org/v6/api/hashing/#verifyMessage) provide message hashing and signer recovery. Recovery identifies the address associated with a signature over the supplied message. It does not itself parse SIWE, compare your application's domain or consume your application's nonce. Those checks remain necessary."
      ]
    },
    {
      "heading": "Contract accounts use contract validation",
      "paragraphs": [
        "For contract accounts, SIWE recommends [ERC-1271](https://ercs.ethereum.org/ERCS/erc-1271#specification), with the validating contract resolved on the declared chain. ERC-1271 defines `isValidSignature(hash, signature)` and the successful return value `0x1626ba7e`.",
        "This is a validation interface, not a claim that a contract has a private key or produces a signature by calling ERC-1271. The contract evaluates supplied signature data under its own rules. Those rules may depend on state, time, signer permissions or the signature scheme, so an EOA-recovery-only path is not a general contract-account verifier. SIWE also calls for considering session invalidation when relevant validation state changes."
      ]
    },
    {
      "heading": "Keep authentication, sessions and permissions distinct",
      "paragraphs": [
        "[Ethereum's authentication documentation](https://ethereum.org/developers/docs/ethereum-stack/authentication/) separates sharing a wallet address from signing a login challenge. After authentication, the application still needs session management, such as a session cookie or JWT. SIWE requires the session to bind to the verified address rather than a mutable resolved resource.",
        "The standard leaves interpretation of the optional resources list and authorization to server resources outside its scope. Likewise, ERC-191 framing does not make every offchain signature harmless: ERC-1271's motivation describes signed orders that can authorize later asset movement."
      ]
    },
    {
      "heading": "Before accepting the login",
      "paragraphs": [
        "Check the displayed site and account; validate the complete message; compare its fields with the expected login context; verify through the appropriate account method; and enforce challenge and session handling. A chain ID in a message is context that must be checked, not a standalone guarantee against misuse.",
        "This is an AI-assisted review of the cited specifications and documentation. It does not certify a particular wallet, application or live login session, and no signature or wallet test was performed."
      ]
    }
  ],
  "sources": [
    {
      "id": "p02-s1",
      "label": "ERC-4361: Sign-In with Ethereum",
      "url": "https://ercs.ethereum.org/ERCS/erc-4361",
      "sourceType": "primary",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "id": "p02-s2",
      "label": "ERC-191: Signed Data Standard",
      "url": "https://ercs.ethereum.org/ERCS/erc-191",
      "sourceType": "primary",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "id": "p02-s3",
      "label": "ERC-1271: Standard Signature Validation Method for Contracts",
      "url": "https://ercs.ethereum.org/ERCS/erc-1271",
      "sourceType": "primary",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "id": "p02-s4",
      "label": "ethers v6 Hashing Utilities",
      "url": "https://docs.ethers.org/v6/api/hashing/",
      "sourceType": "primary",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "id": "p02-s5",
      "label": "Authentication on Ethereum",
      "url": "https://ethereum.org/developers/docs/ethereum-stack/authentication/",
      "sourceType": "primary",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    }
  ],
  "sourceDates": [
    {
      "sourceId": "p02-s1",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "sourceId": "p02-s2",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "sourceId": "p02-s3",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "sourceId": "p02-s4",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    },
    {
      "sourceId": "p02-s5",
      "publishedAt": null,
      "verifiedAt": "2026-11-09T13:20:14.373Z"
    }
  ],
  "originalEvidence": [
    {
      "type": "source_audit",
      "description": "Specification-based field and verification checklist separating origin checks, application challenge handling, EOA recovery, contract-account validation and application sessions. Documentation comparison only; no wallet or login session was tested.",
      "observedAt": "2026-11-09T13:20:14.374Z"
    },
    {
      "type": "structured_comparison",
      "description": "Illustrative SIWE message with expected origin, nonce, time and account-method checks. No signature executed.",
      "observedAt": "2026-11-10T08:12:37.245Z"
    }
  ],
  "reviewedAt": "2026-11-10T08:12:37.245Z",
  "affiliate": {
    "enabled": false,
    "partnerId": null,
    "linkId": null,
    "disclosureRequired": false,
    "rel": null
  },
  "disclosure": "AI-assisted review of SIWE and account-signature documentation. No wallet signature or live login session was tested. No affiliate links are enabled.",
  "internalLinks": [
    "/articles/disconnect-vs-revoke-token-access/",
    "/articles/eip7702-wallet-delegation-security-checks/"
  ],
  "telegramCohort": {
    "surface": "article",
    "cohortId": "article"
  },
  "format": "markdown",
  "seoTitle": "Sign‑In with Ethereum: What to Check Before Signing a Login Message",
  "metaDescription": "Check SIWE message fields, request origin, nonces and account validation. Separate signature recovery from complete login verification and session management.",
  "ads": "off",
  "datePublished": "2026-11-09T21:02:14.438Z",
  "dateModified": "2026-11-10T08:12:37.245Z",
  "heroImage": {
    "src": "/articles/assets/sign-in-with-ethereum-login-message-checks/diagram.png",
    "width": 1600,
    "height": 900,
    "sha256": "a3b73dd8ca1eae995dd5ff82f69e32a91f68ffbe901565555ce4c8d3fb3d786e",
    "alt": "Three explanatory cards separate a SIWE login message, its request origin and account signature validation.",
    "variants": [
      {
        "src": "/articles/assets/sign-in-with-ethereum-login-message-checks/diagram-768.png",
        "width": 768,
        "height": 432,
        "sha256": "66875cbec605b89f7930bcec3b06f58a2f9b1f5ffea1ded3fe39c9d0ad7249e1"
      },
      {
        "src": "/articles/assets/sign-in-with-ethereum-login-message-checks/diagram-480.png",
        "width": 480,
        "height": 270,
        "sha256": "6fb6418a63acc4ee1411f2bbbb7c9fe6101879701a4e3c1d6471c6d19893844e"
      }
    ],
    "rights": {
      "status": "owned",
      "kind": "owned_explanatory_diagram",
      "credit": "JEPETA — owned programmatic explanatory diagram"
    },
    "provenance": {
      "createdAt": "2026-11-09T15:06:27.882Z",
      "sourceSha256": "38a44d88256d527c4c8cc31532faa0455a50eb02fb01a99db4d0db31ad2f6100",
      "tool": "Chromium fixed trusted diagram renderer",
      "method": "Escaped editorial labels rendered through a fixed layout; no model-generated HTML or commands."
    },
    "diagram": {
      "title": "SIWE: message, origin and signature checks",
      "labels": [
        "Message: read the requested login fields",
        "Origin: match the requesting site",
        "Signature: use the account verification method"
      ],
      "caption": "EOA recovery alone is not a complete login check. Documentation-based illustration only.",
      "alt": "Three explanatory cards separate a SIWE login message, its request origin and account signature validation."
    }
  },
  "keyTakeaways": [
    "Match the requesting origin, account, URI and chain to the expected login before accepting the message.",
    "Bind a server-issued nonce to the pending login and consume it once; enforce the declared time bounds.",
    "Verify EOA signatures and contract-account signatures through their appropriate methods, then create an address-bound session."
  ],
  "related": [
    {
      "url": "/articles/disconnect-vs-revoke-token-access/",
      "title": "Wallet connection versus token allowance"
    },
    {
      "url": "/articles/eip7702-wallet-delegation-security-checks/",
      "title": "Account delegation and authorization checks"
    }
  ],
  "editorialTransparency": "AI-assisted review of SIWE and account-signature documentation. No wallet signature or live login session was tested. No affiliate links are enabled. Examples are explicitly illustrative. They do not represent live chain observations or completed wallet or validator tests."
}
