Tendermint is software for securely and consistently replicating an application on many machines.
Tendermint provides BFT (Byzantine Fault Tolerante) State Machine Replication engine.
Tendermint guarantees the safety and liveness of the blockchain so long as less than 1/3 of the total weight of the Validator set is malicious or faulty.
A commit in Tendermint is a set of signed messages from more than 2/3 of the total weight of the current Validator set.
Validators take turns proposing blocks and voting on them. Once enough votes are received, the block is considered committed.
These votes are included in the next block as proof that the previous block was committed
ABCI
Tendermint passes transactions to the application through an interface called the ABCI (opens new window), which the application must implement.
ABCI stands for "Application Blockchain Interface".
ABCI is the interface between Tendermint (a state-machine replication engine) and your application (the actual state machine).
The ABCI consists of 3 primary message types that get delivered from the core to the application.
DeliverTx, CheckTx, Commit
Tendermint Core creates three ABCI connections to the application;
one for the validation of transactions when broadcasting in the mempool
one for the consensus engine to run block proposals
one more for querying the application state.
Note that Tendermint only handles transaction bytes. It has no knowledge of what these bytes mean.
All Tendermint does is order these transaction bytes deterministically.
Tendermint passes the bytes to the application via the ABCI, and expects a return code to inform it if the messages contained in the transactions were successfully processed or not.
Here are the most important messages of the ABCI:
CheckTx: When a transaction is received by Tendermint Core, it is passed to the application to check if a few basic requirements are met.
DeliverTx: When a valid block (opens new window) is received by Tendermint Core, each transaction in the block is passed to the application via DeliverTx in order to be processed.
BeginBlock/EndBlock: These messages are executed at the beginning and the end of each block, whether the block contains transaction or not. It is useful to trigger automatic execution of logic.
Tendermint Core is the consensus system of the Tendermint platform that additionally consists of a generic application interface.
What is unique about Tendermint is that, unlike other blockchain solutions pre-packaged and built-in state machines, developers can use the Tendermint for BFT state machine replication of applications whatever language they desire and whatever development environment works for them. (what does this means?)
Tendermint Core, ensures that the same transactions are recorded on every machine in the same order.
Tendermint has evolved to be a general purpose blockchain consensus engine that can host arbitrary application states.
Since Tendermint can replicate arbitrary applications, it can be used as a plug-and-play replacement for the consensus engines of other blockchains.
Ethermint is such an example of an ABCI application replacing Ethereum's PoW via Tendermint's consensus engine.
Another example of a cryptocurrency application built on Tendermint is the Cosmos network.
Tendermint is able to decompose the blockchain design by offering a very simple API (ie. the ABCI) between the application process and consensus process.
Consensus
Participants in the protocol are called validators;
they take turns proposing blocks of transactions and voting on them.
Blocks are committed in a chain, with one block at each height.
A block may fail to be committed, in which case the protocol moves to the next round, and a new validator gets to propose a block for that height.
Two stages of voting are required to successfully commit a block; we call them pre-vote and pre-commit.
A block is committed when more than 2/3 of validators pre-commit for the same block in the same round.
Validators may fail to commit a block for a number of reasons;
the current proposer may be offline
the network may be slow
Assuming less than one-third of the validators are Byzantine, Tendermint guarantees that safety will never be violated - that is, validators will never commit conflicting blocks at the same height.
Tendermint (opens new window) is an application-agnostic engine that is responsible for handling the networking and consensus layers of a blockchain.
In practice, this means that Tendermint is responsible for propagating and ordering transaction bytes. Tendermint Core relies on an eponymous Byzantine-Fault-Tolerant (BFT) algorithm to reach consensus on the order of transactions.
The sequence (Propose -> Prevote -> Precommit) is called round
+-------------------------------------+
v |(Wait til `CommmitTime+timeoutCommit`)
+-----------+ +-----+-----+
+----------> | Propose +--------------+ | NewHeight |
| +-----------+ | +-----------+
| | ^
|(Else, after timeoutPrecommit) v |
+-----+-----+ +-----------+ |
| Precommit | <------------------------+ Prevote | |
+-----+-----+ +-----------+ |
|(When +2/3 Precommits for block found) |
v |
+--------------------------------------------------------------------+
| Commit |
| |
| * Set CommitTime = now; |
| * Wait for block, then stage/save/commit block; |
+--------------------------------------------------------------------+
The Tendermint consensus algorithm (opens new window) works with a set of special nodes called Validators.
Validators are responsible for adding blocks of transactions to the blockchain.
At any given block, there is a validator set V. A validator in V is chosen by the algorithm to be the proposer of the next block.
This block is considered valid if more than two thirds of V signed a prevote (opens new window) and a precommit (opens new window) on it, and if all the transactions that it contains are valid.
The validator set can be changed by rules written in the state-machine.
Proposal
A proposal is signed and published by the designated proposer at each round. The proposer is chosen by a deterministic and non-choking round robin selection algorithm that selects proposers in proportion to their voting power.
Upon entering Propose - The designated proposer proposes a block at (H,R).
Prevote
Upon entering Prevote, each validator broadcasts its prevote vote.
Intro
ABCI
Tendermint passes transactions to the application through an interface called the ABCI (opens new window), which the application must implement.
ABCI stands for "Application Blockchain Interface".
ABCI is the interface between Tendermint (a state-machine replication engine) and your application (the actual state machine).
The ABCI consists of 3 primary message types that get delivered from the core to the application.
DeliverTx, CheckTx, Commit
Tendermint Core creates three ABCI connections to the application;
Note that Tendermint only handles transaction bytes. It has no knowledge of what these bytes mean.
All Tendermint does is order these transaction bytes deterministically.
Tendermint passes the bytes to the application via the ABCI, and expects a return code to inform it if the messages contained in the transactions were successfully processed or not.
Here are the most important messages of the ABCI:
CheckTx
: When a transaction is received by Tendermint Core, it is passed to the application to check if a few basic requirements are met.DeliverTx
: When a valid block (opens new window) is received by Tendermint Core, each transaction in the block is passed to the application via DeliverTx in order to be processed.BeginBlock/EndBlock
: These messages are executed at the beginning and the end of each block, whether the block contains transaction or not. It is useful to trigger automatic execution of logic.Tendermint's Core BFT POS consensus engine:
Tendermint Core is the consensus system of the Tendermint platform that additionally consists of a generic application interface. What is unique about Tendermint is that, unlike other blockchain solutions pre-packaged and built-in state machines, developers can use the Tendermint for BFT state machine replication of applications whatever language they desire and whatever development environment works for them. (
what does this means?
)Consensus
pre-vote
andpre-commit
.Consensus:
The sequence
(Propose -> Prevote -> Precommit)
is calledround
Proposal
A proposal is signed and published by the designated proposer at each round. The proposer is chosen by a deterministic and non-choking round robin selection algorithm that selects proposers in proportion to their voting power.
Propose
- The designated proposer proposes a block at(H,R)
.Prevote
Upon entering Prevote, each validator broadcasts its prevote vote.
Precommit