|
| 1 | +# 1. Blockchain architecture |
| 2 | + |
| 3 | +## 1.1. Consensus on top of Bitcoin |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 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 | + |
0 commit comments