mxinden
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- slideOptions: transition: fade theme: white --- <style> .reveal { font-size: 20px; } .reveal pre { border: none; box-shadow: none; } .reveal .slides { text-align: left; } .reveal .slides section>* { margin-left: 0; margin-right: 0; } </style> # Hotstuff ## BFT Consensus in the Lens of Blockchain By Maofan Yin, Dahlia Malkhi, Michael K. Reiter, Guy Golan Gueta, and Ittai Abraham. --- ### Hotstuff > A **leader-based** **Byzantine fault-tolerant** replication protocol for the **partially synchronous model**. - _leader based_ - with leader selection out of scope of the paper. - _byzantine fault-tolerant_ - in regards to the _Byzantine Generals Problem_. - _partially synchronous model_ - Safety at all times even in asynchronous networks. - Liveness once network becomes synchronous. --- ### Constributions - **Linear communication and view change** with O(#replicas). Difference to PBFT. - **Optimistic Responsiveness**: Consensus at the pace of actual (vs. maximum) network delay. Difference to Tendermint and Casper. --- ### Related work #### Classics - Leslie Lamport, Robert E. Shostak, and Marshall C. Pease. "The byzantine generals problem." ACM Trans. Program. Lang. Syst., 4(3):382–401, 1982. - Fischer, Michael J., Nancy A. Lynch, and Michael S. Paterson. "Impossibility of distributed consensus with one faulty process." Journal of the ACM (JACM) 32.2 (1985): 374-382. - Dwork, Cynthia, Nancy Lynch, and Larry Stockmeyer. "Consensus in the presence of partial synchrony." Journal of the ACM (JACM) 35.2 (1988): 288-323. - Castro, Miguel, and Barbara Liskov. "Practical Byzantine fault tolerance." OSDI. Vol. 99. No. 1999. 1999. --- ### Related work #### Blockchain - Nakamoto, Satoshi, and A. Bitcoin. "A peer-to-peer electronic cash system." Bitcoin.–URL: https://bitcoin.org/bitcoin.pdf (2008). - Buchman, Ethan. Tendermint: Byzantine fault tolerance in the age of blockchains. Diss. 2016. - Buterin, Vitalik, and Virgil Griffith. "Casper the friendly finality gadget." arXiv preprint arXiv:1710.09437 (2017). --- ### Basic Hotstuff ( ) New View messages (1) **Prepare Phase**: Ensure a leader does not send different proposals to different replicase (Equivocation). (2) **Pre-Commit Phase**: Solve _hidden lock problem_ and thus achieve linear view changes. (3) **Commit Phase**: Ensure that a commit proposal stays commited. ( ) Decide message --- ### Quorum Certificate (QC) Collection of - n - f signatures - for a leader proposal (prepare, pre-commit, commit) - for a specific view number. --- ### 1. Prepare Phase 4 nodes with one leader and 3 replicas out of which one might be byzantine (safety in async networks with n = 3k + 1). ```mermaid sequenceDiagram participant Leader participant Replica A participant Replica B participant Replica C Note over Leader,Replica C: Transition into new view. Replica A->>Leader: prepareQC Replica B->>Leader: prepareQC Replica C->>Leader: prepareQC Leader->>Replica C: Broadcast MSG(PREPARE, current Proposal, highest QC) Note over Replica A,Replica C: SafeNode predicate either:<br/>(a) proposal extends from current lockedQC<br/>(b) highestQC.viewNumber > lockedQC.viewNumber Replica A->>Leader: VOTEMSG(PREPARE, m.node) Replica B->>Leader: VOTEMSG(PREPARE, m.node) Replica C->>Leader: VOTEMSG(PREPARE, m.node) ``` --- ### SafeNode Predicate Either one has to be true: (a) proposal extends from current lockedQC ```mermaid graph LR Genesis --> ... --> lockedQC.node --> newQC.node ``` (b) newQC.viewNumber > lockedQC.viewNumber Given that newQC with view number 11 exists, conflicting proposal for lockedQC with view number 10 can not possibly been decided as otherwise honest replicas would not have signed newQC. ```mermaid graph LR Genesis --> ... -->|view 9| decidedValue -->|view10| lockedQC10.node --> someFailure decidedValue -->|view12| newQC11.node style someFailure fill:#FF0000 ``` --- ### 2. Pre-Commit Phase ```mermaid sequenceDiagram participant Leader participant Replica A participant Replica B participant Replica C Note over Leader: Wait for n - f PREPARE votes. Leader->>Replica C: Broadcast MSG(PRE-COMMIT, _, prepareQC) Note over Replica A,Replica C: prepareQC <- prepareQC Replica A->>Leader: VOTEMSG(PRE-COMMIT, m.node) Replica B->>Leader: VOTEMSG(PRE-COMMIT, m.node) Replica C->>Leader: VOTEMSG(PRE-COMMIT, m.node) ``` --- ### 3. Commit Phase ```mermaid sequenceDiagram participant Leader participant Replica A participant Replica B participant Replica C Note over Leader: Wait for n - f PRE-COMMIT votes. Leader->>Replica C: Broadcast MSG(COMMIT, _, precommitQC) Note over Replica A,Replica C: lockedQC <- precommitQC. Replica A->>Leader: VOTEMSG(COMMIT, m.node) Replica B->>Leader: VOTEMSG(COMMIT, m.node) Replica C->>Leader: VOTEMSG(COMMIT, m.node) ``` --- ### Hidden Lock Problem Violates liveness even in synchronous (bounded by Δ) networks. Solved through either: - 2nd (pre-commit) phase in Hotstuff (_Optimistic Responsiveness_). - By waiting Δ amount of times before leader changes in Tendermint and Casper. ```mermaid graph LR Genesis --> ... --> b' --> b b' --> b'' ``` What happens when we do **two**-phase (prepare & commit) Hotstuff with _Optimistic Responsiveness_? ```mermaid sequenceDiagram participant Leader 1 participant Leader 2 participant Replicas ... participant Replica Y participant Replica Z Note over Leader 2,Replicas ...: Network Partition Leader 1->>Replica Z: Broadcast MSG(COMMIT, _, precommitQC(b)) Note over Replica Y: lockedQC <- precommitQC(b). Replica Y->>Leader 1: VOTEMSG(COMMIT, b) Note over Leader 1,Replica Z: Transition into new view with Leader 2 Leader 2->>Replica Z: Broadcast MSG(PREPARE, b'', prepareQC(b') Replicas ...->>Leader 2: Some VOTEMSG(PREPARE, b'') Replica Z->>Leader 2: VOTEMSG(PREPARE, b'') Replica Y->>Leader 2: VOTEMSG(REJECT, b'') Note over Leader 2: No majority yet Note over Replicas ...: 2f transition into new view Replicas ...->>Leader 2: Single missing VOTEMSG(PREPARE, b'') from malicious replica Leader 2->>Replica Z: Broadcast MSG(COMMIT, _, prepareQC(b'') Note over Replica Z: lockedQC <- prepareQC(b'') Replica Z->>Leader 2: Honest replica VOTEMSG(COMMIT, b'') Note over Leader 1,Replica Z: Repeat ``` --- ### Chained Hotstuff - 3 phases are structurally the same. - Have each leader only do _PREPARE_ phase. Driving block of previous leader along the way. ![](https://i.imgur.com/X6YFGIA.png) --- ### Comparison | | Best Case Latency | Normal Case Communication | View Change Communication | View Change Responsiveness | | -------- | -------- | -------- | ---|---| | Bitcoin | 1 | O(n) | - | - | | PBFT | 2 | O(n²) | O(n²) | **Yes** | | Tendermint / Casper | 2 | **O(n)** | **O(n)** | No | | Hotstuff | 3 | **O(n)** | **O (n)** | **Yes** | --- ### Additional Sources - [ZK-TLV 0x09 - Ittai Abraham - The Bitcoin Breakthrough in the less of Distributed Computing (Part 1)](https://youtu.be/IUwsxssViqc) - [ZK-TLV 0x09 - Ittai Abraham - State Machine Replication from traditional to modern (Part 2)](https://youtu.be/-RcYagFNyLU) - [ZK-TLV 0x09 - Ittai Abraham - The HotStuff approach to BFT (Part 3)](https://youtu.be/ONobI3X70Rc) - [ZKPodcast: Consensus Algorithms & HotStuff with Ittai Abraham](https://www.zeroknowledge.fm/127) - [Murat Buffalo: Hotstuff Blog Post](https://muratbuffalo.blogspot.com/2019/12/hotstuff-bft-consensus-in-lens-of.html)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully