Winding Ring — Specification & Implementation
Webring Topology Visualizer with URL State Protocol
Table of Contents
Introduction
A webring with ord members and next/prev navigation is a discrete cylinder.
The position \((k, w) \in \mathbb{Z}_{\text{ord}} \times \mathbb{Z}\) has ring
position \(k\) on a circle and winding count \(w\) on an unbounded integer axis.
The fundamental group \(\pi_1(S^1 \times \mathbb{R}) \cong \mathbb{Z}\) has one
generator: the ring loop. The winding number is the covering space coordinate
for the universal cover \(\mathbb{R} \to S^1\) — a spiral staircase, not a donut.
Nomenclature
| Display | Code | Domain | Description |
|---|---|---|---|
ord |
n |
\(\mathbb{N}^+\) | Order of cyclic group \(\vert\mathbb{Z}_{\text{ord}}\vert\) |
k |
p |
\(\mathbb{Z}_{\text{ord}}\) | Element in cyclic group (1-indexed) |
w |
w |
\(\mathbb{Z}\) | Winding number (net circuits) |
t |
t |
\(\mathbb{N}\) | Turning count (direction reversals) |
d |
d |
\(\{+, -\}\) | Direction (\(+\) = positive, \(-\) = negative) |
The display uses group-theoretic notation (ord, k) while the implementation
uses shorter variable names (n, p) for readability.
Why This Matters
Traditional webrings have no memory. You click "next" and arrive at a page with no knowledge of how many members you've visited or how many times you've traversed the ring. By encoding the traversal state in the URL itself, we get:
- Stateless persistence — no cookies, no server, the URL is the state
- Topological coordinates — every URL is a point on the cylinder
- Analytics via UTM — standard attribution tracks ring traversal
- Visual rendering — any URL can be rendered as its helix position
Behavioral Classes
User behavior can be classified by the \((w, t)\) trajectory:
Passive Observer
Single page view, no navigation.
\(w = 0, t = 0\)
Linear Explorer
Forward traversal, no reversals.
\(w \geq 0, t = 0, d = +\)
Backtracker
Reverses direction at least once.
\(t > 0\)
Circumnavigator
Completes at least one full circuit.
\(|w| \geq 1\)
Oscillator
High turning count relative to winding.
\(t \gg |w|\)
URL Protocol Specification
Canonical Form
https://wal.sh/?w=3&t=5&d=n&utm_source=ring&utm_medium=webring&utm_campaign=wwn
Parameters
| Param | Default | Domain | Description |
|---|---|---|---|
w |
0 | \(\mathbb{Z}\) | Winding number (omit if 0) |
t |
0 | \(\mathbb{N}\) | Turning count (omit if 0) |
d |
+ | \(\{n\}\) | Direction (omit for +, use d=n for −) |
Note: ord and k are inferred from the manifest (/.well-known/webring.json)
and current host, not passed in URL.
Defaults and the Trivial Ring
The bare URL with no parameters yields the origin of the cylinder:
https://wal.sh/
This is (ord=1, k=1, w=0, t=0, d=+) — a single node, no winding, at rest.
Display Format
ord=7 k=1 w=3 t=5 d=−
Only non-default values shown after ord and k.
State Transitions
Winding Changes on Wraparound Only
| Direction | Condition | Effect |
|---|---|---|
| + | k = ord | k → 1, w → w+1 |
| + | k < ord | k → k+1 |
| − | k = 1 | k → ord, w → w−1 |
| − | k > 1 | k → k−1 |
Turning Changes on Direction Reversal Only
| Previous d | New action | Effect |
|---|---|---|
| + | prev | t → t+1, d → − |
| − | next | t → t+1, d → + |
| + | next | t unchanged |
| − | prev | t unchanged |
Formal Transition Functions
Mathematical Background
The Fundamental Group of the Circle
For a single webring (ignoring intra-site navigation):
\[\pi_1(S^1) \cong \mathbb{Z}\]
The winding number \(w\) is the single generator.
Topology: Cylinder or Torus?
The topology depends entirely on boundary behavior:
| Design | \(w\) space | Topology | \(\pi_1\) | Hole |
|---|---|---|---|---|
| Unbounded | \(\mathbb{Z}\) | Cylinder (infinite) | \(\mathbb{Z}\) | No |
| Clamped | \([-N, N]\) | Cylinder (finite, capped) | \(\mathbb{Z}\) | No |
| Wrapped | \(\mathbb{Z}_{2N+1}\) | Torus | \(\mathbb{Z} \times \mathbb{Z}\) | Yes |
Unbounded: Infinite Cylinder
With \(w \in \mathbb{Z}\) unbounded, the state space \((k, w) \in \mathbb{Z}_{\text{ord}} \times \mathbb{Z}\) is a cylinder — a spiral staircase, not a donut:
- \(k \in \mathbb{Z}_{\text{ord}}\) — cyclic, wraps (discrete \(S^1\))
- \(w \in \mathbb{Z}\) — unbounded, never wraps (\(\cong \mathbb{R}\), contractible)
The winding number is the covering space coordinate for \(\mathbb{R} \to S^1\). There is no hole. \(\pi_1(S^1 \times \mathbb{R}) \cong \mathbb{Z}\).
Clamped: Finite Cylinder
With \(w \in [-N, N]\) clamped (sticking at boundaries), the state space is \(\mathbb{Z}_{\text{ord}} \times [-N, N]\): a cylinder with caps. Navigation dies at the edges. Still no hole. \(\pi_1 \cong \mathbb{Z}\).
Wrapped: Torus (Implemented)
We implement wrapping: \(w\) wraps at \(\pm 8191\) (\(2^{13}-1\), Mersenne prime), giving \(w \in \mathbb{Z}_{16383}\). The state space is \(\mathbb{Z}_{\text{ord}} \times \mathbb{Z}_{16383}\): a discrete torus with \(\pi_1(T^2) \cong \mathbb{Z} \times \mathbb{Z}\). The hole is real.
A bot crawling in one direction traces a path on this torus. The path topology depends on \(\gcd(\text{ord}, 16383)\):
- If \(\gcd(\text{ord}, 16383) = 1\): the bot visits every state before returning, tracing a $(1, \text{ord})$-torus knot — a curve that can't be deformed into either generator loop.
- If \(\gcd(\text{ord}, 16383) = g > 1\): the bot covers only \(\frac{\text{ord} \cdot 16383}{g}\) states, tracing a simpler closed curve. Multiple bots tile the torus into \(g\) parallel strands.
Bot Fingerprinting via Homotopy Class
The clamp enables behavioral classification via torus knot topology:
| Behavior | Path characteristics | Homotopy class |
|---|---|---|
| Human browser | low \(w\), high \(t\) | small winding, many turns |
| Linear scraper | monotonic \(w\) | $(1, \text{ord})$-knot |
| Ping-pong bot | \(w \approx 0\), \(t \to \infty\) | trivial (contractible) |
The feature space for crawler detection is \(\pi_1(T^2)\). The hole distinguishes obsessive crawlers (high winding) from casual browsers (low winding, high turning).
Connection to Winding Numbers
In complex analysis, the winding number of a closed curve \(\gamma\) around a point \(z_0\) is:
\[n(\gamma, z_0) = \frac{1}{2\pi i} \oint_\gamma \frac{dz}{z - z_0}\]
In the discrete webring case, this simplifies: each full traversal of
ord members increments the winding number by 1.
Game Mechanics
TODO: Define scoring, achievements, leaderboard based on \((w, t)\) trajectories.
