Skip to content

Conversation

f321x
Copy link
Member

@f321x f321x commented Feb 6, 2025

Adds the submitpackage method to the protocol documentation.
See e-x implementation in spesmilo/electrumx#288
Note that the function signature contains a semicolon after [raw_txs]; as sphinx otherwise shows it incorrectly as [raw_txs,] in the generated html.

add hint on order of transactions
Copy link

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this 🙏

* Value: Indicating the result of the package submission
* `errors`
* Type: Optional[List[Dict]]
* Value: Error message and txid (NOT wtxid) of transactions that were not accepted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: the bitcoind response lists both txid and wtxid - although it keys results based on wtxid. In this use case either one is sufficient. There can be no collision of txids within a package.
The electrum protocol uses txids generally, I think we can keep to that and do the same here.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good, I don't see any issue with using txid either.

Comment on lines +572 to +576
If *verbose* is :const:`true`:

The Bitcoin Core daemon result according to its RPC API documentation.
Note that the exact structure and semantics can depend on the bitcoind version,
and hence the electrum protocol can make no guarantees about it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect most clients to want the default, simple, verbose=false option.

However, AFAICT it does not cost a server implementation ~anything to offer the rich bitcoind response. The server has to call the submitpackage bitcoind RPC anyway. (Contrast this with e.g. blockchain.transaction.get, where the verbose=false option is implemented by e.g. esplora without calling bitcoind, while the verbose=true option must call bitcoind)

Having access to the full bitcoind result can be useful e.g. if you trust the server, or for quick scripts. And maybe also for some unforeseen use-cases where the verbose=false response is not sufficient, the rich result can be used a stopgap.

So I think we can also add this verbose=true variant. (with this explicit caveat that its structure is not guaranteed)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough!

Copy link

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants