Advanced Features
Understanding dURLs

Understanding dURLs

A deep dive into how decentralized URLs work in TELA, common misconceptions, and what to do when things don't go as planned.

πŸ’‘

Key Insight: A dURL is a human-friendly label, NOT a unique identifier. The SCID (Smart Contract ID) is the true identity of your application.

What is a dURL?

A dURL (Dero URL) is a human-readable name stored in your TELA contract, like myapp.tela or explorer.tela. It makes sharing and discovering applications easier than passing around 64-character SCIDs.

// Stored in your INDEX or DOC contract
33 STORE("dURL", "myapp.tela")

The Common Misconception

Many developers assume dURLs work like traditional domain names:

Traditional DNSTELA dURLs
βœ… Unique - only one owner per domain❌ NOT unique - anyone can use any dURL
βœ… Central registry (ICANN)❌ No registry - fully decentralized
βœ… Enforced ownership❌ No enforcement - just a label
βœ… Transfers between owners❌ Each contract has its own dURL store

Reality: Multiple INDEX contracts can have the exact same dURL. There's nothing preventing two developers from both deploying contracts with calculator.tela.


Why dURLs Are Not Unique

Decentralization Philosophy

On a decentralized blockchain, there's no central authority to enforce uniqueness. Implementing unique dURLs would require:

  • A central registry - Someone to approve/reject dURL claims (anti-decentralization)
  • First-come-first-served on-chain - Adds complexity, gas costs, and enables squatting
  • Governance voting - Slow and impractical for app naming

TELA chose simplicity and freedom over enforced uniqueness. Anyone can deploy anything with any dURL.

Legitimate Use Cases

There are valid reasons multiple contracts might share a dURL:

ScenarioWhy Same dURL Makes Sense
Forking an appDeveloper forks calculator.tela to improve it
Testnet vs MainnetSame app deployed to both networks
Competing implementationsTwo devs independently build a "calculator"
Version transitionsv1 and v2 coexist temporarily

SCID vs dURL: The True Identity

Understanding this distinction is critical:

PropertySCIDdURL
Uniquenessβœ… Cryptographically unique❌ Not enforced
Format64-character hex hashHuman-readable (e.g., myapp.tela)
ChangesNever (permanent)Can be updated (if INDEX is RS2)
PurposeTrue contract identityHuman convenience
AnalogyGit commit hashBranch name or tag
πŸ”‘

Think of it like Git:

  • SCID = Commit SHA (permanent, unique, cryptographic)
  • dURL = Branch name (human-friendly label, can point to different commits)

Example

Contract A (SCID: abc123...)
β”œβ”€β”€ dURL: "explorer.tela"
└── Deployed by: Alice

Contract B (SCID: def456...)
β”œβ”€β”€ dURL: "explorer.tela"  ← Same dURL!
└── Deployed by: Bob

Both exist. Both are valid. Both have the same dURL.

How dURL Resolution Works

When a browser or host app resolves a dURL, here's what happens:

User navigates to: "explorer.tela"
         ↓
Gnomon searches all indexed TELA contracts
         ↓
Finds ALL contracts where dURL = "explorer.tela"
         ↓
Returns FIRST match found
         ↓
Browser serves that contract's content

The Problem with Duplicates

With multiple contracts sharing a dURL:

  • No deterministic resolution - Which one you get depends on indexer state
  • No "latest wins" - Newer deployments don't automatically override older ones
  • No rating-based priority - A 0-rated app might be served over a 99-rated one
  • No owner priority - The original deployer has no special claim
⚠️

Critical: If you deploy a new INDEX with the same dURL as an existing one, users may still get the old version. Resolution is unpredictable with duplicates.


Best Practices

1. Use Unique dURLs

Before deploying, search for existing dURLs:

Β» search durl myapp

If it exists, choose a different name or add a suffix:

  • myapp-v2.tela
  • myapp-2024.tela
  • myapp-yourname.tela

2. Share SCIDs for Critical Apps

For important applications, share the SCID directly rather than relying on dURL resolution:

βœ… "Install from SCID: abc123def456..."
❌ "Navigate to myapp.tela"

3. Version Your dURLs

If you anticipate multiple versions:

myapp.tela        # Version 1
myapp-v2.tela     # Version 2
myapp-v3.tela     # Version 3

4. Check Before Deploying

Always verify your chosen dURL isn't already in use:

Β» search durl your-chosen-name

Recovery Scenarios

"I deployed my INDEX with ringsize > 2 and can't update it"

If your INDEX is immutable (anonymous deployment), you cannot:

  • Update which DOCs it references
  • Fix bugs in the code
  • Change the dURL or metadata

Your only option:

  1. Deploy new DOC contracts with your updated code
  2. Deploy a NEW INDEX (new SCID) with ringsize 2 this time
  3. Use a different dURL to avoid resolution conflicts
  4. Share the new SCID with your users
  5. Rate the old INDEX down (optional) to reduce its visibility
# Deploy new INDEX with ringsize 2
Β» install-index
Enter INDEX name Β» My App v2
Enter INDEX dURL Β» myapp-v2.tela  # Different from original!
Enter INDEX install ringsize Β» 2  # Updateable this time!

"Someone else is using my dURL"

Unfortunately, there's no recourse. dURLs are not owned or reserved. Options:

  1. Choose a different dURL - Add your name, version, or unique suffix
  2. Compete on quality - If your app is better rated, users may find it
  3. Share your SCID directly - Bypass dURL resolution entirely

"I want to 'transfer' my dURL to a new INDEX"

You can't transfer a dURL because it's not an owned resource. Instead:

  1. Deploy new INDEX with the same dURL (both will exist)
  2. Rate the old one down to 0 (if you own it)
  3. Hope resolution favors your new one (not guaranteed)

Better approach: Use a new dURL and communicate the change to users.


How Browsers Handle dURLs

Browser Behavior

TELA browsers use Gnomon to resolve dURLs:

// Simplified resolution logic
func ResolveDURL(durl string) (scid string, found bool) {
    apps := gnomon.GetTELAApps()
    for _, app := range apps {
        if app["durl"] == durl {
            return app["scid"], true  // Returns FIRST match
        }
    }
    return "", false
}

Key points:

  • Resolution is case-insensitive
  • First match wins (order not guaranteed)
  • No fallback or priority system

Direct SCID Access

Browsers also support direct SCID navigation, bypassing dURL resolution entirely:

dero://abc123def456...  # Direct SCID access

This is the most reliable way to access a specific contract.


Summary

ConceptReality
dURL uniquenessNOT enforced - multiple contracts can share a dURL
True identitySCID is the unique identifier, not dURL
ResolutionFirst-match, unpredictable with duplicates
OwnershipNo one "owns" a dURL
Best practiceUse unique dURLs, share SCIDs for critical apps
RecoveryDeploy new INDEX with different dURL
βœ…

Remember: The SCID is your contract's permanent, unique identity. The dURL is just a convenient label. Plan accordingly!

Related Documentation