smithery/neversight

viem-siwe

Comprehensive guide and reference implementation for Sign-In with Ethereum (SIWE) using the viem v2 library.

Installation

$ npx skills add smithery/neversight --skill viem-siwe

Summary

  • Comprehensive guide and reference implementation for Sign-In with Ethereum (SIWE) using the viem v2 library.
  • Use this skill when implementing authentication flows, verifying Ethereum addresses on a backend, parsing EIP-4361 messages, or managing SIWE sessions.
  • It includes nonce generation, message creation, signature verification, and best practices for replay protection and session management.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/neversight · top by installs.

npx skills add smithery/neversight

Browse all from smithery/neversight

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,836 B
  • docs SUMMARY.md 414 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Viem SIWE

This skill provides expertise in implementing Sign-In with Ethereum (SIWE) adhering to EIP-4361 using viem.

Reference Implementation

For a complete, copy-pasteable implementation of a SIWE auth module, refer to [references/implementation.md](references/implementation.md).

This implementation includes:

  • siwe.ts: Core logic for nonce generation, message creation, parsing, and verification.
  • index.ts: Public API for the auth module.

API Documentation

For detailed API documentation of viem's SIWE utilities (createSiweMessage, verifySiweMessage, etc.), refer to [references/api-docs.md](references/api-docs.md).

Critical Implementation Details

Nonce Management

  • Always generate a unique nonce for every login attempt.
  • Store nonces with an expiration (TTL) on the backend.
  • Verify and consume the nonce upon signature validation to prevent replay attacks.

Message Verification

  • Verify Domain: Ensure the domain in the message matches the host to prevent phishing.
  • Verify Chain ID: Ensure the chainId matches the expected network.
  • Check Expiration: Respect expirationTime and notBefore fields.

Smart Contract Wallets (ERC-1271)

When verifying signatures from smart contract wallets:

  • Use a PublicClient instance in verifySiweMessage.
  • Do not rely solely on verifyMessage which only works for EOAs.