Dominik Schmid
    • 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 New
    • Engagement control
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    **Blogpost about bridge security** **Our goal:** To educate users and the broader crypto community about bridge security, and some of the existing solutions on the market, as well as ongoing research. **Our target audience:** Retail users wanting to bridge tokens - Alice. **Our timeline:** Finalisation 15th of June **What do users want when they bridge?** So Alice has 0.5 Eth on Arbitrum and wants to use those tokens on Polygon PoS. To do so, Alice has to use a bridge. For her, most bridges look the same. She connects her MetaMask - or any other wallet - to the bridge UI. Then she selects the source and destination chain and the tokens she wants to bridge. After setting the desired amount, she can submit a transaction and wait until she receives her tokens on the destination chain. In the background, blockchain bridges are complex protocols. Some are more secure than others. Bridges tie scaling solutions to Ethereum layer-1 and connect different blockchains. A bridge is responsible for holding the assets on a (layer-1) blockchain while similar assets are released on another (and external) service. It defines who has custody of the funds and the conditions that must be satisfied before the assets can be unlocked. In a nutshell, whenever a layer-1 blockchain like Ethereum connects to any other system, there is a bridge involved. In that sense, a bridge is fundamental for any scaling solution. Furthermore, the security and integrity of a bridge define the security of the usage of the off-chain system. Imagine connecting two secure systems via a highly fragile bridge. In any case, from the perspective of the source blockchain, a bridge is a smart contract in some cases a multi-sig wallet, that holds users' funds and defines the conditions of how those funds can be withdrawn. The other side of the bridge, on the target system or blockchain, creates or unlocks the same amount of funds for the user. That way the user can use those funds on the other system. A blockchain bridge cannot really move tokens between blockchains - only messages with cryptographic signatures. Those messages trigger a payout on the destination chain. So bridges must ensure the validity of those messages. The technical challenge of bridges lies in the very nature of blockchains. Blockchains are designed to be consistent and validatable. So in fact, a blockchain can only know and trust information that it itself produces. Any external information - and therefore bridged tokens - is hard to independently validate since a blockchain has no way of knowing the outside world or the other blockchain. Most bridges use clever tricks to ensure that the into the destination chain injected message is valid and if so Alice can receive her tokens. If a bridge can ensure most of the time that it relays valid messages and blocks invalid ones, we call it secure. **What do we mean by security?** Security is the absence of risk. In our case, we understand risk as the risk of a bridge relaying an invalid message. This includes not relaying a valid message, for example, a valid withdrawal request. In other words and from Alice’s perspective, the security of a bridge is defined as the likelihood of a happy case, so to receive the tokens that she was promised on the destination chain. The more likely it is, the more secure we call the bridge. To assess the security of a bridge, we will try to list all the bad outcomes for Alice and compare the different bridge designs on how they can prevent such a case. So what could happen to Alice when she tries to bridge her tokens. 1. **Alice could be censored.** So her transaction could be rejected because the bridge operators have her account on a black list. In that case she could not bridge and maybe not withdrawal her tokens. In this case the bridge would have blocked a valid message. 2. **Alice could receive fewer or no tokens on the destination chain than agreed upon.** So in our example, Alice could be promised 0.495 wETH on Polygon PoS but she only gets 0.1 or none at all. In the case the bridge would have relayed a wrong message. 3. **Alice could receive the wrong tokens** or tokens with less value. So Alice could send wETH on the source chain but receive something else on the target chain. Some bridges mint their own tokens instead of unlocking the canonical tokens immediately. That way, there is a risk for Alice. 4. Alice could get an IOU for her tokens on the destination chain, but then the **Bridge could get hacked** and Alice loses the value of her IOU. 5. … So for now we can break down the question of the security of bridges on how the different bridges designs prevent those bad outcomes for Alice. Because there are over 60 bridges out there, we can look at categories of bridges which differ by their protocol design. **Which categories of bridges do we see?** We put all bridges into four different categories. We follow the work of L2beat and their great educational efforts to … **Rollups and other Layer2s** can be seen as highly secure bridges. The validity of messages and resulting states can be challenged and proven on layer-1. They implement a light client on layer-1 that checks the validity of the state root from layer-2. That way those bridges inherit the security of the layer-1 blockchain. We call these "native" bridges. Examples: StarkGate, Arbitrum Bridge, Optimism Bridge The next category is bridges implementing a "consensus" light client. **Consensus-checking light clients** are less secure than Rollups as they do not validate the state explicitly - they trust the Miners/Validators of the source domain. Basically, they check if a block is signed correctly and in the case of PoW they check the difficulty. In the block there is the message, which validity needs to be ensured. If the Miners/Validators are compromised, they can mine an invalid block. Examples: NEAR, Cosmos IBC Then we have **Optimistic Bridges**. They are secure as long as there is at least one honest validator that manages to raise an alarm within the fraud-proof window (the longer the better). A proposer proposes a set of new valid messages and a watcher can check the validity and step in if there is fraud. Examples: Nomad/Connext, Across Finally, we have bridges that rely on some **validators attesting to the validity of messages**. It could be MultiSig, dynamic validator set with PoS consensus, MPC scheme, Intel SGX security box, whatever. It is ultimately all the same category. Examples: Multichain, Celer cBridge v2 Show a comparison table on how bridges are secured: Here we can now compare how the different bridge designs would prevent the bad outcomes for Alice. | | Native Bridges | Light Client Bridges | Optimistic Bridges | Validator Bridges | | --------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | | Censoring | As long as the blockchain and the open source smart contract are censorship resistant, this is not possible | As long as the blockchain and the open source smart contract are censorship resistant, this is not possible | If the proposer and all the watchers collude, they could censor a user. If the watcher set is unknown, a collusion is unlikely | As long as > 1/3 of the validators do not collude, the bridge cannot censor | | Invalid Message | Alice (or someone else) can challenge this on the source chain and she will most likely win her case | Alice (or someone else) can challenge this on the source chain and she will most likely win her case | Alice (or someone else) can challenge this on the source chain and she will most likely win her case | As long as > 1/3 of the validators do not collude, the bridge realy an invalid message | | Wrong Tokens | Bridge only use canonical tokens backed 1:1 on the source chain | Bridge should use only canonical tokens backed 1:1 on the source chain | Bridge should use only canonical tokens backed 1:1 on the source chain | Bridge should use only canonical tokens backed 1:1 on the source chain | | Bridge hack | There is always the possibility of hacks. Risk increases the more different chains and VMs are connected | There is always the possibility of hacks. Risk increases the more different chains and VMs are connected | There is always the possibility of hacks. Risk increases the more different chains and VMs are connected | There is always the possibility of hacks. Risk increases the more different chains and VMs are connected |

    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