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 sobenjamin*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>
For exemple, you can check https://big-dipper.iov-mainnet-2.iov.one/starname/*benjamin
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 :
If the starname looks like *mybusiness
for example, you will run the same command :
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 :
If the starname looks like *mybusiness
for example, you will run the same command :
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
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, theuri
isasset:xxx
wherexxx
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 pairuri
,resource
. Search for the pair where theuri
is matchingasset:btc
and return the value of the fieldresource
. If you don't find any matchinguri
, then it means that there is no BTC address associated with this Starname yet.
Last updated