DocumentREADME
Version0.1.0-draft
StatusDraft Specification
Last Updated2025-12-01

Getting Started with WDP

Waddling Diagnostic Protocol - Quick start guide and overview

Abstract#

The Waddling Diagnostic Protocol (WDP) is a comprehensive, structured error coding system designed for modern distributed systems. It provides:

  • Structured, semantic error codes for human readability and debugging
  • Compact IDs for efficient network transmission and storage
  • Multi-language support through catalog-based expansion
  • Namespace isolation for multi-service architectures
  • Offline capability through client-side catalog caching
  • Efficient wire format with minimal transmission overhead

WDP solves the challenge of creating error codes that are both meaningful to developers and efficient for systems.

Quick Example#

Traditional approach:

Json
{
  "error": {
    "code": "E.AUTH.TOKEN.EXPIRED",
    "message": "Token expired at 2024-01-15T10:30:00Z",
    "description": "The JWT token has exceeded its TTL."
  }
}

WDP approach:

Json
{
  "xY9Kp": {
    "f": {"timestamp": "2024-01-15T10:30:00Z"}
  }
}

Client expands xY9Kp using a pre-downloaded catalog to display:

โŒ Error: Token expired at 2024-01-15T10:30:00Z
๐Ÿ’ก Use /auth/refresh endpoint with refresh token
Key Insight

WDP separates the error identity (compact ID) from the error description (catalog). This enables efficient transmission while maintaining rich error information.

Recommended Reading Order#

1. Start Here

2. Core Specifications (Parts 1-5)

3. Conventions

4. Multi-Service Support

5. Internationalization

  • 8-I18N โ€” Multi-language support

6. Catalog System (Part 9)

7. User Experience

8. Security & Metadata

  • 11-SECURITY โ€” Security considerations and PII handling
  • 12-METADATA โ€” Additional diagnostic metadata

Architecture#

The 5-Part Structure

Every WDP error code consists of five parts:

E.Auth.Token.001 โ†’ xY9Kp
โ”‚ โ”‚    โ”‚     โ”‚     โ”‚
โ”‚ โ”‚    โ”‚     โ”‚     โ””โ”€ Part 5: Compact ID (5-char hash)
โ”‚ โ”‚    โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Part 4: Sequence (001)
โ”‚ โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Part 3: Primary (Token)
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Part 2: Component (Auth)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Part 1: Severity (E = Error)

Dual representation:

  • Parts 1-4: Human-readable structured code (E.AUTH.TOKEN.001)
  • Part 5: Machine-friendly compact ID (xY9Kp)

Both identify the same diagnostic but serve different purposes.

Catalog-Based Expansion

WDP uses a catalog system to enable efficient transmission:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Server         โ”‚  Sends: {"xY9Kp": {"f": {"timestamp": "..."}}}
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Client         โ”‚  1. Downloads catalog once (cached)
โ”‚  + Catalog      โ”‚  2. Looks up xY9Kp โ†’ full metadata
โ”‚                 โ”‚  3. Interpolates fields
โ”‚                 โ”‚  4. Displays: "Token expired at ..."
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Benefits:

  • Compact wire format with efficient transmission
  • Offline expansion capability
  • Multi-language support (different catalogs per language)
  • Consistent error identification across services

Namespace Support

For multi-service architectures, WDP supports namespaces to prevent collision:

Single-namespace catalog (90% of use cases):

Json
{
  "namespace": "auth_service",
  "diags": {
    "xY9Kp": {"code": "E.Auth.Token.001", ...}
  }
}

Aggregated catalog (monitoring, gateways):

Json
{
  "namespaces": {
    "auth_service": "h4tYw2",
    "payment_service": "k9Px3a"
  },
  "diags": {
    "h4tYw2-xY9Kp": {"code": "E.Auth.Token.001", ...},
    "k9Px3a-mN3Yr": {"code": "E.Payment.Invalid.001", ...}
  }
}

See 7-NAMESPACES for details.

Use Cases#

1. IoT Devices

Problem: Constrained bandwidth and battery

Solution: Send 5-character compact IDs instead of full error messages

Sensor โ†’ {"xY9Kp": {"f": {"temp": "45.2"}}}
Gateway expands โ†’ "Temperature 45.2ยฐC exceeds threshold"

2. Mobile Applications

Problem: Slow/expensive mobile networks

Solution: Download catalog once, expand errors locally

1. App downloads catalog (cached for 7 days)
2. API returns compact diagnostics
3. App expands locally (works offline)
4. Supports multiple languages

3. Microservices Architecture

Problem: High-volume logging across distributed services

Solution: Compact log entries with efficient aggregation

Service A: [xY9Kp] Auth failure
Service B: [xY9Kp] Auth failure
Service C: [xY9Kp] Auth failure
โ†’ Centralized logging aggregates by compact ID

4. Multi-Language Support

Problem: Supporting multiple languages efficiently

Solution: Same compact IDs, different language catalogs

Backend โ†’ {"xY9Kp": {"f": {"timestamp": "2024-01-15"}}}

English client:  "Token expired at 2024-01-15"
Spanish client:  "Token expirรณ el 2024-01-15"
Japanese client: "ใƒˆใƒผใ‚ฏใƒณใฎๆœ‰ๅŠนๆœŸ้™ใŒๅˆ‡ใ‚Œใพใ—ใŸ 2024-01-15"

Key Features#

FeatureDescription
Structured & SemanticFive-part structure: Severity.Component.Primary.Sequence with human-readable codes
Compact & Efficient5-character Base62 hash IDs with O(1) catalog lookups
InternationalizationCatalog-based message expansion, same compact ID for all languages
Multi-Service ReadyNamespace support for collision prevention, aggregated catalogs
Offline CapableClient-side catalog caching, works without network
Developer FriendlyClear severity levels, actionable hints, consistent attribution

Conformance Levels#

WDP defines three conformance levels:

LevelNameDescription
Level 0Error Codes (Basic)Implement Parts 1-4 (structured codes). Minimum viable implementation.
Level 1Compact IDs (Standard)Level 0 + Part 5 (compact ID generation). Recommended for most applications.
Level 2Extended (Full)Level 1 + Parts 6-12 (catalogs, namespaces, i18n, etc.). Required for multi-service, high-scale systems.

Status#

This specification is currently in DRAFT status. All documents are subject to change based on implementation feedback and community discussion.

FieldValue
Current Version0.1.0-draft
Target Stable Version1.0.0
LicenseCC BY 4.0

Specification Stability

For version 0.1.0-draft, specification parts are classified by stability:

ClassificationPartsDescription
Stable1-5Core protocol (Severity, Component, Primary, Sequence, Compact ID). Breaking changes unlikely.
Provisional7-9, 11-12Well-designed but may evolve. Catalog format includes version field for migration.
Informative6, 10Non-normative guidance. May change freely.

Contributing#

We welcome contributions! Please see the contributing guidelines for details.

Ways to Contribute

  • Report issues or suggest improvements
  • Propose new features or extensions
  • Share implementation feedback
  • Improve documentation and examples

Quick Links

Copyright ยฉ 2025 Ashutosh Mahala
Licensed under CC BY 4.0