A modern, user-friendly web application for decoding and validating Nostr HTTP Authentication tokens (NIP-98). This tool helps developers and users understand the structure and validity of NIP-98 tokens used in Nostr-based authentication systems.
NIP-98 defines a standard for HTTP authentication using Nostr events. This decoder allows you to:
- Decode base64-encoded NIP-98 tokens
- Validate token structure and required fields
- Inspect event metadata, identity information, and tags
- Verify token freshness and cryptographic validity
- Debug authentication issues in Nostr applications
- Real-time Validation: Instant feedback on token structure and validity
- Comprehensive Checks: Validates all required NIP-98 fields and constraints
- Beautiful UI: Modern, responsive interface with smooth animations
- Dark Mode Support: Automatic theme switching based on system preferences
- Mobile Friendly: Works seamlessly on desktop and mobile devices
- Developer Friendly: Clear error messages and detailed validation results
- Node.js 18+ and npm
- Modern web browser
- Clone the repository:
git clone https://github.com/hexquarter/nip98-decoder.git
cd nip98-decoder- Install dependencies:
npm install- Start the development server:
npm run dev- Open http://localhost:5174 in your browser
npm run build
npm run preview- Paste a Token: Copy a NIP-98 token (with or without the "Nostr " prefix) into the text area
- View Results: The app will automatically decode and validate the token
- Check Validation: Review the validation checks to ensure the token meets NIP-98 requirements
- Inspect Details: Examine event metadata, identity information, and tags
Nostr eyJub3N0ciI6eyJpZCI6IjEyMzQ1Njc4OTAiLCJwdWJrZXkiOiJhYmNkZWYiLCJzaWciOiIxMjM0NTY3ODkwIiwia2luZCI6MjcyMzUsImNyZWF0ZWRfYXQiOjE2NDU4MzY3ODksInRhZ3MiOltbInUiLCJodHRwczovL2V4YW1wbGUuY29tIl0sWyJtZXRob2QiLCJHRVQiXV19fQ==
The decoder performs the following validations:
- Kind Validation: Ensures event kind is 27235 (NIP-98)
- Public Key: Validates 64-character hexadecimal pubkey
- Signature: Checks for valid 128-character hexadecimal signature
- Event ID: Verifies 64-character hexadecimal event ID
- Timestamp: Confirms created_at is within acceptable time window
- URL Tag: Validates presence of "u" tag with target URL
- Method Tag: Checks "method" tag contains valid HTTP verb
- Payload Tag: Optional SHA-256 hash of request body
- Frontend: React 19 with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS v4
- Icons: Built-in SVG icons
- Nostr Integration: nostr-tools library
This tool implements NIP-98: HTTP Auth, which defines how Nostr can be used for HTTP authentication. Key requirements:
- Event kind must be
27235 - Must include
utag with target URL - Must include
methodtag with HTTP method - May include
payloadtag with request body hash - Event must be signed by the authenticating user
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- Nostr Protocol for the decentralized social protocol
- NIP-98 Specification
- nostr-tools for Nostr utilities