{"id":"e6deb65a89a762ecf6562e9df4c9c4065e7034df2674d9136f95bdf28acea93c","pubkey":"867d7d8f08f454618ff50ec981de1a66bac5149d88b138589a0861789ce5b04f","created_at":1769376800,"kind":30817,"tags":[["d","url-indexing"],["title","URL Indexing"],["k","31263"],["client","nostrhub.io"]],"content":"## Abstract\n\nThis NIP defines `kind:31263` (parameterized replaceable event) to publish metadata about URLs.\nEach event represents the indexing result of a URL and contains normalized identifiers and extracted metadata.\n\nThese events can be used to build decentralized search indexes, discovery systems, and content catalogs.\n\n## Event Structure\n\n```json\n{\n  \"kind\": 31263,\n  \"tags\": [\n    [\"d\", \"<normalized-url>\"],\n    [\"title\", \"<title>\"],\n    [\"description\", \"<meta-description>\"],\n    [\"l\", \"<language-code>\"],\n    [\"keywords\", \"<comma-separated-keywords>\"],\n    [\"x\", \"<sha256-page-hash>\"],\n    [\"m\", \"<mime-type>\"]\n  ],\n  \"content\": \"<raw-text-snippet>\"\n}\n```\n### Tags\n- **d**: Normalized URL identifier (see normalization rules below). *(Required)*\n- **title**: Title of the page (from \\<title> tag). *(Optional)*\n- **description**: Meta description (from \\<meta name=\"description\">). *(Optional)* \n- **l**: Language of the content (ISO 639-1 code, e.g., en, fr). *(Optional)* \n- **keywords**: Comma-separated keywords (from \\<meta name=\"keywords\">). *(Optional)*\n- **x**: SHA-256 hash of the full page content (for deduplication). *(Optional)*\n- **m**: MIME type of the content (e.g., text/html, application/pdf). *(Optional)*\n\n### Content\nA plain-text snippet extracted from the main readable content.\n\n## Normalized URL\n\n1. Convert the **scheme** and **host** to lowercase: \n- HTTP://Example.COM → http://example.com. \n2. Remove default ports: \n- https://example.com:443 → https://example.com. \n3. Remove the www. prefix: \n- https://www.example.com → https://example.com. \n4. Strip non-essential query parameters: \n- Remove tracking parameters (e.g., ?utm_source=..., ?ref=...). \n- Keep essential parameters (e.g., ?lang=fr, ?id=123). \n- Example: https://example.com/page?lang=fr&ref=abc → https://example.com/page?lang=fr. \n5. Remove fragments (#section): \n- https://example.com/page#intro → https://example.com/page. \n6. Resolve relative paths: \n- https://example.com/a/../b → https://example.com/b. \n7. Remove trailing slashes (except for root /): \n- https://example.com/path/ → https://example.com/path. \n8. Percent-encode special characters: \n- https://example.com/my page → https://example.com/my%20page. \n9. Sort remaining query parameters alphabetically: \n- https://example.com/page?b=2&a=1 → https://example.com/page?a=1&b=2. \n10. Normalize Internationalized Domain Names (IDNs): \n- Convert IDNs to Punycode (e.g., https://例子.测试 → https://xn--fsqu00a.xn--0zwm56d).\n\n## Conflicting Metadata\nIn cases where multiple events with the same normalized URL have conflicting metadata, clients can prioritize events based on the following criteria:\n- **Hash verification**: Events with a verified hash match are prioritized.\n- **Trusted sources**: Events from trusted indexers or contacts are prioritized.\n- **Timestamp**: More recent events may be prioritized if other criteria are equal.\n\n\n## Example\n\n```json\n{\n  \"id\": \"...\",\n  \"pubkey\": \"...\",\n  \"sig\": \"...\",\n  \"created_at\": 1769366915,\n  \"kind\": 31263,\n  \"tags\": [\n    [\"d\", \"https://example.com/articles/ostriches?lang=en\"],\n    [\"title\", \"The Social Life of Ostriches\"],\n    [\"description\", \"Analysis of ostrich social behaviors.\"],\n    [\"l\", \"en\"],\n    [\"keywords\", \"ostriches,animals,science\"],\n    [\"x\", \"6f5635035f36ad500b4fc4bb7816bb72ef5594e1bcae44fa074c5e988fc4c0fe\"],\n    [\"m\", \"text/html\"]\n  ],\n  \"content\": \"Ostriches live in groups called troops. They display complex social behaviors, including cooperative breeding and communal nesting. These behaviors allow them to gain benefits from social interactions, such as increased protection from predators and more effective rearing of their young.\"\n}\n```","sig":"5a1a63c7671c0a695cbf282b7a787878830658a792c7d016071ddc8b72b62f6a6149443573481caf1b5f3ac8148f9f8b4f7c118b8660b5ad7c8892f344623a69"}