You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.9 KiB

  1. ---
  2. order: 1
  3. title: Overview
  4. parent:
  5. title: Tendermint Spec
  6. order: 7
  7. ---
  8. # Tendermint Spec
  9. This is a markdown specification of the Tendermint blockchain.
  10. It defines the base data structures, how they are validated,
  11. and how they are communicated over the network.
  12. If you find discrepancies between the spec and the code that
  13. do not have an associated issue or pull request on github,
  14. please submit them to our [bug bounty](https://tendermint.com/security)!
  15. ## Contents
  16. - [Overview](#overview)
  17. ### Data Structures
  18. - [Encoding and Digests](./blockchain/encoding.md)
  19. - [Blockchain](./blockchain/blockchain.md)
  20. - [State](./blockchain/state.md)
  21. ### Consensus Protocol
  22. - [Consensus Algorithm](./consensus/consensus.md)
  23. - [Creating a proposal](./consensus/creating-proposal.md)
  24. - [Time](./consensus/bft-time.md)
  25. - [Light-Client](./consensus/light-client.md)
  26. ### P2P and Network Protocols
  27. - [The Base P2P Layer](./p2p/node.md): multiplex the protocols ("reactors") on authenticated and encrypted TCP connections
  28. - [Peer Exchange (PEX)](./reactors/pex/reactor.md): gossip known peer addresses so peers can find each other
  29. - [Block Sync](./reactors/block_sync/reactor.md): gossip blocks so peers can catch up quickly
  30. - [Consensus](./reactors/consensus/consensus.md): gossip votes and block parts so new blocks can be committed
  31. - [Mempool](./reactors/mempool/reactor.md): gossip transactions so they get included in blocks
  32. - [Evidence](./reactors/evidence/reactor.md): sending invalid evidence will stop the peer
  33. ### Software
  34. - [ABCI](./abci/README.md): Details about interactions between the
  35. application and consensus engine over ABCI
  36. - [Write-Ahead Log](./consensus/wal.md): Details about how the consensus
  37. engine preserves data and recovers from crash failures
  38. ## Overview
  39. Tendermint provides Byzantine Fault Tolerant State Machine Replication using
  40. hash-linked batches of transactions. Such transaction batches are called "blocks".
  41. Hence, Tendermint defines a "blockchain".
  42. Each block in Tendermint has a unique index - its Height.
  43. Height's in the blockchain are monotonic.
  44. Each block is committed by a known set of weighted Validators.
  45. Membership and weighting within this validator set may change over time.
  46. Tendermint guarantees the safety and liveness of the blockchain
  47. so long as less than 1/3 of the total weight of the Validator set
  48. is malicious or faulty.
  49. A commit in Tendermint is a set of signed messages from more than 2/3 of
  50. the total weight of the current Validator set. Validators take turns proposing
  51. blocks and voting on them. Once enough votes are received, the block is considered
  52. committed. These votes are included in the _next_ block as proof that the previous block
  53. was committed - they cannot be included in the current block, as that block has already been
  54. created.
  55. Once a block is committed, it can be executed against an application.
  56. The application returns results for each of the transactions in the block.
  57. The application can also return changes to be made to the validator set,
  58. as well as a cryptographic digest of its latest state.
  59. Tendermint is designed to enable efficient verification and authentication
  60. of the latest state of the blockchain. To achieve this, it embeds
  61. cryptographic commitments to certain information in the block "header".
  62. This information includes the contents of the block (eg. the transactions),
  63. the validator set committing the block, as well as the various results returned by the application.
  64. Note, however, that block execution only occurs _after_ a block is committed.
  65. Thus, application results can only be included in the _next_ block.
  66. Also note that information like the transaction results and the validator set are never
  67. directly included in the block - only their cryptographic digests (Merkle roots) are.
  68. Hence, verification of a block requires a separate data structure to store this information.
  69. We call this the `State`. Block verification also requires access to the previous block.