Skip to content

Commit b0b7159

Browse files
committed
initial commit
0 parents  commit b0b7159

36 files changed

+18542
-0
lines changed

.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*

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](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+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
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.

docs/intro.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Tutorial Intro
6+
7+
Let's discover **Docusaurus in less than 5 minutes**.
8+
9+
## Getting Started
10+
11+
Get started by **creating a new site**.
12+
13+
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
14+
15+
### What you'll need
16+
17+
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
18+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
19+
20+
## Generate a new site
21+
22+
Generate a new Docusaurus site using the **classic template**.
23+
24+
The classic template will automatically be added to your project after you run the command:
25+
26+
```bash
27+
npm init docusaurus@latest my-website classic
28+
```
29+
30+
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
31+
32+
The command also installs all necessary dependencies you need to run Docusaurus.
33+
34+
## Start your site
35+
36+
Run the development server:
37+
38+
```bash
39+
cd my-website
40+
npm run start
41+
```
42+
43+
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
44+
45+
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
46+
47+
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# 1. Blockchain architecture
2+
3+
## 1.1. Consensus on top of Bitcoin
4+
5+
6+
7+
![](https://lh6.googleusercontent.com/1ffvgXb4ZPWGcSUEo42tzpzMXBcIV9rIGdx-79hxy8zo6dSPNTXiRwytCuirPvycqDfH8FseFclEGE7h_wijUxgbO1y6cK6wuhtxmA1sYSJ-l6I6LzAGnAfMgZFc7tb-OQVU4Vxt)
8+
9+
Mintlayer blockchain is anchored to Bitcoin: every Mintlayer block has a reference to a Bitcoin block. In each Mintlayer round, lasting 1008 Bitcoin blocks, the participants are selected among the stakers to collaborate on creating the chain’s blocks.
10+
11+
A user who decides to actively participate in the network consensus needs to run a node and stake enough MLT tokens to pass a minimum threshold. Each round, an election is automatically enforced by the algorithm, where the user may be chosen as a “participant”. The higher the token stake, the higher the chances are to be selected.
12+
13+
The selection mechanism uses hashes of the Bitcoin blocks as a randomization source to ensure an unbiased selection of the participants and randomly establish the order they will follow in the creation and validation of blocks.
14+
15+
At a specific time in each round, every participant is requested to build and propagate a block for which all the transaction fees will be collected.
16+
17+
The long-term security of the Mintlayer chain is guaranteed by a checkpoint system on the Bitcoin blockchain.
18+
19+
20+
21+
## 1.2. Participation in the network
22+
23+
In order to become a “participant” for the round, it is necessary to stake MLT tokens \([see §6](6-token-and-public-sale.md#6-1-1-staking)\). Anyone staking at least 0,01% of the total token supply has a chance to be selected by the algorithm. The 0,01% accounts for 40,000 MLT tokens upon the mainnet launch.
24+
25+
There are 1008 member slots available, but a single user can be rewarded with more than one slot \([see the DSA Consensus Paper §4-5](https://www.mintlayer.org/docs/consensus-paper.pdf)\).
26+
27+
MLT tokens must be staked two rounds before the desired participation round \(active round\). Tokens will be locked for the entire duration of 3 rounds \(auction round, active round, and lock-in round\).
28+
29+
* _Setup round_ \(round x-2\): the user who wants to apply as a participant in round x must stake MLT tokens in one block of the round x-2. Tokens are not locked during this round.
30+
* _Auction round_ \(round x-1\): the hash of the first Bitcoin block of the round x-1 is used as a source of entropy to determine the participants for the active round x. The participants are only selected from those who \(a\) have staked tokens in one block of the round x-2 and \(b\) did not move those coins at stake up until the beginning of the round x-1. Since the first block of the auction round, the funds staked by the selected users as participants are locked-in.
31+
* _Active round_ \(round x\): the participants selected in the auction round x-1 generate and countersign blocks.
32+
* _Lock-in round_ \(round x+1\): the participants of round x cannot move the locked-in tokens during the auction round.
33+
34+
35+
The extended timeframe during which the coins of the participants are locked in \(about 3 weeks\) discourages users that obtained a significant number of slots from any malicious behavior or any attack attempts, considering that they will be committed with a high stake in the chain and will not be able to move the MLT tokens for a long period.
36+
37+
If a participant decides to renew his lock-in, the same stake used to participate in the previous auction round is also used to participate in the next round, thus effectively eliminating the need to wait for several rounds to pass to participate again. This implies that the validator holding a fixed share of the network stake can maintain approximately the same amount of slots for each round.
38+
39+
Once a round is determined, each participant knows the number of blocks they will be able to create and at what block height they will be issued. Thus, users conducting a large number of transactions in the network would benefit from being in the participant’s position as it grants them the possibility to include their own transactions in the blocks that they create while paying zero-fees for it. Therefore, those users would be economically incentivized to become MLT token holders and participants of the network.
40+
41+
42+
43+
## 1.3. Block frequency and size limit
44+
45+
**Block generation frequency on Mintlayer is dynamic:** each block proposer is given a timeframe during which there is a high probability of getting the block countersigned by other participants. That time frame spans between 1 and 2 minutes.
46+
47+
In case the Mintlayer mempool is empty of transactions, the block proposers have incentives to wait up to 2 minutes before creating and broadcasting the block in hopes to collect more fees from incoming transactions. If the blockchain is congested, the block proposers might be willing to create blocks faster, depending on their considerations on how the fee market will react and whether the network will benefit from a higher block issuing frequency.
48+
49+
Hypothetically, if there are no transactions to be validated, the participant who is expected to create the block in that timeframe has no incentives for doing so, and neither do other participants in that round have any reason to replace him in the block generation. Such a system discourages network pollution with empty blocks, especially when the blockchain has just been launched.
50+
51+
With the purpose of long-term sustainability, the block size limit is set to 1 MB so that, in theory, the blockchain size could not get larger than 525 GB per year even when fully saturated and with its block frequency at the peak. Furthermore, the pruning system, which is based on checkpoints, and the utreexo technology, which is used to reduce the size of the UTXO, dramatically reduce hardware storage requirements. Thanks to these optimizations, it will always be possible to run a full node on an average personal computer, fostering a more decentralized network.
52+
53+
54+
55+
## 1.4. Checkpoint system
56+
57+
**The checkpoint system serves three purposes:**
58+
59+
1. To increase the security of the network, preventing long-range attacks.
60+
2. To decrease the initial blockchain download time \(IBD\) for users willing to run a node with a fast-sync mode.
61+
3. To discard \(prune\) the blockchain before a certain block height so that the space required on disk remains minimal.
62+
63+
Anyone can create a “marker” on the Bitcoin blockchain in a Bitcoin transaction by using a specific OP\_RETURN. The participant of the Mintlayer network can include that marker in a Mintlayer block, creating a checkpoint request. The checkpoint is consolidated and locally enforced by the nodes once the participants have validated enough Mintlayer blocks on top of that checkpoint request \([see the Consensus paper §11-12](https://www.mintlayer.org/docs/consensus-paper.pdf)\).
64+
65+
Creating a checkpoint on the Bitcoin blockchain means to notarize or “snapshot” the status of Mintlayer so that the Bitcoin proof-of-work secures it. Anyone running a node with a fast-sync mode can download the blockchain starting from the latest checkpoint instead of downloading the whole blockchain. In the case of full-synch from the genesis block, it is always possible to prune the entire blockchain up to the checkpoint, saving most of the space otherwise required.
66+
67+
While checkpoints allow for shrinking the blockchain’s, the utreexo technology shrinks the size of the UTXO set, which is merkelized and reduced down to about 1 KB instead of several Gigabytes.
68+
69+
70+
71+
## 1.5. Token inclusivity
72+
73+
In the cryptocurrency ecosystem, the blockchains supporting multiple tokens \(such as Ethereum\) force users to pay transaction fees in the native blockchain currency \(e.g., ETH\). The impossibility of transferring a token without having a “gas” bank in the native cryptocurrency creates entry barriers and introduces friction in user experience, preventing a broader network effect.
74+
75+
Mintlayer has no base currency to pay transaction fees. Instead, users can pay in any MLS-01 or MLS-02 \([see §3.2.5](3-tokenization-standard.md#3-2-5-gas-free-economy).\) cryptocurrency they choose as long as the network participants are willing to accept it. Every block proposer can signal the list of tokens accepted in the block - the free market dictates its rules.
76+
77+
Because transactions do not necessarily pay fees in a determined gas token, it is possible to make transfers without owning more cryptocurrencies, or without storing and spending a gas bank in a token which is different from the ones transferred, which implies higher transaction costs and pollution for the network \(UTXO dust\).
78+
79+
80+
81+

docs/whitepaper/2-mintlayer-wallet.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# 2. Mintlayer wallet
2+
3+
![](https://lh3.googleusercontent.com/suX59GLiX38iJHZOPlI4HhN_Ai1sMFd3IjoGMFF7HEAA4Vq3Ay6RQo0tMQsx0xwT6Vi8AIjAEskpsH225WBlajij88WXdAkhBVmWj2JB9Nj399F9_raGS_2neLm7yrhhloOqMkJz)
4+
5+
Mintlayer is an open-source project, and every developer is free to contribute, fork the codebase, or create alternative software following the consensus/protocol RFC. There are two first-reference implementations released for desktop and mobile devices in the form of a full node and light node.
6+
7+
The full node wallet is built to serve every user type, from validators, stakers, to investors, traders or simple bitcoin holders. The mobile wallet application is made for average users with particular care for UX/UI. It also implements advanced functionalities such as transaction batching and DEX trading. Both types of wallets are non-custodial solutions, meaning that users can access their funds by managing their private keys independently, also by importing or exporting them from/to hardware wallets.
8+
9+
Mintlayer wallets have multi-token support, including bitcoin \(BTC\), Mintlayer \(MLT\), and all tokens issued or pegged on the chain \(the standard MLS, [see §3.](3-tokenization-standard.md#3-2-mls-01-features)\).
10+
11+
For security tokens or other tokens that require particular policies \(see ACL conditions [§3.2.1.](3-tokenization-standard.md#3-2-1-access-control-list-conditions)\), it is possible to verify the “decentralized digital identity” \(DID, see [§4](4-decentralized-finance-defi.md#4-4-decentralized-identity-did-and-oracles).\) straight from the application. The private key of the DID can also enable a “login” to access the services of third party providers.
12+
13+
14+
15+
## 2.1 The light wallet
16+
17+
A light wallet offers the basic multi-token functionalities:
18+
19+
* Store, send, and receive Bitcoin as any other traditional Bitcoin wallet \(Bech32 native SegWit support, hierarchical deterministic, BIP38, BIP39, BIP44, BIP49, BIP84, BIP174\).
20+
* Store, send and receive MLT token and all **MLS-01, MLS-02, MLS-03 tokens** \([see §3](3-tokenization-standard.md).\).
21+
* Batch transactions \([see §3.](3-tokenization-standard.md#3-2-3-peer-to-peer-batching)\) with other peers before broadcasting to the network to pay lower fees, alleviate the burden of the blockchain and fasten transactions.
22+
* Use the Lightning Network for transactions \(BTC, MLT and MLS-01\).
23+
* Peer-to-peer exchange BTC, MLT, and MLS-01 using **atomic swap DEX** \([see §5.2.](5-decentralized-exchange-dex.md#5-2-the-atomic-swap-dex)\).
24+
25+
26+
27+
## 2.2. The full node
28+
29+
A Mintlayer full node is coupled with a Bitcoin Core node. The user has to download both but does not necessarily have to wait for Bitcoin Core to fully sync up with mainnet because Mintlayer node uses Pierre Rochard’s idea of “node launcher” for rapid onboarding. This way, the node's functionalities are ready in the first minutes after launching the software[ \($$^1$$\)](2-mintlayer-wallet.md#footnotes) .
30+
31+
Also, Mintlayer full nodes use utreexo, which compacts the size of the UTXO set down to 1 KB. As such, pruned nodes will never take up more than around 3 GB of space \(about 3 days of blockchain at maximum throughput\) even in the very long run.
32+
33+
A Mintlayer full node offers all the light wallet functionalities, plus the following:
34+
35+
* Stake MLT tokens to become the “participant” of the network.
36+
* As a “participant”, propose or countersign blocks and earn transaction fees.
37+
* Create an MLS-01 token by executing a Mintlayer on-chain transaction.
38+
* Peg-in BTC to create wrapped BTC as MLS-01/02 tokens for faster transactions and lower fees \(also enabling confidential transactions\).
39+
* Update the token policies \(such as **ACL**, [see §4.3.](4-decentralized-finance-defi.md#4-3-acl-rules-for-securities)\) to your issued MLS-01 tokens.
40+
* Create custom smart contracts and **programmable pools** \(see [§4.5.](4-decentralized-finance-defi.md#4-5-programmable-pools-dividends-taxation)\) to manage financial operations with your tokens and create a DeFi system.
41+
* Connect to multiple oracles to query for DEX data \(such as the DHT order book, see [§5.3.](5-decentralized-exchange-dex.md#5-3-dht-multiparty-swaps), [§5.4.](5-decentralized-exchange-dex.md#5-4-observer-of-multiparty-swaps), [§5.5.](5-decentralized-exchange-dex.md#5-5-book-aggregators-for-multiparty-swaps), [§5.8.](5-decentralized-exchange-dex.md#5-8-peer-to-peer-messaging-system)\) or identity data, also to facilitate DEX transactions or decentralized identity applications \([see §4.4.](4-decentralized-finance-defi.md#4-4-decentralized-identity-did-and-oracles)\). Standard wallet API is provided so that oracles can be programmed to help build smart contracts on Mintlayer.
42+
43+
44+
45+
## Footnotes
46+

0 commit comments

Comments
 (0)