# OP-NS

OP-NS is a domain system that combines all the greatest aspects of the Bitcoin data economy – proof-of-work, data ownership, and abundant microtransactions. The protocols fuses the principles of proof-of-work and ordinal theory to build a naming system capable of serving as the foundation of the on-chain data economy

### Idea

This protocol allows us to **use** [**BSV Ordinals Inscriptions**](https://docs.1satordinals.com/) **backed by** [**Proof-of-Work**](https://en.wikipedia.org/wiki/Proof_of_work) **(PoW) to create a fair-mint hierarchical naming system for the Bitcoin dataspace**.&#x20;

* Fairly mine a Domain using computational Proof-of-Work
* It is impossible to instantly claim the entire domain space due to mining requirements
* Create hierarchical sub-domains for fine grained data control

#### Potential Use Cases of OP-NS

* Recursively subdivide the domain space to categorize data as needed.
* Deploy a fungible token against your domain
* Serve data in your name space (e.g. html)
* Prove in authenticity of ordinals minted within your domain (e.g. content gallery)
* Create access permissions to data based on token ownership (i.e. gated content)

## Architecture

### Mine

#### Diagram

<figure><img src="/files/R6Cj4zHFoDkPIquiBnYz" alt=""><figcaption></figcaption></figure>

#### API

The OP-NS contract relies on a Mint function that allows a domain claim request to be submitted with the computational solution for the required PoW

**Arguments:**

* char - "char to be mined"
* nonce - "random number that solves proof of work"
* lock - "output script (e.g. receiving address) of the resulting artifact"
* trailingOutputs - "any additional output"

### Genesis

All valid OP-NS domains must be derived from the genesis contract or its children. The genesis contract is found at transaction: `58b7558ea379f24266c7e2f5fe321992ad9a724fd7a87423ba412677179ccb25`

### Proof of Ownership

The owner of an OP-NS domain can prove ownership in order modify and develop it by deploying further OP contracts against it.&#x20;

Ownership is proven by providing the UTXO/satoshi containing the domain artifact as an input to an **atomic transaction** that:

1. validates the authenticity of domain ownership&#x20;
2. guarantees the safe return of the domain satoshi to the owner address
3. generates any additional outputs enabled by the domain ownership

The artifact is hence always found at the owners address.

<figure><img src="/files/wLuzZhBQgmsgFrU6iAWM" alt=""><figcaption></figcaption></figure>

### Transfers

OP-NS inscriptions inherit the transfer functionalities of Ordinals. The satoshis with the inscribed domains can therefore be ***sent***, ***bought*** and ***sold***.

##

## How To OP-NS?

### Build Your Own Interface

#### OP-NS Contract Code

<https://github.com/op-enheimer/op-ns>

<br>

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://op0-2.gitbook.io/op-standard/protocols/op-ns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
