{"url":"https://docs.blockstack.org/core/naming/introduction.html","headline":"Blockstack Naming Service (BNS)","dateModified":"2018-10-26T14:14:34-07:00","datePublished":"2018-10-26T14:14:34-07:00","mainEntityOfPage":{"@type":"WebPage","@id":"https://docs.blockstack.org/core/naming/introduction.html"},"author":{"@type":"Person","name":"Blockstack"},"description":"Blockstack Naming Service (BNS)","@type":"BlogPosting","@context":"http://schema.org"}</script>
<p>We rely on naming systems in everyday life, and they play a critical
role in many different applications. For example, when you look up a
friend on social media, you are using the platform’s naming service to resolve
their name to their profile. When you look up a website, you are using the
Domain Name Service to
resolve the hostname to its host’s IP address. When you check out a Git branch, you
are using your Git client to resolve the branch name to a commit hash.
When you look up someone’s PGP key on a keyserver, you are resolving
their key ID to their public key.</p>
<p>What kinds of things do we want to be true about names? In BNS, names are
globally unique, names are human-meaningful, and names are strongly-owned.
However, if you look at these examples, you’ll see that each of them only
guarantees <em>two</em> of these properties. This limits how useful they can be.</p>
<ul>
<li>In DNS and social media, names are globally unique and human-readable, but not
strongly-owned. The system operator has the
final say as to what each names resolves to.
<ul>
<li><strong>Problem</strong>: Clients must trust the system to make the right
choice in what a given name resolves to. This includes trusting that
no one but the system administrators can make these changes.</li>
</ul>
</li>
<li>In Git, branch names are human-meaningful
and strongly-owned, but not globally unique. Two different Git nodes may resolve the same
branch name to different unrelated repository states.
<ul>
<li><strong>Problem</strong>: Since names can refer to conflicting state, developers
have to figure out some other mechanism to resolve ambiguities. In Git’s
case, the user has to manually intervene.</li>
</ul>
</li>
<li>In PGP, names are key IDs. They are
are globally unique and cryptographically owned, but not human-readable. PGP
key IDs are derived from the keys they reference.
<ul>
<li><strong>Problem</strong>: These names are difficult for most users to
remember since they do not carry semantic information relating to their use in the system.</li>
</ul>
</li>
</ul>
<p>BNS names have all three properties, and none of these problems. This makes it a
powerful tool for building all kinds of network applications. With BNS, we
can do the following and more:</p>
<ul>
<li>Build domain name services where hostnames can’t be hijacked.</li>
<li>Build social media platforms where user names can’t be stolen by phishers.</li>
<li>Build version control systems where repository branches do not conflict.</li>
<li>Build public-key infrastructure where it’s easy for users to discover and
remember each other’s keys.</li>
</ul>
<h1id="organization-of-bns">Organization of BNS</h1>
<p>BNS names are organized into a global name hierarchy. There are three different
layers in this hierarchy related to naming:</p>
<ul>
<li>
<p><strong>Namespaces</strong>. These are the top-level names in the hierarchy. An analogy
to BNS namespaces are DNS top-level domains. Existing BNS namespaces include
<codeclass="highlighter-rouge">.id</code>, <codeclass="highlighter-rouge">.podcast</code>, and <codeclass="highlighter-rouge">.helloworld</code>. All other names belong to exactly one
namespace. Anyone can create a namespace, but in order for the namespace
to be persisted, it must be <em>launched</em> so that anyone can register names in it.
Namespaces are not owned by their creators.</p>
</li>
<li>
<p><strong>BNS names</strong>. These are names whose records are stored directly on the
blockchain. The ownership and state of these names are controlled by sending
blockchain transactions. Example names include <codeclass="highlighter-rouge">verified.podcast</code> and
<codeclass="highlighter-rouge">muneeb.id</code>. Anyone can create a BNS name, as long as the namespace that
contains it exists already. The state for BNS names is usually stored in the <ahref="/core/atlas/overview.html">Atlas
network</a>.</p>
</li>
<li>
<p><strong>BNS subdomains</strong>. These are names whose records are stored off-chain,
but are collectively anchored to the blockchain. The ownership and state for
these names lives within the <ahref="/core/atlas/overview.html">Atlas network</a>. While BNS
subdomains are owned by separate private keys, a BNS name owner must
broadcast their subdomain state. Example subdomains include <codeclass="highlighter-rouge">jude.personal.id</code>
and <codeclass="highlighter-rouge">podsaveamerica.verified.podcast</code>. Unlike BNS namespaces and names, the
state of BNS subdomains is <em>not</em> part of the blockchain consensus rules.</p>
</li>
</ul>
<p>A feature comparison matrix summarizing the similarities and differences
between these name objects is presented below:</p>
<table>
<thead>
<tr>
<th>Feature</th>
<th><strong>Namespaces</strong></th>
<th><strong>BNS names</strong></th>
<th><strong>BNS Subdomains</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>Globally unique</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>Human-meaningful</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>Owned by a private key</td>
<td></td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>Anyone can create</td>
<td>X</td>
<td>X</td>
<td>[1]</td>
</tr>
<tr>
<td>Owner can update</td>
<td></td>
<td>X</td>
<td>[1]</td>
</tr>
<tr>
<td>State hosted on-chain</td>
<td>X</td>
<td>X</td>
<td></td>
</tr>
<tr>
<td>State hosted off-chain</td>
<td></td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>Behavior controlled by consensus rules</td>
<td>X</td>
<td>X</td>
<td></td>
</tr>
<tr>
<td>May have an expiration date</td>
<td></td>
<td>X</td>
<td></td>
</tr>
</tbody>
</table>
<p>[1] Requires the cooperation of a BNS name owner to broadcast its transactions</p>
<divclass="share uk-text-center">
<ahref="https://twitter.com/intent/tweet?text=Blockstack Naming Service (BNS)&url=https://docs.blockstack.org/core/naming/introduction.html&via=&related="rel="nofollow"target="_blank"title="Share on Twitter"onclick="window.open(this.href, 'twitter', 'width=550,height=235');return false;"><spandata-uk-icon="icon: twitter; ratio: 1.2"></span></a>
/* A CSS selector that points to your search box */
searchBox: {
selector: '#searchBox'
},
results: {
embedConfig: undefined, // {'url':undefined,'contentBlock':'.page-content-body'}, // if url is given the page will change to that URL and look for the content block there to insert the results
fullScreenConfig: undefined, // {trigger: '#ss360-search-trigger', caption: 'Search this site'}, trigger is the CSS selector to the element that starts the search full screen overlay and searchCaption the caption on the full screen search page
caption: 'Found #COUNT# search results for \"#QUERY#\"', // the caption of the search results
group: true, // whether results should be grouped if content groups are available
filters: undefined,
num: 96, // the maximum number of search results to be shown
highlightQueryTerms: true, // whether to highlight the query terms in search results
moreResultsButton: "Show more results", // HTML for the more results button, all results will be shown if this is null
noResultsText: 'Sorry, we have not found any matches for your query.', // the text to show when there are no results
queryCorrectionText: 'Did you mean "#CORRECTION#"?',
searchQueryParamName: 'ss360Query', // the name of the search query parameter
linksOpenNewTab: false, // should clicking on the result links open a new tab/window?
showSearchBoxLayover: true, //whether to show search box in search result layover
moreResultsPagingSize: 12, // the number of new results to show each time the more results button is pressed (max: 24)
orderByRelevanceText: "Relevance" // the text to be shown in order select box to describe 'order by relevance' option
},
suggestions: {
show: true, // whether to show search suggestions
maxQuerySuggestions: 3, // the maximum number of query suggestions
querySuggestionHeadline: undefined, // the headline of the query suggestions, leave blank if no headline should be shown
emptyQuerySuggestions: undefined,
showImages: false, // show images in search suggestions
num: 6, // the maximum number of search suggestions to be shown
minChars: 3, // minimum number of characters before the suggestions shows, default: 3,
maxWidth: 'auto', // the maximum width of the suggest box, default: as wide as the input box, at least 275px
throttleTime: 300, // the number of milliseconds before the suggest is triggered after finished input, default: 300ms
extraHtml: undefined, // extra HTML code that is shown in each search suggest, you can even show values of datapoints here,
highlight: true, // whether matched words should be highlighted, default: true
},
smart404: { /* The caption of the search results. */
caption: 'These links might be useful', /* The string in the title that identifies the page as a 404 page. */
identifier: 'Page not found', /* A CSS selector that points to the area in which the alternative links should be shown. */