Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 9f1ffbe

Browse files
authored
Add docusaurus
1 parent b2aa9f5 commit 9f1ffbe

File tree

23 files changed

+265
-114
lines changed

23 files changed

+265
-114
lines changed

.github/workflows/test-docs-build.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test Docs Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
checks:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Test Build
21+
run: |
22+
corepack enable
23+
yarn install --no-immutable
24+
yarn build

.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
11
book/
22
src/
3+
4+
# Dependencies
5+
node_modules
6+
7+
# Yarn
8+
yarn.lock
9+
.pnp.*
10+
.yarn/*
11+
!.yarn/patches
12+
!.yarn/plugins
13+
!.yarn/releases
14+
!.yarn/sdks
15+
!.yarn/versions
16+
17+
# Production
18+
/build
19+
20+
# Generated files
21+
.docusaurus
22+
.cache-loader
23+
package-lock.json
24+
25+
# Misc
26+
.DS_Store
27+
.env.local
28+
.env.development.local
29+
.env.test.local
30+
.env.production.local
31+
32+
npm-debug.log*
33+
yarn-debug.log*
34+
yarn-error.log*

.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

CONTRIBUTE.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
> **Note**
2+
> This guide is meant for local development and contributing to the repository only, for guidance on the TIPs process and how to propose Tangle improvements, please see the [README](README.md)
3+
4+
5+
# Documentation
6+
7+
The TIPs online documentation is built using [Docusaurus 2](https://docusaurus.io/). The deployment is done through a centralized build from [IOTA WIKI](https://github.com/iota-wiki/iota-wiki). To run a local instance, the [IOTA WIKI CLI](https://www.npmjs.com/package/@iota-wiki/cli) is used.
8+
9+
## Prerequisites
10+
11+
- [Node.js 16.10 or above](https://nodejs.org/en/download/).
12+
- [Modern Yarn](https://yarnpkg.com/getting-started/install) enabled by running `corepack enable`.
13+
14+
## Installation
15+
16+
```console
17+
yarn
18+
```
19+
20+
This command installs all necessary dependencies.
21+
22+
## Local Development
23+
24+
```console
25+
yarn start
26+
```
27+
28+
This command starts a local, wiki themed development server and opens up a browser window. Most changes are reflected live without having to restart the server.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Building the IOTA ecosystem is a community effort, therefore we welcome anyone t
88

99
Do you have an idea how to improve the IOTA technology stack?
1010
- Head over to the [discussions](https://github.com/iotaledger/tips/discussions) page to browse already submitted ideas or share yours!
11-
- Once your idea is discussed, you can submit a draft TIP ([template here](./tip-template.md)) as a PR to the repository.
11+
- Once your idea is discussed, you can submit a draft TIP ([template here](https://github.com/iotaledger/tips/blob/main/tip-template.md) as a PR to the repository.
1212
- You will receive feedback from the TIP Editors and review from core devs.
1313
- Once accepted, your TIP is merged as Draft.
1414
- It is your responsibility to drive its implementation and to present a clear plan on how the new feature will be adopted by the network.

docusaurus.config.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const { link } = require('fs');
2+
const path = require('path');
3+
4+
module.exports = {
5+
plugins: [
6+
[
7+
'@docusaurus/plugin-content-docs',
8+
{
9+
id: 'iota-tips',
10+
path: path.resolve(__dirname, './'),
11+
routeBasePath: 'tips',
12+
editUrl: 'https://github.com/iotaledger/tips/edit/main/',
13+
remarkPlugins: [require('remark-import-partial')],
14+
include: ['tips/**/*.md', 'README.md'],
15+
16+
// Create own sidebar to flatten hierarchy and use own labeling
17+
async sidebarItemsGenerator({
18+
defaultSidebarItemsGenerator,
19+
...args
20+
}) {
21+
const items = await defaultSidebarItemsGenerator(args);
22+
23+
const result = items[1].items.map((item) => {
24+
if (item.type === 'category') {
25+
if (item.link.type === 'doc') {
26+
// Get TIP number and append TIP name
27+
item.label = item.link.id.slice(-4) + '-' + item.label
28+
}
29+
}
30+
return item;
31+
});
32+
33+
return [items[0]].concat(result);
34+
},
35+
}
36+
],
37+
],
38+
staticDirectories: [],
39+
};

package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "iota-tips",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"start": "iota-wiki start",
6+
"build": "iota-wiki build"
7+
},
8+
"license": "UNLICENSED",
9+
"engines": {
10+
"node": ">=16.10.0"
11+
},
12+
"devDependencies": {
13+
"@iota-wiki/cli": "latest"
14+
},
15+
"packageManager": "[email protected]"
16+
}

tips/TIP-0001/tip-0001.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TIPs must adhere to the format and structure requirements that are outlined in t
5656

5757
### TIP Template
5858

59-
The template to follow for new TIPs is located in the [repository](../../tip-template.md).
59+
The template to follow for new TIPs is located in the [repository](https://github.com/iotaledger/tips/blob/main/tip-template.md).
6060

6161
### TIP Process
6262

tips/TIP-0004/tip-0004.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ In the following we define the Merkle tree hash (MTH) function that returns the
5959
- The output is a single 32-byte hash.
6060

6161
Given an ordered list of n input strings D<sub>n</sub> = {d<sub>1</sub>, d<sub>2</sub>, ..., d<sub>n</sub>}, the Merkle tree hash of D is defined as follows:
62-
- If D is an empty list, MTH(D) is the hash of an empty string:<br>
62+
- If D is an empty list, MTH(D) is the hash of an empty string:<br/>
6363
MTH({}) = BLAKE2().
64-
- If D has the length 1, the hash (also known as a leaf hash) is:<br>
64+
- If D has the length 1, the hash (also known as a leaf hash) is:<br/>
6565
MTH({d<sub>1</sub>}) = BLAKE2( 0x00 || d<sub>1</sub> ).
6666
- Otherwise, for D<sub>n</sub> with n > 1:
6767
- Let k be the largest power of two less than n, i.e. k < n ≤ 2k.
68-
- The Merkle tree hash can be defined recursively:<br>
68+
- The Merkle tree hash can be defined recursively:<br/>
6969
MTH(D<sub>n</sub>) = BLAKE2( 0x01 || MTH({d<sub>1</sub>, ..., d<sub>k</sub>}) || MTH({d<sub>k+1</sub>, ..., d<sub>n</sub>}) ).
7070

7171
Note that the hash calculations for leaves and nodes differ. This is required to provide second preimage resistance: Without such a prefix, for a given input D an attacker could replace two (or more) leaves with their corresponding aggregated node hash without changing the final value of MTH(D). This violates the fundamental assumption that, given MTH(D), it should be practically impossible to find a different input D' leading to the same value. Adding a simple prefix mitigates this issue, since now leaf and node hashes are computed differently and can no longer be interchanged.

tips/TIP-0006/tip-0006.md

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ The following table describes the serialization of a _Message_ following the not
111111
</tr>
112112
</table>
113113
</details>
114+
</td>
115+
</tr>
114116
<tr>
115117
<td>Nonce</td>
116118
<td>uint64</td>

tips/TIP-0007/tip-0007.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ The following table describes the entirety of a _Transaction Payload_ in its ser
284284
</tr>
285285
</table>
286286
</details>
287-
<tr>
287+
</td>
288+
</tr>
288289
</table>
289290
</details>
290291
</td>

tips/TIP-0008/tip-0008.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ The following table describes the entirety of a _Milestone Payload_ in its seria
167167
</tr>
168168
</table>
169169
</details>
170-
<tr>
170+
</td>
171+
</tr>
171172
</table>
172173
</details>
173174
</td>

tips/TIP-0009/tip-0009.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ Defines an output.
6969
</tr>
7070
<tr>
7171
<td>Message Hash</td>
72-
<td>Array<byte>[32]</td>
72+
<td>Array&lt;byte&gt;[32]</td>
7373
<td>The hash of the message in which the transaction was contained which generated this output.</td>
7474
</tr>
7575
<tr>
7676
<td>Transaction hash</td>
77-
<td>Array<byte>[32]</td>
77+
<td>Array&lt;byte&gt;[32]</td>
7878
<td>The hash of the transaction which generated this output.</td>
7979
</tr>
8080
<tr>
@@ -89,7 +89,7 @@ Defines an output.
8989
<summary>SigLockedSingleDeposit</summary>
9090
<table>
9191
<tr>
92-
<td><b>Name<b></td>
92+
<td><b>Name</b></td>
9393
<td><b>Type</b></td>
9494
<td><b>Description</b></td>
9595
</tr>
@@ -105,7 +105,7 @@ Defines an output.
105105
<summary>Ed25519 Address</summary>
106106
<table>
107107
<tr>
108-
<td><b>Name<b></td>
108+
<td><b>Name</b></td>
109109
<td><b>Type</b></td>
110110
<td><b>Description</b></td>
111111
</tr>
@@ -134,7 +134,7 @@ Defines an output.
134134
<summary>SigLockedDustAllowanceDeposit</summary>
135135
<table>
136136
<tr>
137-
<td><b>Name<b></td>
137+
<td><b>Name</b></td>
138138
<td><b>Type</b></td>
139139
<td><b>Description</b></td>
140140
</tr>
@@ -150,7 +150,7 @@ Defines an output.
150150
<summary>Ed25519 Address</summary>
151151
<table>
152152
<tr>
153-
<td><b>Name<b></td>
153+
<td><b>Name</b></td>
154154
<td><b>Type</b></td>
155155
<td><b>Description</b></td>
156156
</tr>
@@ -196,15 +196,15 @@ Defines the diff a milestone produced by listing the created/consumed outputs an
196196
</tr>
197197
<tr>
198198
<td>Milestone Payload</td>
199-
<td>Array<byte>[Milestone Payload length]</td>
199+
<td>Array&lt;byte&gt;[Milestone Payload length]</td>
200200
<td>The milestone payload in its serialized binary form.</td>
201201
</tr>
202202
<tr>
203203
<td>
204-
Treasury Input
205-
<blockquote>
206-
only included if milestone contains a receipt
207-
</blockquote>
204+
Treasury Input
205+
<blockquote>
206+
only included if milestone contains a receipt
207+
</blockquote>
208208
</td>
209209
<td colspan="2">
210210
<table>
@@ -215,7 +215,7 @@ Defines the diff a milestone produced by listing the created/consumed outputs an
215215
</tr>
216216
<tr>
217217
<td>Treasury Input Milestone Hash</td>
218-
<td>Array<byte>[32]</td>
218+
<td>Array&lt;byte&gt;[32]</td>
219219
<td>The hash of the milestone this input references.</td>
220220
</tr>
221221
<tr>
@@ -260,7 +260,7 @@ Defines what a full snapshot file contains.
260260

261261
<table>
262262
<tr>
263-
<td><b>Name<b></td>
263+
<td><b>Name</b></td>
264264
<td><b>Type</b></td>
265265
<td><b>Description</b></td>
266266
</tr>
@@ -311,7 +311,7 @@ Defines what a full snapshot file contains.
311311
</tr>
312312
<tr>
313313
<td>Treasury Output Milestone Hash</td>
314-
<td>Array<byte>[32]</td>
314+
<td>Array&lt;byte&gt;[32]</td>
315315
<td>The milestone hash of the milestone which generated the treasury output.</td>
316316
</tr>
317317
<tr>
@@ -323,7 +323,7 @@ Defines what a full snapshot file contains.
323323
<td valign="top">SEPs</td>
324324
<td colspan="2">
325325
<details>
326-
<summary>SEP Array<byte>[32]</summary>
326+
<summary>SEP Array&lt;byte&gt;[32]</summary>
327327
</details>
328328
</td>
329329
</tr>
@@ -351,7 +351,7 @@ Defines what a delta snapshot contains.
351351

352352
<table>
353353
<tr>
354-
<td><b>Name<b></td>
354+
<td><b>Name</b></td>
355355
<td><b>Type</b></td>
356356
<td><b>Description</b></td>
357357
</tr>
@@ -399,7 +399,7 @@ Defines what a delta snapshot contains.
399399
<td valign="top">SEPs</td>
400400
<td colspan="2">
401401
<details>
402-
<summary>SEP Array<byte>[32]</summary>
402+
<summary>SEP Array&lt;byte&gt;[32]</summary>
403403
</details>
404404
</td>
405405
</tr>

tips/TIP-0012/tip-0012.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The IOTA protocol uses proof-of-work as a means to rate-limit the network. Curre
1616

1717
# Motivation
1818

19-
In the current IOTA Protocol, each transaction has a fixed size of 8019 trits and is hashed using Curl-P-81 to compute its 243-trit transaction hash, where the PoW's difficulty equals the number of trailing zero trits in that hash.<br>
20-
Unfortunately, the performance of Curl-P-81 is slow, achieving only about 2 MB/s on a single core. This would make the PoW validation a bottleneck, especially for high usage scenarios with larger messages. Thus, this RFC proposes a two-stage approach to speed up the validation process: First, the [BLAKE2b-256](https://tools.ietf.org/html/rfc7693) hash function is used to create a short, fixed length digest of the message. Then, this digest, together with the nonce, is hashed using Curl-P-81. Since the digest only needs to be computed once while iterating over different nonce values, this preserves Curl as the PoW-relevant hash. However, the validation is much faster, as BLAKE2b-256 has a performance of about 1 GB/s and Curl then only needs to be executed for one single 243-trit block of input. Since the input of the final Curl computation is always fixed, parallel Curl variants can be used in this stage to further speed up the validation if necessary.<br>
19+
In the current IOTA Protocol, each transaction has a fixed size of 8019 trits and is hashed using Curl-P-81 to compute its 243-trit transaction hash, where the PoW's difficulty equals the number of trailing zero trits in that hash.<br/>
20+
Unfortunately, the performance of Curl-P-81 is slow, achieving only about 2 MB/s on a single core. This would make the PoW validation a bottleneck, especially for high usage scenarios with larger messages. Thus, this RFC proposes a two-stage approach to speed up the validation process: First, the [BLAKE2b-256](https://tools.ietf.org/html/rfc7693) hash function is used to create a short, fixed length digest of the message. Then, this digest, together with the nonce, is hashed using Curl-P-81. Since the digest only needs to be computed once while iterating over different nonce values, this preserves Curl as the PoW-relevant hash. However, the validation is much faster, as BLAKE2b-256 has a performance of about 1 GB/s and Curl then only needs to be executed for one single 243-trit block of input. Since the input of the final Curl computation is always fixed, parallel Curl variants can be used in this stage to further speed up the validation if necessary.<br/>
2121
Furthermore, it is important to note that the time required to do the PoW depends on the PoW difficulty and not on the message length. As such, to treat messages with different lengths differently, we need to weight the PoW difficulty by the message length.
2222

2323
It will be easy to adapt existing hardware and software implementations of the current PoW mechanism to work with the proposed design. Only the input and the position of the nonce in the buffer needs to be adapted. This enables existing Curl projects to continue persisting and also the entire PoW landscape should stay almost the same.

0 commit comments

Comments
 (0)