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

Commit d029409

Browse files
author
Sébastien Dan
committed
First commit
0 parents  commit d029409

35 files changed

+9849
-0
lines changed

.github/workflows/docker.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
# Allows you to run this workflow manually from the Actions tab
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
push_to_registry:
15+
name: Push Docker image to GitHub Container Registry
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Login to GitHub Container Registry
21+
uses: docker/login-action@v1
22+
with:
23+
registry: ghcr.io
24+
username: robot-toposware
25+
password: ${{ secrets.ROBOT_TOPOSWARE_GH_PACKAGE_TOKEN }}
26+
- name: Extract metadata (tags, labels) for Docker
27+
id: meta
28+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
29+
with:
30+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
31+
- name: Push to GitHub Container Registry
32+
uses: docker/build-push-action@v2
33+
with:
34+
push: true
35+
context: .
36+
tags: ${{ steps.meta.outputs.tags }}
37+
labels: ${{ steps.meta.outputs.labels }}
38+
build-args: NPM_TOKEN=${{ secrets.ROBOT_TOPOSWARE_GH_PACKAGE_TOKEN }}

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "es5"
5+
}

Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:14 as build-deps
2+
WORKDIR /usr/src/app
3+
COPY package.json yarn.lock ./
4+
RUN yarn
5+
COPY . ./
6+
RUN yarn build
7+
8+
FROM nginx:1.12-alpine
9+
COPY --from=build-deps /usr/src/app/build /usr/share/nginx/html
10+
EXPOSE 80
11+
CMD ["nginx", "-g", "daemon off;"]

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
```
30+
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31+
```
32+
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/develop/_category_.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Develop",
3+
"position": 3
4+
}

docs/develop/getting-started.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Getting Started
6+
7+
Welcome to the **Develop** section of Topos Docs!
8+
9+
- Take a look at [Substrate](/develop/substrate) for information about the base framework Topos software extends.
10+
- Read [XCP Pallets](/develop/xcp-pallets) for details about how Topos software augments Substrate.

docs/develop/substrate.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Substrate
6+
7+
Topos software is based on [Substrate](https://substrate.io/), a blockchain framework developed by [Parity](https://www.parity.io/) and written in rust.
8+
9+
Originally the base project of [Polkadot](https://polkadot.network/), [Substrate](https://substrate.io/) packages a fully functional blockchain backbone and exposes a framework-in-the-framework ([FRAME](#frame)) tailored for custom _on-chain_ business logic—the **runtime**.
10+
11+
:::info
12+
13+
Refer to the [**Substrate Developer Hub**](https://docs.substrate.io/) for a complete overview of Substrate.
14+
15+
:::
16+
17+
## FRAME
18+
19+
Developing a [Substrate](https://substrate.io/) runtime with FRAME comes down to writing domain-specific modules called **Pallets**. FRAME pallets implement a common interface that eases runtime development by clearly encapsulating the declaration of runtime specifc objects and methods (e.g. storage element, storage mutation functions).
20+
21+
A large part of the blockchain backbone exposed by Substrate is itself developed in FRAME both as system/meta pallets that build FRAME itself and as pallets that define core components of a blockchain (e.g. block production mechanism).
22+
23+
:::note Example: block production mechanism
24+
25+
With regards to the block production mechanism of a Substrate blockchain—i.e. selecting the leaders who author blocks—FRAME exposes multiple solutions: the _Aura_ pallet introduces the Aura block production mechanism where known authorities take turns producting blocks, the _Babe_ pallet introduces the Babe block production mechanism where publicly verifiable randomness is used along with stake distribution to randomly designate block authors.
26+
27+
:::
28+
29+
The composition of FRAME prebuilt pallets and ones defining custom business logic is what makes a Substrate blockchain specific.
30+
31+
:::info
32+
33+
More details about FRAME [**here**](https://docs.substrate.io/v3/runtime/frame/).
34+
35+
:::

docs/develop/xcp-pallets.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# XCP Pallets
6+
7+
Topos software builds on top of FRAME core pallets to augment Substrate with cross-chain capabilities.
8+
9+
## Pallet 1
10+
11+
TODO: Explain Pallet 1
12+
13+
## Pallet 2
14+
15+
TODO: Explain Pallet 2
16+
17+
## Pallet 3
18+
19+
TODO: Explain Pallet 3

docs/introduction.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Introduction
6+
7+
Welcome to **Topos Docs**, the official documentation to help you get familiar with the Topos _Cross-Chain Protocol_ (_XCP_) and join the network!
8+
9+
## Why Topos XCP?
10+
11+
Today's Web2.0 Internet remains a network of highly centralized computers and services managed by a handful of big tech companies. Concerns from users about how their data is handled and to which extent it is controlled and owned by such companies are getting stronger every day.
12+
13+
Blockchain has paved the way for Web3.0, a new era of distributed and decentralized web services that give back the control to application users. Yet, more than a decade later, the promised revolution hasn't landed. Facing scalability, interoperability and privacy issues, the blockchain technology hasn't been able to proceed to its full industrial adoption and still resides within the scope of experimentation and small-scale production deployment.
14+
15+
**The Topos XCP aims at giving back the control and freedom to service users and to lead the way for a true open and decentralized Internet.**
16+
17+
## How does the Topos XCP work?
18+
19+
Continue with the [Learn](/learn/getting-started) section to learn more about Topos XCP.

docs/learn/_category_.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Learn",
3+
"position": 2
4+
}

docs/learn/certificate.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# Certificate
6+
7+
## State Transitions
8+
9+
A blockchain participating in the Topos XCP is no different from a common blockchain: it is a distributed ledger that rests upon a p2p network which leverages a shared consensus mechanism to totally order propagated transactions and hence replicate a consistent state over the network.
10+
11+
A state transition in a blockchain is a set of transactions, i.e. state mutations, that from a given state commitment induce the next state commitment. New blocks are such state commitments that are validated by the consensus layer as valid state transitions from their preceding block.
12+
13+
## Proof of valid state transition
14+
15+
For Topos XCP to retain a consistent global state—i.e. blockchains can interact with one another and inconsistent state is prevented— participating blockchains construct proofs of the validity of their state transitions. Topos XCP is **privacy-enhancing** hence does not request blockchains to publicly share their blocks. Instead, another form of state commitments is used by all ledgers: **Certificates**.
16+
17+
To prove the validity of their state transitions while exposing only a part of their internal state (more on that later), Topos XCP blockchains nodes compute [zkSTARK](/learn/zkSTARK) proofs attesting the validity of every transaction that happened since the previous Certificate.
18+
19+
Other blockchains verify such state transitions by verifying Certificates which among other things equates to verifying the zkSTARK proof.
20+
21+
## Certificate composition
22+
23+
Beside containing zkSTARK proofs, Certificates include in clear the set of new—i.e. since the previous Certificate—cross-chain (XC) transactions that were emitted towards other Topos XCP blockchains.
24+
25+
Overall, Topos XCP blockchains construct Certificates with the following data:
26+
27+
- The ledger id
28+
- A reference to the previous Certificate
29+
- zkSTARK proofs of valid state transition (both exposed and non-exposed state)
30+
- The list of outgoing XC transactions (exposed state)
31+
- A signature of the Certificate
32+
33+
Certificates are signed by a [threshold signature](/learn/threshold-signature) scheme that is detailed in the next section.

docs/learn/getting-started.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Getting Started
6+
7+
The Topos XCP is an open blockchain protocol that does not compromise in creating an ecosystem that permits full interoperability between participating ledgers. Typical trust assumptions are replaced by zk-based cryptographic constructions that allow for friction-less cross-chain communication. The Topos XCP does not require any specific blockchain architecture or framework from ledger developers and ensures global consistency between heterogeneous **private** and **public** blockchains via a core [reliable broadcast](/learn/reliable-broadcast) mechanism, where existing multi-chain projects commonly rely on a central consensus layer that has authority over the rest of the network chains.
8+
9+
Ledgers in the Topos ecosystem prove the validity of their state transitions by computing [zkSTARKs](/learn/zkSTARK) which are published in [Certificates](/learn/certificate). On one hand [zkSTARKs](/learn/zkSTARK) are publicly verifiable by participants in and out of the protocol, and on the other hand [Certificates](/learn/certificate) are signed by known identities on each blockchain via a [threshold signature](/learn/threshold-signature) scheme. **It's the combination of publicly verifiable zk proofs and robust distributed signatures that allow the Topos XCP to rely on a consensus-less deterministic reliable broadcast of state transition certificates to ensure the global consistency of the ecosystem.**

docs/learn/reliable-broadcast.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Reliable Broadcast
6+
7+
## Causal Ordering

docs/learn/threshold-signature.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Threshold Signature
6+
7+
## Digital Signature
8+
9+
To prevent spamming, false identity and data tampering, Topos XCP leverages _digital signatures_ to ensure Certificates are attributed to the right originators—i.e. the blockchains that emit them to prove the validity of their state transitions—and that their integrity is retained during their propagation. As seen previously, signatures are included in Certificates and hence can be validated prior to verifying the Certificate validity.
10+
11+
## R-ICE-FROST
12+
13+
To allow a non-unary and dynamic set of signers to sign Certificates against a static public key, Topos XCP makes use of **R-ICE-FROST**, an in-house customization of the [FROST](https://eprint.iacr.org/2020/852.pdf) threshold signature scheme.
14+
15+
:::tip Threshold Signature
16+
17+
A _t out of n_ threshold signature scheme is a multi-party digital signature protocol such that a subset of cardinality _t_ of the _n_ participants is large enough to successfully create a valid signature.
18+
19+
:::
20+
21+
In addition to augmenting FROST with robustness, the R-ICE-FROST protocol allows a blockchain network to distribute a **static long-running public key** against which partial signatures can be produced by any set of signers. This is a key feature for blockchains, i.e. dynamic networks whose participating nodes arbitrarily join and leave.

docs/learn/zkSTARK.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# zkSTARK
6+
7+
## Zero-knowledge Proofs
8+
9+
Zero-knowledge protocols are such that allow one party to prove the validity of a given statement without revealing any information from it to another—verifying—party. Such technology has received major attraction in the field of blockchain for it is privacy enhancing, a property that is central to multi-chain networks open to both public and private ledgers.
10+
11+
Topos XCP leverages zero-knowledge proofs in how a blockchain proves the validity of its state transitions to the rest of the ecosystem. More specifically, Topos XCP leverages zkSTARKs.
12+
13+
## zkSTARKs
14+
15+
zkSTARK stands for zero-knowledge scalable transparent argument of knowledge. Such proofs can be **non-interactive**, i.e. the verifying party need not interact with the prover to verify the proof. zkSNARKs are specifically used to prove **computation integrity**, meaning given a known computation specified by an alegbraic intermediate representation (AIR) or by a permuted algebraic intermediate representation (PAIR), the verifying party can attest the validity of the computation. The "zk" in zkSTARK adds the property that some inputs to that computation remain opaque to the verifier.

0 commit comments

Comments
 (0)