

Editor's Note: This article comes fromBlue Fox Notes (ID: lanhubiji), reprinted by Odaily with authorization.
Editor's Note: This article comes from
Blue Fox Notes (ID: lanhubiji)
, reprinted by Odaily with authorization.
I have talked about the scalability of the public chain many times before, but most of the time I discuss the scalability of Layer 1 and Layer 2, such as sharding, Plasma, ZK-Rollup, Optimistic Rollups, state channels, side chains, etc. Today, Blue Fox Notes focuses on Layer 0.
What does scalability through Layer 0 bring to blockchains like Ethereum?
secondary title
Layer 0 and scalability
Layer 0 is the communication layer for passing information between nodes. The way information is structured is directly related to the efficiency with which consensus can be reached. The speed at which consensus is reached is related to the scalability and security of the blockchain. From this perspective, Layer 0 can also contribute to improving the scalability of the blockchain.
The difference between the blockchain network and the centralized network is that the blockchain network does not require permission, and it must consider the restrictions from the Internet itself. If it is a centralized enterprise, private lines can be used to improve network performance through CDN and SD-WANs. For a decentralized network, this is not realistic.
So, is there any chance to solve the above-mentioned problems?
secondary title
Marlin's Layer 0
Marlin is marlin, said to be the fastest fish in the world. Marlin is the communication layer serving the blockchain. It hopes that under its promotion, the speed of the blockchain network will become faster and faster, just like a marlin. Marlin hopes to contribute its own solution to the development of blockchain scalability through Layer 0.
image description
(Marlin is said to be the fastest swimming fish, Marlin.pro)
In order to improve the TPS of the blockchain, generally speaking, from the perspective of the chain, there are two methods, one is to increase the block capacity, and the other is to shorten the block generation time (horizontal sharding is not considered here).
If the method of large blocks is adopted, it will take longer for the nodes to verify the received information, which will delay the speed of block broadcasting; if the block generation time is shortened and the block generation rate is increased, the fork problem will be faced, and one of The reason is also limited by the speed of block propagation. In order to increase the speed of block generation, it is necessary to accelerate the propagation of blocks. The current block propagation speed is not conducive to increasing the block generation speed. When people modify the block size of Bitcoin from 1M upper limit to 32M or even 2G, or shorten the block time from about 10 minutes to a shorter time, it does improve scalability, but it brings bigger problems , For example, the whole node is offline, the data cannot be synchronized, and even the block needs to be reorganized. Once the block is too large and the block generation time is too fast, there will be problems with the consistency or availability of the network. One of the most important reasons is that the full node is limited by the physical conditions of the network and hardware, and cannot verify and broadcast in time.
In the Marlin network, there are nodes specially used for relaying, called Marlin Nodes. Nodes transmit information to each other, which can speed up the propagation speed. Marlin borrows CDN acceleration technology and divides the network, so there are many relay networks.
The current network layer is also not conducive to decentralized protocols. In the current mechanism design of some protocols, because of competition, miners have the motivation to relay their blocks and receive the latest blocks, but they have little motivation to actively spread other miners. of blocks, the miner hopes to dig out the block first. Nodes expect other nodes to broadcast and hitchhike themselves, saving bandwidth costs. At the same time, this mechanism will also lead to centralization, because in the end, only those large nodes have the incentive to forward these transactions. In order to solve problems such as selfish mining, Marlin incorporates an economic incentive mechanism. Nodes in its network can get rewards as long as they successfully relay information, thus encouraging the rate of information transmission. By introducing a network layer with an incentive mechanism, attacks such as spam/DDoS can also be prevented.
In addition to providing scalability for the public chain, Marlin can also provide accelerated services for DeFi applications. Siddhartha is the founder of Marlin and one of the former core developers of the public chain project Zilliqa. He once mentioned: "For example, in the DeFi field, Marlin's relay framework can provide peripheral interfaces, which provide DeFi traders with the advantage of low latency. In the early stage of DApp, when querying APIs such as Infura, Alchemy, and Graph, loading The time is often as high as 10 seconds, which is very slow. Marlin Cache can reduce this delay to about 250 milliseconds, and can achieve web2.0-like performance in DApp."
All P2P applications use the network layer for node communication, which leads to any application that uses decentralized storage or computing can also take advantage of Marlin's services. For example, applications currently using IPFS have to use a centralized CDN to help users improve performance. The advantage of Marlin is that it allows these applications using Filecoin/Arweave to achieve good performance even without a CDN. From this perspective, Marlin is similar to Akamai in the Web 2 era.
Marlin's Layer 0 Scalability
Marlin solves the scalability problem of the public chain on Layer 0. The core stems from its design in two aspects: relay network and token incentive mechanism.
1. Relay network
The Marlin protocol is a protocol for constructing a relay network. Marlin nodes following its protocol requirements form a relay network. In addition to Marlin nodes, there are auditor nodes, which ensure that relay nodes and the relay network adhere to their performance and SLA guarantees. Users of the Marlin network can have miners and full nodes. Miners use the Marlin relay network to broadcast their data packets and blocks, while full nodes (wallets or merchants, etc.) use the Marlin network to receive the latest transactions and blocks. Therefore, the Marlin network is essentially a relay network market.
image description
(Major player in the Marlin network, Marlin.pro)
In the picture above, Marlin divides its participants into producers, receivers, relayers, and relay clusters (relay network). Where producers are a group of nodes that introduce blocks into the relay network. Producers are usually miners, and they broadcast blocks as quickly as possible. Producers are responsible for block validity, and producers who introduce invalid blocks will be penalized.
Receivers include other miners, exchanges, wallets, block explorers or other nodes, etc., and they want to receive blocks as soon as possible. Recipients need to pay a subscription fee to the protocol to become a recipient. Relayers are groups of nodes that relay blocks from producers to recipients. Relayers will be rewarded for disseminating blocks as quickly as possible, and only those nodes that participate in the relay dissemination of blocks have the opportunity to earn rewards. A relayer cluster is a set of relay networks composed of relayers. They are collectively responsible for propagating blocks and are rewarded for doing so.
Furthermore, how is the Marlin protocol network structured?
A Marlin network can be divided into four parts: creation, management, packet broadcast, and monitoring.
*create
The Marlin network is composed of many Marlin nodes. To become a Marlin node, you first need to run the Marlin relay node software and pledge a certain amount of tokens, which will be mentioned below. These nodes need to meet certain requirements, such as good network connection, location distribution closer to end users, etc.
After becoming a Marlin node, the node and relay network can display their own features, functions and prices to their target users (such as miners and full nodes), including IP addresses, median bandwidth, longitude, latitude, and pledged tokens public key etc. And miners and full nodes can choose the relay network according to their needs. This forms a trading market.
Nodes can create a relay cluster, set the maximum number of nodes allowed to join, the maximum and minimum number of nodes to join according to geographical location, the minimum pledge amount of nodes, the minimum configuration requirements of nodes (bandwidth, CPU core, etc.), minimum SLA requirements, etc. . Once a relay network is created, it will automatically appear on the Marlin marketplace.
*manage
After a node creates a relay network, it needs to be managed, including node joining, parameter adjustment, node exit, etc.
A node can join a relay network by being invited or applying to join. A node can be invited to participate in its relay network after a majority of votes agree, and the invited node can join as long as it publishes an invitation transaction before the invitation expires. Another way is to apply to join, if the majority vote agrees, you can join the relay network.
After a relay network is created, it is not immutable. Although the nodes in it will follow the initial parameters at the beginning. However, as subsequent nodes join, these nodes will also have the right to speak. According to changes in user needs and the competition environment of the relay network, the parameters of the relay network may also face adjustments. These all need to be changed through governance. At present, the Marilin network uses voting to adjust parameters. If a minority of nodes disagree, they can choose to leave and create their own relay network.
Finally, a node needs to say hello when it exits a relay network. If a node quits a relay network without any notice, it will be very detrimental to the relay network and its users. In Marlin's relay network, if a node exits silently or exits early, the pledged tokens will be reduced. A node exiting the relay network can initiate an exit declaration transaction. If the relay network finds a replacement node, it allows that node to exit before its claim period ends. In addition, there is a forced exit mode, if the majority of nodes think that a node is misbehaving, it can also be kicked out of the relay network.
*packet broadcast
Miners and merchants are users of the Marlin relay network. They only need to integrate the Marlin SDK to interact with Marlin nodes. In order to provide flexible services, Marlin adopts a modular structure. Protocol developers can write plug-ins to customize some functions, and can execute custom codes on Marlin nodes and full nodes for their protocol-related data packets. For example, strategies for selecting different relay networks; random selection of relay networks when certain conditions are met, or a list of hard-coded relay networks.
When a miner generates a block, it can be sent to the relay network according to its own strategy. At this time, you may face the problem of paying fees (covering the block verification cost of the entry node), but paying fees will add additional delays. Another alternative is to require miners to pledge tokens to reduce the block verification at the first hop. If it is spam, penalties can be imposed.
Marlin's relay network is a mesh network with multicast paths optimized based on source. It will constantly monitor the packet loss rate, bandwidth and waiting time of different paths, so as to realize the multicast transmission of blocks in the shortest possible time.
In terms of receiving blocks and transactions, miners subscribe to neighboring Marlin relay nodes to receive notifications of new blocks and transactions. Whenever a Marlin node receives a new block, it sends its hash to all subscribers. Subscribers who receive new blocks and transactions pay a small fee. At the same time, in order to avoid additional delays, nodes can directly push to the whitelist miners, and pay later.
*monitoring
These audit nodes are first of all anonymous, and they look just like ordinary miners or full nodes. The auditor network is independent of the relay network. In order to confirm whether specific nodes are performing well, auditor nodes will vote through the Schelling point mechanism, thereby confirming whether these nodes meet their SLA obligations. If a node fails to meet the requirements, its pledged tokens are slashed.
2. Token Incentive Mechanism
image description
text
First of all, POND can be used to pay fees, motivate relay nodes, and also be used to restrain nodes from doing evil.
The fee allocation mechanism of the relay node needs to meet: anti-isolation; maintain order. To solve this problem, transactions and blocks need to contain witnesses attached to the original content body. One is a signed link: each node in the propagation path that is forwarding its content attaches a public key and signs its body with a private key. In addition, there is a key list, the node will newly created key pair
text
text
text
text
text
text
text
text
text
text
text
text
secondary title
text
To sum up, the reason why Marlin has the opportunity to help the public chain improve scalability lies in the construction of an optimized relay network system. In this relay network system, the relayer is willing to broadcast the producer's block and transaction to the receiver in the shortest time, and at the same time can obtain the corresponding fee income. In this relay network system, its token mechanism plays an important role in maintaining the entire relay network market.


