Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide partial history for pruned nodes using scantxoutset #27

Open
shesek opened this issue May 30, 2020 · 4 comments
Open

Provide partial history for pruned nodes using scantxoutset #27

shesek opened this issue May 30, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@shesek
Copy link
Collaborator

shesek commented May 30, 2020

No description provided.

@shesek shesek added the enhancement New feature or request label May 30, 2020
@leshik
Copy link

leshik commented Jun 6, 2020

Trying to figure this out manually, I wonder how is this supposed to work when no raw transaction information available (i.e. not only pruned node, but any node with no txindex enabled)? It's my understanding that raw transactions are needed for importprunedfunds to work. What am I missing?

@nothingmuch
Copy link

with scantxoutset (experimental) outputs of a descriptor can be found, and the height at which the funding transaction was confirmed is also known (but not the full transaction). since the headers are known, the height is enough information to re-fetch specific blocks to extract the raw tx and inclusion proof to be generated. this is kind of cumbersome and does not provide transactions that pertain to already spent outputs, but can at least be used to obtain previous transactions as will be required because of the recent changes to trezor's BIP 143 signing.

@leshik
Copy link

leshik commented Jun 7, 2020

Yeah, I understand that blocks with heights corresponding to funding transactions need to be re-fetched, just don't see how this could be done on a pruned node? There were some attempts to add this functionality to Bitcoin Core but none of them were merged.

@nothingmuch
Copy link

oops, i must have missed the email, sorry.

to get the full tx history - yeah it'd have to be something like those PRs, and I think it's unlikely.

but for spending currently unspent outputs, if you need the funding tx, you can still get the information needed to locate the txs precisely from the UTXO set using scantxoutset.

once you know the heights, fetching those blocks is pretty easy (and i don't i don't mean functionality in core, but writing a non-validating p2p client is pretty easy and libraries exist that let you do that), and your node already validated them in the past so it's just a matter of comparing them to the block header that the node doesn't prune.

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

No branches or pull requests

3 participants