Skip to content

Step 1: Onion address parsing and validation #37

@igor53627

Description

@igor53627

Parent Issue

Part of #23 (Onion service support)

Overview

Add onion address parsing using tor-hscrypto crate.

Tasks

  • Add tor-hscrypto dependency to webtor
  • Create webtor/src/onion.rs module
  • Implement OnionAddress type wrapping HsId
  • Add helper to detect .onion hostnames in URLs
  • Add unit tests for v3 onion address parsing
  • Verify WASM build still works

Technical Notes

  • tor-hscrypto already compiles for WASM
  • HsId implements FromStr for parsing "${base32}.onion" addresses
  • Validates checksum and version byte (v3 = 0x03)

Acceptance Criteria

  • Can parse valid v3 onion addresses
  • Rejects invalid/v2 addresses with clear errors
  • All tests pass on both native and WASM

Metadata

Metadata

Assignees

No one assigned

    Labels

    .onionRelated to onion service supportenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions