Resolving a Starname
This is how to get the information attached to a starname.
A starname can have two different formats:
    *domain
    name*domain

What is a valid starname format?

A Starname needs to match the following format:
    left*right, matching the regex ^[-.a-z0-9]{0,63}*[-a-z0-9]{1,32}$ . Please note the left part can be an empty string so benjamin*cosmostation and *cosmostation are two valid starnames which can be resolved.
If you look for a Starname which has an invalid format, you will fail to resolve. You can check before resolving that the format is matching the regex.

I know someone's starname, how do I know the associated info?

With a web browser, Starname explorer Big Dipper

You can easily check a starname with a web browser using the url: https://big-dipper.iov-mainnet-2.iov.one/starname/<your_starname>
On a web browser, you can see the friendly UI version of the starname at https://starname.me/<your_starname>, for exemple: https://starname.me/*benjamin

With the REST API

You can query the crypto-addresses associated with a starname ( fondation-aphp*iov as example) by running the command :
1
curl -X POST "https://iovnscli-rest-api.iov-mainnet-2.iov.one/starname/query/resolve" \
2
-H "accept: application/json" \
3
-H "Content-Type: application/json" \
4
-d '{"starname":"fondation-aphp*iov"}'
Copied!
If the starname looks like *mybusiness for example, you will run the same command :
1
curl -X POST "https://iovnscli-rest-api.iov-mainnet-2.iov.one/starname/query/resolve" \
2
-H "accept: application/json" \
3
-H "Content-Type: application/json" \
4
-d '{"starname":"*benjamin"}'
Copied!
The result of this POST is a JSON with the Starname data.

With the IOVNS CLI

You can query the crypto-addresses associated with a starname ( fondation-aphp*iov as example) by running the command :
1
iovnscli query starname resolve --starname fondation-aphp*iov
Copied!
If the starname looks like *mybusiness for example, you will run the same command :
1
iovnscli query starname resolve --starname *benjamin
Copied!
The result of this POST is a JSON with the Starname data.

The Starname data

These commands will return the information attached to the starname in a JSON format. To get the specific data you are looking for, you can simply parse the JSON data. It will look like this
1
{
2
"account":{
3
"domain":"iov",
4
"name":"fondation-aphp",
5
"owner":"star12uv6k3c650kvm2wpa38wwlq8azayq6tlh75d3y",
6
"valid_until":1633046400,
7
"resources":[
8
{
9
"uri":"asset:eth",
10
"resource":"0x795997519227f64879977d1a53625707f29b25b2"
11
},
12
{"
13
uri":"asset:btc",
14
"resource":"14AcAvkYz9eUP226NpGvTf62uP4Du2NnZJ"
15
},
16
{
17
"uri":"asset:bch",
18
"resource":"bitcoincash:qzmddu0vq53dkeej9nwt6jm8nyzlfxgn2vnh46k77u"
19
},
20
{
21
"uri":"asset:ltc",
22
"resource":"M8N2BjsijFyQTYVAq7WXZGmC5dmLUbBefb"
23
},
24
{
25
"uri":"asset:xtz",
26
"resource":"tz1XAMyU4VtmMyber79FF56RESdrAcuN886z"
27
},
28
{
29
"uri":"asset:atom",
30
"resource":"cosmos18qvxu5t9h29pwhf6jtf0a2lpwt4y026e09tln9"
31
}
32
],
33
"certificates":null,
34
"broker":"",
35
"metadata_uri":""
36
}
37
}
Copied!
Field name
Description
account
the type of what has been resolved. An account is a starname, i.e. this is a name*domain
domain
the string after the * in a starname
name
the string before the * in a starname
owner
the star address of who has the right to edit and perform transactions on this starname. Note: the owner of a closed domain has the right to delete any starname of a closed domain.
valid_until
the expiry date of the starname, in seconds from 1jan1970
resources
an array of pair (uri, resource) where the uri is the unique asset-id (string) to a resource, the associated crypto address (string). The list of asset-id can use is here.
broker
the star address of who has helped registering this starname -- most likely the app that was used to register the name, and it will be rewarded for this
metadata_uri
the uri of the metadata of the starname (string) -- For example it can be the URL of a link to IPFS which return a JSON file with the full name, a picture and a small description of the starname
Typically, you will be using the Resolver to look for the specific address of the recipient for the asset you want to send.
For exemple, you want to send BTC to *benjamin. You are therefore looking for the BTC address associated with the Starname *benjamin.
    You send the request to resolve starname *benjamin (via REST or CLI), and you receive the Starname JSON data.
    Because you are sending BTC, you are looking for the data associated with the uri: asset:btc. For all common coins, the uri is asset:xxx where xxx is the ticker of the coin. You can see here all the Asset Tickers.
    At this point, get the value of the field resources. It is an array of pair uri, resource. Search for the pair where the uri is matching asset:btc and return the value of the field resource. If you don't find any matching uri, then it means that there is no BTC address associated with this Starname yet.
Last modified 10mo ago