ICRC-Rosetta 1.0.0 Release

Hello,

The Financial-Integrations Team @ DFINITY is happy to share with you that the first version of Rosetta for ICRC-1 Ledgers is out.

What does it do?

ICRC-Rosetta implements the Rosetta-API standard for ICRC-1 Ledgers. You can use it to store the respective blockchain inside an ICRC-1 Ledger, query blocks, transactions, balances and the status of the network. Furthermore, it allows you to post transactions to your ICRC-1 Ledger of choice. All the transactions are signed offline and your keys never make their way inside of Rosetta. ICRC-Rosetta stores the blocks that it fetched from the ICRC-1 Ledger inside a local SQLite database which is accessible to the user.

Why would I use it?

ICRC-Rosetta can be used for various tasks. Historically, exchanges, custodians and other Layer-3 entities prefer using a common standard to interact with blockchains.

Under the assumption that you run the instance within your own trust domain Rosetta makes sure that the blocks and thus the data you receive is verified and has not been tampered with. No need to worry about whether the blockchain you fetched is correct or not.

You can use the locally created database to run SQL queries e.g, to perform analytics tasks on it.

How do I use it?

We are still working on extensive documentation for ICRC-Rosetta. It was designed to be very similar to ICP Rosetta for which you can find Documentation here.

The docker image for ICRC-Rosetta is available on Dockerhub. You can run ICRC-Rosetta with this example command: docker run -ti dfinity/ic-icrc-rosetta-api --network-type mainnet --ledger-id 2ouva-viaaa-aaaaq-aaamq-cai

In this case we are connecting to mainnet with the ICRC-1 ledger with the canister id: 2ouva-viaaa-aaaaq-aaamq-cai

Every ICRC-1 Ledger has its own canister id. Some noteworthy examples are the following: :

ckBTC: mxzaz-hqaaa-aaaar-qaada-cai

ckETH: ss2fx-dyaaa-aaaar-qacoq-cai

SNS Example OpenChat: 2ouva-viaaa-aaaaq-aaamq-cai

ckTestBTC:mc6ru-gyaaa-aaaar-qaaaq-cai

ckTestETH: apia6-jaaaa-aaaar-qabma-cai

Until we have detailed guides on how ICRC-Rosetta shows transactions, we recommend checking out some transactions or blocks using the /block/transaction or /block endpoints. The process for using the construction-api is very similar to ICP-Rosetta, but with a few small differences that you can easily spot by looking at how transactions are set up.

FAQ:

Q: Does there exist an ICRC-1 Ledger on a testnet?

A: No, currently there exists no ICRC-1 Ledger on any testnet

Q: Can I use a single Rosetta instance for multiple ICRC-1 Ledgers?

A: No, you need to setup a Rosetta instance per ICRC-1 Ledger. Rosetta is a lightweight server and this approach allows for different configurations with minimal effort.

Q: How do I know the ICRC-1 Ledger id to connect to?

A: You can find ckBTC, ckETH and all SNS tokens on the dashboard, there you will also find the canister ids. We do not keep track of other ICRC-1 Ledgers and thus do not know their canister ids.

Q:How do I know whether my transaction was successful?

A: ICRC-Rosetta has a Fire-and-Forget design which makes it non-blocking. To check whether your transaction was successful you can either query for the transaction hash you received from /construction/hash and search for it at /search/transactions or you query for blocks through /block/transaction or /block and check for the transaction hash inside the returned blocks/transactions.

40 Likes

Wow, thanks for sharing such a great news with us timely. Very excited to see. Thanks for the team’s hard work, you are the best team in my heart😺

4 Likes

Amazing news! Let DEFI kickstart on ICP

4 Likes

Dang It’s Time to List On CEX !!!

3 Likes

That’s very well. Nice, good job my friends.

Awesome! Thanks for the work :slight_smile:

if we use rosetta API do we need to deploy it and pay and how much it cost?

Awesome. This is pretty cool. Has been waiting for Onchain Token integrations with Rosetta for a long time. :rocket:

Could you pls predict how long it will take for mainstream wallet applications like Metamask and Bitget to start supporting ICP’s Rosetta? Only when widely-used wallet applications support SNS tokens will ICP’s Dapps attract more users. Are there specific personnel working on advancing and coordinating with major wallet providers?

Thanks.

看起来并不难用,希望能有开发者能基于此做出一款通用产品出来

There is no cost involved with using Rosetta.

1 Like

I am not aware of any plans on working with Metamask or Bitget. The Internet Identity is what is commonly used to interact with Smart Contracts on the Internet Computer. Rosetta is a standard for blockchain integration, not for wallets.

1 Like

Although Rosetta is free, but I think deploying its servers will incurs costs, and establishing a secure and highly available architecture can also result in high costs.

2 Likes

You rarely have to do this. Most exchanges will run their own version of the rostta image on a hardware spec with redundancy that meets their need. They don’t want to be dependent on your implementation.

If you need your own for a block explorer dapp or something like that then you get to choose how much redundancy you want, but unless you’re running a token that has massive volume a solid digital ocean instance will get you a long way for non-critical applications.

3 Likes

Great! I just started my node with the OpenChat ledger. How do I now get the data for my analytical purposes?

So far I have fetched those for the ICP token via PHP using this payload:

$requestData = json_encode(array(
    "network_identifier" => array(
        "blockchain" => "Internet Computer",
        "network" => "00000000000000020101"
    )
));

And then using commands like this for example, to get the last block:

CURLOPT_URL => $rosettaUrl . "/network/status",

How do these change for ICRC tokens? So far I have not been able to find anything in the documentation.

Hi, you can get the data for your analytical purposes by using the database that was created. Its default name is data.sqlite and it is stored in the root directory of the docker container. You can of course mount some directory to the docker container in order to also use the database when rosetta is not running.

For the network_identifier you can call the network/list endpoint to acquire the correct network_identifier for the rosetta you are running.

1 Like

Can I find network/list somewhere else like on dashboard.internetcomputer.org? Or only on my node (if so there is a way to it pull via console ssh)?

After that the rest will be the same as I do for ICP token ledger?

When will be available?

Is it possible to start a new rosetta icrc node on the same server where a standard ICP ledger rosetta node is running?

I started an icrc-rosetta following your instructions, mapped it to a different port, as you can see, but I can’t contact it as I do with the existing one (rosetta-node)

I don’t have any firewall set up that could block the connection to the port, I have checked the ip address and container port of the new node (rosetta-node-icrc-openchat) more than once. The node is running and synchronized to the last block.

Where am I going wrong? Thanks for your help.

We are working on it. You can use the documentation for ICP rosetta in the meantime. Since ICRC Rosetta right now only supports transfers of tokens, the requests look very similar to ICP rosetta.