Skip to main content

Authentication

SHIELD uses Sign-In with Ethereum (SIWE) for authentication. No passwords required—just your wallet.

SIWE Flow

Endpoints

1. Get Nonce

Returns a unique nonce for signing. Response:

2. Verify Signature

Request Body:
The message follows the EIP-4361 SIWE standard. Response:

3. Authenticated Requests

Include the JWT in subsequent requests:
Or via Authorization header:

SIWE Message Format

Client Implementation

Using wagmi + siwe

Using ethers.js

Session Details

Security Considerations

Nonce Requirements

  • Must be used within 5 minutes
  • Single-use only
  • Cryptographically random (32 bytes)

Signature Verification

Server verifies:
  • Signature is valid
  • Address matches recovered signer
  • Nonce was issued by server
  • Domain matches expected
  • Chain ID is supported

Replay Protection

  • Nonces are single-use
  • Timestamps prevent old signatures
  • Sessions expire after 1 hour

Error Codes

Testing

Test Authentication