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.