-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into docs/update-devtools-folder-structure
- Loading branch information
Showing
125 changed files
with
3,950 additions
and
796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
--- | ||
|
||
**Is your feature request related to a problem with the content or with the docs platform? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## What | ||
* Specify new changes introduced within the docs repo... | ||
|
||
## Why | ||
* Specify why this change is needed... | ||
* Add/tag related issues, if available... | ||
|
||
## Refs | ||
* Add related links (tasks, notion, or jira) | ||
* Add NA if not applicable |
27 changes: 27 additions & 0 deletions
27
.github/PULL_REQUEST_TEMPLATE/pull_request_template_main.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Title | ||
* Clear and concise description of the change | ||
|
||
## Description | ||
|
||
* Briefly explain the purpose of the change. | ||
* If applicable, describe the issue that was resolved or the feature that was added. | ||
* Highlight the specific changes made to the documentation. | ||
|
||
## Screenshots/GIFs | ||
|
||
* Include any relevant screenshots or GIFs to visually demonstrate the changes. | ||
|
||
## Testing | ||
|
||
* Describe how you tested the changes to ensure they are correct and do not introduce new issues. | ||
|
||
## Checklist | ||
|
||
[ ] I have read and understood the contributing guidelines. | ||
[ ] I have followed the style guide and formatting guidelines. | ||
[ ] I have added appropriate comments to explain the changes. | ||
[ ] I have tested my changes thoroughly. | ||
|
||
## Additional Notes | ||
|
||
* If there are any specific considerations or concerns, please mention them here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
sidebar_label: Getting Started | ||
sidebar_position: 500 | ||
title: "Getting Started" | ||
tags: [rif, rns, Getting Started] | ||
description: "" | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
--- | ||
sidebar_label: RNS | ||
sidebar_position: 400 | ||
title: "RIF RNS: RIF Name Service | Rootstock (RSK)" | ||
tags: [rif, rns, rif-name-service, rsk] | ||
description: "Information about the RIF token, where to obtain it, how to transfer it, and technical details on its token standard" | ||
--- | ||
|
||
RNS provides an architecture which enables the identification of blockchain addresses by human-readable names. | ||
|
||
<form class="form" id="frm-rns-search"> | ||
<div class="form-group"> | ||
<div class="input-group"> | ||
<input type="text" id="txt-rns-name" class="form-control" placeholder="find your domain" /> | ||
<div class="input-group-append"> | ||
<span class="input-group-text">.rsk</span> | ||
</div> | ||
<div class="input-group-append"> | ||
<button class="btn btn-rns-register">Register!</button> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<div class="container the-stack"> | ||
<div class="row rif_blue_text"> | ||
<div class="col"> | ||
<div class="rns-index-box"> | ||
<a href="try-rns">Try the service</a> | ||
<br /> | ||
<br /> | ||
<p>Register a domain in the Testnet, for free.</p> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<div class="rns-index-box"> | ||
<a href="./integrate">Integrate with RNS</a> | ||
<br /> | ||
<br /> | ||
<p>Easy guides on how to integrate RNS in your solution.</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row rif_blue_text"> | ||
<div class="col"> | ||
<div class="rns-index-box"> | ||
<a href="run-locally">Develop on top of RNS</a> | ||
<br /> | ||
<br /> | ||
<p>Deploy RNS suite in your local development environment</p> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<div class="rns-index-box"> | ||
<a href="libs">Use the libraries</a> | ||
<br /> | ||
<br /> | ||
<p>Use simple libraries to interact with RNS service.</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
## The stack | ||
|
||
![image](/img/rif/rns/theStack.png) | ||
|
||
## Motivation | ||
|
||
By adding a name resolution service, also known as “alias”, the probability of errors is significantly reduced. In addition, centralizing the access to multiple resources associated with a human-readable name improves the blockchain platform user experience. As resource names may change over time, the system needs to be flexible to support frequent changes. | ||
|
||
Currently over the World Wide Web, the Domain Name System (DNS) is responsible for mapping human-readable names to IP addresses. RNS is a decentralized and secure service that works over RSK's blockchain. | ||
|
||
Here’s a refined version of your text, maintaining the same tone and voice: | ||
|
||
|
||
## Design | ||
|
||
RNS is a hierarchical namespace inspired by DNS, where the hierarchy roughly reflects organizational structure, with levels separated by the "." character. | ||
|
||
The design of the RIF Name Service is shaped by specific goals: | ||
|
||
- The primary objective is to establish a consistent namespace for referencing resources. | ||
- Each piece of data associated with a name is tagged with a type, allowing queries to be limited to a specific type. | ||
- To ensure the namespace is adaptable across different networks and applications, RNS supports the use of the same namespace with various protocol families or management systems. Data in RNS is tagged with both a class and a type, enabling the parallel use of different formats for data of type "address." | ||
- There may be trade-offs between data acquisition costs, update speed, and cache accuracy. The domain owner, as the data source, should consider these trade-offs and decide what to store and how to cache it. | ||
|
||
> [RNS specs](./specs) | ||
|
||
## Elements of the RNS | ||
|
||
RNS has four major components: | ||
|
||
| **Component** | **Description** | **Specs** | | ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------| | ||
| **RNS Registry** | The RNS Registry is a specification for a tree-structured namespace and the data associated with the names. Conceptually, each node and leaf in the domain name space tree represents a set of information. Query operations attempt to extract specific types of information from a particular set. A query specifies the domain name of interest and the type of resource information desired. | [Specs](./specs/registry) | | ||
| **RNS Resolvers** | RNS Resolvers are contracts that provide information from a name in response to client requests. Resolvers must answer a query directly or use referrals to other resolvers. Typically, a resolver is a contract's public function that is directly accessible to user programs or other contracts. No specific protocol is required between the resolver and the user program. | [Specs](./specs/resolver) | | ||
| **RNS Registrar** | The RNS Registrar is a critical component within the RIF Name Service, managing the registration of `.rsk` domain names. This contract has the authority to register names in the RSK Owner contract, ensuring that new domain registrations are handled securely and efficiently. | [Specs](./specs/registrar) | | ||
| **Renewer** | The Renewer is a contract designed to facilitate the renewal of names registered in the Node Owner. It is equipped with permissions to renew these names and provides flexibility in how the renewal is executed. | ||
|
||
These fours components roughly correspond to the four layers or views of the domain system: | ||
- From the user's point of view, the domain system is accessed through a simple resolution operation. The domain space consists of a single tree and the user can request information from any section of the tree. | ||
- From the resolver's point of view, the domain system is composed of an unknown number of names. Each name has a corresponding resolver that provides information for a set of resolution types directly. | ||
- From the registry's point of view, the domain system consists of a hierarchical tree where each leaf has an owner (contract or account) and an associated resolver that provides information of the name. | ||
- From the **renewal's point of view**, the domain system ensures continued ownership through renewal processes, facilitating the payment of fees for name renewals via supported methods like ERC-20 or ERC-677. | ||
|
||
|
||
## Guidelines on use | ||
|
||
Before RNS can be used to hold naming information for some kind of object, two needs must be met: | ||
- A convention for mapping between object names and domain names. This describes how information about an object is accessed. Find specs [here](specs#name-mapping-convention) | ||
- Resource record types and data formats for describing the object. Find specs. | ||
|
||
The guideline for finding a specific record for a name is as follows: | ||
1. Calculate the name identifier with [`namehash` function](specs#name-mapping-convention). | ||
2. Get the name's resolver address via [`resolver(bytes32)`](specs/registry#AcessFunctions). | ||
3. Determine if resolver supports desired resource record via [ERC-165 interface detection](https://eips.ethereum.org/EIPS/eip-165). | ||
4. Get the desired resource record. Find currently standardized [resolvers](./specs/resolver). | ||
|
||
> Guidelines on integration | ||
### Resource records | ||
|
||
A domain name identifies a node. Each node has a set of resource information, which may be empty. The set of resource information associated with a particular name is composed of separate resource records (RRs). The order of RRs in a set is not significant. Resource records associated with a name are found in the domain's resolver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
sidebar_label: Spec | ||
sidebar_position: 400 | ||
title: "Specification" | ||
tags: [rif, rns, spec] | ||
description: "The domain name space is a tree structure. Each node and leaf on the tree corresponds to a resource set (which may be empty)." | ||
--- | ||
|
||
The domain name space is a tree structure. Each node and leaf on the tree corresponds to a resource set (which may be empty). | ||
|
||
The domain system makes no distinctions between the uses of the interior nodes and leaves, and this memo uses the term "node" to refer to both. | ||
|
||
The domain name of a node is the list of the labels on the path from the node to the root of the tree. By convention, the labels that compose a domain name are printed or read left to right, from the most specific (lowest, farthest from the root) to the least specific (highest, closest to the root). | ||
|
||
When a user needs to type a domain name, the length of each label is omitted and the labels are separated by dots `(.)`. | ||
|
||
Since a complete domain name ends with the root label, this leads to a printed form which ends in a dot, that is omitted. For example, a valid domain name is `wallet.alice.rsk`. | ||
|
||
## Valid names | ||
For simplicity, a valid RNS domain is defined as follows: | ||
|
||
- TLD is one of the predefined TLDs, which currently may only be `rsk` | ||
- The first label is compulsory | ||
- Any second and subsequent labels are optional | ||
- All labels must be alphanumeric and lower case | ||
- All labels and the TLD are delimited by `.` | ||
|
||
The reference implementation for RNS domain validation can be found in [RNS SDK](https://www.npmjs.com/package/@rsksmart/rns-sdk) | ||
|
||
- AVAILABLE_TLDS in src/constants.ts | ||
- isValidDomain and isValidLabel in src/utils.ts | ||
|
||
|
||
Example #1: uno2tres.rsk is valid: | ||
|
||
✔️ TLD is rsk | ||
✔️ First label is uno2tres; which is present and lowercase alphanumeric | ||
✔️ Second and subsequent labels are not present | ||
|
||
Example #2: rss.website.alice.rsk is valid: | ||
|
||
- ✔️ TLD is rsk | ||
- ✔️ First label is alice; which is present and lowercase alphanumeric | ||
- ✔️ Second label is website; which is present and lowercase alphanumeric | ||
- ✔️ Third label is rss; which is present and lowercase alphanumeric | ||
|
||
Example #3: my_illegal_domain.com is invalid: | ||
|
||
- ❌ TLD is com | ||
- ❌ First label is my_illegal_domain; which is present, however contains non-alphanumeric characters | ||
- ✔️ Second and subsequent labels are not present | ||
|
||
## Name mapping convention | ||
Each domain name has a node identifier in the RNS Registry, that is obtained via `namehash` functions, that is as follows: | ||
|
||
```python | ||
def namehash(name): | ||
if name == '': | ||
return '\0' * 32 | ||
else: | ||
label, _, remainder = name.partition('.') | ||
return sha3(namehash(remainder) + sha3(label)) | ||
``` | ||
|
||
Given a `node`, a `subnode` can be identified by using its label: `sha3(namehash(node) + sha3(label))` | ||
|
Oops, something went wrong.