I have been working a lot with Rosetta lately. First of all, I really like the overall idea of the project. Thanks for choosing Open Source. I am sure it offers tremendous value for all new platforms.
I am currently implementing the Rosetta Protocol for a cryptocurrency that is a fork of Bitcoin, so I am referring to bitcoin-cli/rpc in the following. I think I already know the answer to my question. I am sure it may help other people in our community if the question pop ups somewhere
The bitcoin client does not track addresses because we all know that addresses are just an abstraction above the protocol level. The request of the endpoint
account/balance requires an
AccountIdentifier which specifies an address.
So you should already be able to guess what question I am about to ask:
Are the Rosetta Implementations supposed to provide a middleware (in that case a database) that keeps track of all addresses/utxos?
AFAIK, there is no other way to determine the balances for an account (except adding ‘watch-only’ accounts using bitcoin-rpc but of course this is very impractical regarding the generic idea of the Rosetta protocol).
So I need to build my own Blockchain Syncer, processing every transaction, is that right?
Thanks in advance!
For all people who didn’t know:
My question not only affects the /account/balance endpoint, but also the /block endpoint, in which the implementation has to create the one-sided balance operations. This is only possible knowing from which address an input came from.