Terence Tsao
    • 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

      This note has no invitees

    • 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
    • Note Insights
    • 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 Note Insights 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

    This note has no invitees

  • 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
    --- type: slide slideOptions: theme: solarized --- ## L2 Sequencing ### Where are we? Where are we heading? *Terence Tsao* Core Dev @ Offchain Labs --- <!-- .slide: style="text-align: left" --> ## Agenda * Why do we sequence? * Sequencing vs. execution * Sequencer * Dos and Donts * Decentralized design goals * Today's landscape vs. tmw * Interaction with MEV --- <!-- .slide: style="text-align: left" --> ## Why do we sequence? - Txs can be ordered by the parent chain - Not economical - Aggregate off-chain, batch, and commit on-chain under a single tx - Compression - Minimizes user cost - At the very least, users can still use parent chain - Censorship prevention - Worse UX and higher cost --- <!-- .slide: style="text-align: left" --> ## Sequencing vs. execution - Separation of concern is a feature, not a bug! - Once tx is sequenced, (& posted on parent chain) it's final - Why separate? - Because they are! - Proposer requires the sequence - Sequencer doesn't require the state --- <!-- .slide: style="text-align: left" --> ## Sequencing vs. execution ![](https://hackmd.io/_uploads/Hk5JDSidn.png) [ref](https://developer.arbitrum.io/inside-arbitrum-nitro/#sequencing-followed-by-deterministic-execution) --- <!-- .slide: style="text-align: left" --> ## Sequencer main role - Receive txs from users - Emit ordered and timestamped sequence from users txs - Emit **soft** commit (ms) - Emit **hard** commit (parent chain finalization time) - Proposers take sequenced txs and propose L2 blocks --- <!-- .slide: style="text-align: left" --> ## Sequencer cannot do - Change the result of the txs - Can not censor you forever - Invariants: - Collect execution fee - How much to charge for gas - Protocol only **trusts** sequencer for one thing, and that is order txs --- <!-- .slide: style="text-align: left" --> ## Sequencer Design goals - Liveness - Minimize the following - Tx latency - Toxic MEV (front-running) - Reduce co-location incentive - Resolve latency by bidding - Censorship resistance --- <!-- .slide: style="text-align: left" --> ## Sequencer designs - Centralized - Partial/full decentralized - Shared/outsourced --- <!-- .slide: style="text-align: left" --> ## Outsourced designs - Your sequencer can be outsourced to another - Sequencer - L2 chain - L1 chain --- <!-- .slide: style="text-align: left" --> ## Break down the problems Sequencer committee is just a set of computers[1] that implements some ordering policies[2] through some consensus algorithms[3] --- <!-- .slide: style="text-align: left" --> ## Ordering policy - First come, first serve - MEVA (full block auction) - Time boost - Continuous time - Discrete time --- <!-- .slide: style="text-align: left" --> ## Ordering policy: FCFS - Easy to understand - Minimize TX latency - Minimize Toxic MEV (front-running) - Can't resolve race by bidding --- <!-- .slide: style="text-align: left" --> ## Ordering policy: MEVA - Anyone can become a sequencer by bidding - Highest bid wins to sequence at a future time - Rational profit-maxi actor will maximize value - Bid should be as close as the value extracted - Unknowns: timing & censorship --- <!-- .slide: style="text-align: left" --> ## Ordering policy: Time boost - Allow bidder to buy time / bid up time for adjusted timestamp $t_\mathrm{adjusted}(T) = t_\mathrm{arrival}(T) - \frac{gB(T)}{B(T)+c}$ - No tx can be held for more than $g$ time - Resolve race by bidding, no front running if sequencer is honest - Dist time vs. cont time - Under analysis which is more efficient --- <!-- .slide: style="text-align: left" --> ## Ordering policy comparisons | ordering policy | latency | reduce toxic MEV | resolve race by bidding | trusting sequencer to not reorder| | --- | --- | --------------- | -------- | -------- | | FCFC | ✅✅ | ✅ | ❌ | ❓| | MEVA | ❓ | ❌ | ✅ | ❓ | | Time-boost | ✅ | ✅ | ✅ | ❓ | --- <!-- .slide: style="text-align: left" --> ## Sequencer consensus policy - Leader auction - Random leader election - Economic competition - Threshold cryptography --- <!-- .slide: style="text-align: left" --> ## Consensus + ordering policy - Ordering policy can be applied to any design - Committee reaches consensus on ordering - Pre-determined safety assumption - Tradeoffs between latency & size --- <!-- .slide: style="text-align: left" --> ## Decentralize via committee - No longer a single sequencer - Committee can be elected by gov - Ordering policy is voted through protocol - Front run can be detected and slashed out of band - Reserved sequencer for liveness - Requires manual intervention --- <!-- .slide: style="text-align: left" --> ## Decentralize via BFT - Round-based single-leader selection - Txs are gossiped through p2p network - Better liveness - Likely slower - Manual intervention is no longer required --- <!-- .slide: style="text-align: left" --> ## Decentralize via committee + threshold decryption - Leaderless, anyone can batch post - Encrypted tx goes to all parties - Parties work together to decrypt a tx - Parties reach a consensus on ordering - Require automatic broadcast protocol. Non-trivial latency --- <!-- .slide: style="text-align: left" --> ## Comparisons | Consensus | Liveness | Latency | Reduce co-location incentive | Censorship resistance | Trustless | | -- | -- | -- | -- | -- | -- | | Centralized | ❌ | ✅✅✅ | ❌ | ❌ | | Committee | ✅ | ✅✅ | ✅| ✅ | | BFT | ✅ | ❓ | ✅ | ✅ | | Committee + Threshold | ✅ | ✅ | ✅✅ | ✅✅ | --- <!-- .slide: style="text-align: left" --> ## Shared sequencing - Can achieve efficient data packing - Cross-domain value extraction - Automatic inclusion, not execution! - How to achieve cross-rollup composition? - Unless it runs every $STF$? - How to distribute value extraction back to individual rollup? --- <!-- .slide: style="text-align: left" --> ## Finally. What's next❓ - Sequencer will be decentralized - Ordering policy will be adopted - Proposals will go through governence vote - May the best one win (multiple winners?) --- <!-- .slide: style="text-align: left" --> ## Thank you! Enjoy rest of ethCc! Find me @terencechain ---

    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