Concepts
Blocks and finality
LibChain uses QBFT, a Byzantine fault tolerant proof-of-authority protocol. A sealed block is final, so one confirmation is enough.
LibChain produces blocks with QBFT, a Byzantine fault tolerant consensus protocol for proof-of-authority networks. A known set of validators takes turns proposing blocks and signs each one before it's added.
#Finality
A QBFT block is final when it's sealed. There are no forks to resolve and no reorganisations, so one confirmation is enough. Wait for the receipt, then treat the transaction as settled.
const hash = await wallet.sendTransaction({ to, value })
const receipt = await client.waitForTransactionReceipt({ hash }) // final here
if (receipt.status !== 'success') throw new Error('Reverted')If you're porting code from Ethereum that waits for 12 or more confirmations, you can drop that to 1 on LibChain.
#Block timing
| With pending transactions | A new block every 2 seconds |
| When idle | One empty block every 60 seconds |
| Gas limit | 30,000,000 per block |
So a transaction you send is normally included, and final, within about two seconds, even after a quiet minute. Don't use block numbers as a clock: the gap between blocks changes with activity. Use block.timestamp.
#Validators
Lib Testnet currently runs with a single validator operated by the LibChain team. Adding independent validator operators is on the roadmap for mainnet. With QBFT, a network of n validators keeps working as long as more than two thirds of them are online and honest.
You can see who sealed each block on Lib Explorer or on the Network page of LibChain Hub.
#What this means for your app
- Show success as soon as the receipt arrives. There's no "pending confirmations" stage.
- Expect a block within two seconds of sending, and up to a minute between blocks when nothing is happening.
block.numberincreases by one per block, as on Ethereum, but not at a fixed rate.