Skip to content

Commit

Permalink
Merge branch 'main' into docs/update-devtools-folder-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
owans committed Oct 31, 2024
2 parents d50f495 + f48a4d2 commit 646341c
Show file tree
Hide file tree
Showing 125 changed files with 3,950 additions and 796 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
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.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
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.
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
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 .github/PULL_REQUEST_TEMPLATE/pull_request_template_main.md
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.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This repo contains the [Rootstock Developer Portal](https://dev.rootstock.io). The Developer Docs is the home for Rootstock documentation for end users and developers. Check out our quickstarts, tutorials, API reference, and code examples.

_Start your journey to building dApps on Rootstock, see the [quick start guide](./docs/02-developers/04-quickstart/index.md) or see the [setup](#set-up) instructions, or the [contributing](CONTRIBUTING_DOCS.md) guide for how to contribute to Rootstock Documentation._
_Start your journey to building dApps on Rootstock, see the [Quick Start Guide](./docs/02-developers/04-quickstart/index.md) or see the [setup](#set-up) instructions, or the [contributing](CONTRIBUTING_DOCS.md) guide for how to contribute to Rootstock Documentation._

🚀 [Send us feedback](#issues)

🚀 Join the [Join the global Rootstock community on Discord](http://discord.gg/rootstock)
🚀 Join the [global Rootstock community on Discord](http://discord.gg/rootstock)

> This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. For more information on how to use Docusaurus, please refer to the [Docusaurus Documentation](https://docusaurus.io/docs).
Expand Down Expand Up @@ -61,7 +61,7 @@ Here's a simplified example of how it might look:

The main navigation of the website is created based on the root directories in the `/docs` folder. Each directory has its own sidebar for easy navigation.

> Root directories name must contain only a character that is a letter, a number, a dash, or an underscore. If it doesn't, the directory is ignored and won't apear in main navigation.
> Root directories name must contain only a character that is a letter, a number, a dash, or an underscore. If it doesn't, the directory is ignored and won't appear in main navigation.
In this case, the main navigation of the website would have two sections: "Guide" and "Tutorial".

Expand All @@ -82,7 +82,7 @@ For more information on how to use images in Docusaurus, please refer to the [Co
Steps:
1. Locate the `docs` folder
2. Create a markdown file in the section you wish to add the docs.
3. Add `title`, `aidebar_label`, `tags`, `description`, and `sidebar_position` attributes
3. Add `title`, `sidebar_label`, `tags`, `description`, and `sidebar_position` attributes
to the front matter as appropriate - see below for more details.
4. If the new page is within a collection, and it is named `index.md`, add a `section_title`, `menu_title`. Ensure that you set a `permalink` attribute in the front matter, with a trailing `/`.

Expand Down Expand Up @@ -266,4 +266,4 @@ Fill it in accordingly.
Note that **What** and **Why** sections are compulsory,
and the **Refs** section is optional.

> Note to run `yarn build` to test the build output of your branch prior to creating a new pull request, or pushing more commits to an existing one. Don't introduce any regressions!
> Note to run `yarn build` to test the build output of your branch prior to creating a new pull request, or pushing more commits to an existing one. Don't introduce any regressions!
1 change: 1 addition & 0 deletions docs/01-concepts/powpeg/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Rootstock’s **PowPeg** protocol, has matured from its inception in 2018 as a f
- The PowPeg App is available on [Testnet](https://powpeg.testnet.rootstock.io/) and [Mainnet](https://powpeg.rootstock.io/).
- For general information about the design and architecture, how to perform a peg-in transaction using Ledger and Trezor, Frequently asked questions and advanced operations you can perform on the PowPeg, please refer to the [PowPeg user guide](/resources/guides/powpeg-app/).
- Get information on the signatories and attestion in the [PowPeg HSM Firmware Attestation](/concepts/powpeg/hsm-firmware-attestation) section.
- Read [Introducing Fast Mode: Getting RBTC via the PowPeg, but Faster](https://blog.rootstock.io/noticia/get-rbtc-fast-mode/) to learn about the difference between Native Mode and Fast Modes when using the PowPeg.
:::

## The History of the PowPeg Protocol
Expand Down
8 changes: 8 additions & 0 deletions docs/01-concepts/rif-suite/rns/getting-started/index.md
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: ""
---

125 changes: 125 additions & 0 deletions docs/01-concepts/rif-suite/rns/index.md
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
66 changes: 66 additions & 0 deletions docs/01-concepts/rif-suite/rns/specs/index.md
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))`

Loading

0 comments on commit 646341c

Please sign in to comment.