fboucquez
    • 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
    # Rosetta Review This page describes my initial findings after reading the Rosetta specifications, docs, looking at the examples, and coding a little bit. ## What is Coinbase's Rosetta? Rosetta is an open-source [specification](https://github.com/coinbase/rosetta-specifications) that makes integrating with blockchains simpler, faster, and more reliable. If a blockchain provides the Rosetta implementation, different services, and apps that can "talk" Rosetta would be able to integrate with that blockchain. The main selling point is the Coinbase integration. Coinbase would like the blockchain developers to integrate with them by providing a Rosetta implementation. Coinbase isn't going to integrate with a specific blockchain implement. The blockchain devs (us) are doing the dirty work for them. Coinbase integration is not the only selling point, once Symbol/Nis1 implements Rosetta, other (or our own) explorers/wallets/apps could easily integrate (in theory). ## What is a Rosetta Implementation? A Rosetta implementation is a docker container image that runs a rest server implementing the Rosetta Open API specification. Some bullet points: - The Open API is a POST-only RCP style specification. There are 23 endpoints to implements. The RCP style makes code generation simple. - There is an online and offline mode. If the container runs in online mode, blockchain data can be queried and transactions can be announced. If the container runs in offline mode, stateless SDK-related operations like public key to address transformation, payload processing, and static configuration loading are executed. No connection to a node in offline mode. - There are specific requirements about how to build and run the Docker container. The container itself can contain multiple internal services but they must all be started when the container starts. Only one mounted volume is allowed. ## Implementation languages Rosetta is just an open-source specification and has some docker (packaging) requirements. It doesn't force us to use any language. The Coinbase team does provide an official [Golang SDK](https://github.com/coinbase/rosetta-sdk-go). The SDK provides utility functions and services to create Rosetta rest servers and clients. From what I'm seeing, most teams have used the GO SDK but there are also examples of Javascript and Rust. Possible symbol implementations: | | Go | Typescript | Python | C++ | |-----------------------------------|-------------------------|---------------------------------------------------------------------------------------------------------|--------------|--------| | Rosetta SDK | Yes, plenty of examples | "In Plan", some JS examples [Personal POC SDK](https://github.com/fboucquez/rosetta-sdk-typescript) | No | No | | Rosetta Open API gen friendly | Yes | Yes | Unsure | Unsure | | Symbol SDK | No | Yes | Yes | Yes? | | Symbol Open API gen friendly (may not be required) | Unsure | Yes | AnyOf issues | Unsure | | Current team skill | Low? | High | Mid-High? | Mid? | ## Rosetta implementation talking to an external node The initial idea was to have a Rosetta Symbol service talking to an external node, like one of our Testnet or Mainnet nodes (or a Symbol node running in the exchange infrastructure). But it seems like the node needs to be built-in. Talking to an external node is actually a [common mistake](https://www.rosetta-api.org/docs/common_mistakes.html#connecting-to-a-block-explorer-or-external-node). Some quotes: > To reiterate, any external services must be wholly contained in your single Dockerfile (should be started and stopped automatically)! >Our security team considers it an “integration blocker” to rely on some external party (some external node) for connectivity to the network I'm not 100% about if external nodes are completely banned. Maybe Coinbase allows a Rosetta container to talk to a separate node hosted by Coinbase. I have asked that question. ## Rosetta implementation with a built-in node If having a separate container/compose running a Symbol node is not an option, we would need to squash a Symbol node next to the Rosetta implementation in the same Docker file/container. These Rosetta examples do that, running a node and a Rosetta server next to each other. https://github.com/coinbase/rosetta-bitcoin/blob/master/Dockerfile https://github.com/coinbase/rosetta-ethereum/blob/master/Dockerfile These are some initial options for built-in node: ### Full dual node: Squashing Catapult, Broker, RocksDB, Mongo, Recovery, Rest, and the Rosetta implementation (new) into one large container. Too big, too many points of failure. Rest needs to be extended adding or modifying some endpoints as they are not Rosetta friendly. e.g. Block by hash, or transaction hashes of a block. ### Api only node: Squashing Catapult, RocksDB, Recovery, and the Rosetta implementation (new) into one large container. The Rosetta implementation would query RocksDB and talk to Server API directly. We most likely need a RocksDB query/indexer service/component (new). Unsure how hard is to query and index RocksDB. ### Api only node + light rest: Squashing Catapult, RocksDB, Recovery, Ligh Rest (new), and the Rosetta implementation (new) into one large container. The Rosetta implementation would talk to a Light Rest service. The Light Rest implementation would query RocksDB and talk to the Server API. A light rest service could be used for regular node deployment, not just Rosetta. We most likely need a RocksDB query/indexer service/component (new). ### Catapult extension: A catapult C++ extention that exposes the Rossetta implementation by querying the RocksDB directly. ### Custom/Go catapult client: A brand new Catapult client that exposes the Rosetta endpoints. E.g. a GO catapult client that uses the Rosetta GO SDK. ## Endpoint mappings. TODO. In this section, I would like to talk about how the 23 Rossetta endpoints can be mapped to Symbol data and operations. ## Future research, questions, TODOs: - How symbol specific transactions like metadata, restrictions, etc can be implemented in Rossetta? - How Symbol specific entities like restriction, metadata, etc can be used in Rosetta? - Can a built-in node vote, harvest and collect harvesting rewards? - How to create a single image for both testnet and mainnet nodes. How to setup the node configuration in the image, especially around dynamic/provided keys or customizations. - Can a Symbol/Nis1-Rosetta be a first-class citizen? Would regular node admins want to run those kinds of nodes? - What if we create explorers and wallets that understand Rosetta for our networks or any other Rosetta compatible subchain? - How can Rosetta be extended by adding extra Symbol/Nis1 specific endpoints (like `/node/unlockedaccount`)? - Understand how mempool and subchain works in Rosetta. - [Storage prunning](https://www.rosetta-api.org/docs/storage_pruning.html) and how can we delete old blocks. ## Links - [Docs](https://www.rosetta-api.org/docs/welcome.html) - [Community](https://community.rosetta-api.org/) Not super active lately? - [Rosetta Go SDK](https://github.com/coinbase/rosetta-sdk-go) ### Examples: - [Bitcoin - Go ](https://github.com/coinbase/rosetta-bitcoin) - [Ethereum - Go](https://github.com/coinbase/rosetta-ethereum) - [Celo - Go](https://github.com/celo-org/rosetta) - [Vechain - Javascript](https://github.com/vechain/rosetta) - [Diem - Rust](https://github.com/diem/rosetta-proxy) - Lots of examples you can see in the community form. ### Blogs: - [Bitcon Rosetta](https://blog.coinbase.com/introducing-rosetta-bitcoin-coinbases-bitcoin-implementation-of-the-rosetta-api-71323052b32c) - [Harmony](https://blog-harmony-one.cdn.ampproject.org/v/s/blog.harmony.one/insights-on-integrating-the-rosetta-api-developed-by-coinbase/amp/?amp_js_v=a6&amp_gsa=1#referrer=https%3A%2F%2Fwww.google.com&amp_tf=From%20%251%24s&ampshare=https%3A%2F%2Fblog.harmony.one%2Finsights-on-integrating-the-rosetta-api-developed-by-coinbase%2F) ### Test: - [Rosetta CLI](https://github.com/fboucquez/rosetta-sdk-typescript) To perform integration tests by hitting the different endpoints. - [LunarDev](https://docs.lunar.dev/#/) Cloud service hosting different Rosetta implementations. It can be used to see how other protocols behave. - [E2E test requirements](https://community.rosetta-api.org/t/rosetta-end-to-end-testing-prerequisites/296) ### Docker: - [Multiple service question](https://community.rosetta-api.org/t/for-the-docker-file-implementation-can-we-add-additional-services-to-our-implementation/181/2) - [Why to run all in one container](https://community.rosetta-api.org/t/when-is-it-appropriate-to-run-a-node-locally/236)

    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