Description
Stellar supports federation addresses — human-readable aliases like ben*stellarterm.com or alice*lobstr.co that resolve to a full G-address via the Stellar federation protocol. Currently users must paste a 56-character G-address into the search bar. This issue adds automatic federation address resolution so users can type or paste a friendly address and the app resolves it transparently.
How Stellar Federation Works
- User types
alice*lobstr.co
- App detects the
* character and treats it as a federation address
- App fetches
https://lobstr.co/.well-known/stellar.toml to find the federation server URL
- App calls the federation server:
GET {server}?q=alice*lobstr.co&type=name
- Federation server returns the G-address
- App proceeds with the G-address as normal
The Stellar JS SDK has a built-in federation resolver — use @stellar/stellar-sdk which is already commonly available, or use the lightweight @stellar/stellar-base package.
What To Build
src/lib/federation.ts
export function isFederationAddress(input: string): boolean
// Returns true if input matches pattern: anything*anything.tld
export async function resolveFederationAddress(
address: string
): Promise<string>
// Resolves federation address to G-address
// Throws FederationError if not found or server unavailable
Use the @stellar/stellar-sdk Federation class, or implement directly using the Stellar TOML + federation protocol.
Update src/app/app/page.tsx
In handleExplain(), before routing to /account/:address:
- Check
isFederationAddress(input)
- If yes, show a resolving state ("Resolving federation address...")
- Call
resolveFederationAddress(input)
- On success, route to
/account/:resolvedAddress
- On failure, show a clear error: "Could not resolve federation address. Check the spelling and try again."
Update src/components/SearchBar.tsx
- Accept
resolving prop (boolean) for loading state
- Show subtle animation while resolving
- Placeholder text:
e.g. alice*lobstr.co or GABC...
Update src/app/account/[address]/page.tsx
If a federation address was resolved, show it at the top of the account page:
Federation: alice*lobstr.co → GABC...
Pass the original federation address as a URL query param: /account/GABC...?fed=alice*lobstr.co
Package to add
"@stellar/stellar-sdk": "^12.0.0"
Or implement the federation protocol directly without the SDK to keep bundle size small — both approaches are acceptable.
Key Files
New files:
Modified files:
src/app/app/page.tsx
src/components/SearchBar.tsx
src/app/account/[address]/page.tsx
package.json
Acceptance Criteria
Complexity: Medium · 150 pts
Description
Stellar supports federation addresses — human-readable aliases like
ben*stellarterm.comoralice*lobstr.cothat resolve to a full G-address via the Stellar federation protocol. Currently users must paste a 56-character G-address into the search bar. This issue adds automatic federation address resolution so users can type or paste a friendly address and the app resolves it transparently.How Stellar Federation Works
alice*lobstr.co*character and treats it as a federation addresshttps://lobstr.co/.well-known/stellar.tomlto find the federation server URLGET {server}?q=alice*lobstr.co&type=nameThe Stellar JS SDK has a built-in federation resolver — use
@stellar/stellar-sdkwhich is already commonly available, or use the lightweight@stellar/stellar-basepackage.What To Build
src/lib/federation.tsUse the
@stellar/stellar-sdkFederation class, or implement directly using the Stellar TOML + federation protocol.Update
src/app/app/page.tsxIn
handleExplain(), before routing to/account/:address:isFederationAddress(input)resolveFederationAddress(input)/account/:resolvedAddressUpdate
src/components/SearchBar.tsxresolvingprop (boolean) for loading statee.g. alice*lobstr.co or GABC...Update
src/app/account/[address]/page.tsxIf a federation address was resolved, show it at the top of the account page:
Pass the original federation address as a URL query param:
/account/GABC...?fed=alice*lobstr.coPackage to add
Or implement the federation protocol directly without the SDK to keep bundle size small — both approaches are acceptable.
Key Files
New files:
src/lib/federation.tsModified files:
src/app/app/page.tsxsrc/components/SearchBar.tsxsrc/app/account/[address]/page.tsxpackage.jsonAcceptance Criteria
alice*lobstr.coresolves correctly and loads the account pageben*stellarterm.comresolves correctlyComplexity: Medium · 150 pts