๐Block Finality
How much time it takes to finalize a block on Asset Chain.
Last updated
How much time it takes to finalize a block on Asset Chain.
Last updated
Finality is the point at which a transaction on a blockchain becomes irreversible and permanently recorded. But before we dive in further, itโs important to have a basic understanding of how a blockchain works.
At its core, a blockchain is simply a database that contains transactions. When a transaction is submitted to a blockchain, itโs not added directly to it. Rather, itโs bundled into a โblockโ alongside other transactions, which is then incorporated into the database. As such, a blockchain is a sequential chain of blocks that contain transactions, hence its name.
Most importantly, a blockchain is decentralized, which means it doesnโt run on a single server. Instead, the blockchain exists simultaneously on a massive amount of computers around the world that run software to communicate with each other and agree on the content of the database. (On Asset Chain, these computers are called validators.)
Itโs these computers that bundle transactions into blocks and add them to the blockchain at frequent intervals. Every ~10 minutes for Bitcoin, every ~12 seconds for Ethereum, and every ~0.4 seconds for the Sonic closed testnet.
However, once a block is added to the blockchain, it doesnโt mean the transactions contained within are instantly final and permanent. In the majority of blockchains, a single computer is usually picked to create the next block and add it to the blockchain. Other computers in the system then receive this block and validate the transactions within it to make sure theyโre valid.
However, due to the design of most blockchains, there can be occasions when two computers are simultaneously chosen to create a block. In such a scenario, how does the rest of the system know which block to follow? Well, they must wait until the next computer is chosen to create the next block, and the previous block used by this computer is accepted as the legitimate one, while the alternative block is disregarded.
This is called the longest chain rule as every computer in the system follows the version of the blockchain with the most blocks, which naturally would be the version on the most recent computer chosen to create a block. Both Bitcoin and Ethereum implement this mechanism.
After a computer is selected to create the next block, bringing the blockchain back on track, we still have to wait for several more blocks to be created. Due to potential communication delays between the computers in the system, itโs technically possible for some of them to still have the old invalid block in their version of the blockchain.
After a certain amount of blocks have been created, this is no longer a risk as we can assume those outdated computers have undergone chain reorganization to change their database to the current and correct one. Only then can we consider the transactions in the initial block as final and irreversible.
And now weโre ready to define time to finality, which simply means how long it takes for a transaction to be considered irreversible after itโs submitted. On Bitcoin, it takes around an hour (6 blocks created). On Ethereum, it takes around two minutes (12 blocks created). On the Asset Chain mainnet, it takes only a few seconds.
Thatโs because the design of Asset Chain allows for a block and its transactions to be considered final and irreversible the moment itโs added to the blockchain. The longest chain rule and chain reorganizations do not exist on Asset Chain. Once a transaction has been added to the blockchain, itโs instantly final.
There are a few things that work in conjunction to make this possible. On Asset Chain, no single computer is chosen to create the next block. Instead, the block is added to the blockchain once the majority of the computers in the system have received it. As such, there can never be a situation on Asset Chain in which the computers disagree on the state of the database.