RPC Feature: option for prevouts in getrawtransaction #13108

issue jimpo opened this issue on April 28, 2018
  1. jimpo commented at 5:49 AM on April 28, 2018: contributor

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    I think it might be useful for certain applications to be able to get transaction fees from the RPC API. The problem is that loading all prevouts from disk could be pretty expensive depending on the number of inputs, so it should be made optional with a flag. One way to expose this in the API is to include the prevout (scriptPubKey & amount) with every input in vin, as well as adding a "fee" field to the top level of the response payload.

    How would people feel about this?

    <!--- What behavior did you expect? -->

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. fanquake added the label RPC/REST/ZMQ on Apr 28, 2018
  3. sipa commented at 5:51 AM on April 28, 2018: member

    NACK. getrawtransaction shouldn't do more than getting raw transactions.

    If applications need transaction fees, they should have the wallet watch for it. Not rely on having a fully indexed chain available; that does not scale.

  4. jimpo commented at 5:10 PM on April 29, 2018: contributor

    I'm not asking for wallet applications, but for fee estimators, explorer-type applications, and the like. Is there an alternative you suggest, or is the answer to build a full auxiliary indexing service? Or two just make the getrawtransaction RPC requests for all prevouts at the client level?

  5. promag commented at 11:42 PM on July 25, 2018: member

    NACK. getrawtransaction shouldn't do more than getting raw transactions.

    Agree on that.

    I think it might be useful for certain applications to be able to get transaction fees from the RPC API.

    I'm not asking for wallet applications, but for fee estimators, explorer-type applications, and the like. Is there an alternative you suggest, or is the answer to build a full auxiliary indexing service?

    I feel this is not the best place to serve that data. A "full auxiliary indexing service" sounds more scalable!

    Or two just make the getrawtransaction RPC requests for all prevouts at the client level?

    That looks insane?

  6. MarcoFalke commented at 1:43 AM on April 26, 2020: member

    Something like this has been implemented here: #16083 It is up for grabs (needs rebase).

    Let's continue discussion in #18771

  7. MarcoFalke closed this on Apr 26, 2020

  8. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-03 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me