Unable to find example payloads

The schemas found on the rosetta api documentation do not help new users trying to make calls to a rosetta call.

Construction · Rosetta These payloads here often put “string” in place of hex and numerous other fields that when I try to send these requests to rosetta-bitcoin I always get errors.

I can find no blogs, nor guides, nor any other material on how to make a successful /construction/combine request for example. I feel documentation for rosetta services and the rosetta docs themselves all need improvements around this.

Hello @mowkoshka

Welcome the the community. Apologies for the trouble. We are constantly working to improve our documentation to make sure it’s easy to develop with Rosetta. We are working to get some sample Postman requests (or a swagger UI with sample request) so that anyone can easily start with. I will update this thread once we have that collection

-Madhur

Greetings, and a big +1 to what mowkoshka says. I’m basically new to using Rosetta, just working through the puzzle pieces, kind of jammed up at /construction/combine. Having done a bunch of background, I feel like a basic E2E cookbook with use cases would be a life saver. Like, just getting from key pair generation to having a derived signature in string form that works as my hex_bytes on the /combine call. I will no doubt feel like a dummy once it’s cleared up, but I’ve been there before ;). At the moment I’m struggling with basic nuts and bolts of getting it to work. Thanks very much in advance.

@thelonious definitely. I totally get it. I will be back with some updates soon. In the meantime (since you mentioned key pair generation I added a gist which can help with one curve. I will add more soon. Derive public key from private key · GitHub

there are two issues here:

  1. the answer to a lot of “what do I pass here” for the construction API is answered with “whatever the previous step says.” examples:
    • what do we pass to /construction/combine? → the unsigned_transaction field is whatever you get from the /construction/payloads step, and the signatures field is what the Rosetta SDK produces after signing whatever payloads you get from the /construction/payloads step.
    • what is the format for various account identifier fields etc? → whatever you get out of /construction/derive
    • what is the format for keys that you give to /construction/derive? → whatever Rosetta SDK produces
  2. in the few cases where there really is original input, most notably the operations in /construction/preprocess, those are defined per-Rosetta-implementation, and the broader API spec that you link to is correct in having little to say about the content of those fields. ideally implementations would have docs to guide you on how to write up an operations sequence to do what you want, but the official samples don’t. there is at least a code sample though:
    rosetta-bitcoin/bitcoin.ros at v0.0.10 · coinbase/rosetta-bitcoin · GitHub
    and here’s the docs for our implementation, if you want to get a sense of what implementations, in our opinion, should document:
    GitHub - oasisprotocol/oasis-rosetta-gateway: The official Rosetta server implementation for the Oasis Network.
1 Like