Support transaction broadcast in REST interface #31017

issue RCasatta openend this issue on October 2, 2024
  1. RCasatta commented at 9:19 am on October 2, 2024: none

    Please describe the feature you’d like to see added.

    I would like to have the possibility to broadcast a transaction via the REST interface which is currently not possible https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md

    An indexer like the ones for the electrum protocol should work without having access to the RPC interface, I think the only missing method from the REST interface is the tx broadcast.

    Describe the solution you’d like

    I would like another REST end point like the following:

    POST /tx

    Broadcast a raw transaction to the network.

    The transaction should be provided as hex in the request body. The txid will be returned on success.

    (hex is used for similarity with esplora API, binary would be ok)

    Describe any alternatives you’ve considered

    Using RPC requires an authenticated connection. Using the p2p network requires to know an additional endpoint and the peering from the indexer

    Please leave any additional context

    The REST interface already has risks https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md#risks and I don’t think would be more risky to have tx broadcast

    Transaction packages may be added in another endpoint

  2. RCasatta added the label Feature on Oct 2, 2024
  3. danielabrozzoni referenced this in commit dff67a815c on Oct 10, 2024
  4. danielabrozzoni referenced this in commit 1e07530836 on Oct 14, 2024
  5. stickies-v commented at 10:43 am on October 16, 2024: contributor

    Using RPC requires an authenticated connection.

    Could you please elaborate on why RPC or authentication is not a feasible option for your use case?

  6. maflcko commented at 10:52 am on October 16, 2024: member

    Using RPC requires an authenticated connection.

    Could you please elaborate on why RPC or authentication is not a feasible option for your use case?

    I am not familiar with electrum protocol, but the issue description says:

    An indexer like the ones for the electrum protocol should work without having access to the RPC interface

  7. stickies-v commented at 11:10 am on October 16, 2024: contributor
    The “should work without having access to the RPC interface” is the part that I’d like to understand better. For example, the electrs docs specifically mention the bitcoind jsonrpc authentication: https://github.com/romanz/electrs/blob/master/doc/config.md#electrs-configuration
  8. brunoerg commented at 11:21 am on October 16, 2024: contributor

    The “should work without having access to the RPC interface” is the part that I’d like to understand better. For example, the electrs docs specifically mention the bitcoind jsonrpc authentication: https://github.com/romanz/electrs/blob/master/doc/config.md#electrs-configuration

    It’s not clear to me as well. Maybe they need it to start using the REST interface?

  9. RCasatta commented at 3:52 pm on October 16, 2024: none
    Please see #31065 (comment) for details
  10. danielabrozzoni referenced this in commit 6b32a886e3 on Oct 17, 2024
  11. stickies-v commented at 9:42 am on October 24, 2024: contributor
    Note: #31065 was closed because of lack of conceptual support to implement this feature.
  12. fanquake commented at 10:36 am on October 24, 2024: member
    Closing for now, given the PR was closed. Feel free to discuss further. cc @laanwj @0xB10C
  13. fanquake closed this on Oct 24, 2024

  14. laanwj commented at 12:14 pm on October 24, 2024: member
    We’re kind of having the conceptual discussion over in #31065. Probably not a good idea to split it. But in retrospect it should have been done here, and sooner, before someone started working on it (Edit: oh, this issue is only three weeks old? sorry, thought it was much older)

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: 2024-11-24 09:12 UTC

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