lido
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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
    • Transfer ownership
    • Delete this note
    • 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 Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    # Data Bus Research: On-chain Based Transport Layer ## Introduction During a discussion of the DSM 1.5 specification, the need to diversify the data bus was identified. Currently, the data bus utilizes RabbitMQ, which falls short in several aspects: it doesn't provide the openness, vendor neutrality, or fast deployment required for the project. While exploring options like L2 networks and EVM based networks, the research (findings available at [link](#Conclusion4)) concluded that existing solutions could fulfill all the requirements. Therefore, the remaining focus lies in selecting the optimal network as the transport layer for the Data Bus. :::info This reserch was created before the Dencun update. At the moment, according to the information from https://l2fees.info/, the prices of L2 solutions are still much more expensive than Gnosis and Polygon. ::: ## Objective - Define network selection criteria - Prepare a toolkit for searching networks - Based on the criteria and using the toolkit, prepare an overview of popular networks - Calculate the approximate cost per day and per year ## Network Selection Criteria - Low gas price - evm-based - High network stability >99% - Availability of tools: monitoring, block exporters, development and debugging tools ## Network Search Toolkit For effective research, it is necessary to choose a convenient toolkit. Below is a list of services that I used during the research. ### L2 Fees website - https://l2fees.info/ A convenient website that collects transaction prices in L2 networks ### L2 Beat I propose to use this tool as the main tool for searching and evaluating the quality of L2 networks. This tool covers the main L2 networks, while including deep research collected in one place. website - https://l2beat.com/ github - https://github.com/l2beat/l2beat ## Network Overview ### Cost Calculation Before taking a closer look at each network, we need to narrow down the search. First, let's calculate the approximate cost per day and per year. This way we will immediately understand which solutions are definitely not suitable for us. The cost will be calculated using the following formula: ```javascript const dayInSeconds = 24 * 60 * 60; const minSigningBlocksPeriod = 150; const minSigningBlocksPeriodSeconds = minSigningBlocksPeriod * 12; const depositTransactionsPerDay = dayInSeconds / minSigningBlocksPeriodSeconds; const councilsCount = 6; const modulesCount = 2; const dayPrice = depositTransactionsPerDay * usdAvgPrice * councilsCount * modulesCount; const yearPrice = dayPrice * 365; ``` - `minSigningBlocksPeriod` — in deposit messages we pass a signature that needs to be re-signed every 100-150 blocks - `modulesCount` — the calculation is based on two modules, it should be kept in mind that there may be many more modules in the future ### Estimated Cost Assessment Prices are quoted in US dollars at the time of writing. #### L2 by l2fees data | Chain | Price per day | Price per year | |-------------|-------------|-------------| | ZkSync era | 74.88 | 27331.20 | | ZkSync lite | 144.00 | 52560.00 | | Optimism | 230.40 | 84096.00 | #### Different EVM based network | Chain | Price per day | Price per year | |-------------|-------------|-------------| | Polygon | 10.78 | 3935.61 | | Ronin | 3.47 | 1267.12 | | Gnosis | 0.10 | 37.09 | | Harmony | 0.96 | 349.21 | From the tables, it can be seen that L2 solutions are not suitable for us, the maintenance is too expensive. And with EVM-based networks the situation is much better and we have four networks that we can explore further. <details> <summary>Source code of the price calculator</summary> ```javascript const getAvgPrice = (usdAvgPrice) => { const dayInSeconds = 24 * 60 * 60; const minSigningBlocksPeriod = 150; const minSigningBlocksPeriodSeconds = minSigningBlocksPeriod * 12; const depositTransactionsPerDay = dayInSeconds / minSigningBlocksPeriodSeconds; const councilsCount = 6; const modulesCount = 2; const dayPrice = depositTransactionsPerDay * usdAvgPrice * councilsCount * modulesCount; const yearPrice = dayPrice * 365; return [dayPrice.toFixed(2), yearPrice.toFixed(2)]; }; console.log('L2 by l2fees data'); console.log() console.log('| Chain | Price per day | Price per year |'); console.log('|-------------|-------------|-------------|'); console.log('| ZkSync era |', getAvgPrice(0.13).join(' | '), ' | '); console.log('| ZkSync lite |', getAvgPrice(0.25).join(' | '), ' | '); console.log('| Optimism |', getAvgPrice(0.4).join(' | '), ' | '); console.log(); console.log('Different evm based network'); console.log() console.log('| Chain | Price per day | Price per year |'); console.log('|-------------|-------------|-------------|'); // avg tx price * 5 * token to usd price // https://polygonscan.com/tx/0x67e28b6adadb12c4cf2ee5a35ba6b8c6a4fbf2c853376aedbbbfe6678de2b720 // https://coinmarketcap.com/currencies/polygon/ console.log('| Polygon |', getAvgPrice(0.003565636714899 * 5 * 1.05).join(' | '), ' | '); // https://app.roninchain.com/tx/0x4e5b9f29d1b8e755f65ddc1c68fe9b67cb7be30f36328131ea1366a3e1812e2b // https://coinmarketcap.com/currencies/ronin/ console.log('| Ronin |', getAvgPrice(0.00042 * 5 * 2.87).join(' | '), ' | '); // https://gnosisscan.io/tx/0x600e1469a299ee5c89318e53c399aa8b562dcef3151e8cbd97bd3c6fcc133e06 // https://coinmarketcap.com/currencies/xdaistable/ console.log('| Gnosis |', getAvgPrice(0.00003528 * 5 * 1).join(' | '), ' | '); // https://explorer.harmony.one/tx/0xdc103aa33629a554db2f99d3aad6c55bde656fffce973b815405d9af860257c3 // https://coinmarketcap.com/currencies/harmony/ console.log('| Harmony |', getAvgPrice(0.01438116 * 5 * 0.0231).join(' | '), ' | '); ``` </details> --- ## Gnosis - Twitter: https://twitter.com/gnosischain - Website: https://www.gnosis.io/ - Blockscan: https://gnosisscan.io/gastracker - Blockscout: https://gnosis.blockscout.com/stats ### Cost of Use in More Detail Let's take historical gas price data from https://gnosisscan.io/chart/gasprice ![image](https://hackmd.io/_uploads/SyqPeXRna.png) The graph above shows the gas price for the past year. It can be seen that the initial calculation was based on the most optimistic price. To get a more accurate calculation, I propose taking the median price for the year and updating our calculations. As a result of calculating the median for the year, we get that we need to multiply our previous result by 3.66, which gives us the following: - Price per day: $0.366 - Price per year: $135 It turns out that even with a less optimistic gas price, the Gnosis-based solution is much cheaper than the competition. ### Uptime The uptime of all services can be viewed on the website https://status.gnosischain.com/ The annual uptime of all services is above 99%, which is a suitable result. ### Community A quick search did not reveal any obvious problems mentioned in the communities. ### Conclusion This network is the cheapest, with excellent infrastructure and high uptime. ## Harmony - Twitter: https://twitter.com/harmonyprotocol - Website: https://www.harmony.one/ - Blockscan: https://explorer.harmony.one/ Here we should also start by comparing the transaction costs for the year. Let's go to the website https://explorer.harmony.one/charts/fee and calculate the median. ![image](https://hackmd.io/_uploads/Sy8_gmRnT.png) As a result of the calculations, we get that we need to multiply the result of our experiment by 2.64, which gives us the following prices: - Price per day: $2.53 - Price per year: $921 ### Uptime The uptime of all network services can be viewed on the website https://status.harmony.one/ Uptime for the last 90 days is 100% ### Community A quick search showed that the protocol was hacked, but it continues to work: https://www.reddit.com/r/harmony_one/comments/1b16cua/harmony_one_what_are_your_thoughts_on_price/ https://www.reddit.com/r/harmony_one/comments/18daylr/harmony_wallet_compromised_metamask/ ### Conclusion This network is more expensive than Gnosis, with working infrastructure and uptime. However, there are security concerns. This issue requires further research. At this point, I recommend using this network only as a backup transport layer in case of problems with the primary network, and only for a limited time. ## Ronin - Twitter: https://twitter.com/Ronin_Network - Website: https://roninchain.com/ - Blockscan: https://app.roninchain.com/ Roninchain does not provide historical transaction cost data in a convenient format. ### Community A quick search did not reveal any obvious problems mentioned in the communities. ### Conclusion Affordable price, good tooling, but only from the main developer, no third-party tooling. It is also difficult to understand the historical cost of gas. At this point, I can only recommend using it as a backup transport layer. ## Polygon - Website: https://polygon.technology/ - Blockscan: https://polygonscan.com/ - Twitter: https://twitter.com/0xPolygon ![image](https://hackmd.io/_uploads/SkTYxQAnp.png) Polygon has experienced the least gas price fluctuations over the past year compared to other networks. Our preliminary calculations differ from the median by 1.08. Therefore, the median price will be as follows: - Price per day: $11.64 - Price per year: $4250,45 ### Community A quick search did not reveal any obvious problems mentioned in the communities. ### Status The uptime of the service for the last 90 days is quite high, >90%. You can check it on https://polygonstatus.com/ ### Conclusion This solution is significantly more expensive than the others, but still cheaper than any L2 solution. However, this network is quite well-known and reliable. We also have many people in our team with experience working with this network. This solution is recommended as a fallback provider, in case we implement fallback provider logic. ## Risk Assessment Currently, the following risks are evident: - Sudden network outage: This could be caused by a technical issue or a deliberate attack. - Censorship/substitution of Council messages: This could prevent the Council from communicating with other nodes or from sending valid transactions. - Sharp increase in gas prices: This could make it prohibitively expensive to use the network. ### On-Chain Data Bus Monitoring This can be implemented as a separate service or as Forta code. We need to monitor the following: - Gas cost: This includes tracking the gas price and usage for different types of transactions. - Council balance: We need to monitor the balance of each Council to ensure that they have enough funds to pay for transactions. - Network availability: This involves monitoring the network uptime and latency. - Message consistency: We need to ensure that the messages sent by our Council are consistent with the messages received by other nodes in the network. Based on the monitoring results, we should notify the Councils about any issues in a timely manner and take preventive measures. ### Fallback Network In the current solution, we use Gnosis as the primary network. However, we need to be prepared for the possibility that this network may become unavailable, transaction fees may increase, or censorship may occur. To mitigate these risks, we can use a fallback network such as Polygon or Ronin. This would allow us to switch the transport layer from Gnosis to another network and back if necessary. ## Conclusion Based on the research conducted, the following table has been compiled: | Chain | Median price per year | Uptime | No incidents | Community (Twitter) | Tooling |-------------|-------------|-------------|-------------|-------------|-------------| | Gnosis | $135 | >99% | + | >70k | + | Polygon | $4250,45 | >99% | + | > 2kk | + | Harmony | $921 | >99% | - | > 399k | + | Ronin | $1267.12 | >99% | + | > 170k | + ***Ronin** The price for the year was taken from the calculation of a random transfer transaction, as there are no tools to check historical data as there are in other networks. **Harmony** seems to have excellent indicators at first glance, but there are problems in the community related to asset theft. Based on the research, I propose using **Gnosis** as the primary network and **Polygon** as a backup network in case of problems with **Gnosis**. Additional considerations: - **Security**: Gnosis and Polygon are both considered to be secure networks. However, it is important to note that no network is completely immune to attack. It is therefore important to develop a monitoring and switching/fallback mechanism. - **Cost**: Gnosis has a lower median daily gas price than Polygon. However, Polygon's median yearly gas price is lower. This is due to the fact that Gnosis' gas price is more volatile than Polygon's. - **Community**: Gnosis has a smaller community than Polygon. This could make it more difficult to get support if you encounter problems with the network.

    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