How Link Shortening Works

We compress 256-bit blockchain IDs into 3-character URLs using shortest-prefix detection and base62 encoding.

TL;DR

95% compressionZero collisions

Our two-stage algorithm finds the shortest unique hexadecimal prefix for each ID, then compresses it to base62. This creates URLs like i7n.xyz/9LE that are 95% shorter than full blockchain identifiers while maintaining perfect uniqueness through creation-date sorting.

Why 64-Character URLs Don't Work

Intuition protocol uses 256-bit hexadecimal identifiers for atoms, triples, and lists. These IDs are 64 characters long, making them impractical for sharing on social media or messaging platforms.

0x8c486fd3377cef67861f7137bcc89b188c7f1781314e393e22c1fa6fa24e520e

Our solution: A two-stage algorithm that achieves ~95% compression while maintaining uniqueness and readability.

The Two-Stage Algorithm

1

Find Shortest Unique Prefix

Instead of using the full 64-character ID, we find the shortest prefix that uniquely identifies the term in the Intuition database.

Full ID: 0x8c486fd3377cef67861f7137bcc89b188c7f1781314e393e22c1fa6fa24e520eShortest: 0x8c48

The algorithm uses smart collision detection: it starts with a 2-character prefix and increments by 2 until it finds a unique match. Most terms need only 4-8 characters.

How Creation Date Ensures Uniqueness

When multiple terms share the same starting characters, the system uses creation date sorting to determine which term gets the shorter ID. Terms are sorted by when they were created (oldest first), ensuring:

  • Older terms get shorter IDs: The first term created with a prefix claims that short ID
  • Newer terms need longer prefixes: Later terms with similar starting characters require more characters to differentiate
  • Deterministic behavior: The same prefix always resolves to the same (oldest) term
// Example collision scenarioTerm A (created Jan 1, 2024): 0x8c486fd3377cef67861f7137bcc89b188c7f1781...Term B (created Feb 15, 2024): 0x8c489a2b5d8e1f47c2d3b8f4e9a1c5d7f2b6a4e8... ^ Differ at position 5Short ID for Term A: 0x8c486f → 9LKx (6 chars)Short ID for Term B: 0x8c489a → 9LMp (6 chars)

If you try to shorten a newer term that shares a prefix with an older term, the algorithm will detect the collision and return a longer prefix to ensure the URL uniquely identifies the correct term.

2

Compress with Base62

We convert the shortest hex prefix to base62 (using 0-9, A-Z, a-z) for maximum URL density.

Hex: 0x8c48 (4 characters)Base62: 9LE (3 characters)

Base62 uses the full alphanumeric character set, resulting in shorter URLs that are still easy to read and share.

Final Result
i7n.xyz/9LE
95% shorter

Live Examples

Atom

Before
portal.intuition.systems/explore/atom/0x8c486fd3377cef67861f7137bcc89b188c7f1781314e393e22c1fa6fa24e520e
After
i7n.xyz/9LE

Triple

Before
portal.intuition.systems/explore/triple/0xa1739235f5a8362b15268eab46484abdd7660a1e2a6a5d7deacbed9d4c055e68
After
i7n.xyz/Akd

List

Before
portal.intuition.systems/explore/list/0x7ec36d201c842dc787b45cb5bb753bea4cf849be3908fb1b0a7d067c3c3cc1f5-0xc2bd74b8b79a52c311e2adcfe3739db273c4c5df1168dd5f30471998877dd784
After
i7n.xyz/8RP/Cy5

Lists use two short IDs (predicate and object) separated by a slash

Deep Dive: How the Algorithm Works

Understanding the exact mechanics of prefix finding and collision resolution helps explain why some URLs are shorter than others.

Step-by-Step Algorithm Flow

1

Start with shortest prefix (2 characters)

Extract first 2 hex characters after "0x" (e.g., 0x8c)

2

Query database with wildcard

Search for all IDs matching 0x8c% (LIKE operator)

Results are sorted by created_at: asc (oldest first)

3

Check first result

If first result matches your target ID → Success! Use this prefix

4

Handle collision (first result is different)

Compare character-by-character to find where they differ

Jump directly to the needed prefix length (smart optimization)

5

Repeat until unique

Continue with longer prefixes until finding one that uniquely identifies your term as the first result

Real-World Example Scenarios

SCENARIO 1Unique Early Prefix (Ideal Case)
Your term: 0x8c486fd3377cef67861f7137bcc89b188c7f1781314e393e22c1fa6fa24e520e
Query 1: Search 0x8c% → Returns 5 results, first one is 0x8c48... (different term)
Query 2: Smart jump to 0x8c48% → Returns 1 result matching your term
Result: 0x8c48 (4 characters)Base62: 9LE (3 characters)Final URL: i7n.xyz/9LE
SCENARIO 2Early Collision (Newer Term)
Older term (Jan 2024): 0x7a3b9c2d8f1e4a6b5c9d2e8f1a3b7c4d9e2f8a1b6c3d7e9f2a5b8c1d4e7f9a2bYour term (Mar 2024): 0x7a3b9c5a1f2e3d4c5b6a7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a ^ Differ at position 7
Query 1: Search 0x7a% → Returns older term first (created earlier)
Query 2: Smart jump to 0x7a3b9c2d% → Older term still appears first
Query 3: Use 0x7a3b9c5a% → Your term appears first!
Result: 0x7a3b9c5a (8 characters)Base62: 2Gf9Jm (6 characters)Final URL: i7n.xyz/2Gf9Jm
SCENARIO 3Medium Collision (Mid-Length Prefix)
Older term (Feb 2024): 0xa1739235f5a8362b15268eab46484abdd7660a1e2a6a5d7deacbed9d4c055e68Your term (Apr 2024): 0xa1739235f5a8362b15268fab72b9c3d5e8f1a2b6c4d7e9f3a5b8c2d6e1f4a7b9c ^ Differ at position 26
Query 1: Search 0xa1% → Older term appears first
Query 2: Smart jump to position 26, use 0xa1739235f5a8362b15268f prefix → Your term appears first!
Result: 0xa1739235f5a8362b15268f (26 chars)Base62: 7kNmQxDwFpHr (12 characters)Final URL: i7n.xyz/7kNmQxDwFpHr

Key Takeaway

The length of your shortened URL depends on when your term was created and how similar its ID is to older terms. This is why:

  • Terms with unique early hex patterns get very short URLs (3-6 characters)
  • Terms sharing longer prefixes with older terms need proportionally longer URLs (typically 6-20 characters)
  • The same short URL always resolves to the same term (deterministic behavior)
  • Most URLs achieve 80-95% compression despite this collision handling

Social Media Features

Beyond just shortening URLs, our service optimizes links for social media sharing:

Key Advantages

This approach offers several important benefits:

Developer API

In addition to the web interface, we provide REST API endpoints for programmatic access. These endpoints return shortened URLs as plain text, making them ideal for integration with other services and automation workflows.

Term Shortening API

GET /api/short/term/:termId

Accepts hex IDs (full or partial) or base62 IDs. Returns the shortened URL as plain text.

Example Request
curl i7n.xyz/api/short/term/0x8c486fd3377cef67861f7137bcc89b188c7f1781314e393e22c1fa6fa24e520e
Response
i7n.xyz/9LE

List Shortening API

GET /api/short/list/:predicateTermId/:objectTermId

Accepts hex IDs or base62 IDs for both the predicate and object terms.

Example Request
curl i7n.xyz/api/short/list/0x7ec36d201c842dc787b45cb5bb753bea4cf849be3908fb1b0a7d067c3c3cc1f5/0x8ed4f8de1491e074fa188b5c679ee45c657e0802c186e3bb45a4d3f3faa6d426
Response
i7n.xyz/8RP/9Vk

API Features: Format detection, plain text response, error handling, and parallel processing for optimal performance.

Try It Yourself

Experience the compression in action by shortening your own Intuition URLs.