[Pre-SEP] On-chain name resolution for Stellar addresses #2070
Replies: 2 comments
|
(Disclaimer, I am working at Aha as well but only had one meeting so far about this topic.) Love this! Especially the link with SEP-002. I think this is something to dig into. I know that Lobstr supports it, not sure about the rest. But I am also thinking about SEP-001 and the need in general to attach metadata to addresses and other objects on-chain. So yes I would try to make it work and maybe doing this helps to generalize the metadata concept and how it works for both G and C (and the rest of the alphabet.) On accounts. This is attaching a name to an address. Do we want to just codify that or more? My thought is having methods on smart accounts to name it or call a registry for it's name. Which would naturally lead, to me, to SEP-50 (NFTs). |
Flagging: ...
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What we're proposing
A SEP that standardizes setting a human-readable name that resolves to a Stellar address, on-chain, through a Soroban contract instead of an HTTP server. The named address has to consent to the name, and anyone can verify the answer against the ledger.
We've built and deployed this as part of Stellar Registry, where a name like
aliceorunverified/aliceresolves to a classic G-address or a smart account (C-address). Other implementations could also support muxed accounts (M-addresses) or muxed contract addresses (W-addresses). Before writing a draft, we'd like to know whether it belongs in a SEP, so that wallets, explorers and other tools can resolve the same names the same way.Why
SEP-0002 (Federation) is still the standard way to give a Stellar account a name. It works well for what it was built for, but it has gaps for some uses today:
name*domain.comresolves through theFEDERATION_SERVERlisted in that domain'sstellar.toml. You have to trust whoever runs the domain, and nothing about the answer is recorded on-chain or can be checked against the ledger.What people see today is long strings like
GA7Y…KPXREin wallets, explorers and contract metadata, which makes copy-paste mistakes easy and on-chain activity hard to read.How the current implementation works for Stellar Registry
Names live in a registry contract that anyone can query on-chain:
Every change emits a contract event. For example, registering a name emits:
It's emitted with the topic
register_accountand the fields as a map. The other events follow the same pattern:rename_account,update_acct_addr,update_acct_owner,sec_flag_acct,preauth_acctandrevoke_preauth_acct. Changes made after registration also record theoperator: the owner, or the manager acting for it.Properties:
-and_, and the first character must be a letter. Rust keywords aren't allowed. Names are made lowercase and_is turned into-before storage, soAlice_Payandalice-payare the same name.channel/nameresolves in a subregistry, whose own contract ID is looked up in the root by the channel name. The root decides through governance which names it accepts. Subregistries such asunverifiedare open to anyone.preauthorize_account(name, address, owner), which is single-use and expires.Address, so an entry never carries a muxed ID. Soroban itself could support more:MuxedAddress(CAP-67) can be passed into a contract, and a registry could store the ID next to the address. CAP-84 (protocol 30) extends muxing to contract addresses (W…). See open question 6.Resolution flow (sketch)
Given a name
Non a network:Ncontains/, split it intochannelandname. Look up the subregistry's contract ID by callingfetch_contract_id(channel)on the root registry. Otherwise, use the root registry.fetch_account_id(name)on that registry.flowchart TD N["Name N"] --> Q{"Does N contain '/'?"} Q -- "yes: channel/name" --> C["Root registry:<br/>fetch_contract_id(channel)"] C --> SUB["Subregistry"] Q -- "no" --> ROOT["Root registry"] SUB --> F["fetch_account_id(name)"] ROOT --> F F --> FL{"Flagged?"} FL -- "no" --> ADDR["Address"] FL -- "yes" --> WARN["Warn or fail"] REV["Address"] -. "reverse lookup (indexer)" .-> CAND["Candidate name"] CAND -. "verify (step 2)" .-> FReference implementation
CAAXJETKPYAATU4HVVQUTE2FFBULNFGZNEOC3MS635U5K3GZLAY2HI4M. Mainnet, atCDU4M3LDIOUJJ5F3YXKJ4EJEP5VPRPG6N2LJ5HOQIMN7MNGL3NS3EGUY, is waiting on the v0.8.0 upgrade.stellar registry account register | fetch-id | fetch-owner | preauthorize | …in https://github.com/stellar-registry/cli/v1/accounts/by-address/{address}): https://github.com/stellar-registry/indexerOpen questions
fetch_account_id,fetch_account_owner, events), so that other naming contracts can implement it too? Or should it also specify Stellar Registry's existing namespace and governance model?unverifieddoesn't), only the name's owner can. The flag is stored on-chain and emitted as an event, but there's no getter for it, andfetch_account_idstill returns the address, so resolvers must read contract storage or an indexer to check it. Should the standard require a getter likeis_account_flagged(name) -> bool, havefetch_account_idfail for flagged names, or both? And should the standard fix who can set and clear a flag, or leave that to each registry?channel/namematches how Registry names Wasms and contracts, but it can't be told apart from other strings at a glance. Is a distinct form worth it, such as@alice,alice.xlm, or something closer to SEP-0002'sname*domain?memo_type: id. Should a name be able to carry an optional muxed ID (resolving to an M- or W-address), or should names stay one per account and leave per-customer routing to federation or the exchange?Ask
We'd like feedback on whether this should be a SEP and on the open questions above, especially from wallet and explorer teams, who would be the main consumers. If there's interest, we'll follow up with a draft SEP shaped by the answers here. The reference implementation is live on testnet, with the mainnet rollout in progress.
All reactions