You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

752 lines
35 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.5.0 -->
<title>Resolve a name | Blockstack</title>
<meta name="generator" content="Jekyll v3.8.3" />
<meta property="og:title" content="Resolve a name" />
<meta name="author" content="Blockstack" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Resolve a name" />
<meta property="og:description" content="Resolve a name" />
<link rel="canonical" href="https://zbabystack.netlify.com/core/naming/resolving.html" />
<meta property="og:url" content="https://zbabystack.netlify.com/core/naming/resolving.html" />
<meta property="og:site_name" content="Blockstack" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2018-09-10T15:46:41-07:00" />
<script type="application/ld+json">
{"description":"Resolve a name","author":{"@type":"Person","name":"Blockstack"},"@type":"BlogPosting","url":"https://zbabystack.netlify.com/core/naming/resolving.html","headline":"Resolve a name","dateModified":"2018-09-10T15:46:41-07:00","datePublished":"2018-09-10T15:46:41-07:00","mainEntityOfPage":{"@type":"WebPage","@id":"https://zbabystack.netlify.com/core/naming/resolving.html"},"@context":"http://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<!-- <meta property="og:image" content="https://zbabystack.netlify.com/assets/posts/logo.png"/> -->
<meta property="og:image" content="/assets/posts/logo.png"/>
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="shortcut icon" type="image/png" href="/assets/img/touch-icon.png" >
<link rel="alternate" type="application/rss+xml" title="Blockstack" href="/feed.xml">
<script src="/assets/js/main.js"></script>
</head>
<body>
<header class="uk-background-secondary">
<div data-uk-sticky="sel-target: .uk-navbar-container; cls-active: uk-navbar-sticky" class="uk-sticky uk-sticky-fixed" style="position: fixed; top: 0px; width: 1904px;">
<nav class="uk-navbar-container">
<div class="uk-container">
<div data-uk-navbar>
<div class="uk-navbar-left">
<!-- <a class="uk-navbar-item uk-logo" href="/"><img src="https://zbabystack.netlify.com/assets/posts/logo.png" alt="Docs"></a> -->
<a class="uk-navbar-item uk-logo" href="/"><img src="/assets/posts/logo.png" alt="Docs"></a>
</div>
<div class="uk-navbar-right">
<ul class="uk-navbar-nav uk-visible@m">
<li><a href="https://blockstack.org" target="_blank" >Blockstack.org</a></li>
<li><a href="https://forum.blockstack.org/" target="_blank" >Forums</a></li>
<li><a href="https://github.com/blockstack" target="_blank" >GitHub</a></li>
</ul>
<div>
<a class="uk-navbar-toggle" uk-search-icon href="#"></a>
<div class="uk-drop uk-background-default uk-border-rounded" uk-drop="mode: click; pos: left-center; offset: 0">
<form class="uk-search uk-search-navbar uk-width-1-1" onsubmit="return false;">
<input id="searchBox" class="uk-search-input" type="search" placeholder="Search..." autofocus>
</form>
<ul id="searchBox-results" class="uk-position-absolute uk-width-1-1 uk-list"></ul>
</div>
</div>
<a class="uk-navbar-toggle uk-hidden@m" href="#offcanvas" data-uk-navbar-toggle-icon data-uk-toggle></a>
</div>
</div>
</div>
</nav>
</div>
</header>
<div class="uk-section">
<div class="uk-container">
<div class="uk-grid-large" data-uk-grid>
<div class="sidebar-fixed-width uk-visible@m">
<div class="sidebar-docs uk-position-fixed">
<h5>Overview</h5>
<ul class="uk-nav uk-nav-default doc-nav">
<!-- -->
<li class=""><a href="/core/naming/introduction.html">Blockstack Naming Service (BNS)</a></li>
<!-- -->
<li class=""><a href="/core/naming/architecture.html">Understand the Architecture</a></li>
<!-- -->
<li class=""><a href="/core/naming/namespaces.html">Understand Namespaces</a></li>
<!-- -->
<li class=""><a href="/core/naming/comparison.html">Naming system feature comparison</a></li>
</ul>
<h5>Tutorials & Cookbooks</h5>
<ul class="uk-nav uk-nav-default doc-nav">
<!-- -->
<li class=""><a href="/core/naming/tutorial_creation.html">Create and Launch a Namespace</a></li>
<!-- -->
<li class=""><a href="/core/naming/tutorial_subdomains.html">Subdomain Design and Implementation</a></li>
<!-- -->
<li class=""><a href="/core/naming/search.html">How to build a Profile Search Index</a></li>
<!-- -->
<li class=""><a href="/core/naming/openbazaar.html">How to link your OpenBazaar GUID to your Blockstack ID</a></li>
</ul>
<h5>How to use BNS</h5>
<ul class="uk-nav uk-nav-default doc-nav">
<!-- -->
<li class=""><a href="/core/naming/pickname.html">Choose a name</a></li>
<!-- -->
<li class=""><a href="/core/naming/creationhowto.html">Creating a Namespace</a></li>
<!-- -->
<li class="uk-active"><a href="/core/naming/resolving.html">Resolve a name</a></li>
<!-- -->
<li class=""><a href="/core/naming/register.html">Register a name</a></li>
<!-- -->
<li class=""><a href="/core/naming/manage.html">Manage BNS Names</a></li>
<!-- -->
<li class=""><a href="/core/naming/subdomains.html">BNS Subdomains</a></li>
</ul>
<h5>Forks and Dids</h5>
<ul class="uk-nav uk-nav-default doc-nav">
<!-- -->
<li class=""><a href="/core/naming/forks.html">BNS Forks</a></li>
<!-- -->
<li class=""><a href="/core/naming/did.html">Decentralized Identifiers (DIDs)</a></li>
</ul>
<h5>Atlas</h5>
<ul class="uk-nav uk-nav-default doc-nav">
<!-- -->
<li class=""><a href="/core/atlas/overview.html">Overview of the Atlas network</a></li>
<!-- -->
<li class=""><a href="/core/atlas/howitworks.html">How Atlas Works</a></li>
<!-- -->
<li class=""><a href="/core/atlas/howtouse.html">How to Use the Atlas Network</a></li>
</ul>
<h5>Reference</h5>
<ul class="uk-nav uk-nav-default doc-nav">
<!-- -->
<li class=""><a href="/common/javascript_ref.html">Blockstack Javascript Reference</a></li>
<!-- -->
<li class=""><a href="/common/core_ref.html">Blockstack CORE API</a></li>
<!-- -->
<li class=""><a href="/core/faq_technical.html">Blockstack Technical FAQ</a></li>
</ul>
</div>
</div>
<div class="uk-width-1-1 uk-width-expand@m">
<article class="uk-article">
<h1 class="uk-article-title">Resolve a name</h1>
<div class="uk-article-meta uk-margin-top uk-margin-medium-bottom">
<!-- <img class="avatar avatar-small" alt="Blockstack" width="32" height="32" data-proofer-ignore="true" src="https://avatars2.githubusercontent.com/Blockstack?v=3&s=32" srcset="https://avatars2.githubusercontent.com/Blockstack?v=3&s=32 1x, https://avatars2.githubusercontent.com/Blockstack?v=3&s=64 2x, https://avatars2.githubusercontent.com/Blockstack?v=3&s=96 3x, https://avatars2.githubusercontent.com/Blockstack?v=3&s=128 4x" /> -->
<!-- Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Blockstack</span></span><br> -->
<time datetime="2018-09-10T15:46:41-07:00" itemprop="datePublished">
<a "target="_blank" href="https://github.com/blockstack/blockstack-core/blob/master/docs/resolving.md" class="btn btn-default githubEditButton" role="button">
<span data-uk-icon="icon: pencil; ratio: 1.2"></span> Edit this page on Github</a>
<span style="font-family:Wingdings">&#119;</span> Sep 10, 2018
</time>
</div>
<div class="article-content">
<p class="no_toc">This section explains resolving BNS names and provides instructions for methods
you can use to accomplish namespace resolution.</p>
<ul id="markdown-toc">
<li><a href="#understand-resolution" id="markdown-toc-understand-resolution">Understand resolution</a></li>
<li><a href="#look-up-a-names-public-key-and-zone-file-reference" id="markdown-toc-look-up-a-names-public-key-and-zone-file-reference">Look up a name’s public key and zone file (reference)</a></li>
<li><a href="#list-all-names-the-node-knows-about-reference" id="markdown-toc-list-all-names-the-node-knows-about-reference">List all names the node knows about (reference)</a></li>
<li><a href="#look-up-the-history-of-states-a-name-was-in-reference" id="markdown-toc-look-up-the-history-of-states-a-name-was-in-reference">Look up the history of states a name was in (reference)</a></li>
<li><a href="#look-up-the-list-of-names-owned-by-a-given-public-key-hash-reference" id="markdown-toc-look-up-the-list-of-names-owned-by-a-given-public-key-hash-reference">Look up the list of names owned by a given public key hash (reference)</a></li>
</ul>
<h2 id="understand-resolution">Understand resolution</h2>
<p>BNS names are bound to both public keys and to about 40Kb of off-chain state.
The off-chain state is encoded as a <a href="https://en.wikipedia.org/wiki/Zone_file">DNS zone file</a>,
which contains routing information for discovering the user’s Blockstack data
(such as their profile and app data, which are hosted in the <a href="https://github.com/blockstack/gaia">Gaia storage
system</a>).</p>
<p>The blockchain is not used to store this information directly. Instead, the
blockchain stores the <em>public key hash</em> and the <em>zone file hash</em>. When
indexing the blockchain, each BNS node builds a database with
three columns: all the on-chain BNS names that have been registered, each
name’s public key hash, and each name’s zone file’s hash.
In addition, each BNS node maintains the <em>transaction history</em> of each name.
A developer can resolve a name to any configuration it was in at any prior
point in time.</p>
<p>Below is an example name table pulled from a live BNS node:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Public key hash</th>
<th>Zone File Hash</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">ryan.id</code></td>
<td><code class="highlighter-rouge">15BcxePn59Y6mYD2fRLCLCaaHScefqW2No</code></td>
<td><code class="highlighter-rouge">a455954b3e38685e487efa41480beeb315f4ec65</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">muneeb.id</code></td>
<td><code class="highlighter-rouge">1J3PUxY5uDShUnHRrMyU6yKtoHEUPhKULs</code></td>
<td><code class="highlighter-rouge">37aecf837c6ae9bdc9dbd98a268f263dacd00361</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">jude.id</code></td>
<td><code class="highlighter-rouge">16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg</code></td>
<td><code class="highlighter-rouge">b6e99200125e70d634b17fe61ce55b09881bfafd</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">verified.podcast</code></td>
<td><code class="highlighter-rouge">1MwPD6dH4fE3gQ9mCov81L1DEQWT7E85qH</code></td>
<td><code class="highlighter-rouge">6701ce856620d4f2f57cd23b166089759ef6eabd</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">cicero.res_publica.id</code></td>
<td><code class="highlighter-rouge">1EtE77Aa5AA8etzF2irk56vvkS4v7rZ7PE</code></td>
<td><code class="highlighter-rouge">7e4ac75f9d79ba9d5d284fac19617497433b832d</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">podsaveamerica.verified.podcast</code></td>
<td><code class="highlighter-rouge">1MwPD6dH4fE3gQ9mCov81L1DEQWT7E85qH</code></td>
<td><code class="highlighter-rouge">0d6f090db8945aa0e60759f9c866b17645893a95</code></td>
</tr>
</tbody>
</table>
<p>In practice, the zone file hash is the <code class="highlighter-rouge">RIPEMD160</code> hash of the <code class="highlighter-rouge">SHA256</code> hash of
the zone file, and the public key is the <code class="highlighter-rouge">base58check</code>-encoded <code class="highlighter-rouge">RIPEMD160</code> hash
of the double-<code class="highlighter-rouge">SHA256</code> hash of the ECDSA public key (i.e. a Bitcoin address).</p>
<p>The BNS consensus rules ensure that
a BNS name can only be registered if it is not already taken, and that only the
user who owns the name’s private key can change its public key hash or zone file
hash. This means that a name’s public key and zone file can be stored anywhere,
since they can be authenticated using the hashes discovered by indexing the
blockchain under the BNS consensus rules.</p>
<p>BNS nodes implement a decentralized storage system for zone files called the
<a href="atlas_network.md">Atlas network</a>. In this system, BNS nodes eagerly replicate
all the zone files they know about to one another, so that eventually every BNS
node has a full replica of all zone files.</p>
<p>The public keys for names are stored off-chain in <a href="https://github.com/blockstack/gaia">Gaia</a>.
The user controls where their public keys are hosted using the zone file
contents (if they are hosted online anywhere at all).</p>
<p>Developers can query this table via the BNS API. The API offers routes
to do the following:</p>
<h2 id="look-up-a-names-public-key-and-zone-file-reference">Look up a name’s public key and zone file (<a href="https://core.blockstack.org/#name-querying-get-name-info">reference</a>)</h2>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>curl https://core.blockstack.org/v1/names/muneeb.id
<span class="o">{</span>
<span class="s2">"address"</span>: <span class="s2">"1J3PUxY5uDShUnHRrMyU6yKtoHEUPhKULs"</span>,
<span class="s2">"blockchain"</span>: <span class="s2">"bitcoin"</span>,
<span class="s2">"expire_block"</span>: 599266,
<span class="s2">"last_txid"</span>: <span class="s2">"7e16e8688ca0413a398bbaf16ad4b10d3c9439555fc140f58e5ab4e50793c476"</span>,
<span class="s2">"status"</span>: <span class="s2">"registered"</span>,
<span class="s2">"zonefile"</span>: <span class="s2">"</span><span class="nv">$ORIGIN</span><span class="s2"> muneeb.id</span><span class="se">\n</span><span class="nv">$TTL</span><span class="s2"> 3600</span><span class="se">\n</span><span class="s2">_http._tcp URI 10 1 </span><span class="se">\"</span><span class="s2">https://gaia.blockstack.org/hub/1J3PUxY5uDShUnHRrMyU6yKtoHEUPhKULs/0/profile.json</span><span class="se">\"\n</span><span class="s2">"</span>,
<span class="s2">"zonefile_hash"</span>: <span class="s2">"37aecf837c6ae9bdc9dbd98a268f263dacd00361"</span>
<span class="o">}</span>
</code></pre>
</div>
<p>Note that the <code class="highlighter-rouge">zonefile</code> field is given with the off-chain data that hashes
to the <code class="highlighter-rouge">zonefile_hash</code> field.</p>
<h2 id="list-all-names-the-node-knows-about-reference">List all names the node knows about (<a href="https://core.blockstack.org/#name-querying-get-all-names">reference</a>)</h2>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>curl https://core.blockstack.org/v1/names?page<span class="o">=</span>0
<span class="o">[</span>
<span class="s2">"judecn.id"</span>,
<span class="s2">"3.id"</span>,
<span class="s2">"4.id"</span>,
<span class="s2">"8.id"</span>,
<span class="s2">"e.id"</span>,
<span class="s2">"h.id"</span>,
<span class="s2">"5.id"</span>,
<span class="s2">"9.id"</span>,
<span class="s2">"i.id"</span>,
<span class="s2">"l.id"</span>,
<span class="s2">"p.id"</span>,
<span class="s2">"w.id"</span>,
<span class="s2">"ba.id"</span>,
<span class="s2">"df.id"</span>,
...
<span class="o">]</span>
</code></pre>
</div>
<p>Each page returns 100 names. While no specific ordering is mandated by the
protocol, the reference implementation orders names by their order of creation
in the blockchain.</p>
<h2 id="look-up-the-history-of-states-a-name-was-in-reference">Look up the history of states a name was in (<a href="https://core.blockstack.org/#name-querying-name-history">reference</a>)</h2>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>curl https://core.blockstack.org/v1/names/patrickstanley.id/history
<span class="o">{</span>
<span class="s2">"445838"</span>: <span class="o">[</span>
<span class="o">{</span>
<span class="s2">"address"</span>: <span class="s2">"1occgbip7tFDXX9MvzQhcnTUUjcVX2dYK"</span>,
<span class="s2">"block_number"</span>: 445838,
<span class="s2">"burn_address"</span>: <span class="s2">"1111111111111111111114oLvT2"</span>,
<span class="s2">"consensus_hash"</span>: <span class="s2">"7b696b6f4060b792d41912068944d73b"</span>,
<span class="s2">"op"</span>: <span class="s2">"?"</span>,
<span class="s2">"op_fee"</span>: 25000,
<span class="s2">"opcode"</span>: <span class="s2">"NAME_PREORDER"</span>,
<span class="s2">"preorder_hash"</span>: <span class="s2">"26bf7874706ac761afdd403ed6b3b9578fb01a34"</span>,
<span class="s2">"sender"</span>: <span class="s2">"76a91408d0dd44c1f0a3a4f0957ae95901929d7d66d55788ac"</span>,
<span class="s2">"sender_pubkey"</span>: <span class="s2">"039a8948d339ecbff44cf426cb85d90fce876f1658d385cdc47f007f279be626ea"</span>,
<span class="s2">"txid"</span>: <span class="s2">"6730ae09574d5935ffabe3dd63a9341ea54fafae62fde36c27738e9ee9c4e889"</span>,
<span class="s2">"vtxindex"</span>: 40
<span class="o">}</span>
<span class="o">]</span>,
<span class="s2">"445851"</span>: <span class="o">[</span>
<span class="o">{</span>
<span class="s2">"address"</span>: <span class="s2">"17CbHgTgBG3kLedXNneEKBkCTgW2fyrnUD"</span>,
<span class="s2">"block_number"</span>: 445838,
<span class="s2">"consensus_hash"</span>: null,
<span class="s2">"first_registered"</span>: 445851,
<span class="s2">"importer"</span>: null,
<span class="s2">"importer_address"</span>: null,
<span class="s2">"last_creation_op"</span>: <span class="s2">"?"</span>,
<span class="s2">"last_renewed"</span>: 445851,
<span class="s2">"name"</span>: <span class="s2">"patrickstanley.id"</span>,
<span class="s2">"name_hash128"</span>: <span class="s2">"683a3e1ee5f0296833c56e481cf41b77"</span>,
<span class="s2">"namespace_block_number"</span>: 373601,
<span class="s2">"namespace_id"</span>: <span class="s2">"id"</span>,
<span class="s2">"op"</span>: <span class="s2">":"</span>,
<span class="s2">"op_fee"</span>: 25000,
<span class="s2">"opcode"</span>: <span class="s2">"NAME_REGISTRATION"</span>,
<span class="s2">"preorder_block_number"</span>: 445838,
<span class="s2">"preorder_hash"</span>: <span class="s2">"26bf7874706ac761afdd403ed6b3b9578fb01a34"</span>,
<span class="s2">"revoked"</span>: <span class="nb">false</span>,
<span class="s2">"sender"</span>: <span class="s2">"76a9144401f3be5311585ea519c1cb471a8dc7b02fd6ee88ac"</span>,
<span class="s2">"sender_pubkey"</span>: <span class="s2">"039a8948d339ecbff44cf426cb85d90fce876f1658d385cdc47f007f279be626ea"</span>,
<span class="s2">"transfer_send_block_id"</span>: null,
<span class="s2">"txid"</span>: <span class="s2">"55b8b42fc3e3d23cbc0f07d38edae6a451dfc512b770fd7903725f9e465b2925"</span>,
<span class="s2">"value_hash"</span>: null,
<span class="s2">"vtxindex"</span>: 54
<span class="o">}</span>
<span class="o">]</span>,
<span class="s2">"445873"</span>: <span class="o">[</span>
<span class="o">{</span>
<span class="s2">"address"</span>: <span class="s2">"17CbHgTgBG3kLedXNneEKBkCTgW2fyrnUD"</span>,
<span class="s2">"block_number"</span>: 445838,
<span class="s2">"consensus_hash"</span>: <span class="s2">"18b8d69f0182b89ccb1aa536f83be18a"</span>,
<span class="s2">"first_registered"</span>: 445851,
<span class="s2">"importer"</span>: null,
<span class="s2">"importer_address"</span>: null,
<span class="s2">"last_creation_op"</span>: <span class="s2">"?"</span>,
<span class="s2">"last_renewed"</span>: 445851,
<span class="s2">"name"</span>: <span class="s2">"patrickstanley.id"</span>,
<span class="s2">"name_hash128"</span>: <span class="s2">"683a3e1ee5f0296833c56e481cf41b77"</span>,
<span class="s2">"namespace_block_number"</span>: 373601,
<span class="s2">"namespace_id"</span>: <span class="s2">"id"</span>,
<span class="s2">"op"</span>: <span class="s2">"+"</span>,
<span class="s2">"op_fee"</span>: 25000,
<span class="s2">"opcode"</span>: <span class="s2">"NAME_UPDATE"</span>,
<span class="s2">"preorder_block_number"</span>: 445838,
<span class="s2">"preorder_hash"</span>: <span class="s2">"26bf7874706ac761afdd403ed6b3b9578fb01a34"</span>,
<span class="s2">"revoked"</span>: <span class="nb">false</span>,
<span class="s2">"sender"</span>: <span class="s2">"76a9144401f3be5311585ea519c1cb471a8dc7b02fd6ee88ac"</span>,
<span class="s2">"sender_pubkey"</span>: <span class="s2">"039a8948d339ecbff44cf426cb85d90fce876f1658d385cdc47f007f279be626ea"</span>,
<span class="s2">"transfer_send_block_id"</span>: null,
<span class="s2">"txid"</span>: <span class="s2">"dc478659fc684a1a6e1e09901971e82de11f4dfe2b32a656700bf9a3b6030719"</span>,
<span class="s2">"value_hash"</span>: <span class="s2">"02af0ef21161ad06b0923106f40b994b9e4c1614"</span>,
<span class="s2">"vtxindex"</span>: 95
<span class="o">}</span>
<span class="o">]</span>,
<span class="s2">"445884"</span>: <span class="o">[</span>
<span class="o">{</span>
<span class="s2">"address"</span>: <span class="s2">"1GZqrVbamkaE6YNveJFWK6cDrCy6bXyS6b"</span>,
<span class="s2">"block_number"</span>: 445838,
<span class="s2">"consensus_hash"</span>: <span class="s2">"18b8d69f0182b89ccb1aa536f83be18a"</span>,
<span class="s2">"first_registered"</span>: 445851,
<span class="s2">"importer"</span>: null,
<span class="s2">"importer_address"</span>: null,
<span class="s2">"last_creation_op"</span>: <span class="s2">"?"</span>,
<span class="s2">"last_renewed"</span>: 445851,
<span class="s2">"name"</span>: <span class="s2">"patrickstanley.id"</span>,
<span class="s2">"name_hash128"</span>: <span class="s2">"683a3e1ee5f0296833c56e481cf41b77"</span>,
<span class="s2">"namespace_block_number"</span>: 373601,
<span class="s2">"namespace_id"</span>: <span class="s2">"id"</span>,
<span class="s2">"op"</span>: <span class="s2">"&gt;&gt;"</span>,
<span class="s2">"op_fee"</span>: 25000,
<span class="s2">"opcode"</span>: <span class="s2">"NAME_TRANSFER"</span>,
<span class="s2">"preorder_block_number"</span>: 445838,
<span class="s2">"preorder_hash"</span>: <span class="s2">"26bf7874706ac761afdd403ed6b3b9578fb01a34"</span>,
<span class="s2">"revoked"</span>: <span class="nb">false</span>,
<span class="s2">"sender"</span>: <span class="s2">"76a914aabffa6dd90d731d3a349f009323bb312483c15088ac"</span>,
<span class="s2">"sender_pubkey"</span>: null,
<span class="s2">"transfer_send_block_id"</span>: 445875,
<span class="s2">"txid"</span>: <span class="s2">"7a0a3bb7d39b89c3638abc369c85b5c028d0a55d7804ba1953ff19b0125f3c24"</span>,
<span class="s2">"value_hash"</span>: <span class="s2">"02af0ef21161ad06b0923106f40b994b9e4c1614"</span>,
<span class="s2">"vtxindex"</span>: 16
<span class="o">}</span>
<span class="o">]</span>
<span class="o">}</span>
</code></pre>
</div>
<p>All of the above information is extracted from the blockchain. Each top-level
field encodes the states the name transitioned to at the given block height (e.g.
445838, 445851, 445873, adn 445884). At each block height, the name’s zone file
hashes are returned in the order they were discovered in the blockchain.</p>
<p>Each name state contains a lot of ancillary data that is used internally by
other API calls and client libraries. The relevant fields for this document’s
scope are:</p>
<ul>
<li><code class="highlighter-rouge">address</code>: This is the base58check-encoded public key hash.</li>
<li><code class="highlighter-rouge">name</code>: This is the name queried.</li>
<li><code class="highlighter-rouge">value_hash</code>: This is the zone file hash.</li>
<li><code class="highlighter-rouge">opcode</code>: This is the type of transaction that was processed.</li>
<li><code class="highlighter-rouge">txid</code>: This is the transaction ID in the underlying blockchain.</li>
</ul>
<p>The name’s <em>entire</em> history is returned. This includes the history of the name
under its previous owner, if the name expired and was reregistered.</p>
<h2 id="look-up-the-list-of-names-owned-by-a-given-public-key-hash-reference">Look up the list of names owned by a given public key hash (<a href="https://core.blockstack.org/#name-querying-get-names-owned-by-address">reference</a>)</h2>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>curl https://core.blockstack.org/v1/addresses/bitcoin/16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg
<span class="o">{</span>
<span class="s2">"names"</span>: <span class="o">[</span>
<span class="s2">"judecn.id"</span>,
<span class="s2">"patrickstanley1.id"</span>,
<span class="s2">"abcdefgh123456.id"</span>,
<span class="s2">"duckduckgo_tor.id"</span>,
<span class="s2">"jude.id"</span>,
<span class="s2">"blockstacknewyear2017.id"</span>,
<span class="s2">"jude.statism.id"</span>
<span class="o">]</span>
<span class="o">}</span>
</code></pre>
</div>
<p>Note that this API endpoint includes names and
<a href="#bns-subdomains">subdomains</a>.</p>
<div class="share uk-text-center">
<a href="https://twitter.com/intent/tweet?text=Resolve a name&url=https://zbabystack.netlify.com/core/naming/resolving.html&via=&related=" rel="nofollow" target="_blank" title="Share on Twitter" onclick="window.open(this.href, 'twitter', 'width=550,height=235');return false;"><span data-uk-icon="icon: twitter; ratio: 1.2"></span></a>
<a class="uk-margin-small-left" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fzbabystack.netlify.com%2Fcore%2Fnaming%2Fresolving.html" rel="nofollow" target="_blank" title="Share on Facebook" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;"><span data-uk-icon="icon: facebook; ratio: 1.2"></span></a>
</div>
</div>
<hr class="uk-margin-medium">
<div class="uk-margin-large-top">
<h3>Related Articles</h3>
<ul class="uk-list">
</ul>
</div>
</article>
<script>
// Table of contents scroll to
UIkit.scroll('#markdown-toc a', {
duration: 400,
offset: 120
});
</script>
</div>
</div>
</div>
<div id="offcanvas" data-uk-offcanvas="flip: true; overlay: true">
<div class="uk-offcanvas-bar">
<button class="uk-offcanvas-close" type="button" data-uk-close></button>
<ul class="uk-nav uk-nav-default">
<!-- <li><a class="uk-logo uk-margin-small-bottom" href="/"><img src="https://zbabystack.netlify.com/assets/posts/logo.png" alt="Docs"></a></li> -->
<li><a class="uk-logo uk-margin-small-bottom" href="/"><img src="/assets/posts/logo.png" alt="Docs"></a></li>
<li><a href="https://blockstack.org" target="_blank" >Blockstack.org</a></li>
<li><a href="https://forum.blockstack.org/" target="_blank" >Forums</a></li>
<li><a href="https://github.com/blockstack" target="_blank" >GitHub</a></li>
</ul>
<div class="uk-margin-small-top uk-text-center uk-text-muted uk-link-muted">
<div data-uk-grid class="uk-child-width-auto uk-grid-small uk-flex-center uk-grid">
<div class="uk-first-column">
<a href="https://twitter.com/" data-uk-icon="icon: twitter" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
<div>
<a href="https://www.facebook.com/" data-uk-icon="icon: facebook" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
<div>
<a href="https://www.instagram.com/" data-uk-icon="icon: instagram" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
<div>
<a href="https://vimeo.com/" data-uk-icon="icon: vimeo" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
</div>
</div>
</div>
</div>
<footer class="uk-section uk-text-center uk-text-muted uk-link-muted">
<div class="uk-container uk-container-small">
<!-- <div>
<ul class="uk-subnav uk-flex-center">
<li><a href="https://blockstack.org" target="_blank" >Blockstack.org</a></li>
<li><a href="https://forum.blockstack.org/" target="_blank" >Forums</a></li>
<li><a href="https://github.com/blockstack" target="_blank" >GitHub</a></li>
</ul>
</div>
<div class="uk-margin-medium">
<div data-uk-grid class="uk-child-width-auto uk-grid-small uk-flex-center uk-grid">
<div class="uk-first-column">
<a href="https://twitter.com/" data-uk-icon="icon: twitter" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
<div>
<a href="https://www.facebook.com/" data-uk-icon="icon: facebook" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
<div>
<a href="https://www.instagram.com/" data-uk-icon="icon: instagram" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
<div>
<a href="https://vimeo.com/" data-uk-icon="icon: vimeo" class="uk-icon-link uk-icon" target="_blank"></a>
</div>
</div>
</div> -->
<div class="uk-margin-medium uk-text-small copyright">&copy; 2018 Blockstack</div>
</div>
</footer>
<script type="text/javascript">
/* Create a configuration object */
var ss360Config = {
/* Your site id */
siteId: 'blockstack',
/* A CSS selector that points to your search box */
searchBox: {selector: '#searchBox'}
};
</script>
<script src="https://cdn.sitesearch360.com/sitesearch360-v11.min.js" async></script>
</body>
</html>