"Become a crypto enthusiast" is my credo #BaCE Twitter: https://twitter.com/Typpak_TrueJ 🐦
"Become a crypto enthusiast" is my credo #BaCE Twitter: https://twitter.com/Typpak_TrueJ 🐦

Subscribe to Typpak

Subscribe to Typpak
Share Dialog
Share Dialog
<100 subscribers
<100 subscribers


This is an introductory article that will show the true identity of a blockchain like Sei in the DeFi cryptosphere.
These days many things come into being through simple necessity of application. Every new technology is not just invented and appears out of nowhere, it is probably something new that can actually bring utility and practicality to the world or on a smaller scale to industry.
In our world of cryptocurrencies, special attention is paid to Web3 application development. What is truly called the new world of the internet, where everything consists of automation and most importantly, data control without regard to the human factor.
DeFi* is a branch of finance that belongs to the Web3 industry.*
Decentralized finance can even now do many of the functions of current corporations, applications and systems. But there is a problem in a more scalable future where the whole world is tied up. This is a serious problem as its still difficult for us to imagine.
Blockchains are keeping up with the times or at least trying to, because things are changing fast in this world. But blockchains are playing a game where they are trying to compete with each other. Wouldnt it be logical to become so authentic that you cant be competed with or even compared to?
Quite yes.
Sei does and shows it. I will show you that too in a more detailed review.

As stated in the official documentation:
Sei is the first Tier 1 blockchain designed for trading and improving the quality of exchange platforms.
Blockchains come in three varieties, commonly thought of as levels: 1, 2 and 3. Level 1 is actually the source code and type of blockchain, direct examples are Bitcoin, Binance Chain and Ether. Further levels are built on top of previous levels and are like addons.
Ofc! There are already similar ideas and even the implementation of similar ideas about a single chain of blocks where mechanisms will be built in for comfortable DeFi.
But everything is far from ideal, attempts do not end. A direct example of Serum.
What makes Sei different is that its built on the foundation of Cosmos network technology, which includes many linked blockchains. I hope you understand what im talking about and roughly understand what the Cosmos blockchain network is.

Each quality we will try to understand more quickly and most importantly visually. Lets begin!

For proper synchronization and just the convenience of attracting new markets, an native order matching engine was created.
The beauty of this mechanism is that it allows any DeFi markets built on Sei to be implemented. It is very diverse and accommodates several features.
The deployment of CLOB (Central Limit Order Book) essentially a book of orders, where market participants trade directly with each other.
It contains limit orders, market orders, stop loss orders, fill or kill orders and cancel orders.
All CLOB-related operations will be performed atomically within the within the block.
Sp the life cycle of such an order was thought out and studied. It is volumetric and its scheme can be seen below:

A lot of obscure processes, but its actually simpler than that.
All transactions go to the DEX complex, where there can be several orders and all of them are added to the MemState, which is essentially a database of orders.
In addition it contains the Endblock, which already completes the processing of transactions and scatters orders to all the necessary markets, because there are a lot of them and they are all different.
After the blockchain is behind to call the smart contract, which already knows all the logic of interaction with the mechanism of order matching engine Sei.
First of all, a hook is a technology that can be used to write concise, concise, and more understandable code.
Sei allows contracts to register hooks on the network. Registered hooks will be called every block and will allow operations such as flash loan returns to be performed in the same block as all associated trade settlements.
There can be simple transactions such as the first hook waiting for information on a potential transaction and the other is the final one that executes the transaction for the smart contract.
A customized flexible solution that allows DeFi exchanges to decide for themselves how to represent assets. So you dont have to tokenize everything.
Frequent Batch Auctioning allows you to execute multiple orders at a clearing price, which provides greater security with respect to the user. Validators simply do their job.
ei offers several levels of order batching to improve user experience and performance. Lets now look at them in more detail.
Bundling of client orders — each order is executed in its own market.
Order batching at the blockchain level — each transaction calls a VM (Virtual Machine) for its execution. Instead every transaction with all orders on all markets Sei gathers into one thing and executes one interaction with the virtual machine.
Trade commissions — ofc there will be no commissions when the Sei mechanism is launched, but in the future there may be a fee for managing the blockchain. Also each DEX can put its own fee for the execution of transactions.
Intermediate software — developers are expected to create their own custom smart contracts on top of the Sei mechanism, this expands the diversity of markets and allows the creation of new features.

As we know Sei is built on the Cosmos and most importantly the Tendermit core. For lovers of alphas on this network or just avid geeks this is already familiar and doesnt need to be explained. But i will explain for another part of the readers.
If you go deeper into the technical part, the correct definition of Tendermit is a solution that combines the network and consensus layers of blockchain into a common engine, allowing developers to focus on application development rather than the complex underlying protocol.
Tendermint can be described as a low-level protocol, which functions as a peer-to-peer network protocol and is responsible for consensus finding algorithm. At the same time it is optimized to solve the problem of fault tolerance of Byzantine generals (i.e. to find consensus) in distributed applications and to process data in a large number of nodes.
Key features of Tendermint that make it a competitive blockchain mechanism:
It can be applied to both public and private blockchains. If the application built on the engine determines that validators are elected based on ownership share, then the blockchain will be a PoS. But if developers introduce pre-authorization for validators, the blockchain will become private.
High performance. Tendermint can process up to 1000 transactions per second (what Sei points out).
Instant finalization. This means that users can be assured that their transactions will be considered complete and final as soon as a block is created.
Security. If a fork does occur, there is a way to determine liability. By fork here we mean the simultaneous creation of several blocks, as a result of which the network is like “starting a branch”.

At the heart of the usual technical device of the Cosmos network is the consensus, which is connected by a core Tendermit. The consensus eliminates the BFT (Byzantine fault tolerance) problem and uses the POS system.
Sei adds new technology and calls it by one name — Twin-Turbo consensus.
Consensus is split into two parts, so its twin.
Intelligent Block Propagation and Optimistic Block Processing.
In a normal blockchain system we send the transaction to a validator, where it is later sent to a mempool. Other validators also receive information about the transaction. One of them creates the block and sends the others to vote on adding it to the blockchain.

Regarding Sei’s solution, if we understand that everyone has a common mempool, then it turns out it isnt necessary to send all blocks with transactions over the network. We can simply have hashes of these transactions and add them directly to the blocks. This way we reduce the block size and speed up our blockchain.
Optimistic Block Processing
In the second solution we have already realized that adding a block is quite a long process and consists of many actions, its tiring and makes the functionality not fast enough.
There are several steps: block proposal, preliminary voting, preparatory step, and block finalization.

The whole point is that instead of waiting for the preprocessing step of the block and then starting its finalization, validators can start the optimistic processing beforehand. The block collected during optimistic processing is placed in cache memory as a candidate to be added to the blockchain. If the block is accepted by the blockchain, the data from the cache is safely processed.


Looking back at past parts of this article lets turn to FBA and learn more about what it gives to blockchain.
Since validators manage incoming transactions and can control blocks, there is a MEV problem that gives an advantage to those who stand to process data on the blockchain. This prevents just the user from doing their blockchain activity and adds an additional earning opportunity for the validator, which is not a primary obligation.
In the order example, we understand that we can do a sandwich swap and make the user buy the token at a higher price because the validator has managed to buy the same token before and increase its price and then sells the token immediately to the same user.
So the Sei executes all orders at the clearing price. That is conditional order 1 and order 2 are executed at a price equal to the sum of these orders, divided then by the number of orders of all, which prevents this problem.

This is probably the hardest part of everything we have looked at so far.
Since Cosmos consists of the Tendermit core, SDK and ABCI parts — they are linked together.
ABCI is a protocol that allows Tendermit to communicate with any application. A total of four connections to the application from Tendermit are opened and are handled by a subset of the ABCI protocol. Most of it is not important for our parallelization example, but the case is that the following logic is sequential.

I will show you some more examples:

In the scheme above, the DeliveryTx logic is responsible for processing and changing different types of transactions. If we take CLOB-related transactions only superficial processing takes place there, because the entire essence falls on EndBlock logic. This is done naturally so that our orders are executed at the clearing price. Thats where Sei added the parallelization, which helps improve performance.
A more detailed version of how this whole system works uses so-called database keys and we solve the problem of accessing the same database by repeatedly updating the key by correctly mapping the types of access. As a result, the same messages with the key update are executed sequentially and different ones can be separated and done in parallel.
Also if we go even deeper, the blocks are checked for dependencies between transactions according to the acyclic graph prototype.

If we throw a connection message to some module, it will be executed sequentially.

If we throw tokens from one account to another, then these are different things and we can apply parallelism to improve the performance of the blockchain.

Since we dont use message content checking and do message type mapping protection, as this would lead to consistent execution. We can designate the dependency mapping as some kind of templates which will be executed by detailed concurrency resources.
Gas fees also play a role here. Sei took care of the dependency mappings between blocks, but if a smart contract creator wants to change them, he has to do it right so that users dont subsequently get long transaction processing times and pay extra gas to process them. They could get stuck in a blockchain traffic jam and that would be a nuisance.
Of course Sei has its own oracles to oversee the recording and pricing of various asset exchange rates. Validators are like oracles. Asset pricing has been reduced to one block, providing a better and more recent exchange rate.
At the voting stage, the validator provides its proposed exchange rates and at the end of the voting all votes are added up and a weighted median (average value) for a particular exchange rate for each asset is obtained.
Naturally there are penalties for failing to submit a vote or for votes that deviate greatly from the weighted median in the final decision. Such a validator is suspended for a certain period of time.

Phew, it was quite a challenge to tell you in detail what Sei is all about. But now you fully understand the workings and processes inside the Level 1 blockchain, which was created specifically for the DeFi sector as a whole.
More details will come out in the future, why this particular blockchain is needed now and what is in store for us in the near future in the DeFi space. The Sei blockchain looks very confident in its goal of becoming the main harbor for building many DeFi products.

About Sei
Sei (https://www.seinetwork.io/) serves as plumbing for the future financial system — infrastructure to support capital markets, starting with exchanges. As the first Layer 1 specialized for trading, Sei is the fastest chain to finality, optimizing every layer of its stack to give exchanges an unfair advantage.
Official Link
This is an introductory article that will show the true identity of a blockchain like Sei in the DeFi cryptosphere.
These days many things come into being through simple necessity of application. Every new technology is not just invented and appears out of nowhere, it is probably something new that can actually bring utility and practicality to the world or on a smaller scale to industry.
In our world of cryptocurrencies, special attention is paid to Web3 application development. What is truly called the new world of the internet, where everything consists of automation and most importantly, data control without regard to the human factor.
DeFi* is a branch of finance that belongs to the Web3 industry.*
Decentralized finance can even now do many of the functions of current corporations, applications and systems. But there is a problem in a more scalable future where the whole world is tied up. This is a serious problem as its still difficult for us to imagine.
Blockchains are keeping up with the times or at least trying to, because things are changing fast in this world. But blockchains are playing a game where they are trying to compete with each other. Wouldnt it be logical to become so authentic that you cant be competed with or even compared to?
Quite yes.
Sei does and shows it. I will show you that too in a more detailed review.

As stated in the official documentation:
Sei is the first Tier 1 blockchain designed for trading and improving the quality of exchange platforms.
Blockchains come in three varieties, commonly thought of as levels: 1, 2 and 3. Level 1 is actually the source code and type of blockchain, direct examples are Bitcoin, Binance Chain and Ether. Further levels are built on top of previous levels and are like addons.
Ofc! There are already similar ideas and even the implementation of similar ideas about a single chain of blocks where mechanisms will be built in for comfortable DeFi.
But everything is far from ideal, attempts do not end. A direct example of Serum.
What makes Sei different is that its built on the foundation of Cosmos network technology, which includes many linked blockchains. I hope you understand what im talking about and roughly understand what the Cosmos blockchain network is.

Each quality we will try to understand more quickly and most importantly visually. Lets begin!

For proper synchronization and just the convenience of attracting new markets, an native order matching engine was created.
The beauty of this mechanism is that it allows any DeFi markets built on Sei to be implemented. It is very diverse and accommodates several features.
The deployment of CLOB (Central Limit Order Book) essentially a book of orders, where market participants trade directly with each other.
It contains limit orders, market orders, stop loss orders, fill or kill orders and cancel orders.
All CLOB-related operations will be performed atomically within the within the block.
Sp the life cycle of such an order was thought out and studied. It is volumetric and its scheme can be seen below:

A lot of obscure processes, but its actually simpler than that.
All transactions go to the DEX complex, where there can be several orders and all of them are added to the MemState, which is essentially a database of orders.
In addition it contains the Endblock, which already completes the processing of transactions and scatters orders to all the necessary markets, because there are a lot of them and they are all different.
After the blockchain is behind to call the smart contract, which already knows all the logic of interaction with the mechanism of order matching engine Sei.
First of all, a hook is a technology that can be used to write concise, concise, and more understandable code.
Sei allows contracts to register hooks on the network. Registered hooks will be called every block and will allow operations such as flash loan returns to be performed in the same block as all associated trade settlements.
There can be simple transactions such as the first hook waiting for information on a potential transaction and the other is the final one that executes the transaction for the smart contract.
A customized flexible solution that allows DeFi exchanges to decide for themselves how to represent assets. So you dont have to tokenize everything.
Frequent Batch Auctioning allows you to execute multiple orders at a clearing price, which provides greater security with respect to the user. Validators simply do their job.
ei offers several levels of order batching to improve user experience and performance. Lets now look at them in more detail.
Bundling of client orders — each order is executed in its own market.
Order batching at the blockchain level — each transaction calls a VM (Virtual Machine) for its execution. Instead every transaction with all orders on all markets Sei gathers into one thing and executes one interaction with the virtual machine.
Trade commissions — ofc there will be no commissions when the Sei mechanism is launched, but in the future there may be a fee for managing the blockchain. Also each DEX can put its own fee for the execution of transactions.
Intermediate software — developers are expected to create their own custom smart contracts on top of the Sei mechanism, this expands the diversity of markets and allows the creation of new features.

As we know Sei is built on the Cosmos and most importantly the Tendermit core. For lovers of alphas on this network or just avid geeks this is already familiar and doesnt need to be explained. But i will explain for another part of the readers.
If you go deeper into the technical part, the correct definition of Tendermit is a solution that combines the network and consensus layers of blockchain into a common engine, allowing developers to focus on application development rather than the complex underlying protocol.
Tendermint can be described as a low-level protocol, which functions as a peer-to-peer network protocol and is responsible for consensus finding algorithm. At the same time it is optimized to solve the problem of fault tolerance of Byzantine generals (i.e. to find consensus) in distributed applications and to process data in a large number of nodes.
Key features of Tendermint that make it a competitive blockchain mechanism:
It can be applied to both public and private blockchains. If the application built on the engine determines that validators are elected based on ownership share, then the blockchain will be a PoS. But if developers introduce pre-authorization for validators, the blockchain will become private.
High performance. Tendermint can process up to 1000 transactions per second (what Sei points out).
Instant finalization. This means that users can be assured that their transactions will be considered complete and final as soon as a block is created.
Security. If a fork does occur, there is a way to determine liability. By fork here we mean the simultaneous creation of several blocks, as a result of which the network is like “starting a branch”.

At the heart of the usual technical device of the Cosmos network is the consensus, which is connected by a core Tendermit. The consensus eliminates the BFT (Byzantine fault tolerance) problem and uses the POS system.
Sei adds new technology and calls it by one name — Twin-Turbo consensus.
Consensus is split into two parts, so its twin.
Intelligent Block Propagation and Optimistic Block Processing.
In a normal blockchain system we send the transaction to a validator, where it is later sent to a mempool. Other validators also receive information about the transaction. One of them creates the block and sends the others to vote on adding it to the blockchain.

Regarding Sei’s solution, if we understand that everyone has a common mempool, then it turns out it isnt necessary to send all blocks with transactions over the network. We can simply have hashes of these transactions and add them directly to the blocks. This way we reduce the block size and speed up our blockchain.
Optimistic Block Processing
In the second solution we have already realized that adding a block is quite a long process and consists of many actions, its tiring and makes the functionality not fast enough.
There are several steps: block proposal, preliminary voting, preparatory step, and block finalization.

The whole point is that instead of waiting for the preprocessing step of the block and then starting its finalization, validators can start the optimistic processing beforehand. The block collected during optimistic processing is placed in cache memory as a candidate to be added to the blockchain. If the block is accepted by the blockchain, the data from the cache is safely processed.


Looking back at past parts of this article lets turn to FBA and learn more about what it gives to blockchain.
Since validators manage incoming transactions and can control blocks, there is a MEV problem that gives an advantage to those who stand to process data on the blockchain. This prevents just the user from doing their blockchain activity and adds an additional earning opportunity for the validator, which is not a primary obligation.
In the order example, we understand that we can do a sandwich swap and make the user buy the token at a higher price because the validator has managed to buy the same token before and increase its price and then sells the token immediately to the same user.
So the Sei executes all orders at the clearing price. That is conditional order 1 and order 2 are executed at a price equal to the sum of these orders, divided then by the number of orders of all, which prevents this problem.

This is probably the hardest part of everything we have looked at so far.
Since Cosmos consists of the Tendermit core, SDK and ABCI parts — they are linked together.
ABCI is a protocol that allows Tendermit to communicate with any application. A total of four connections to the application from Tendermit are opened and are handled by a subset of the ABCI protocol. Most of it is not important for our parallelization example, but the case is that the following logic is sequential.

I will show you some more examples:

In the scheme above, the DeliveryTx logic is responsible for processing and changing different types of transactions. If we take CLOB-related transactions only superficial processing takes place there, because the entire essence falls on EndBlock logic. This is done naturally so that our orders are executed at the clearing price. Thats where Sei added the parallelization, which helps improve performance.
A more detailed version of how this whole system works uses so-called database keys and we solve the problem of accessing the same database by repeatedly updating the key by correctly mapping the types of access. As a result, the same messages with the key update are executed sequentially and different ones can be separated and done in parallel.
Also if we go even deeper, the blocks are checked for dependencies between transactions according to the acyclic graph prototype.

If we throw a connection message to some module, it will be executed sequentially.

If we throw tokens from one account to another, then these are different things and we can apply parallelism to improve the performance of the blockchain.

Since we dont use message content checking and do message type mapping protection, as this would lead to consistent execution. We can designate the dependency mapping as some kind of templates which will be executed by detailed concurrency resources.
Gas fees also play a role here. Sei took care of the dependency mappings between blocks, but if a smart contract creator wants to change them, he has to do it right so that users dont subsequently get long transaction processing times and pay extra gas to process them. They could get stuck in a blockchain traffic jam and that would be a nuisance.
Of course Sei has its own oracles to oversee the recording and pricing of various asset exchange rates. Validators are like oracles. Asset pricing has been reduced to one block, providing a better and more recent exchange rate.
At the voting stage, the validator provides its proposed exchange rates and at the end of the voting all votes are added up and a weighted median (average value) for a particular exchange rate for each asset is obtained.
Naturally there are penalties for failing to submit a vote or for votes that deviate greatly from the weighted median in the final decision. Such a validator is suspended for a certain period of time.

Phew, it was quite a challenge to tell you in detail what Sei is all about. But now you fully understand the workings and processes inside the Level 1 blockchain, which was created specifically for the DeFi sector as a whole.
More details will come out in the future, why this particular blockchain is needed now and what is in store for us in the near future in the DeFi space. The Sei blockchain looks very confident in its goal of becoming the main harbor for building many DeFi products.

About Sei
Sei (https://www.seinetwork.io/) serves as plumbing for the future financial system — infrastructure to support capital markets, starting with exchanges. As the first Layer 1 specialized for trading, Sei is the fastest chain to finality, optimizing every layer of its stack to give exchanges an unfair advantage.
Official Link
No activity yet